public class RMEditor extends RMViewer implements DeepChangeListener
RMViewer.PhantomPane, RMViewer.RMVPrintable, RMViewer.ZoomMode
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CurrentTool_Prop |
static java.lang.String |
SelectedShapes_Prop |
static java.lang.String |
SuperSelectedShape_Prop |
static java.lang.String |
TextSelection_Prop |
Content_Prop, PRINT_MODE_RASTER, PRINT_MODE_VECTOR, ZOOM_CHANGE
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
RMEditor()
Creates a new editor.
|
Modifier and Type | Method and Description |
---|---|
void |
addPage()
Adds a page to the document after current page.
|
void |
addPage(RMPage aPage,
int anIndex)
Adds a given page to the current document at the given index.
|
void |
addPagePrevious()
Adds a page to the document before current page.
|
void |
addSelectedShape(RMShape aShape)
Add a shape to the selected shapes list.
|
void |
addShapesToShape(java.util.List<? extends RMShape> theShapes,
RMParentShape aShape,
boolean withCorrection)
Adds shapes as children to given shape.
|
void |
copy()
Standard clipboard copy functionality.
|
java.awt.dnd.DropTarget |
createDropTarget()
Called to enabled drag and drop.
|
RMViewerInputAdapter |
createInputAdapter()
Creates an editor input adapter for viewer adapter.
|
protected RMShapePainterJ2D |
createShapePainter(java.awt.Graphics2D aGr)
Creates the object that is actually responsible for paining shapes in the viewer.
|
RMEditorShapes |
createShapesHelper()
Creates the shapes helper.
|
protected RMViewerShape |
createViewerShape()
Creates the viewer shape.
|
void |
cut()
Standard clipboard cut functionality.
|
void |
deepChange(java.beans.PropertyChangeListener aShape,
java.beans.PropertyChangeEvent anEvent)
Property change.
|
void |
delete()
Deletes all the currently selected shapes.
|
RMParentShape |
firstSuperSelectedShapeThatAcceptsChildren()
Returns the first SuperSelectedShape that accepts children.
|
RMShape |
firstSuperSelectedShapeThatAcceptsChildrenAtPoint(RMPoint aPoint)
Returns the first SuperSelected shape that accepts children at a given point.
|
void |
flushEditingChanges()
This method finalizes any (potentially cached) changes in progress in the editor (like from text editing).
|
RMShape |
getChildShapeAtPoint(RMShape aShape,
RMPoint aPoint)
Returns the child of the given shape hit by the given point.
|
RMTool |
getCurrentTool()
Tool method - returns the currently selected tool.
|
RMDataSource |
getDataSource()
Returns the datasource associated with the editor's document.
|
java.lang.Object |
getDataSourceDataset()
Returns the sample dataset from the document's datasource.
|
RMEditorInputAdapter |
getEditorInputAdapter()
Returns the even helper object.
|
RMEditorPane |
getEditorPane()
Returns the editor pane for this editor, if there is one.
|
static RMEditor |
getMainEditor()
Returns the editor that was most recently activated.
|
protected java.awt.Dimension |
getPrefSize()
Returns the ideal size of the viewer.
|
RMRect |
getRepaintBoundsForShape(RMShape aShape)
Overrides RMViewer implementation to account for selected shapes potentially having different bounds.
|
RMShape |
getSelectedOrSuperSelectedShape()
Returns the currently selected shape or, if none, the super-selected shape.
|
RMShape |
getSelectedOrSuperSelectedShape(int anIndex)
Returns the currently selected shape at the given index, or the super-selected shape.
|
int |
getSelectedOrSuperSelectedShapeCount()
Returns the number of currently selected shapes or simply 1, if a shape is super-selected.
|
java.util.List<RMShape> |
getSelectedOrSuperSelectedShapes()
Returns the currently selected shapes or, if none, the super-selected shape in a list.
|
RMShape |
getSelectedShape()
Returns the first selected shape.
|
RMShape |
getSelectedShape(int anIndex)
Returns the selected shape at the given index.
|
int |
getSelectedShapeCount()
Returns the number of selected shapes.
|
java.util.List<RMShape> |
getSelectedShapes()
Returns the selected shapes list.
|
RMRect |
getSelectedShapesBounds()
Scrolls selected shapes to visible.
|
RMShape |
getShapeAtPoint(java.awt.geom.Point2D aPoint)
Returns first shape hit by point given in View coords.
|
RMEditorShapes |
getShapesHelper()
Returns the shapes helper.
|
RMParentShape |
getSuperSelectedParentShape()
Returns the first super selected shape, if parent shape.
|
RMShape |
getSuperSelectedShape()
Returns the first super-selected shape.
|
RMShape |
getSuperSelectedShape(int anIndex)
Returns the super-selected shape at the given index.
|
int |
getSuperSelectedShapeCount()
Returns the number of super-selected shapes.
|
java.util.List<RMShape> |
getSuperSelectedShapes()
Returns the super selected shape list.
|
RMEditorTextEditor |
getTextEditor()
Returns the text editor (or null if not editing).
|
RMEditorTextEditor |
getTextEditor(boolean evenIfNotActive)
Returns the text editor (even if not editing).
|
RMEditorTextEditor |
getTextEditor(RMTextShape aText)
Returns the text editor, primed for editing the given text shape.
|
java.lang.String |
getToolTipText(java.awt.event.MouseEvent anEvent)
Returns a tool tip string by asking deepest shape's tool.
|
boolean |
getValueIsAdjusting()
Returns whether the editor is in a state of constant change, like during a mouse drag loop.
|
RMEditorShape |
getViewerShape()
Override to return as editor shape.
|
java.awt.Rectangle |
getZoomFocusRect()
Override to have zoom focus on selected shapes rect.
|
boolean |
isCurrentToolSelectTool()
Returns whether the select tool is currently selected.
|
boolean |
isCurrentToolSelectToolAndSelecting()
Tool method - Returns whether the select tool is currently selected and if it's currently being used to select.
|
boolean |
isEditing()
Returns whether viewer is really doing editing.
|
boolean |
isSelected(RMShape aShape)
Returns whether a given shape is selected in the editor.
|
boolean |
isSuperSelected(RMShape aShape)
Returns whether a given shape is super-selected in the editor.
|
void |
paintComponent(java.awt.Graphics g)
Overrides JComponent implementation to paint viewer shapes and page, margin, grid, etc.
|
void |
paste()
Standard clipbard paste functionality.
|
void |
popSelection()
Un-SuperSelect currently super selected shape.
|
protected void |
processEvent(java.awt.AWTEvent e)
Override to revalidate when ideal size changes.
|
void |
redo()
Called to redo the last undo operation in the editor.
|
void |
removePage()
Removes current page from document.
|
void |
removePage(int anIndex)
Removes the document page at the given index.
|
void |
removeSelectedShape(RMShape aShape)
Remove a shape from the selected shapes list.
|
void |
resetCurrentTool()
Resets the currently selected tool.
|
protected void |
saveUndoerChanges()
Saves Undo Changes.
|
protected void |
saveUndoerChangesLater()
Saves undo changes after a delay.
|
void |
selectAll()
Causes all the children of the current super selected shape to become selected.
|
void |
setCurrentTool(RMTool aTool)
Tool method - sets the currently select tool to the given tool.
|
void |
setCurrentToolToSelectTool()
Sets the current tool to the select tool.
|
void |
setDataSource(RMDataSource aDataSource)
Sets the datasource associated with the editor's document.
|
void |
setEditing(boolean aFlag)
Sets whether viewer is really doing editing.
|
void |
setSelectedPageIndex(int anIndex)
Override viewer method to reset selected shapes on page change.
|
void |
setSelectedShape(RMShape aShape)
Selects the given shape.
|
void |
setSelectedShapes(java.util.List<RMShape> theShapes)
Selects the shapes in the given list.
|
void |
setSuperSelectedShape(RMShape aShape)
Super select a shape.
|
protected void |
setTextSelection(int aStart,
int anEnd)
Called to notify the TextEditor has changed selection.
|
protected void |
setUndoSelection(java.lang.Object aSelection)
Sets the undo selection.
|
void |
undo()
Called to undo the last edit operation in the editor.
|
convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, docShapeRepaint, 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, 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, zoomToggleLast
addAncestorListener, 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, 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, updateUI
add, 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, validateTree
action, 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, getPeer, 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, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String CurrentTool_Prop
public static final java.lang.String SelectedShapes_Prop
public static final java.lang.String SuperSelectedShape_Prop
public static final java.lang.String TextSelection_Prop
public static RMEditor getMainEditor()
public RMEditorPane getEditorPane()
public RMEditorShape getViewerShape()
getViewerShape
in class RMViewer
protected RMViewerShape createViewerShape()
createViewerShape
in class RMViewer
public boolean isEditing()
public void setEditing(boolean aFlag)
public boolean getValueIsAdjusting()
protected RMShapePainterJ2D createShapePainter(java.awt.Graphics2D aGr)
createShapePainter
in class RMViewer
public java.awt.dnd.DropTarget createDropTarget()
@Nullable public RMEditorTextEditor getTextEditor()
public RMEditorTextEditor getTextEditor(boolean evenIfNotActive)
public RMEditorTextEditor getTextEditor(RMTextShape aText)
protected void setTextSelection(int aStart, int anEnd)
public RMEditorShapes getShapesHelper()
public RMEditorShapes createShapesHelper()
@Nullable public RMShape getSelectedShape()
public void setSelectedShape(RMShape aShape)
public int getSelectedShapeCount()
public RMShape getSelectedShape(int anIndex)
public java.util.List<RMShape> getSelectedShapes()
public void setSelectedShapes(java.util.List<RMShape> theShapes)
public void addSelectedShape(RMShape aShape)
public void removeSelectedShape(RMShape aShape)
@Nullable public RMShape getSuperSelectedShape()
public RMParentShape getSuperSelectedParentShape()
public void setSuperSelectedShape(RMShape aShape)
public boolean isSelected(RMShape aShape)
public boolean isSuperSelected(RMShape aShape)
public int getSuperSelectedShapeCount()
public RMShape getSuperSelectedShape(int anIndex)
public java.util.List<RMShape> getSuperSelectedShapes()
public int getSelectedOrSuperSelectedShapeCount()
public RMShape getSelectedOrSuperSelectedShape(int anIndex)
@Nullable public RMShape getSelectedOrSuperSelectedShape()
public java.util.List<RMShape> getSelectedOrSuperSelectedShapes()
public void popSelection()
public RMRect getRepaintBoundsForShape(RMShape aShape)
getRepaintBoundsForShape
in class RMViewer
public void flushEditingChanges()
public RMShape getShapeAtPoint(java.awt.geom.Point2D aPoint)
public RMShape getChildShapeAtPoint(RMShape aShape, RMPoint aPoint)
@Nullable public RMParentShape firstSuperSelectedShapeThatAcceptsChildren()
public RMShape firstSuperSelectedShapeThatAcceptsChildrenAtPoint(RMPoint aPoint)
public void cut()
public void copy()
public void paste()
public void selectAll()
public void delete()
public void addShapesToShape(java.util.List<? extends RMShape> theShapes, RMParentShape aShape, boolean withCorrection)
public void addPage()
public void addPagePrevious()
public void addPage(RMPage aPage, int anIndex)
public void removePage()
public void removePage(int anIndex)
public RMTool getCurrentTool()
public void setCurrentTool(RMTool aTool)
public boolean isCurrentToolSelectTool()
public void setCurrentToolToSelectTool()
public boolean isCurrentToolSelectToolAndSelecting()
public void resetCurrentTool()
public void setSelectedPageIndex(int anIndex)
setSelectedPageIndex
in class RMViewer
public RMRect getSelectedShapesBounds()
public java.awt.Rectangle getZoomFocusRect()
getZoomFocusRect
in class RMViewer
public void paintComponent(java.awt.Graphics g)
paintComponent
in class RMViewer
public RMViewerInputAdapter createInputAdapter()
createInputAdapter
in class RMViewer
public RMEditorInputAdapter getEditorInputAdapter()
protected void processEvent(java.awt.AWTEvent e)
processEvent
in class java.awt.Container
protected java.awt.Dimension getPrefSize()
getPrefSize
in class RMViewer
public java.lang.String getToolTipText(java.awt.event.MouseEvent anEvent)
getToolTipText
in class javax.swing.JComponent
public RMDataSource getDataSource()
public void setDataSource(RMDataSource aDataSource)
public java.lang.Object getDataSourceDataset()
public void undo()
public void redo()
protected void setUndoSelection(java.lang.Object aSelection)
public void deepChange(java.beans.PropertyChangeListener aShape, java.beans.PropertyChangeEvent anEvent)
deepChange
in interface DeepChangeListener
protected void saveUndoerChanges()
protected void saveUndoerChangesLater()