JTS Topology Suite - v 1.12

## com.vividsolutions.jts.awt
Class ShapeWriter

    java.lang.Object
      com.vividsolutions.jts.awt.ShapeWriter

    public class ShapeWriter

extends java.lang.Object

Writes `Geometry`s into Java2D `Shape` objects

Field Summary
`static PointShapeFactory` `DEFAULT_POINT_FACTORY` The point shape factory used by default.
`static PointTransformation` `DEFAULT_POINT_TRANSFORMATION` The point transformation used by default.

Constructor Summary
`ShapeWriter()` Creates a new ShapeWriter with the default (identity) point transformation.
`ShapeWriter(PointTransformation pointTransformer)` Creates a new ShapeWriter with a specified point transformation and the default point shape factory.
`ShapeWriter(PointTransformation pointTransformer, PointShapeFactory pointFactory)` Creates a new ShapeWriter with a specified point transformation and point shape factory.

Method Summary
`java.awt.Shape` `toShape(Geometry geometry)` Creates a `Shape` representing a `Geometry`, according to the specified PointTransformation and PointShapeFactory (if relevant).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_POINT_TRANSFORMATION

    public static final PointTransformation DEFAULT_POINT_TRANSFORMATION

  The point transformation used by default.

### DEFAULT_POINT_FACTORY

    public static final PointShapeFactory DEFAULT_POINT_FACTORY

  The point shape factory used by default.

Constructor Detail

### ShapeWriter

    public ShapeWriter(PointTransformation pointTransformer,
                       PointShapeFactory pointFactory)

  Creates a new ShapeWriter with a specified point transformation and point shape factory.

  Parameters:
    `pointTransformer` - a transformation from model to view space to use
    `pointFactory` - the PointShapeFactory to use

### ShapeWriter

    public ShapeWriter(PointTransformation pointTransformer)

  Creates a new ShapeWriter with a specified point transformation and the default point shape factory.

  Parameters:
    `pointTransformer` - a transformation from model to view space to use

### ShapeWriter

    public ShapeWriter()

  Creates a new ShapeWriter with the default (identity) point transformation.

Method Detail

### toShape

    public java.awt.Shape toShape(Geometry geometry)

  Creates a `Shape` representing a `Geometry`, according to the specified PointTransformation and PointShapeFactory (if relevant).

  Note that Shapes do not preserve information about which elements in heterogeneous collections are 1D and which are 2D. For example, a GeometryCollection containing a ring and a disk will render as two disks if Graphics.fill is used, or as two rings if Graphics.draw is used. To avoid this issue use separate shapes for the components.

  Parameters:
    `geometry` - the geometry to convert
  Returns:
    a Shape representing the geometry

JTS Topology Suite - v 1.12