Class LineBandTool
- java.lang.Object
-
- org.locationtech.jtstest.testbuilder.ui.tools.BasicTool
-
- org.locationtech.jtstest.testbuilder.ui.tools.IndicatorTool
-
- org.locationtech.jtstest.testbuilder.ui.tools.LineBandTool
-
- All Implemented Interfaces:
java.awt.event.KeyListener,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.event.MouseWheelListener,java.util.EventListener,Tool
- Direct Known Subclasses:
AbstractDrawTool,AbstractStreamDrawTool
public abstract class LineBandTool extends IndicatorTool
-
-
Field Summary
Fields Modifier and Type Field Description private intclickCountToFinishprivate booleancloseRingprivate java.util.Listcoordinatesprivate booleandrawBandLinesprotected CoordinatetentativeCoordinate
-
Constructor Summary
Constructors Constructor Description LineBandTool()LineBandTool(java.awt.Cursor cursor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidadd(Coordinate c)protected abstract voidbandFinished()private voiddrawVertices(java.awt.geom.GeneralPath path)protected voidfinishGesture()java.util.ListgetCoordinates()Returns an empty List once the shape is cleared.protected java.awt.ShapegetShape()Gets the shape for displaying the current state of the action.protected booleanisFinishingRelease(java.awt.event.MouseEvent e)CoordinatelastCoordinate()voidmouseDragged(java.awt.event.MouseEvent e)protected voidmouseLocationChanged(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent e)voidmouseReleased(java.awt.event.MouseEvent e)protected voidsetClickCountToFinishGesture(int clickCountToFinish)protected voidsetCloseRing(boolean closeRing)protected voidsetDrawBandLines(boolean drawBandLines)protected Coordinate[]toArray(java.util.List coordinates)-
Methods inherited from class org.locationtech.jtstest.testbuilder.ui.tools.IndicatorTool
clearIndicator, isIndicatorVisible, redrawIndicator
-
Methods inherited from class org.locationtech.jtstest.testbuilder.ui.tools.BasicTool
activate, deactivate, geomModel, getCursor, getGraphics2D, getModelSnapTolerance, gridSize, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseWheelMoved, panel, toModel, toModel, toModelCoordinate, toModelSnapped, toModelSnappedIfCloseToViewGrid, toModelSnappedToViewGrid, toView, toView
-
-
-
-
Field Detail
-
coordinates
private java.util.List coordinates
-
tentativeCoordinate
protected Coordinate tentativeCoordinate
-
closeRing
private boolean closeRing
-
clickCountToFinish
private int clickCountToFinish
-
drawBandLines
private boolean drawBandLines
-
-
Method Detail
-
setCloseRing
protected void setCloseRing(boolean closeRing)
-
setClickCountToFinishGesture
protected void setClickCountToFinishGesture(int clickCountToFinish)
-
setDrawBandLines
protected void setDrawBandLines(boolean drawBandLines)
-
getCoordinates
public java.util.List getCoordinates()
Returns an empty List once the shape is cleared.
-
lastCoordinate
public Coordinate lastCoordinate()
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener- Overrides:
mouseReleasedin classBasicTool
-
mouseLocationChanged
protected void mouseLocationChanged(java.awt.event.MouseEvent e)
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener- Overrides:
mouseMovedin classIndicatorTool
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener- Overrides:
mouseDraggedin classIndicatorTool
-
add
protected void add(Coordinate c)
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener- Overrides:
mousePressedin classBasicTool
-
getShape
protected java.awt.Shape getShape()
Description copied from class:IndicatorToolGets the shape for displaying the current state of the action. Subclasses should override.- Overrides:
getShapein classIndicatorTool- Returns:
- null if nothing should be drawn
-
drawVertices
private void drawVertices(java.awt.geom.GeneralPath path)
-
isFinishingRelease
protected boolean isFinishingRelease(java.awt.event.MouseEvent e)
-
toArray
protected Coordinate[] toArray(java.util.List coordinates)
-
finishGesture
protected void finishGesture() throws java.lang.Exception- Throws:
java.lang.Exception
-
bandFinished
protected abstract void bandFinished() throws java.lang.Exception- Throws:
java.lang.Exception
-
-