Class GeometryAdapter
java.lang.Object
org.gvsig.app.project.documents.layout.geometryadapters.GeometryAdapter
- All Implemented Interfaces:
Cloneable,org.gvsig.tools.lang.Cloneable,org.gvsig.tools.persistence.Persistent
- Direct Known Subclasses:
CircleAdapter,PolyLineAdapter
public abstract class GeometryAdapter
extends Object
implements org.gvsig.tools.persistence.Persistent, org.gvsig.tools.lang.Cloneable
Abstract adaptor to relate the geometries with the fframes and to be able to
integrate them in the Layout.
- Author:
- Vicente Caballero Navarro
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.gvsig.fmap.geom.GeometryManagerstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintAdd a point to de geometry.voidApplies the transformation to all the points of the geometry.voidchangePoint(int pos, Point2D point) Modifies a point of the Geometry from an index by the one that is passed like parameter.clone()voidRemove last point of Geometry.voiddraw(Graphics2D g, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws the geometry on the Graphics that is passed like parameter.voiddrawVertex(Graphics2D g, AffineTransform at) Draws a handler in each vertex of the Geometry.voidend()End the creation of the geometry with the last point added.org.gvsig.fmap.geom.GeometryReturns the geometry to draworg.gvsig.fmap.geom.GeometryObtains the shape of the Geometry.Point2D[]Returns all the points of Geometry.voidloadFromState(org.gvsig.tools.persistence.PersistentState state) abstract voidObtains the geometry passing him as parameter the last point.abstract voidpaint(Graphics2D g, AffineTransform at, boolean andLastPoint) Paints the geometry on the Graphics adding him the last point if the parameter andLastPoint is true.abstract voidSet the point of cursor.voidprint(Graphics2D g, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol, org.gvsig.compat.print.PrintAttributes properties) It print the geometry on the Graphics that is passed like parameter.static voidvoidsaveToState(org.gvsig.tools.persistence.PersistentState state) protected voidsetGeometry(org.gvsig.fmap.geom.Geometry geometry) Adds the GeneralPathX with all the points of the geometry.voidAdd all the points of Geometry.
-
Field Details
-
PERSISTENCE_DEFINITION_NAME
- See Also:
-
geomManager
protected static final org.gvsig.fmap.geom.GeometryManager geomManager
-
-
Constructor Details
-
GeometryAdapter
public GeometryAdapter()
-
-
Method Details
-
addPoint
Add a point to de geometry.- Parameters:
point- Point that is added.- Returns:
- Number of points that contains the geometry.
-
end
public void end()End the creation of the geometry with the last point added. -
setGeometry
protected void setGeometry(org.gvsig.fmap.geom.Geometry geometry) Adds the GeneralPathX with all the points of the geometry.- Parameters:
gpx- GeneralPathX
-
obtainShape
Obtains the geometry passing him as parameter the last point.- Parameters:
p- Last Point.- Throws:
org.gvsig.fmap.geom.exception.CreateGeometryException
-
applyTransform
Applies the transformation to all the points of the geometry.- Parameters:
at- AffineTransform
-
draw
public void draw(Graphics2D g, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol) It draws the geometry on the Graphics that is passed like parameter.- Parameters:
g- Graphicsat- AffineTransformsymbol- FSymbol
-
print
public void print(Graphics2D g, AffineTransform at, org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol symbol, org.gvsig.compat.print.PrintAttributes properties) It print the geometry on the Graphics that is passed like parameter.- Parameters:
g- Graphicsat- AffineTransformsymbol- ISymbolproperties-
-
paint
Paints the geometry on the Graphics adding him the last point if the parameter andLastPoint is true.- Parameters:
g- Graphicsat- AffineTransformandLastPoint- If true add last point.
-
pointPosition
Set the point of cursor.- Parameters:
p- Point of cursor.
-
getGeometry
Obtains the shape of the Geometry.- Returns:
- Geometry.
-
getGeometry
public org.gvsig.fmap.geom.Geometry getGeometry()Returns the geometry to draw- Returns:
- the geometry
-
getPoints
Returns all the points of Geometry.- Returns:
- Array of points.
-
drawVertex
Draws a handler in each vertex of the Geometry.- Parameters:
g- Graphicsat- AffineTransform.
-
changePoint
Modifies a point of the Geometry from an index by the one that is passed like parameter.- Parameters:
pos- Indexpoint- Point
-
setPoints
Add all the points of Geometry.- Parameters:
points- All points.
-
delLastPoint
public void delLastPoint()Remove last point of Geometry. -
clone
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getBounds2D
-
registerPersistent
public static void registerPersistent() -
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-