|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.latexdraw.glib.views.AbstractView<S>
net.sf.latexdraw.glib.views.Java2D.impl.LShapeView<S>
abstract class LShapeView<S extends IShape>
Defines a view of the LShape model.
This file is part of LaTeXDraw.
Copyright (c) 2005-2012 Arnaud BLOUIN
LaTeXDraw is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
LaTeXDraw is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
02/16/2008
Field Summary | |
---|---|
protected java.util.List<IViewArrow> |
arrows
The view of the arrows of the shape. |
protected java.awt.geom.Rectangle2D |
border
The border of the shape. |
protected java.awt.geom.Path2D |
path
The Java2D path used to draw the shape. |
Fields inherited from class net.sf.latexdraw.glib.views.AbstractView |
---|
shape |
Constructor Summary | |
---|---|
protected |
LShapeView(S model)
Creates a view of the given model and initialises the Java2D view. |
Method Summary | |
---|---|
protected IPoint |
beginRotation(java.awt.Graphics2D g)
Begins the rotation by modifying the Graphics2D using the rotation angle. |
boolean |
contains(double x,
double y)
Tests if the given point is into the pickable object. |
boolean |
contains(IPoint pt)
Allows to know if the point pt is in (or not) the shape. |
protected void |
endRotation(java.awt.Graphics2D g,
IPoint translation)
Ends the rotation of the view by modifying the Graphics2D using the rotation angle of the model of the view, and the given translation vector. |
void |
flush()
Removes and flushes the used resources and temporary documents. |
java.awt.geom.Rectangle2D |
getBorder()
|
java.awt.geom.Path2D |
getPath()
|
Picker |
getPicker()
|
java.awt.Shape |
getRotatedShape2D()
This function creates the corresponding rotated Java shape using the shape model. |
protected static java.awt.Shape |
getRotatedShape2D(double angle,
java.awt.Shape shape,
IPoint tlPoint,
IPoint brPoint)
|
java.awt.BasicStroke |
getStroke()
Creates and returns a stroke corresponding to the current parameters of the shape model. |
double |
getStrokeThickness()
|
boolean |
intersects(java.awt.geom.Rectangle2D rec)
|
void |
paint(java.awt.Graphics2D g)
Draws the shape within a Java2D graphics. |
protected void |
paintArrows(java.awt.Graphics2D g,
boolean asShadow)
Paints the arrows of the shape. |
void |
paintBorders(java.awt.Graphics2D g)
Draws the borders of the shape within a Java2D graphics. |
private void |
paintBordersDouble(java.awt.Graphics2D g)
Draws the double borders of the shape. |
private void |
paintBordersSimple(java.awt.Graphics2D g)
Draws the simple border (not with double borders). |
void |
paintFilling(java.awt.Graphics2D g)
Fills the shape within a Java2D graphics. |
private void |
paintHatchings2(java.awt.Graphics2D g,
double angle,
java.awt.geom.Rectangle2D clip)
Paints the hatchings. |
void |
paintShadow(java.awt.Graphics2D g)
Draws the shadow of the shape within a Java2D graphics. |
void |
paintShowPointsDots(java.awt.Graphics2D g)
Paints the dots of the option 'show points'. |
void |
paintShowPointsLines(java.awt.Graphics2D g)
Paints the lines of the option 'show points'. |
void |
update()
Updates the view. |
void |
updateBorder()
Update the border of the shape view. |
protected abstract void |
updateDblePathInside()
Updates the borders of the double boundary when position is inside. |
protected abstract void |
updateDblePathMiddle()
Updates the borders of the double boundary when position is middle. |
protected abstract void |
updateDblePathOutside()
Updates the borders of the double boundary when position is outside. |
protected abstract void |
updateGeneralPathInside()
Updates the borders of the shape as inside borders. |
protected abstract void |
updateGeneralPathMiddle()
Updates the borders of the shape as middle borders. |
protected abstract void |
updateGeneralPathOutside()
Updates the borders of the shape as outside borders. |
void |
updatePath()
Updates the path of the shape. |
protected void |
updatePathArrows()
Updates the path of the view of the arrows. |
Methods inherited from class net.sf.latexdraw.glib.views.AbstractView |
---|
getShape |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.latexdraw.glib.views.IAbstractView |
---|
getShape |
Field Detail |
---|
protected java.awt.geom.Path2D path
protected java.util.List<IViewArrow> arrows
protected java.awt.geom.Rectangle2D border
Constructor Detail |
---|
protected LShapeView(S model)
model
- The shape model.
java.lang.IllegalArgumentException
- If model
is null.Method Detail |
---|
protected static java.awt.Shape getRotatedShape2D(double angle, java.awt.Shape shape, IPoint tlPoint, IPoint brPoint)
public java.awt.Shape getRotatedShape2D()
IViewShape
getRotatedShape2D
in interface IViewShape
public java.awt.geom.Path2D getPath()
getPath
in interface IViewShape
public void updateBorder()
IViewShape
updateBorder
in interface IViewShape
protected abstract void updateGeneralPathInside()
protected abstract void updateGeneralPathMiddle()
protected abstract void updateGeneralPathOutside()
public void updatePath()
IViewShape
updatePath
in interface IViewShape
protected void updatePathArrows()
protected abstract void updateDblePathOutside()
protected abstract void updateDblePathInside()
protected abstract void updateDblePathMiddle()
public void update()
IAbstractView
update
in interface IAbstractView
public void paintFilling(java.awt.Graphics2D g)
IViewShape
paintFilling
in interface IViewShape
g
- The graphics where the shape must be drawn.public boolean contains(double x, double y)
Pickable
contains
in interface IViewShape
contains
in interface Pickable
x
- The x-coordinate of the point to test.y
- The y-coordinate of the point to test.
public boolean contains(IPoint pt)
IViewShape
contains
in interface IViewShape
pt
- The point.
public boolean intersects(java.awt.geom.Rectangle2D rec)
intersects
in interface IViewShape
rec
- The rectangle used to check the intersection.
public void paint(java.awt.Graphics2D g)
IViewShape
paint
in interface IViewShape
g
- The graphics where the shape must be drawn.protected void paintArrows(java.awt.Graphics2D g, boolean asShadow)
public void paintBorders(java.awt.Graphics2D g)
IViewShape
paintBorders
in interface IViewShape
g
- The graphics where the shape must be drawn.private void paintBordersDouble(java.awt.Graphics2D g)
g
- The graphics to print into.private void paintBordersSimple(java.awt.Graphics2D g)
g
- The graphics to print into.public void paintShadow(java.awt.Graphics2D g)
IViewShape
paintShadow
in interface IViewShape
g
- The graphics where the shape must be drawn.public void paintShowPointsLines(java.awt.Graphics2D g)
IViewShape
paintShowPointsLines
in interface IViewShape
g
- The graphics.public void paintShowPointsDots(java.awt.Graphics2D g)
IViewShape
paintShowPointsDots
in interface IViewShape
g
- The graphics.private void paintHatchings2(java.awt.Graphics2D g, double angle, java.awt.geom.Rectangle2D clip)
g
- The graphics to paint.angle
- The angle of the hatchings (in radian).clip
- The clip box.public java.awt.BasicStroke getStroke()
IViewShape
getStroke
in interface IViewShape
public double getStrokeThickness()
protected IPoint beginRotation(java.awt.Graphics2D g)
g
- The graphics to modify to draw rotated views.
protected void endRotation(java.awt.Graphics2D g, IPoint translation)
g
- The graphics to un-rotate.translation
- This translation vector is given by function beginRotation. It is
used to translate the graphics at the initial position.public java.awt.geom.Rectangle2D getBorder()
getBorder
in interface IViewShape
public Picker getPicker()
getPicker
in interface Pickable
public void flush()
IViewShape
flush
in interface IViewShape
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |