Package com.treasure.hunt.jts.awt
Class AdvancedShapeWriter
- java.lang.Object
-
- org.locationtech.jts.awt.ShapeWriter
-
- com.treasure.hunt.jts.awt.AdvancedShapeWriter
-
public class AdvancedShapeWriter extends org.locationtech.jts.awt.ShapeWriterEnhances the jtsShapeWriterwith handling the render process forShapeableinstances. In general, it shares aPointTransformationobject to translate theShapeable's Geometry into translated and scaled awtShape's.
-
-
Constructor Summary
Constructors Constructor Description AdvancedShapeWriter(PointTransformation pointTransformation)Constructor for AdvancedShapeWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Arc2DcreateArc(org.locationtech.jts.geom.Coordinate center, double dimension, double start, double extend)Utility function to construct an already transformedArc2Dwith non-scalable width and height.java.awt.geom.Line2DcreateFixedLine(org.locationtech.jts.geom.Coordinate fixed, org.locationtech.jts.geom.Coordinate floating, double length)Utility function to construct an already transformedLine2Dwith non-scalable length.java.awt.geom.Line2DcreateLine(org.locationtech.jts.geom.Coordinate from, org.locationtech.jts.geom.Coordinate to)Utility function to construct an already transformedLine2D.CanvasBoundarygetBoundary()The boundary of the associatedCanvas.PointTransformationgetPointTransformation()ThePointTransformationtransforming a sourceCoordinate.voidsetBoundary(CanvasBoundary boundary)The boundary of the associatedCanvas.java.awt.ShapetoShape(java.lang.Object object)Wrapper function forShapeWriter.toShape(Geometry)to extend functionality forShapeableinstances.voidtransform(org.locationtech.jts.geom.Coordinate src, java.awt.geom.Point2D dest)Wrapper transform function fortransform(Coordinate, Point2D)
-
-
-
Constructor Detail
-
AdvancedShapeWriter
public AdvancedShapeWriter(PointTransformation pointTransformation)
Constructor for AdvancedShapeWriter.- Parameters:
pointTransformation-PointTransformationused in rendering process.
-
-
Method Detail
-
toShape
public java.awt.Shape toShape(java.lang.Object object)
Wrapper function forShapeWriter.toShape(Geometry)to extend functionality forShapeableinstances.- Parameters:
object- object to transfer to aShape- Returns:
Shaperepresenting theobject. Could benull.
-
transform
public void transform(org.locationtech.jts.geom.Coordinate src, java.awt.geom.Point2D dest)Wrapper transform function fortransform(Coordinate, Point2D)- Parameters:
src- source Coordinatedest- point we want to transform
-
createLine
public java.awt.geom.Line2D createLine(org.locationtech.jts.geom.Coordinate from, org.locationtech.jts.geom.Coordinate to)Utility function to construct an already transformedLine2D.- Parameters:
from- startCoordinateto- endCoordinate- Returns:
Line2DShaperepresenting the line
-
createFixedLine
public java.awt.geom.Line2D createFixedLine(org.locationtech.jts.geom.Coordinate fixed, org.locationtech.jts.geom.Coordinate floating, double length)Utility function to construct an already transformedLine2Dwith non-scalable length.- Parameters:
fixed- startCoordinatefloating- directionCoordinatelength- fixed length the line is rendered with- Returns:
Line2DShaperepresenting the line
-
createArc
public java.awt.geom.Arc2D createArc(org.locationtech.jts.geom.Coordinate center, double dimension, double start, double extend)Utility function to construct an already transformedArc2Dwith non-scalable width and height.- Parameters:
center- centerCoordinatethe arc is positioned arounddimension- width and height of the arcstart- start angle relative to x-axis in radiansextend- extend angle (relative to start angle) in radians- Returns:
- transformed open
Arc2D
-
getPointTransformation
public PointTransformation getPointTransformation()
ThePointTransformationtransforming a sourceCoordinate.
-
setBoundary
public void setBoundary(CanvasBoundary boundary)
The boundary of the associatedCanvas. Enables boundary specific shapes like endless lines, grids etc.
-
getBoundary
public CanvasBoundary getBoundary()
The boundary of the associatedCanvas. Enables boundary specific shapes like endless lines, grids etc.
-
-