Class AdvancedShapeWriter


  • public class AdvancedShapeWriter
    extends org.locationtech.jts.awt.ShapeWriter
    Enhances the jts ShapeWriter with handling the render process for Shapeable instances. In general, it shares a PointTransformation object to translate the Shapeable's Geometry into translated and scaled awt Shape's.
    • Field Summary

      • Fields inherited from class org.locationtech.jts.awt.ShapeWriter

        DEFAULT_POINT_FACTORY, DEFAULT_POINT_TRANSFORMATION
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.geom.Arc2D createArc​(org.locationtech.jts.geom.Coordinate center, double dimension, double start, double extend)
      Utility function to construct an already transformed Arc2D with non-scalable width and height.
      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 transformed Line2D with non-scalable length.
      java.awt.geom.Line2D createLine​(org.locationtech.jts.geom.Coordinate from, org.locationtech.jts.geom.Coordinate to)
      Utility function to construct an already transformed Line2D.
      CanvasBoundary getBoundary()
      The boundary of the associated Canvas.
      PointTransformation getPointTransformation()
      The PointTransformation transforming a source Coordinate.
      void setBoundary​(CanvasBoundary boundary)
      The boundary of the associated Canvas.
      java.awt.Shape toShape​(java.lang.Object object)
      Wrapper function for ShapeWriter.toShape(Geometry) to extend functionality for Shapeable instances.
      void transform​(org.locationtech.jts.geom.Coordinate src, java.awt.geom.Point2D dest)
      Wrapper transform function for transform(Coordinate, Point2D)
      • Methods inherited from class org.locationtech.jts.awt.ShapeWriter

        setDecimation, setRemoveDuplicatePoints, toShape
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AdvancedShapeWriter

        public AdvancedShapeWriter​(PointTransformation pointTransformation)
        Constructor for AdvancedShapeWriter.
        Parameters:
        pointTransformation - PointTransformation used in rendering process.
    • Method Detail

      • toShape

        public java.awt.Shape toShape​(java.lang.Object object)
        Wrapper function for ShapeWriter.toShape(Geometry) to extend functionality for Shapeable instances.
        Parameters:
        object - object to transfer to a Shape
        Returns:
        Shape representing the object. Could be null.
      • transform

        public void transform​(org.locationtech.jts.geom.Coordinate src,
                              java.awt.geom.Point2D dest)
        Wrapper transform function for transform(Coordinate, Point2D)
        Parameters:
        src - source Coordinate
        dest - 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 transformed Line2D.
        Parameters:
        from - start Coordinate
        to - end Coordinate
        Returns:
        Line2D Shape representing 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 transformed Line2D with non-scalable length.
        Parameters:
        fixed - start Coordinate
        floating - direction Coordinate
        length - fixed length the line is rendered with
        Returns:
        Line2D Shape representing 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 transformed Arc2D with non-scalable width and height.
        Parameters:
        center - center Coordinate the arc is positioned around
        dimension - width and height of the arc
        start - start angle relative to x-axis in radians
        extend - extend angle (relative to start angle) in radians
        Returns:
        transformed open Arc2D
      • setBoundary

        public void setBoundary​(CanvasBoundary boundary)
        The boundary of the associated Canvas. Enables boundary specific shapes like endless lines, grids etc.
      • getBoundary

        public CanvasBoundary getBoundary()
        The boundary of the associated Canvas. Enables boundary specific shapes like endless lines, grids etc.