Class RMEditor
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.inductiveautomation.rm.viewer.RMViewer
com.inductiveautomation.rm.editor.RMEditor
- All Implemented Interfaces:
- DeepChangeListener,- ImageObserver,- MenuContainer,- PropertyChangeListener,- Serializable,- EventListener,- Scrollable
This class subclasses RMViewer to support RMDocument editing.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class com.inductiveautomation.rm.viewer.RMViewerRMViewer.PhantomPane, RMViewer.RMVPrintable, RMViewer.ZoomModeNested classes/interfaces inherited from class javax.swing.JComponentJComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.ContainerContainer.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.ComponentComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.inductiveautomation.rm.viewer.RMViewerContent_Prop, PRINT_MODE_RASTER, PRINT_MODE_VECTOR, ZOOM_CHANGEFields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddPage()Adds a page to the document after current page.voidAdds a given page to the current document at the given index.voidAdds a page to the document before current page.voidaddSelectedShape(RMShape aShape) Add a shape to the selected shapes list and ensures the super selected is added as well on the first run.voidaddShapesToShape(List<? extends RMShape> theShapes, RMParentShape aShape, boolean withCorrection) Adds shapes as children to given shape.voidcopy()Standard clipboard copy functionality.Called to enabled drag and drop.Creates an editor input adapter for viewer adapter.protected RMShapePainterJ2DCreates the object that is actually responsible for paining shapes in the viewer.Creates the shapes helper.protected RMViewerShapeCreates the viewer shape.voidcut()Standard clipboard cut functionality.voiddeepChange(PropertyChangeListener aShape, PropertyChangeEvent anEvent) Property change.voiddelete()Deletes all the currently selected shapes.Returns the first SuperSelectedShape that accepts children.Returns the first SuperSelected shape that accepts children at a given point.Returns the first SuperSelectedShape that accepts children, or the currently selected page if N/AvoidThis method finalizes any (potentially cached) changes in progress in the editor (like from text editing).getChildShapeAtPoint(RMShape aShape, RMPoint aPoint) Returns the child of the given shape hit by the given point.Tool method - returns the currently selected tool.Returns the datasource associated with the editor's document.Returns the sample dataset from the document's datasource.Returns the even helper object.Returns the editor pane for this editor, if there is one.static RMEditorReturns the editor that was most recently activated.protected DimensionReturns the ideal size of the viewer.getRepaintBoundsForShape(RMShape aShape) Overrides RMViewer implementation to account for selected shapes potentially having different bounds.Returns the currently selected shape or, if none, the super-selected shape.getSelectedOrSuperSelectedShape(int anIndex) Returns the currently selected shape at the given index, or the super-selected shape.intReturns the number of currently selected shapes or simply 1, if a shape is super-selected.Returns the currently selected shapes or, if none, the super-selected shape in a list.Returns the first selected shape.getSelectedShape(int anIndex) Returns the selected shape at the given index.intReturns the number of selected shapes.Returns the selected shapes list.Scrolls selected shapes to visible.getShapeAtPoint(Point2D aPoint) Returns first shape hit by point given in View coords.Returns the shapes helper.Returns the first super selected shape, if parent shape.Returns the first super-selected shape.getSuperSelectedShape(int anIndex) Returns the super-selected shape at the given index.intReturns the number of super-selected shapes.Returns the super selected shape list.Returns the text editor (or null if not editing).getTextEditor(boolean evenIfNotActive) Returns the text editor (even if not editing).getTextEditor(RMTextShape aText) Returns the text editor, primed for editing the given text shape.getToolTipText(MouseEvent anEvent) Returns a tool tip string by asking deepest shape's tool.booleanReturns whether the editor is in a state of constant change, like during a mouse drag loop.Override to return as editor shape.Override to have zoom focus on selected shapes rect.booleanReturns whether the select tool is currently selected.booleanTool method - Returns whether the select tool is currently selected and if it's currently being used to select.booleanReturns whether viewer is really doing editing.booleanisSelected(RMShape aShape) Returns whether a given shape is selected in the editor.booleanisSuperSelected(RMShape aShape) Returns whether a given shape is super-selected in the editor.voidOverrides JComponent implementation to paint viewer shapes and page, margin, grid, etc.voidpaste()Standard clipbard paste functionality.voidUn-SuperSelect currently super selected shape.protected voidOverride to revalidate when ideal size changes.voidredo()Called to redo the last undo operation in the editor.voidRemoves current page from document.voidremovePage(int anIndex) Removes the document page at the given index.voidremoveSelectedShape(RMShape aShape) Remove a shape from the selected shapes list.voidResets the currently selected tool.protected voidSaves Undo Changes.protected voidSaves undo changes after a delay.voidCauses all the children of the current super selected shape to become selected.voidsetCurrentTool(RMTool aTool) Tool method - sets the currently select tool to the given tool.voidSets the current tool to the select tool.voidsetDataSource(RMDataSource aDataSource) Sets the datasource associated with the editor's document.voidsetEditing(boolean aFlag) Sets whether viewer is really doing editing.voidsetSelectedPageIndex(int anIndex) Override viewer method to reset selected shapes on page change.voidsetSelectedShape(RMShape aShape) Selects the given shape.voidsetSelectedShapes(List<RMShape> theShapes) Selects the shapes in the given list.voidsetSuperSelectedShape(RMShape aShape) Super select a shape.protected voidsetTextSelection(int aStart, int anEnd) Called to notify the TextEditor has changed selection.protected voidsetUndoSelection(Object aSelection) Sets the undo selection.voidundo()Called to undo the last edit operation in the editor.Methods inherited from class com.inductiveautomation.rm.viewer.RMViewerconvertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, docShapeRepaint, firstPage, flushShapeRepaints, getBook, getContent, getContentX, getContentY, getCopies, getDocument, getDocumentBounds, getDrawsBackground, getHoverShape, getInputAdapter, getlastZoomFactor, getPageBounds, getPageCount, getPageOrientation, getPaintFrameRate, getPhantomPane, getPreferredScrollableViewportSize, getPreferredSize, getPrefSize, getPrintingDPI, getPrintingMode, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedPage, getSelectedPageIndex, getShape, getShapeAtPoint, getShapePainter, getShapeRepaintEnabled, getShown, getSourceURL, getTransformFromShape, getUndoer, getZoomFactor, getZoomFactor, getZoomMode, getZoomToActualSizeFactor, isCollate, isPreview, isPrintBothSides, isUseAutoLandscape, isZoomToFactor, lastPage, mouseDragged, mouseMoved, mousePressed, mouseReleased, pageBack, pageForward, paintBackground, performActionURLClick, play, print, print, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, propertyChange, repaint, runZoomPanel, setBounds, setCollate, setContent, setContent, setCopies, setInputAdapter, setPageOrientation, setPaintFrameRate, setPrintBothSides, setPrintingDPI, setPrintingMode, setShapeRepaintEnabled, setShown, setUseAutoLandscape, setZoomFactor, setZoomFactorImpl, setZoomMode, setZoomToFitFactor, stop, undoerHasUndos, undoerSetUndoTitle, viewerHidden, viewerShown, zoomToggleLastMethods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
- 
Field Details- 
CurrentTool_Prop- See Also:
 
- 
SelectedShapes_Prop- See Also:
 
- 
SuperSelectedShape_Prop- See Also:
 
- 
TextSelection_Prop- See Also:
 
- 
PageSelection_Prop- See Also:
 
 
- 
- 
Constructor Details- 
RMEditorpublic RMEditor()Creates a new editor.
 
- 
- 
Method Details- 
getMainEditorReturns the editor that was most recently activated.
- 
getEditorPaneReturns the editor pane for this editor, if there is one.
- 
getViewerShapeOverride to return as editor shape.- Overrides:
- getViewerShapein class- RMViewer
 
- 
createViewerShapeCreates the viewer shape.- Overrides:
- createViewerShapein class- RMViewer
 
- 
isEditingpublic boolean isEditing()Returns whether viewer is really doing editing.
- 
setEditingpublic void setEditing(boolean aFlag) Sets whether viewer is really doing editing.
- 
getValueIsAdjustingpublic boolean getValueIsAdjusting()Returns whether the editor is in a state of constant change, like during a mouse drag loop.
- 
createShapePainterCreates the object that is actually responsible for paining shapes in the viewer.- Overrides:
- createShapePainterin class- RMViewer
 
- 
createDropTargetCalled to enabled drag and drop.
- 
getTextEditorReturns the text editor (or null if not editing).
- 
getTextEditorReturns the text editor (even if not editing).
- 
getTextEditorReturns the text editor, primed for editing the given text shape.
- 
setTextSelectionprotected void setTextSelection(int aStart, int anEnd) Called to notify the TextEditor has changed selection.
- 
getShapesHelperReturns the shapes helper.
- 
createShapesHelperCreates the shapes helper.
- 
getSelectedShapeReturns the first selected shape.
- 
setSelectedShapeSelects the given shape.
- 
getSelectedShapeCountpublic int getSelectedShapeCount()Returns the number of selected shapes.
- 
getSelectedShapeReturns the selected shape at the given index.
- 
getSelectedShapesReturns the selected shapes list.
- 
setSelectedShapesSelects the shapes in the given list.
- 
addSelectedShapeAdd a shape to the selected shapes list and ensures the super selected is added as well on the first run.
- 
removeSelectedShapeRemove a shape from the selected shapes list.
- 
getSuperSelectedShapeReturns the first super-selected shape.
- 
getSuperSelectedParentShapeReturns the first super selected shape, if parent shape.
- 
setSuperSelectedShapeSuper select a shape.
- 
isSelectedReturns whether a given shape is selected in the editor.
- 
isSuperSelectedReturns whether a given shape is super-selected in the editor.
- 
getSuperSelectedShapeCountpublic int getSuperSelectedShapeCount()Returns the number of super-selected shapes.
- 
getSuperSelectedShapeReturns the super-selected shape at the given index.
- 
getSuperSelectedShapesReturns the super selected shape list.
- 
getSelectedOrSuperSelectedShapeCountpublic int getSelectedOrSuperSelectedShapeCount()Returns the number of currently selected shapes or simply 1, if a shape is super-selected.
- 
getSelectedOrSuperSelectedShapeReturns the currently selected shape at the given index, or the super-selected shape.
- 
getSelectedOrSuperSelectedShapeReturns the currently selected shape or, if none, the super-selected shape.
- 
getSelectedOrSuperSelectedShapesReturns the currently selected shapes or, if none, the super-selected shape in a list.
- 
popSelectionpublic void popSelection()Un-SuperSelect currently super selected shape.
- 
getRepaintBoundsForShapeOverrides RMViewer implementation to account for selected shapes potentially having different bounds.- Overrides:
- getRepaintBoundsForShapein class- RMViewer
 
- 
flushEditingChangespublic void flushEditingChanges()This method finalizes any (potentially cached) changes in progress in the editor (like from text editing).
- 
getShapeAtPointReturns first shape hit by point given in View coords.
- 
getChildShapeAtPointReturns the child of the given shape hit by the given point.
- 
firstSuperSelectedShapeThatAcceptsChildrenReturns the first SuperSelectedShape that accepts children.
- 
firstSuperSelectedShapeThatAcceptsChildrenSafeReturns the first SuperSelectedShape that accepts children, or the currently selected page if N/A
- 
firstSuperSelectedShapeThatAcceptsChildrenAtPointReturns the first SuperSelected shape that accepts children at a given point.
- 
cutpublic void cut()Standard clipboard cut functionality.
- 
copypublic void copy()Standard clipboard copy functionality.
- 
pastepublic void paste()Standard clipbard paste functionality.
- 
selectAllpublic void selectAll()Causes all the children of the current super selected shape to become selected.
- 
deletepublic void delete()Deletes all the currently selected shapes.
- 
addShapesToShapepublic void addShapesToShape(List<? extends RMShape> theShapes, RMParentShape aShape, boolean withCorrection) Adds shapes as children to given shape.
- 
addPagepublic void addPage()Adds a page to the document after current page.
- 
addPagePreviouspublic void addPagePrevious()Adds a page to the document before current page.
- 
addPageAdds a given page to the current document at the given index.
- 
removePagepublic void removePage()Removes current page from document.
- 
removePagepublic void removePage(int anIndex) Removes the document page at the given index.
- 
getCurrentToolTool method - returns the currently selected tool.
- 
setCurrentToolTool method - sets the currently select tool to the given tool.
- 
isCurrentToolSelectToolpublic boolean isCurrentToolSelectTool()Returns whether the select tool is currently selected.
- 
setCurrentToolToSelectToolpublic void setCurrentToolToSelectTool()Sets the current tool to the select tool.
- 
isCurrentToolSelectToolAndSelectingpublic boolean isCurrentToolSelectToolAndSelecting()Tool method - Returns whether the select tool is currently selected and if it's currently being used to select.
- 
resetCurrentToolpublic void resetCurrentTool()Resets the currently selected tool.
- 
setSelectedPageIndexpublic void setSelectedPageIndex(int anIndex) Override viewer method to reset selected shapes on page change.- Overrides:
- setSelectedPageIndexin class- RMViewer
 
- 
getSelectedShapesBoundsScrolls selected shapes to visible.
- 
getZoomFocusRectOverride to have zoom focus on selected shapes rect.- Overrides:
- getZoomFocusRectin class- RMViewer
 
- 
paintComponentOverrides JComponent implementation to paint viewer shapes and page, margin, grid, etc.- Overrides:
- paintComponentin class- RMViewer
 
- 
createInputAdapterCreates an editor input adapter for viewer adapter.- Overrides:
- createInputAdapterin class- RMViewer
 
- 
getEditorInputAdapterReturns the even helper object.
- 
processEventOverride to revalidate when ideal size changes.- Overrides:
- processEventin class- Container
 
- 
getPrefSizeReturns the ideal size of the viewer.- Overrides:
- getPrefSizein class- RMViewer
 
- 
getToolTipTextReturns a tool tip string by asking deepest shape's tool.- Overrides:
- getToolTipTextin class- JComponent
 
- 
getDataSourceReturns the datasource associated with the editor's document.
- 
setDataSourceSets the datasource associated with the editor's document.
- 
getDataSourceDatasetReturns the sample dataset from the document's datasource.
- 
undopublic void undo()Called to undo the last edit operation in the editor.
- 
redopublic void redo()Called to redo the last undo operation in the editor.
- 
setUndoSelectionSets the undo selection.
- 
deepChangeProperty change.- Specified by:
- deepChangein interface- DeepChangeListener
 
- 
saveUndoerChangesprotected void saveUndoerChanges()Saves Undo Changes.
- 
saveUndoerChangesLaterprotected void saveUndoerChangesLater()Saves undo changes after a delay.
 
-