Class GeometryEditModel
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.model.GeometryEditModel
-
public class GeometryEditModel extends java.lang.Object
Holds the currentTestCaseEdit
.
-
-
Field Summary
Fields Modifier and Type Field Description private int
editGeomIndex
private java.util.Vector
geometryListeners
private int
geomType
private boolean
readOnly
private TestCaseEdit
testCase
private static WKTWriter
wktWriter
-
Constructor Summary
Constructors Constructor Description GeometryEditModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addComponent(java.util.List coordList)
Adds a geometry component of the currently selected type, to the currently selected geometry.void
addGeometryListener(GeometryListener l)
void
clear()
void
clear(int i)
Coordinate[]
findAdjacentVertices(Coordinate vertex)
void
fireGeometryChanged(GeometryEvent e)
void
geomChanged()
Envelope
getEnvelope()
Envelope
getEnvelopeAll()
Envelope
getEnvelopeResult()
Geometry
getGeometry()
Geometry
getGeometry(int i)
int
getGeometryType()
int
getGeomIndex()
Geometry
getResult()
private static Coordinate[]
getRing(java.util.List coordList)
java.lang.String
getText(int textType)
static java.lang.String
getText(Geometry geom, int textType)
boolean
isReadOnly()
GeometryLocation
locateNonVertexPoint(Coordinate testPt, double tolerance)
Locates a non-vertex point on a line segment of the current geometry within the given tolerance, if any.GeometryLocation
locateVertex(Coordinate testPt, double tolerance)
Locates a vertex of the current geometry within the given tolerance, if any.Coordinate
locateVertexPt(Coordinate testPt, double tolerance)
void
moveVertex(Coordinate fromLoc, Coordinate toLoc)
void
removeGeometryListener(GeometryListener l)
void
setEditGeomIndex(int index)
void
setGeometry(int i, Geometry g)
void
setGeometry(Geometry g)
void
setGeometryType(int geomType)
void
setReadOnly(boolean readOnly)
void
setTestCase(TestCaseEdit testCase)
static java.lang.String
toStringVeryLarge(Geometry g)
-
-
-
Field Detail
-
wktWriter
private static WKTWriter wktWriter
-
readOnly
private boolean readOnly
-
editGeomIndex
private int editGeomIndex
-
geomType
private int geomType
-
testCase
private TestCaseEdit testCase
-
geometryListeners
private transient java.util.Vector geometryListeners
-
-
Method Detail
-
getEnvelope
public Envelope getEnvelope()
-
getEnvelopeAll
public Envelope getEnvelopeAll()
-
getEnvelopeResult
public Envelope getEnvelopeResult()
-
getGeomIndex
public int getGeomIndex()
-
setEditGeomIndex
public void setEditGeomIndex(int index)
-
isReadOnly
public boolean isReadOnly()
-
clear
public void clear()
-
getGeometryType
public int getGeometryType()
-
setGeometryType
public void setGeometryType(int geomType)
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
getText
public java.lang.String getText(int textType)
-
getText
public static java.lang.String getText(Geometry geom, int textType)
-
toStringVeryLarge
public static java.lang.String toStringVeryLarge(Geometry g)
-
getResult
public Geometry getResult()
-
getGeometry
public Geometry getGeometry()
-
getGeometry
public Geometry getGeometry(int i)
-
setTestCase
public void setTestCase(TestCaseEdit testCase)
-
setGeometry
public void setGeometry(Geometry g)
-
setGeometry
public void setGeometry(int i, Geometry g)
-
clear
public void clear(int i)
-
addComponent
public void addComponent(java.util.List coordList)
Adds a geometry component of the currently selected type, to the currently selected geometry.- Parameters:
coordList
-
-
getRing
private static Coordinate[] getRing(java.util.List coordList)
-
findAdjacentVertices
public Coordinate[] findAdjacentVertices(Coordinate vertex)
-
locateNonVertexPoint
public GeometryLocation locateNonVertexPoint(Coordinate testPt, double tolerance)
Locates a non-vertex point on a line segment of the current geometry within the given tolerance, if any. Returns the closest point on the segment.- Parameters:
testPt
-tolerance
-- Returns:
- the location found, or null if no non-vertex point was within tolerance
-
locateVertex
public GeometryLocation locateVertex(Coordinate testPt, double tolerance)
Locates a vertex of the current geometry within the given tolerance, if any. Returns the closest point on the segment.- Parameters:
testPt
-tolerance
-- Returns:
- the location of the vertex found, or null if no vertex was within tolerance
-
locateVertexPt
public Coordinate locateVertexPt(Coordinate testPt, double tolerance)
-
moveVertex
public void moveVertex(Coordinate fromLoc, Coordinate toLoc)
-
geomChanged
public void geomChanged()
-
removeGeometryListener
public void removeGeometryListener(GeometryListener l)
-
addGeometryListener
public void addGeometryListener(GeometryListener l)
-
fireGeometryChanged
public void fireGeometryChanged(GeometryEvent e)
-
-