Class GeometryEditModel
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.model.GeometryEditModel
-
public class GeometryEditModel extends Object
Holds the currentTestCaseEdit.- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description GeometryEditModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComponent(List coordList)Adds a geometry component of the currently selected type, to the currently selected geometry.voidaddGeometryListener(GeometryListener l)voidclear()voidclear(int i)voidexchangeGeometry()Coordinate[]findAdjacentVertices(Coordinate vertex)voidfireGeometryChanged(GeometryEvent e)voidgeomChanged()List<GeometryLocation>getComponents(Coordinate testPt, double tolerance)EnvelopegetEnvelope()EnvelopegetEnvelopeAll()EnvelopegetEnvelopeResult()GeometrygetGeometry()GeometrygetGeometry(int i)intgetGeometryType()intgetGeomIndex()GeometrygetResult()StringgetText(int textType)static StringgetText(Geometry geom, int textType)booleanisReadOnly()GeometryLocationlocateNonVertexPoint(Coordinate testPt, double tolerance)Locates a non-vertex point on a line segment of the current geometry within the given tolerance, if any.GeometryLocationlocateVertex(Coordinate testPt, double tolerance)Locates a vertex of the current geometry within the given tolerance, if any.CoordinatelocateVertexPt(Coordinate testPt, double tolerance)voidmoveVertex(Coordinate fromLoc, Coordinate toLoc)voidremoveGeometryListener(GeometryListener l)voidsetEditGeomIndex(int index)voidsetGeometry(int i, Geometry g)voidsetGeometry(Geometry g)voidsetGeometryType(int geomType)voidsetReadOnly(boolean readOnly)voidsetTestCase(TestCaseEdit testCase)static StringtoStringVeryLarge(Geometry g)voidundo()
-
-
-
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 String getText(int textType)
-
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)
-
exchangeGeometry
public void exchangeGeometry()
-
clear
public void clear(int i)
-
undo
public void undo()
-
addComponent
public void addComponent(List coordList)
Adds a geometry component of the currently selected type, to the currently selected geometry.- Parameters:
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
-
getComponents
public List<GeometryLocation> getComponents(Coordinate testPt, double 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)
-
-