Package com.reportmill.editor
Class RMEditor
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.reportmill.RMViewer
com.reportmill.editor.RMEditor
- All Implemented Interfaces:
- RMDocument.DocListener,- ImageObserver,- MenuContainer,- Serializable
- Direct Known Subclasses:
- RBEditor,- RMRptEditor
This class subclasses RMViewer to support RMDocument editing.
- See Also:
- 
Nested Class SummaryNested 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 SummaryFields inherited from class com.reportmill.RMViewerGridColor, MarginColor, PRINT_MODE_RASTER, PRINT_MODE_VECTORFields 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.voidaddShapesToShape(List shapes, RMShape aShape, boolean withCorrection) Adds shapes as children to given shape.voidaddShapeToSelectedShapes(RMShape aShape) Add a shape to the selected shapes list.voidcopy()Standard clipboard copy functionality.voidcut()Standard clipboard cut functionality.voiddelete()Deletes all the currently selected shapes.voiddocUndoerAddDirtyObject(RMDocument aDoc, RMObject anObj) Doc listener method - RMViewer ignores it, but RMEditor calls setUndoSelectedObjects.Returns the first SuperSelectedShape that accepts children.Returns the first SuperSelected shape that accepts children at a given point.Returns the first super selected shape that accepts children or whose children super select immediately.voidThis method finalizes any (potentially cached) changes in progress in the editor (like from text editing).Returns the Map of tags and classes to be used for unarchiving document shapes.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.voidCalled to enabled drag and drop.Returns the shape painter (which is actually an editor shape painter).Returns the even helper object.Returns the description for the editor document for use in open/save panels.Returns extension for editor document.Overrides viewer method to ensure editor is always at least 575x300.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 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.Returns the currentlys elected shapes or, if none, the super-selected shape in a list.getShapeAtPoint(Point2D aPoint) Returns first shape hit by point given in View coords.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(RMText aText) Returns the text editor, primed for editing the given text shape.booleanReturns whether the editor is in a state of constant change, like during a mouse drag loop.Returns the window ancestor that the editor component resides in.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.booleanThis gives us tab events, but seems to be deprecated.booleanReturns whether editor is preview (or viewer) mode.static RMEditorReturns the editor that was most recently used.voidmouseDragged(MouseEvent anEvent) Handle mouse dragged event.voidmouseMoved(MouseEvent anEvent) Handle mouse moved event.voidmousePressed(MouseEvent anEvent) Handle mouse pressed event.voidmouseReleased(MouseEvent anEvent) Handle mouse released event.voidRMEditor drawing.voidpaintViewportAbove(Graphics2D g2, JViewport aViewport) Paints editor stuff in viewport, so that it's independent of scroll.voidpaste()Standard clipbard paste functionality.voidUn-SuperSelect currently super selected shape.protected voidHandle key events.protected voidHandle key event super - so RMEditorEvents can get at default behavior.voidredo()Called to redo the last undo operation in the editor.voidRemoves current page from document.voidremovePage(int index) Removes the document page at the given index.voidremoveShapeFromSelectedShapes(RMShape aShape) Remove a shape from the selected shapes list.voidResets the currently selected tool.voidCauses all the children of the current super selected shape to become selected.voidselectShape(RMShape aShape) Selects the given shape.voidselectShapes(List shapes) Selects the shapes in the given list.voidsetCurrentTool(int anIndex) Tool method - sets the currently selected tool to the specific Tool's core tool at the given index.voidsetCurrentTool(Tool aTool) Tool method - sets the currently select tool to the given tool.voidSets the current tool to the select tool.voidsetDataSource(Object aSource) Sets the datasource associated with the editor's document.voidsetDocument(RMDocument aDoc) Overrides viewer method to add an undoer to document.voidsetPreview(boolean doPreview) Sets whether editor should be in preview (or viewer) mode.voidsetSelectedPageIndex(int index) Override viewer method to reset selected shapes on page change.voidsetZoomFactor(float aFactor) Overrides viewer method to focus zoomed region on selected shapes.voidSuperSelect currently selected shape.voidsuperSelectShape(RMShape aShape) Super select a shape.voidundo()Called to undo the last edit operation in the editor.Methods inherited from class com.reportmill.RMViewerconvertPointFromShape, 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, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, 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, 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, processEvent, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
- 
Constructor Details- 
RMEditorpublic RMEditor()Creates a new editor.
- 
RMEditorCreates an editor initialized with a document from aSource (String(path), File, InputStream, bytes, etc.).
 
- 
- 
Method Details- 
mainEditorReturns the editor that was most recently used.
- 
setDocumentOverrides viewer method to add an undoer to document.- Overrides:
- setDocumentin class- RMViewer
 
- 
isPreviewpublic boolean isPreview()Returns whether editor is preview (or viewer) mode.
- 
setPreviewpublic void setPreview(boolean doPreview) Sets whether editor should be in preview (or viewer) mode.
- 
getValueIsAdjustingpublic boolean getValueIsAdjusting()Returns whether the editor is in a state of constant change, like during a mouse drag loop.
- 
getFileExtensionReturns extension for editor document.
- 
getFileDescriptionReturns the description for the editor document for use in open/save panels.
- 
getWindowReturns the window ancestor that the editor component resides in.
- 
getDragAndDroppublic void getDragAndDrop()Called 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.
- 
getSelectedShapeCountpublic int getSelectedShapeCount()Returns the number of selected shapes.
- 
getSelectedShapeReturns the selected shape at the given index.
- 
getSelectedShapeReturns the first selected shape.
- 
getSelectedShapesReturns the selected shapes list.
- 
getSuperSelectedShapeCountpublic int getSuperSelectedShapeCount()Returns the number of super-selected shapes.
- 
getSuperSelectedShapeReturns the super-selected shape at the given index.
- 
getSuperSelectedShapeReturns the first super-selected shape.
- 
getSuperSelectedShapesReturns the super selected shape list.
- 
getSelectedOrSuperSelectedShapeReturns the currently selected shape or, if none, the super-selected shape.
- 
getSelectedShapesOrSuperSelectedShapeReturns the currentlys elected shapes or, if none, the super-selected shape in a 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.
- 
selectShapeSelects the given shape.
- 
selectShapesSelects the shapes in the given list.
- 
addShapeToSelectedShapesAdd a shape to the selected shapes list.
- 
removeShapeFromSelectedShapesRemove a shape from the selected shapes list.
- 
superSelectShapeSuper select a shape.
- 
superSelectpublic void superSelect()SuperSelect currently selected shape.
- 
flushEditingChangespublic void flushEditingChanges()This method finalizes any (potentially cached) changes in progress in the editor (like from text editing).
- 
popSelectionpublic void popSelection()Un-SuperSelect currently super selected shape.
- 
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.
- 
firstSuperSelectedShapeThatAcceptsChildrenAtPointReturns the first SuperSelected shape that accepts children at a given point.
- 
firstSuperSelectedShapeThatAcceptsChildrenOrChildrenSuperSelectImmediatelyReturns the first super selected shape that accepts children or whose children super select immediately.
- 
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.
- 
addShapesToShapeAdds 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 index) 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.
- 
setCurrentToolpublic void setCurrentTool(int anIndex) Tool method - sets the currently selected tool to the specific Tool's core tool at the given index.
- 
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 index) Override viewer method to reset selected shapes on page change.- Overrides:
- setSelectedPageIndexin class- RMViewer
 
- 
setZoomFactorpublic void setZoomFactor(float aFactor) Overrides viewer method to focus zoomed region on selected shapes.- Overrides:
- setZoomFactorin class- RMViewer
 
- 
getEditorShapePainterReturns the shape painter (which is actually an editor shape painter).
- 
paintComponentAboveRMEditor drawing.- Overrides:
- paintComponentAbovein class- RMViewer
 
- 
paintViewportAbovePaints editor stuff in viewport, so that it's independent of scroll.
- 
getEventsReturns the even helper object.
- 
mouseMovedHandle mouse moved event.- Overrides:
- mouseMovedin class- RMViewer
 
- 
mousePressedHandle mouse pressed event.- Overrides:
- mousePressedin class- RMViewer
 
- 
mouseDraggedHandle mouse dragged event.- Overrides:
- mouseDraggedin class- RMViewer
 
- 
mouseReleasedHandle mouse released event.- Overrides:
- mouseReleasedin class- RMViewer
 
- 
processKeyEventHandle key events.- Overrides:
- processKeyEventin class- JComponent
 
- 
processKeyEventSuperHandle key event super - so RMEditorEvents can get at default behavior.
- 
isManagingFocuspublic boolean isManagingFocus()This gives us tab events, but seems to be deprecated.- Overrides:
- isManagingFocusin class- JComponent
 
- 
getPreferredSizeOverrides viewer method to ensure editor is always at least 575x300.- Overrides:
- getPreferredSizein class- RMViewer
 
- 
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.
- 
docUndoerAddDirtyObjectDoc listener method - RMViewer ignores it, but RMEditor calls setUndoSelectedObjects.- Specified by:
- docUndoerAddDirtyObjectin interface- RMDocument.DocListener
- Overrides:
- docUndoerAddDirtyObjectin class- RMViewer
 
- 
getArchiverClassMapReturns the Map of tags and classes to be used for unarchiving document shapes.
 
-