public abstract class GeometryAdapter extends java.lang.Object implements Persistent, Cloneable
Modifier and Type | Field and Description |
---|---|
protected static GeometryManager |
geomManager |
static java.lang.String |
PERSISTENCE_DEFINITION_NAME |
Constructor and Description |
---|
GeometryAdapter() |
Modifier and Type | Method and Description |
---|---|
int |
addPoint(java.awt.geom.Point2D point)
Add a point to de geometry.
|
void |
applyTransform(java.awt.geom.AffineTransform at)
Applies the transformation to all the points of the geometry.
|
void |
changePoint(int pos,
java.awt.geom.Point2D point)
Modifies a point of the Geometry from an index by the one that is passed
like parameter.
|
java.lang.Object |
clone()
Creates a copy of the object.
|
void |
delLastPoint()
Remove last point of Geometry.
|
void |
draw(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
ISymbol symbol)
It draws the geometry on the Graphics that is passed like parameter.
|
void |
drawVertex(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at)
Draws a handler in each vertex of the Geometry.
|
void |
end()
End the creation of the geometry with the last point added.
|
java.awt.geom.Rectangle2D |
getBounds2D() |
Geometry |
getGeometry()
Returns the geometry to draw
|
Geometry |
getGeometry(java.awt.geom.AffineTransform at)
Deprecated.
|
java.awt.geom.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(java.awt.geom.Point2D p)
Obtains the geometry passing him as parameter the last point.
|
abstract void |
paint(java.awt.Graphics2D g,
java.awt.geom.AffineTransform at,
boolean andLastPoint)
Paints the geometry on the Graphics adding him the last point if the
parameter andLastPoint is true.
|
abstract void |
pointPosition(java.awt.geom.Point2D p)
Set the point of cursor.
|
void |
print(java.awt.Graphics2D g,
java.awt.geom.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(java.awt.geom.Point2D[] points)
Add all the points of Geometry.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
cloneQuietly, cloneQuietly
public static final java.lang.String PERSISTENCE_DEFINITION_NAME
protected static final GeometryManager geomManager
public int addPoint(java.awt.geom.Point2D point)
point
- Point that is added.public void end()
protected void setGeometry(Geometry geometry)
gpx
- GeneralPathXpublic abstract void obtainShape(java.awt.geom.Point2D p)
p
- Last Point.CreateGeometryException
public void applyTransform(java.awt.geom.AffineTransform at)
at
- AffineTransformpublic void draw(java.awt.Graphics2D g, java.awt.geom.AffineTransform at, ISymbol symbol)
g
- Graphicsat
- AffineTransformsymbol
- FSymbolpublic void print(java.awt.Graphics2D g, java.awt.geom.AffineTransform at, ISymbol symbol, PrintAttributes properties)
g
- Graphicsat
- AffineTransformsymbol
- ISymbolproperties
- public abstract void paint(java.awt.Graphics2D g, java.awt.geom.AffineTransform at, boolean andLastPoint)
g
- Graphicsat
- AffineTransformandLastPoint
- If true add last point.public abstract void pointPosition(java.awt.geom.Point2D p)
p
- Point of cursor.public Geometry getGeometry(java.awt.geom.AffineTransform at)
public Geometry getGeometry()
public java.awt.geom.Point2D[] getPoints()
public void drawVertex(java.awt.Graphics2D g, java.awt.geom.AffineTransform at)
g
- Graphicsat
- AffineTransform.public void changePoint(int pos, java.awt.geom.Point2D point)
pos
- Indexpoint
- Pointpublic void setPoints(java.awt.geom.Point2D[] points)
points
- All points.public void delLastPoint()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Cloneable
clone
in class java.lang.Object
java.lang.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 java.awt.geom.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