Package com.kheops.jmap.client.tools
Class ToolDrawBox
java.lang.Object
com.kheops.jmap.client.tools.Tool
com.kheops.jmap.client.tools.ToolDraw
com.kheops.jmap.client.tools.ToolDrawState
com.kheops.jmap.client.tools.ToolDrawBox
- All Implemented Interfaces:
JMapEventDispatcher
,ViewEventListener
,ViewManagerEventListener
,KeyListener
,EventListener
- Direct Known Subclasses:
ToolSelectBox
,ToolZoomInBox
,ToolZoomOutBox
This subclass of Tool automatically draws a rectangle on the view when the
mouse is dragged.
- See Also:
-
Field Summary
Fields inherited from class com.kheops.jmap.client.tools.ToolDrawState
state, STATE_FIRST_CLICK, STATE_NONE, STATE_SECOND_CLICK
Fields inherited from class com.kheops.jmap.client.tools.ToolDraw
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 Summary
ConstructorDescriptionToolDrawBox
(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer) ToolDrawBox
(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer, boolean useUndoManager) ToolDrawBox
(StyleContainer styleContainer) -
Method Summary
Modifier and TypeMethodDescriptionvoid
KeyListener methodsvoid
This method is called by the view (View instance) after mouse clicked events generated by the user.void
This method overrides onToolDragged in Tool.void
This method is called by the view (View instance) after mouse moved events generated by the user.void
This method overrides onToolPressed in Tool.void
This method overrides onToolReleased in Tool.void
Terminates the current toolvoid
This method handles viewRepaintOccurredMethods inherited from class com.kheops.jmap.client.tools.ToolDrawState
init
Methods inherited from class com.kheops.jmap.client.tools.ToolDraw
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
Methods inherited from class com.kheops.jmap.client.tools.Tool
getView, isAutoPan, setAutoPan, toWCPoint
-
Field Details
-
styledPoly
-
styledLabel
-
-
Constructor Details
-
ToolDrawBox
public ToolDrawBox() -
ToolDrawBox
-
ToolDrawBox
public ToolDrawBox(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer) -
ToolDrawBox
public ToolDrawBox(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer, boolean useUndoManager)
-
-
Method Details
-
onToolPressed
This method overrides onToolPressed in Tool. It is called after a mouse pressed event on the view to determine the starting corner coordinates of the box.- Overrides:
onToolPressed
in classTool
- Parameters:
e
- the MouseEvent
-
onToolDragged
This method overrides onToolDragged in Tool. It is called after an mouse drag event on the view to draw dynamically a box from the starting corner location (where the mouse pressed event occurred.) to the ending corner location (the present mouse location)- Overrides:
onToolDragged
in classTool
- Parameters:
e
- the corresponding the MouveEvent
-
onToolReleased
This method overrides onToolReleased in Tool. It is called after an mouse released event on the view.- Overrides:
onToolReleased
in classTool
- Parameters:
e
- the corresponding MouveEvent
-
onToolMoved
Description copied from class:Tool
This method is called by the view (View instance) after mouse moved events generated by the user. It will handle these events by making the necessary changes. This method should be overridden by the subclasses that needs to perform specific tasks when such events occur.- Overrides:
onToolMoved
in classTool
- Parameters:
e
- the corresponding mouse event.
-
terminate
public void terminate()Description copied from class:ToolDraw
Terminates the current tool- Overrides:
terminate
in classToolDrawState
-
keyPressed
Description copied from class:ToolDraw
KeyListener methods- Specified by:
keyPressed
in interfaceKeyListener
- Overrides:
keyPressed
in classToolDraw
-
viewRepaintOccurred
Description copied from interface:ViewEventListener
This method handles viewRepaintOccurred- Specified by:
viewRepaintOccurred
in interfaceViewEventListener
- Overrides:
viewRepaintOccurred
in classToolDraw
- Parameters:
e
- the corresponding ViewRepaintEvent object
-
onToolClicked
Description copied from class:Tool
This method is called by the view (View instance) after mouse clicked events generated by the user. It will handle these events by making the necessary changes. This method should be overridden by the subclasses that needs to perform specific tasks when such events occur.- Overrides:
onToolClicked
in classTool
- Parameters:
e
- the corresponding mouse event.
-