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 int
clickCountToFinish
private boolean
closeRing
private java.util.List
coordinates
private boolean
drawBandLines
protected Coordinate
tentativeCoordinate
-
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 void
add(Coordinate c)
protected abstract void
bandFinished()
private void
drawVertices(java.awt.geom.GeneralPath path)
protected void
finishGesture()
java.util.List
getCoordinates()
Returns an empty List once the shape is cleared.protected java.awt.Shape
getShape()
Gets the shape for displaying the current state of the action.protected boolean
isFinishingRelease(java.awt.event.MouseEvent e)
Coordinate
lastCoordinate()
void
mouseDragged(java.awt.event.MouseEvent e)
protected void
mouseLocationChanged(java.awt.event.MouseEvent e)
void
mouseMoved(java.awt.event.MouseEvent e)
void
mousePressed(java.awt.event.MouseEvent e)
void
mouseReleased(java.awt.event.MouseEvent e)
protected void
setClickCountToFinishGesture(int clickCountToFinish)
protected void
setCloseRing(boolean closeRing)
protected void
setDrawBandLines(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:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classBasicTool
-
mouseLocationChanged
protected void mouseLocationChanged(java.awt.event.MouseEvent e)
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseMoved
in classIndicatorTool
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent e)
- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Overrides:
mouseDragged
in classIndicatorTool
-
add
protected void add(Coordinate c)
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Overrides:
mousePressed
in classBasicTool
-
getShape
protected java.awt.Shape getShape()
Description copied from class:IndicatorTool
Gets the shape for displaying the current state of the action. Subclasses should override.- Overrides:
getShape
in 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
-
-