public class RMEditor extends RMViewer
javax.swing.JComponent.AccessibleJComponent
GridColor, MarginColor, PRINT_MODE_RASTER, PRINT_MODE_VECTOR
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.
|
RMEditor(java.lang.Object aSource)
Creates an editor initialized with a document from aSource (String(path), File, InputStream, bytes, etc.).
|
Modifier and Type | Method and Description |
---|---|
void |
addPage()
Adds a page to the document after current page.
|
void |
addPage(RMPage page,
int index)
Adds a given page to the current document at the given index.
|
void |
addPagePrevious()
Adds a page to the document before current page.
|
void |
addShapesToShape(java.util.List shapes,
RMShape aShape,
boolean withCorrection)
Adds shapes as children to given shape.
|
void |
addShapeToSelectedShapes(RMShape aShape)
Add a shape to the selected shapes list.
|
void |
copy()
Standard clipboard copy functionality.
|
void |
cut()
Standard clipboard cut functionality.
|
void |
delete()
Deletes all the currently selected shapes.
|
void |
docUndoerAddDirtyObject(RMDocument aDoc,
RMObject anObj)
Doc listener method - RMViewer ignores it, but RMEditor calls setUndoSelectedObjects.
|
RMShape |
firstSuperSelectedShapeThatAcceptsChildren()
Returns the first SuperSelectedShape that accepts children.
|
RMShape |
firstSuperSelectedShapeThatAcceptsChildrenAtPoint(RMPoint aPoint)
Returns the first SuperSelected shape that accepts children at a given point.
|
RMShape |
firstSuperSelectedShapeThatAcceptsChildrenOrChildrenSuperSelectImmediately()
Returns the first super selected shape that accepts children or whose children super select immediately.
|
void |
flushEditingChanges()
This method finalizes any (potentially cached) changes in progress in the editor (like from text editing).
|
java.util.Map |
getArchiverClassMap()
Returns the Map of tags and classes to be used for unarchiving document shapes.
|
RMShape |
getChildShapeAtPoint(RMShape aShape,
RMPoint aPoint)
Returns the child of the given shape hit by the given point.
|
Tool |
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.
|
void |
getDragAndDrop()
Called to enabled drag and drop.
|
RMEditorShapePainter |
getEditorShapePainter()
Returns the shape painter (which is actually an editor shape painter).
|
RMEditorEvents |
getEvents()
Returns the even helper object.
|
java.lang.String |
getFileDescription()
Returns the description for the editor document for use in open/save panels.
|
java.lang.String |
getFileExtension()
Returns extension for editor document.
|
java.awt.Dimension |
getPreferredSize()
Overrides viewer method to ensure editor is always at least 575x300.
|
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.
|
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 |
getSelectedShapes()
Returns the selected shapes list.
|
java.util.List |
getSelectedShapesOrSuperSelectedShape()
Returns the currentlys elected shapes or, if none, the super-selected shape in a list.
|
RMShape |
getShapeAtPoint(java.awt.geom.Point2D aPoint)
Returns first shape hit by point given in View coords.
|
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 |
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(RMText aText)
Returns the text editor, primed for editing the given text shape.
|
boolean |
getValueIsAdjusting()
Returns whether the editor is in a state of constant change, like during a mouse drag loop.
|
java.awt.Window |
getWindow()
Returns the window ancestor that the editor component resides in.
|
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 |
isManagingFocus()
This gives us tab events, but seems to be deprecated.
|
boolean |
isPreview()
Returns whether editor is preview (or viewer) mode.
|
static RMEditor |
mainEditor()
Returns the editor that was most recently used.
|
void |
mouseDragged(java.awt.event.MouseEvent anEvent)
Handle mouse dragged event.
|
void |
mouseMoved(java.awt.event.MouseEvent anEvent)
Handle mouse moved event.
|
void |
mousePressed(java.awt.event.MouseEvent anEvent)
Handle mouse pressed event.
|
void |
mouseReleased(java.awt.event.MouseEvent anEvent)
Handle mouse released event.
|
void |
paintComponentAbove(java.awt.Graphics2D g2)
RMEditor drawing.
|
void |
paintViewportAbove(java.awt.Graphics2D g2,
javax.swing.JViewport aViewport)
Paints editor stuff in viewport, so that it's independent of scroll.
|
void |
paste()
Standard clipbard paste functionality.
|
void |
popSelection()
Un-SuperSelect currently super selected shape.
|
protected void |
processKeyEvent(java.awt.event.KeyEvent e)
Handle key events.
|
protected void |
processKeyEventSuper(java.awt.event.KeyEvent e)
Handle key event super - so RMEditorEvents can get at default behavior.
|
void |
redo()
Called to redo the last undo operation in the editor.
|
void |
removePage()
Removes current page from document.
|
void |
removePage(int index)
Removes the document page at the given index.
|
void |
removeShapeFromSelectedShapes(RMShape aShape)
Remove a shape from the selected shapes list.
|
void |
resetCurrentTool()
Resets the currently selected tool.
|
void |
selectAll()
Causes all the children of the current super selected shape to become selected.
|
void |
selectShape(RMShape aShape)
Selects the given shape.
|
void |
selectShapes(java.util.List shapes)
Selects the shapes in the given list.
|
void |
setCurrentTool(int anIndex)
Tool method - sets the currently selected tool to the specific Tool's core tool at the given index.
|
void |
setCurrentTool(Tool aTool)
Tool method - sets the currently select tool to the given tool.
|
void |
setCurrentToolToSelectTool()
Sets the current tool to the select tool.
|
void |
setDataSource(java.lang.Object aSource)
Sets the datasource associated with the editor's document.
|
void |
setDocument(RMDocument aDoc)
Overrides viewer method to add an undoer to document.
|
void |
setPreview(boolean doPreview)
Sets whether editor should be in preview (or viewer) mode.
|
void |
setSelectedPageIndex(int index)
Override viewer method to reset selected shapes on page change.
|
void |
setZoomFactor(float aFactor)
Overrides viewer method to focus zoomed region on selected shapes.
|
void |
superSelect()
SuperSelect currently selected shape.
|
void |
superSelectShape(RMShape aShape)
Super select a shape.
|
void |
undo()
Called to undo the last edit operation in the editor.
|
convertPointFromShape, convertPointToShape, convertRectFromShape, convertRectToShape, docShapeBoundsChanged, docShapeNeedsRepaint, drawsBackground, flushGraphics, getBook, getDirtyRect, getDocument, getDocumentBounds, getFilename, getMinimumSize, getPageBounds, getPageLayout, getPrintingDPI, getPrintingMode, getRenderingHints, getSelectedPage, getSelectedPageIndex, getShapeAtPoint, getShapePainter, getShapeRepaintEnabled, getTransformFromShape, getUndoer, getZoomFactor, pageBack, pageForward, paintComponent, performActionURLClick, print, print, print2, print2, processMouseEvent, processMouseMotionEvent, repaint, runZoomPanel, setPrintingDPI, setPrintingMode, setShapePainter, setShapeRepaintEnabled, setZoomForScreenResolution, undoerAddChildToShape, undoerDisable, undoerEnable, undoerHasUndos, undoerSetCoalesce, undoerSetUndoTitle, updateShapeUnderStack, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, 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, processEvent, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public RMEditor()
public RMEditor(java.lang.Object aSource)
public static RMEditor mainEditor()
public void setDocument(RMDocument aDoc)
setDocument
in class RMViewer
public boolean isPreview()
public void setPreview(boolean doPreview)
public boolean getValueIsAdjusting()
public java.lang.String getFileExtension()
public java.lang.String getFileDescription()
public java.awt.Window getWindow()
public void getDragAndDrop()
public RMEditorTextEditor getTextEditor()
public RMEditorTextEditor getTextEditor(boolean evenIfNotActive)
public RMEditorTextEditor getTextEditor(RMText aText)
public int getSelectedShapeCount()
public RMShape getSelectedShape(int anIndex)
public RMShape getSelectedShape()
public java.util.List getSelectedShapes()
public int getSuperSelectedShapeCount()
public RMShape getSuperSelectedShape(int anIndex)
public RMShape getSuperSelectedShape()
public java.util.List getSuperSelectedShapes()
public RMShape getSelectedOrSuperSelectedShape()
public java.util.List getSelectedShapesOrSuperSelectedShape()
public int getSelectedOrSuperSelectedShapeCount()
public RMShape getSelectedOrSuperSelectedShape(int anIndex)
public void selectShape(RMShape aShape)
public void selectShapes(java.util.List shapes)
public void addShapeToSelectedShapes(RMShape aShape)
public void removeShapeFromSelectedShapes(RMShape aShape)
public void superSelectShape(RMShape aShape)
public void superSelect()
public void flushEditingChanges()
public void popSelection()
public RMShape getShapeAtPoint(java.awt.geom.Point2D aPoint)
public RMShape getChildShapeAtPoint(RMShape aShape, RMPoint aPoint)
public RMShape firstSuperSelectedShapeThatAcceptsChildren()
public RMShape firstSuperSelectedShapeThatAcceptsChildrenAtPoint(RMPoint aPoint)
public RMShape firstSuperSelectedShapeThatAcceptsChildrenOrChildrenSuperSelectImmediately()
public void cut()
public void copy()
public void paste()
public void selectAll()
public void delete()
public void addShapesToShape(java.util.List shapes, RMShape aShape, boolean withCorrection)
public void addPage()
public void addPagePrevious()
public void addPage(RMPage page, int index)
public void removePage()
public void removePage(int index)
public Tool getCurrentTool()
public void setCurrentTool(Tool aTool)
public void setCurrentTool(int anIndex)
public boolean isCurrentToolSelectTool()
public void setCurrentToolToSelectTool()
public boolean isCurrentToolSelectToolAndSelecting()
public void resetCurrentTool()
public void setSelectedPageIndex(int index)
setSelectedPageIndex
in class RMViewer
public void setZoomFactor(float aFactor)
setZoomFactor
in class RMViewer
public RMEditorShapePainter getEditorShapePainter()
public void paintComponentAbove(java.awt.Graphics2D g2)
paintComponentAbove
in class RMViewer
public void paintViewportAbove(java.awt.Graphics2D g2, javax.swing.JViewport aViewport)
public RMEditorEvents getEvents()
public void mouseMoved(java.awt.event.MouseEvent anEvent)
mouseMoved
in class RMViewer
public void mousePressed(java.awt.event.MouseEvent anEvent)
mousePressed
in class RMViewer
public void mouseDragged(java.awt.event.MouseEvent anEvent)
mouseDragged
in class RMViewer
public void mouseReleased(java.awt.event.MouseEvent anEvent)
mouseReleased
in class RMViewer
protected void processKeyEvent(java.awt.event.KeyEvent e)
processKeyEvent
in class javax.swing.JComponent
protected void processKeyEventSuper(java.awt.event.KeyEvent e)
public boolean isManagingFocus()
isManagingFocus
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class RMViewer
public RMDataSource getDataSource()
public void setDataSource(java.lang.Object aSource)
public java.lang.Object getDataSourceDataset()
public void undo()
public void redo()
public void docUndoerAddDirtyObject(RMDocument aDoc, RMObject anObj)
docUndoerAddDirtyObject
in interface RMDocument.DocListener
docUndoerAddDirtyObject
in class RMViewer
public java.util.Map getArchiverClassMap()