public abstract class GeometryAdapter extends Object implements Persistent, Cloneable
Modifier and Type | Field and Description |
---|---|
protected static GeometryManager |
geomManager |
static String |
PERSISTENCE_DEFINITION_NAME |
Constructor and Description |
---|
GeometryAdapter() |
Modifier and Type | Method and Description |
---|---|
int |
addPoint(Point2D point)
Add a point to de geometry.
|
void |
applyTransform(AffineTransform at)
Applies the transformation to all the points of the geometry.
|
void |
changePoint(int pos,
Point2D point)
Modifies a point of the Geometry from an index by the one that is passed
like parameter.
|
Object |
clone()
Creates a copy of the object.
|
void |
delLastPoint()
Remove last point of Geometry.
|
void |
draw(Graphics2D g,
AffineTransform at,
ISymbol symbol)
It draws the geometry on the Graphics that is passed like parameter.
|
void |
drawVertex(Graphics2D g,
AffineTransform at)
Draws a handler in each vertex of the Geometry.
|
void |
end()
End the creation of the geometry with the last point added.
|
Rectangle2D |
getBounds2D() |
Geometry |
getGeometry()
Returns the geometry to draw
|
Geometry |
getGeometry(AffineTransform at)
Deprecated.
|
Point2D[] |
getPoints()
Returns all the points of Geometry.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
abstract void |
obtainShape(Point2D p)
Obtains the geometry passing him as parameter the last point.
|
abstract void |
paint(Graphics2D g,
AffineTransform at,
boolean andLastPoint)
Paints the geometry on the Graphics adding him the last point if the
parameter andLastPoint is true.
|
abstract void |
pointPosition(Point2D p)
Set the point of cursor.
|
void |
print(Graphics2D g,
AffineTransform at,
ISymbol symbol,
PrintAttributes properties)
It print the geometry on the Graphics that is passed like parameter.
|
static void |
registerPersistent() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
protected void |
setGeometry(Geometry geometry)
Adds the GeneralPathX with all the points of the geometry.
|
void |
setPoints(Point2D[] points)
Add all the points of Geometry.
|
public static final String PERSISTENCE_DEFINITION_NAME
protected static final GeometryManager geomManager
public int addPoint(Point2D point)
point
- Point that is added.public void end()
protected void setGeometry(Geometry geometry)
gpx
- GeneralPathXpublic abstract void obtainShape(Point2D p)
p
- Last Point.CreateGeometryException
public void applyTransform(AffineTransform at)
at
- AffineTransformpublic void draw(Graphics2D g, AffineTransform at, ISymbol symbol)
g
- Graphicsat
- AffineTransformsymbol
- FSymbolpublic void print(Graphics2D g, AffineTransform at, ISymbol symbol, PrintAttributes properties)
g
- Graphicsat
- AffineTransformsymbol
- ISymbolproperties
- public abstract void paint(Graphics2D g, AffineTransform at, boolean andLastPoint)
g
- Graphicsat
- AffineTransformandLastPoint
- If true add last point.public abstract void pointPosition(Point2D p)
p
- Point of cursor.public Geometry getGeometry(AffineTransform at)
public Geometry getGeometry()
public Point2D[] getPoints()
public void drawVertex(Graphics2D g, AffineTransform at)
g
- Graphicsat
- AffineTransform.public void changePoint(int pos, Point2D point)
pos
- Indexpoint
- Pointpublic void setPoints(Point2D[] points)
points
- All points.public void delLastPoint()
public Object clone() throws CloneNotSupportedException
Cloneable
clone
in class Object
CloneNotSupportedException
- if the instance of the object cannot
be cloned. As this is extending Cloneable
so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.
public Rectangle2D getBounds2D()
public static void registerPersistent()
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException