|
ReportMill 11 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.reportmill.swing.RJPanel
com.reportmill.viewer.RMViewer
public class RMViewer
The RMViewer class is a JComponent subclass that can be used in Swing applications to display and/or print an RMDocument. You might use it like this to simply print a document:
new RMViewer(aDocument).print();
Or you might want to allocate one and add it to a Swing component hierarchy:
RMViewer viewer = new RMViewer(); JScrollPane scrollPane = new JScrollPane(viewer); myFrame.getContentPane().add(scrollPane, Border.CENTER); viewer.setDocument(new RMDocument(aSource));
Nested Class Summary | |
---|---|
static class |
RMViewer.ZoomMode
|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
RMViewer()
Creates a new RMViewer with an empty document in it. |
|
RMViewer(java.lang.Object aSource)
Creates a new RMViewer from the given owner or source. |
Method Summary | |
---|---|
void |
addBinder(com.reportmill.binder.RMBinder aBinder)
Overrides RJPanel method to get from document. |
void |
checkBindings()
Overrides RJPanel method to forward to document. |
RMPoint |
convertPointFromShape(RMPoint aPoint,
RMShape aShape)
Returns a point converted from the coordinate space of the given shape to viewer coords. |
RMPoint |
convertPointToShape(java.awt.geom.Point2D aPoint,
RMShape aShape)
Returns a point converted from viewer coords to the coordinate space of the given shape. |
RMRect |
convertRectFromShape(RMRect aRect,
RMShape aShape)
Returns a rect converted from the coordinate space of the given shape to viewer coords. |
RMRect |
convertRectToShape(RMRect aRect,
RMShape aShape)
Returns a rect converted from viewer coords to the coordinate space of the given shape. |
com.reportmill.shape.RMShapePainter |
createShapePainter()
Creates the object that is actually responsible for paining shapes in the viewer. |
void |
docShapeBoundsChanged(RMDocument aDoc,
RMShape aShape)
Doc listener method - called by editor when making bounds changes. |
void |
docShapeRepaint(RMDocument aDoc,
RMShape aShape)
Doc listener method - called before a shape makes a visual change. |
boolean |
drawsBackground()
Returns whether or not the gutter, page background & drop shadow get drawn. |
com.reportmill.binder.RMBinder |
getBinder(int anIndex)
Overrides RJPanel method to get from document. |
com.reportmill.binder.RMBinder |
getBinder(java.lang.String aName)
Overrides RJPanel method to get from document. |
int |
getBinderCount()
Overrides RJPanel method to get from document. |
java.awt.print.Book |
getBook()
Returns a java.awt.print.Book, suitable for AWT printing. |
javax.swing.JComponent |
getComponent(java.lang.String aName)
Overrides RJPanel method to extract JComponent from JComponentShape children. |
RMDocument |
getDocument()
Returns the RMDocument associated with this viewer. |
RMRect |
getDocumentBounds()
Returns the bounds of the viewer document. |
int |
getDocumentX()
Returns the document's x location in viewer. |
int |
getDocumentY()
Returns the document's y location in viewer. |
java.lang.String |
getFilename()
Returns filename associated with viewer's document (or null if the document didn't come from a file). |
com.reportmill.viewer.RMViewerInputAdapter |
getInputAdapter()
Returns the input adapter for the viewer (handles mouse and keyboard input). |
java.lang.Object |
getLastSource()
Returns the last source (backtracking). |
java.awt.Dimension |
getMinimumSize()
Returns the minimum size of viewer pane. |
java.lang.Object |
getNextSource()
Returns the next source (forward tracking). |
RMRect |
getPageBounds()
Returns the bounds of the viewer document's selected page. |
byte |
getPageLayout()
Returns the page layout of the viewer's document. |
boolean |
getPaintFrameRate()
Returns whether we paint frame rate. |
java.awt.Dimension |
getPreferredSize()
Returns the optimal size of the viewer. |
RMRect |
getRepaintBoundsForShape(RMShape aShape)
Returns the bounds for a given shape in the viewer. |
RMShape |
getSelectedPage()
Returns the currently selected page shape. |
int |
getSelectedPageIndex()
Returns the index of the current visible document page. |
RMShape |
getShapeAtPoint(java.awt.geom.Point2D aPoint,
boolean goDeep)
Returns the first shape hit by the given point. |
com.reportmill.shape.RMShapePainter |
getShapePainter()
Returns the object that is actually responsible for paining shapes in the viewer. |
boolean |
getShapeRepaintEnabled()
Returns whether changes to shapes cause repaints. |
java.lang.Object |
getSource()
Returns the document source. |
RMDocument |
getSourceDocument()
Returns the document for a source. |
RMDocument |
getSourceDocumentCached()
Returns the document for a source, using cache. |
java.awt.geom.AffineTransform |
getTransformFromShape(RMShape aShape)
Returns the transform from given shape to viewer. |
com.reportmill.base.RMUndoer |
getUndoer()
Returns the undoer associated with the viewer's document. |
float |
getZoomFactor()
Returns the viewer's zoom factor (1 by default). |
RMViewer.ZoomMode |
getZoomMode()
Returns the ZoomMode (ZoomToFit, ZoomIfNeeded, ZoomToFactor). |
float |
getZoomToActualSizeFactor()
Returns the zoom factor to view the document at actual size taking into account the current screen resolution. |
float |
getZoomToFitFactor()
Returns the zoom factor to exactly fit the document in the viewer. |
boolean |
isEditing()
Returns whether viewer is really doing editing. |
boolean |
isPreview()
Returns whether editor is preview (or viewer) mode. |
boolean |
isZoomingToFit()
Whether view is zooming to fit (or should be). |
void |
pageBack()
Selects the previous page. |
void |
pageForward()
Selects the next page. |
void |
paintComponent(java.awt.Graphics aGraphics)
Overrides JComponent implementation to paint viewer shapes and page, margin, grid, etc. |
void |
performActionURLClick(java.lang.String aURL)
Viewer callback - called when shape with URL is clicked (opens URL). |
void |
play()
Starts any animation viewer might have. |
void |
print()
This method tells the RMViewer to print by running the print dialog (configured to the default printer). |
void |
print(java.lang.String aPrinterName,
boolean runPanel)
This method tells the RMViewer to print to the printer with the given printer name (use null for default printer). |
void |
propertyChange(java.beans.PropertyChangeEvent anEvent)
PropertyChangeListener method - called by document. |
void |
reloadSource()
Reloads the source. |
com.reportmill.binder.RMBinder |
removeBinder(int anIndex)
Overrides RJPanel method to get from document. |
int |
removeBinder(com.reportmill.binder.RMBinder aBinder)
Overrides RJPanel method to get from document. |
void |
repaint(java.awt.geom.Rectangle2D aRect)
Requests a repaint for the area represented by the given rect. |
void |
runZoomPanel()
Runs a dialog panel to request a percentage zoom (which is then set with setZoomFactor). |
void |
setBounds(int x,
int y,
int w,
int h)
Overrides component setBounds to enforce zoom-to-fit if needed. |
void |
setDocument(RMDocument aDocument)
Sets the RMDocument associated with this viewer. |
void |
setInputAdapter(com.reportmill.viewer.RMViewerInputAdapter anInputAdapter)
Sets the input adapter for the viewer (handles mouse and keyboard input). |
void |
setLastSource()
Sets the source to the last source (backtracking). |
void |
setNextSource()
Sets the source to the next soruce (forward tracking). |
void |
setPaintFrameRate(boolean aValue)
Sets whether we paint frame rate. |
void |
setSelectedPageIndex(int anIndex)
Sets the page of viewer's document that is visible (by index). |
void |
setShapeRepaintEnabled(boolean aFlag)
Sets whether changes to shapes cause repaints. |
void |
setSource(java.lang.Object aSource)
Sets the document source. |
void |
setZoomFactor(float aFactor)
Sets the viewer's zoom factor (1 for 100%). |
void |
setZoomFactor(float aFactor,
boolean changeMode)
Sets the viewer's zoom factor (1 for 100%). |
void |
setZoomMode(RMViewer.ZoomMode aZoomMode)
Sets the ZoomMode. |
void |
setZoomToFitFactor()
Sets the zoom to fit factor, based on the current zoom mode. |
void |
stop()
Stops any animation viewer might have. |
void |
undoerAddChildToShape(RMShape aShape,
RMShape aParent)
Adds a child with undo registration in the viewer's documents's undoer (convenience). |
void |
undoerDisable()
Disable's undo in the viewer's documents's undoer (convenience). |
void |
undoerEnable()
Enable's undo in the viewer's documents's undoer (convenience). |
boolean |
undoerHasUndos()
Returns whether undos exist in the viewer's documents's undoer (convenience). |
void |
undoerSetCoalesce(boolean aFlag)
Turns on undo coalescing in the viewer's documents's undoer (convenience). |
void |
undoerSetUndoTitle(java.lang.String aTitle)
Sets the title of the next registered undo in the viewer's documents's undoer (convenience). |
void |
zoomToggleLast()
Sets the viewer's zoom to its previous value. |
Methods inherited from class com.reportmill.swing.RJPanel |
---|
createLayoutManager, equals, get, get, getBinders, getBooleanValue, getBooleanValue, getBoolValue, getBoolValue, getButton, getButtonGroup, getButtonGroups, getColorValue, getColorValue, getComboBox, getConversionMap, getConversionMaps, getDataSource, getFloatValue, getFloatValue, getIntValue, getIntValue, getLabel, getLayoutRB, getList, getMenu, getMenuItem, getOwner, getPanel, getProgressBar, getScrollPane, getSelectedIndex, getSelectedIndex, getSelectedObject, getSelectedObject, getSlider, getStringValue, getStringValue, getTabbedPane, getTable, getText, getText, getTextArea, getTextField, getToggleButton, getTree, getValue, getValue, getValueIsAdjusting, getValueIsAdjusting, getWindow, getWindowClass, getWindowClassName, getWindowDefaultButton, getWindowMenuBar, getWindowTitle, isWindowAlwaysOnTop, isWindowHideOnDeactivate, isWindowModal, isWindowResizable, isWindowUndecorated, isWindowVisible, pack, paintBorder, refreshBinders, setDataSource, setEnabled, setEnabled, setEnabled, setOwner, setSelectedIndex, setSelectedIndex, setSelectedObject, setText, setText, setValue, setValue, setValue, setValue, setWindowAlwaysOnTop, setWindowClassName, setWindowDefaultButton, setWindowHideOnDeactivate, setWindowIsUndecorated, setWindowMenuBar, setWindowModal, setWindowResizable, setWindowTitle, setWindowVisible, setWindowVisible, windowDispose |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, hide, 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, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RMViewer()
public RMViewer(java.lang.Object aSource)
Method Detail |
---|
public java.lang.Object getSource()
public void setSource(java.lang.Object aSource)
public RMDocument getSourceDocument()
public RMDocument getSourceDocumentCached()
public void reloadSource()
public RMDocument getDocument()
public void setDocument(RMDocument aDocument)
public java.lang.Object getLastSource()
public void setLastSource()
public java.lang.Object getNextSource()
public void setNextSource()
public boolean isEditing()
isEditing
in interface RMDocument.DocListener
public boolean isPreview()
public RMShape getSelectedPage()
public java.lang.String getFilename()
public byte getPageLayout()
public int getSelectedPageIndex()
public void setSelectedPageIndex(int anIndex)
public void pageForward()
public void pageBack()
public void play()
public void stop()
public RMRect getDocumentBounds()
public RMRect getPageBounds()
public RMShape getShapeAtPoint(java.awt.geom.Point2D aPoint, boolean goDeep)
public float getZoomFactor()
public void setZoomFactor(float aFactor)
public void setZoomFactor(float aFactor, boolean changeMode)
public RMViewer.ZoomMode getZoomMode()
public void setZoomMode(RMViewer.ZoomMode aZoomMode)
public boolean isZoomingToFit()
public float getZoomToFitFactor()
public void setZoomToFitFactor()
public float getZoomToActualSizeFactor()
public void zoomToggleLast()
public void runZoomPanel()
public void setBounds(int x, int y, int w, int h)
setBounds
in class com.reportmill.swing.RJPanel
public int getDocumentX()
public int getDocumentY()
public RMPoint convertPointFromShape(RMPoint aPoint, RMShape aShape)
public RMPoint convertPointToShape(java.awt.geom.Point2D aPoint, RMShape aShape)
public RMRect convertRectFromShape(RMRect aRect, RMShape aShape)
public RMRect convertRectToShape(RMRect aRect, RMShape aShape)
public java.awt.geom.AffineTransform getTransformFromShape(RMShape aShape)
public void repaint(java.awt.geom.Rectangle2D aRect)
public com.reportmill.shape.RMShapePainter getShapePainter()
public com.reportmill.shape.RMShapePainter createShapePainter()
public boolean drawsBackground()
public void paintComponent(java.awt.Graphics aGraphics)
paintComponent
in class com.reportmill.swing.RJPanel
public com.reportmill.viewer.RMViewerInputAdapter getInputAdapter()
public void setInputAdapter(com.reportmill.viewer.RMViewerInputAdapter anInputAdapter)
public void performActionURLClick(java.lang.String aURL)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public com.reportmill.base.RMUndoer getUndoer()
public void undoerSetUndoTitle(java.lang.String aTitle)
public void undoerDisable()
public void undoerEnable()
public void undoerSetCoalesce(boolean aFlag)
public boolean undoerHasUndos()
public void undoerAddChildToShape(RMShape aShape, RMShape aParent)
public boolean getShapeRepaintEnabled()
public void setShapeRepaintEnabled(boolean aFlag)
public void docShapeRepaint(RMDocument aDoc, RMShape aShape)
docShapeRepaint
in interface RMDocument.DocListener
public RMRect getRepaintBoundsForShape(RMShape aShape)
public void docShapeBoundsChanged(RMDocument aDoc, RMShape aShape)
docShapeBoundsChanged
in interface RMDocument.DocListener
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
propertyChange
in interface java.beans.PropertyChangeListener
public javax.swing.JComponent getComponent(java.lang.String aName)
getComponent
in class com.reportmill.swing.RJPanel
public int getBinderCount()
getBinderCount
in class com.reportmill.swing.RJPanel
public com.reportmill.binder.RMBinder getBinder(int anIndex)
getBinder
in class com.reportmill.swing.RJPanel
public com.reportmill.binder.RMBinder getBinder(java.lang.String aName)
getBinder
in class com.reportmill.swing.RJPanel
public void addBinder(com.reportmill.binder.RMBinder aBinder)
addBinder
in class com.reportmill.swing.RJPanel
public com.reportmill.binder.RMBinder removeBinder(int anIndex)
removeBinder
in class com.reportmill.swing.RJPanel
public int removeBinder(com.reportmill.binder.RMBinder aBinder)
removeBinder
in class com.reportmill.swing.RJPanel
public void checkBindings()
checkBindings
in class com.reportmill.swing.RJPanel
public boolean getPaintFrameRate()
public void setPaintFrameRate(boolean aValue)
public void print()
public void print(java.lang.String aPrinterName, boolean runPanel)
public java.awt.print.Book getBook()
|
ReportMill 11 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |