Class Java2DConverter
java.lang.Object
com.vividsolutions.jump.workbench.ui.renderer.java2D.Java2DConverter
Converts JTS Geometry objects into Java 2D Shape objects
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionJava2DConverter(Java2DConverter.PointConverter pointConverter) Create a Java2DConverter based on pointConverter and using a default resolution of 0.5 pixel for decimation.Java2DConverter(Java2DConverter.PointConverter pointConverter, double resolution) Create a coordinate converter using a custom resolution for decimation. -
Method Summary
Modifier and TypeMethodDescriptiontoShape(org.locationtech.jts.geom.Geometry geometry) If you pass in a general GeometryCollection, note that a Shape cannot preserve information about which elements are 1D and which are 2D.org.locationtech.jts.geom.Coordinate[]toViewCoordinates(org.locationtech.jts.geom.Coordinate[] modelCoordinates)
-
Constructor Details
-
Java2DConverter
Create a Java2DConverter based on pointConverter and using a default resolution of 0.5 pixel for decimation.- Parameters:
pointConverter- the PointConverter to convert coordinates from Model to View
-
Java2DConverter
Create a coordinate converter using a custom resolution for decimation.- Parameters:
pointConverter- the PointConverter to convert coordinates from Model to Viewresolution- resolution in pixels for decimation
-
-
Method Details
-
toViewCoordinates
public org.locationtech.jts.geom.Coordinate[] toViewCoordinates(org.locationtech.jts.geom.Coordinate[] modelCoordinates) throws NoninvertibleTransformException - Throws:
NoninvertibleTransformException
-
toShape
public Shape toShape(org.locationtech.jts.geom.Geometry geometry) throws NoninvertibleTransformException If you pass in a general GeometryCollection, note that a Shape cannot preserve information about which elements are 1D and which are 2D. For example, if you pass in a GeometryCollection containing a ring and a disk, you cannot render them as such: if you use Graphics.fill, you'll get two disks, and if you use Graphics.draw, you'll get two rings. Solution: create Shapes for each element.- Throws:
NoninvertibleTransformException
-