public class ToolDrawPolygon extends ToolDrawState
Tool
Modifier and Type | Field and Description |
---|---|
protected K2DStyledElement |
styledLabel |
protected K2DStyledElement |
styledLine |
protected K2DStyledElement |
styledLineTemp |
protected K2DStyledElement |
styledPolygon |
state, STATE_FIRST_CLICK, STATE_NONE, STATE_SECOND_CLICK
altKeyEventManager, altLastPressed, createStyledElement, cursorCrosshair, cursorWait, df, displayLabel, drawLayer, drawLayerId, eventDispatcher, firstPointWc, ID_DISTANCE_LINE, ID_LABEL, ID_LINE_TMP, ID_SNAP_POINT, isPersistant, lastMousePositionDc, secPointWc, showAttributesEditor, snapLayers, styleContainer, t, toRedrawDc, useHighlightHandles, useUndoManager
Constructor and Description |
---|
ToolDrawPolygon() |
ToolDrawPolygon(int nbDecimals,
boolean displayLabel,
boolean isPersistant,
int drawLayerId,
StyleContainer styleContainer) |
ToolDrawPolygon(int nbDecimals,
boolean displayLabel,
boolean isPersistant,
int drawLayerId,
StyleContainer styleContainer,
boolean useUndoManager) |
ToolDrawPolygon(StyleContainer styleContainer) |
Modifier and Type | Method and Description |
---|---|
protected void |
drawStyledPolygon(boolean addPolyToLayerAndRedraw) |
void |
init(View view)
Initiates this drawing tool: Sets the view, the K2DTransform and sets the
layer if none was specified before
|
void |
keyPressed(java.awt.event.KeyEvent e)
KeyListener methods
|
void |
onToolClicked(java.awt.event.MouseEvent e)
This method will handle mouse clicked events.
|
void |
onToolClicked(java.awt.event.MouseEvent e,
boolean addPolyToLayerAndRedraw)
This method handles mouse clicked events
|
void |
onToolDragged(java.awt.event.MouseEvent e)
This method handles mouse dragged event when this tool is used
|
void |
onToolMoved(java.awt.event.MouseEvent e)
This method is called by the view (View instance) after mouse moved events generated by the user.
|
void |
onToolPressed(java.awt.event.MouseEvent e)
This method handles mouse pressed event when this tool is used
|
void |
terminate()
Terminates the current tool
|
void |
viewRepaintOccurred(ViewRepaintEvent e)
This method handles viewRepaintOccurred
|
addEditionEventListener, altIsPressed, altLastPressed, ctrlIsPressed, dispatchEvent, fireEditionEvent, genTrnsprntFillContainer, getCursor, getDrawLayer, getLabelAlignment, getLabelStyle, getLineStyle, getStyleContainer, initEventDispatcher, isCreateStyledElement, isPersistant, isPersistent, isUseUndoManager, keyReleased, keyTyped, offsetGeometry, removeEditionEventListener, setCreateStyledElement, setDrawLayer, setPersistant, setPersistent, setShowAttributesEditor, setStyleContainer, setUseUndoManager, shiftIsPressed, unoffsetGeometry, updatePtMouseVars, updatePtMouseVars, viewActivated, viewAdded, viewChangedOccurred, viewDeactivated, viewPopupMenuShowing, viewReadyOccurred, viewRedrawOccurred, viewRemoved, viewStaticElementChanged, viewToolChangedOccurred
getView, isAutoPan, onToolReleased, setAutoPan, toWCPoint
protected K2DStyledElement styledLine
protected K2DStyledElement styledLineTemp
protected K2DStyledElement styledLabel
protected K2DStyledElement styledPolygon
public ToolDrawPolygon()
public ToolDrawPolygon(StyleContainer styleContainer)
public ToolDrawPolygon(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer)
public ToolDrawPolygon(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer, boolean useUndoManager)
public void onToolClicked(java.awt.event.MouseEvent e)
onToolClicked
in class Tool
e
- the corresponding mouse eventpublic void onToolClicked(java.awt.event.MouseEvent e, boolean addPolyToLayerAndRedraw)
e
- addPolyToLayerAndRedraw
- can be used by extending tools to specify whether the polygon
needs to be added to the layer and drawed.public void onToolPressed(java.awt.event.MouseEvent e)
onToolPressed
in class Tool
e
- the corresponding mouse eventpublic void onToolMoved(java.awt.event.MouseEvent e)
Tool
onToolMoved
in class Tool
e
- the corresponding mouse event.public void onToolDragged(java.awt.event.MouseEvent e)
onToolDragged
in class Tool
e
- the corresponding mouse eventpublic void init(View view)
ToolDraw
init
in class ToolDrawState
view
- view instance associated with the toolpublic void terminate()
ToolDraw
terminate
in class ToolDrawState
public void keyPressed(java.awt.event.KeyEvent e)
ToolDraw
keyPressed
in interface java.awt.event.KeyListener
keyPressed
in class ToolDraw
public void viewRepaintOccurred(ViewRepaintEvent e)
ViewEventListener
viewRepaintOccurred
in interface ViewEventListener
viewRepaintOccurred
in class ToolDraw
e
- the corresponding ViewRepaintEvent objectprotected void drawStyledPolygon(boolean addPolyToLayerAndRedraw)