Package com.inductiveautomation.rm.tool
Class RMLineShapeTool<T extends RMLineShape>
- java.lang.Object
-
- com.inductiveautomation.snap.ui.UIOwner<SwingEvent,javax.swing.JComponent>
-
- com.inductiveautomation.snap.swing.SwingOwner
-
- com.inductiveautomation.rm.tool.RMTool<T>
-
- com.inductiveautomation.rm.tool.RMLineShapeTool<T>
-
public class RMLineShapeTool<T extends RMLineShape> extends RMTool<T>
This class handles creation of lines.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inductiveautomation.rm.tool.RMTool
RMTool.RMShapeHandle
-
-
Field Summary
Fields Modifier and Type Field Description static byte
HandleEndPoint
static byte
HandleStartPoint
-
Fields inherited from class com.inductiveautomation.rm.tool.RMTool
HandleE, HandleN, HandleNE, HandleNW, HandleS, HandleSE, HandleSW, HandleW, HandleWidth, SPLIT_RESET
-
Fields inherited from class com.inductiveautomation.snap.ui.UIOwner
DragDrop, DragEnter, DragEvents, DragExit, DragOver, KeyEvents, KeyFinished, KeyPressed, KeyReleased, KeyTyped, MouseClicked, MouseDragged, MouseEntered, MouseEvents, MouseExited, MouseFinished, MouseMoved, MousePressed, MouseReleased
-
-
Constructor Summary
Constructors Constructor Description RMLineShapeTool()
RMLineShapeTool(com.google.common.eventbus.EventBus ebus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
findArrow(RMLineShape anArrow)
Finds the arrow type for given line segment.java.util.List<RMLineShape>
getArrows()
Loads the list of arrow shapes from a .rpt file.int
getHandleCount(T aShape)
Editor method (returns the number of handles).RMPoint
getHandlePoint(T aShape, int anIndex, boolean isSuperSelected)
Editor method.java.lang.Class
getShapeClass()
Returns the shape class that this tool is responsible for.java.lang.String
getWindowTitle()
Returns the name of this tool to be displayed by inspector.protected void
initUI()
Initialize UI panel.void
mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse drag for line creation.void
mouseMoved(java.awt.event.MouseEvent anEvent)
Event handling - overridden to install cross-hair cursor.void
mousePressed(java.awt.event.MouseEvent anEvent)
Handles mouse press for line creation.void
moveShapeHandle(T aShape, int aHandle, RMPoint aPoint)
Editor method.void
resetUI()
Update UI panel.void
respondUI(SwingEvent anEvent)
Respond to UI change.-
Methods inherited from class com.inductiveautomation.rm.tool.RMTool
acceptsDrag, activateTool, attachEventBus, createUI, deactivateTool, didBecomeSuperSelectedShapeInEditor, dragEnter, dragExit, dragOver, drop, dropClass, dropColor, dropDragKey, dropFiles, dropString, flavorForClass, flushChanges, getAcceptsChildren, getBoundsSuperSelected, getDatasetEntity, getDragDisplayBounds, getEditor, getEditorPane, getFont, getFontDeep, getGalleryClone, getHandleAtPoint, getHandleCursor, getHandleOpposing, getHandleRect, getIcon, getIcon, getPointsFromUnits, getSelectedShape, getSelectedShapes, getSelectTool, getShapeFillInspector, getShapeHandleAtPoint, getTool, getTool, getToolTipText, getUnitsFromPoints, isSelected, isSuperSelectable, isSuperSelected, isUngroupable, mouseDragged, mouseMoved, mousePressed, mousePressedSelection, mouseReleased, mouseReleased, newInstance, paintShapeHandles, paintTool, processKeyEvent, reactivateTool, setFont, setFontBold, setFontBoldDeep, setFontFamily, setFontFamilyDeep, setFontItalic, setFontItalicDeep, setFontName, setFontNameDeep, setFontSize, setFontSizeDeep, willLoseSuperSelectionInEditor
-
Methods inherited from class com.inductiveautomation.snap.swing.SwingOwner
addKeyActionEvent, createTimer, createUI, createWindow, getNode, getNode, getNodeHelper, getTimer, getTimer, getUI, getWindow, isEventThread, isWindowVisible, requestFocus, requestFocusImpl, runLater, sendEvent, setWindowVisible
-
Methods inherited from class com.inductiveautomation.snap.ui.UIOwner
addNodeBinding, disableEvents, enableEvents, getBindingModelValue, getBindingNodeValue, getConversionMap, getConversionMapKey, getConversionMaps, getConversionMapValue, getFirstFocus, getModelValue, getNode, getNodeAction, getNodeBoolValue, getNodeFloatValue, getNodeIntValue, getNodeItemDisplayKey, getNodeItems, getNodeSelectedIndex, getNodeSelectedItem, getNodeStringValue, getNodeText, getNodeValue, getUI, getUIHpr, initUI, isNodeEnabled, isNodeValueAdjusting, isSendEventDisabled, isUISet, processResetUI, processRespondUI, resetLater, resetNodeBindings, runLaterDelayed, runLaterOnce, sendEvent, sendNodeAction, setBindingModelValue, setBindingNodeValue, setFirstFocus, setModelValue, setNodeAction, setNodeEnabled, setNodeItemDisplayKey, setNodeItems, setNodeItems, setNodeSelectedIndex, setNodeSelectedItem, setNodeText, setNodeValue, setSendEventDisabled
-
-
-
-
Field Detail
-
HandleStartPoint
public static final byte HandleStartPoint
- See Also:
- Constant Field Values
-
HandleEndPoint
public static final byte HandleEndPoint
- See Also:
- Constant Field Values
-
-
Method Detail
-
getShapeClass
public java.lang.Class getShapeClass()
Returns the shape class that this tool is responsible for.- Overrides:
getShapeClass
in classRMTool<T extends RMLineShape>
-
getWindowTitle
public java.lang.String getWindowTitle()
Returns the name of this tool to be displayed by inspector.- Overrides:
getWindowTitle
in classRMTool<T extends RMLineShape>
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent anEvent)
Event handling - overridden to install cross-hair cursor.- Overrides:
mouseMoved
in classRMTool<T extends RMLineShape>
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent anEvent)
Handles mouse press for line creation.- Overrides:
mousePressed
in classRMTool<T extends RMLineShape>
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent anEvent)
Handles mouse drag for line creation.- Overrides:
mouseDragged
in classRMTool<T extends RMLineShape>
-
getHandleCount
public int getHandleCount(T aShape)
Editor method (returns the number of handles).- Overrides:
getHandleCount
in classRMTool<T extends RMLineShape>
-
getHandlePoint
public RMPoint getHandlePoint(T aShape, int anIndex, boolean isSuperSelected)
Editor method.- Overrides:
getHandlePoint
in classRMTool<T extends RMLineShape>
-
moveShapeHandle
public void moveShapeHandle(T aShape, int aHandle, RMPoint aPoint)
Editor method.- Overrides:
moveShapeHandle
in classRMTool<T extends RMLineShape>
-
getArrows
public java.util.List<RMLineShape> getArrows()
Loads the list of arrow shapes from a .rpt file.
-
findArrow
public int findArrow(RMLineShape anArrow)
Finds the arrow type for given line segment.
-
initUI
protected void initUI()
Initialize UI panel.- Overrides:
initUI
in classUIOwner<SwingEvent,javax.swing.JComponent>
-
resetUI
public void resetUI()
Update UI panel.- Overrides:
resetUI
in classUIOwner<SwingEvent,javax.swing.JComponent>
-
respondUI
public void respondUI(SwingEvent anEvent)
Respond to UI change.- Overrides:
respondUI
in classUIOwner<SwingEvent,javax.swing.JComponent>
-
-