public class RMViewer
extends View
new RMViewer(aDocument).print();
Or you might want to allocate one and add it to a Swing component hierarchy:
RMViewer viewer = new RMViewer(); viewer.setContent(new RMDocument(aSource)); myFrame.getContentPane().add(new JScrollPane(viewer));
Modifier and Type | Class and Description |
---|---|
static class |
RMViewer.ZoomMode |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
Content_Prop |
Constructor and Description |
---|
RMViewer()
Creates a new RMViewer with an empty document in it.
|
Modifier and Type | Method and Description |
---|---|
Point |
convertFromShape(double aX,
double aY,
RMShape aShape)
Returns a point converted from the coordinate space of the given shape to viewer coords.
|
Shape |
convertFromShape(Shape aShp,
RMShape aShape)
Returns a rect converted from the coordinate space of the given shape to viewer coords.
|
Point |
convertToShape(double aX,
double aY,
RMShape aShape)
Returns a point converted from viewer coords to the coordinate space of the given shape.
|
Shape |
convertToShape(Shape aShp,
RMShape aShape)
Returns a shape converted from viewer coords to the coordinate space of the given RMShape.
|
ViewEvent |
createShapeEvent(RMShape aShape,
ViewEvent anEvent,
ViewEvent.Type aType)
Creates a shape mouse event.
|
void |
docShapeRepaint(RMShape aShape)
Doc listener method - called before a shape makes a visual change.
|
java.awt.print.Book |
getBook()
Returns a java.awt.print.Book, suitable for AWT printing.
|
RMParentShape |
getContent()
Returns the root shape that is the content of this viewer.
|
int |
getContentX()
Returns the content shape's X location in viewer.
|
int |
getContentY()
Returns the content shape's Y location in viewer.
|
Rect |
getDocBounds()
Returns the bounds of the viewer document.
|
RMDocument |
getDocument()
Returns the RMDocument associated with this viewer.
|
com.reportmill.app.RMViewerEvents |
getEvents()
Returns the event helper for the viewer (handles mouse and keyboard input).
|
Rect |
getPageBounds()
Returns the bounds of the viewer document's selected page.
|
int |
getPageCount()
Returns the page count.
|
double |
getPrefHeightBase()
Returns the preferred size of the viewer (ignores Zoom).
|
double |
getPrefHeightImpl(double aW)
Returns the preferred size of the viewer (includes ZoomFactor).
|
double |
getPrefWidthBase()
Returns the preferred size of the viewer (ignores Zoom).
|
double |
getPrefWidthImpl(double aH)
Returns the preferred size of the viewer (includes ZoomFactor).
|
Rect |
getRepaintBoundsForShape(RMShape aShape)
Returns the bounds for a given shape in the viewer.
|
RMParentShape |
getSelectedPage()
Returns the currently selected page shape.
|
int |
getSelectedPageIndex()
Returns the index of the current visible document page.
|
RMShape |
getShape(java.lang.String aName)
Returns the document shape for given name.
|
RMShape |
getShapeAtPoint(double aX,
double aY,
boolean goDeep)
Returns the first shape hit by the given point.
|
RMShape |
getShapeAtPoint(Point aPoint,
boolean goDeep)
Returns the first shape hit by the given point.
|
boolean |
getShapeRepaintEnabled()
Returns whether changes to shapes cause repaints.
|
WebURL |
getSourceURL()
Returns the source URL.
|
Transform |
getTransformFromShape(RMShape aShape)
Returns the transform from given shape to viewer.
|
Transform |
getTransformToShape(RMShape aShape)
Returns the transform from viewer to given shape.
|
Undoer |
getUndoer()
Returns the undoer associated with the viewer's document.
|
com.reportmill.app.RMViewerShape |
getViewerShape()
Returns the viewer shape.
|
double |
getZoomFactor()
Returns the viewer's zoom factor (1 by default).
|
double |
getZoomFactor(RMViewer.ZoomMode aMode)
Returns the zoom factor for the given mode at the current viewer size.
|
Rect |
getZoomFocusRect()
Returns zoom focus rect (just the visible rect by default, but overriden by editor to return selected shapes rect).
|
RMViewer.ZoomMode |
getZoomMode()
Returns the ZoomMode (ZoomToFit, ZoomIfNeeded, ZoomToFactor).
|
double |
getZoomToActualSizeFactor()
Returns the zoom factor to view the document at actual size taking into account the current screen resolution.
|
boolean |
isEditing()
Returns whether viewer is really doing editing.
|
boolean |
isPreview()
Returns whether editor is preview (or viewer) mode.
|
boolean |
isZoomToFactor()
Returns whether viewer is set to ZoomToFactor.
|
void |
pageBack()
Selects the previous page.
|
void |
pageForward()
Selects the next page.
|
void |
paintFront(Painter aPntr)
Override to paint viewer shapes and page, margin, grid, etc.
|
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(PropChange anEvent)
PropChangeListener method - called by document.
|
void |
setContent(java.lang.Object aSource)
Sets the content from any source.
|
void |
setContent(RMParentShape aShape)
Sets the root shape that is the content of this viewer.
|
void |
setHeight(double aValue)
Overrides to update ZoomFactor if dynamic.
|
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 |
setWidth(double aValue)
Overrides to update ZoomFactor if dynamic.
|
void |
setZoomFactor(double aFactor)
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.
|
boolean |
undoerHasUndos()
Returns whether undos exist 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.
|
public static final java.lang.String Content_Prop
public com.reportmill.app.RMViewerShape getViewerShape()
public RMParentShape getContent()
public void setContent(RMParentShape aShape)
public void setContent(java.lang.Object aSource)
public RMDocument getDocument()
public WebURL getSourceURL()
public boolean isEditing()
public boolean isPreview()
public int getPageCount()
public RMParentShape getSelectedPage()
public int getSelectedPageIndex()
public void setSelectedPageIndex(int anIndex)
public void pageForward()
public void pageBack()
public void play()
public void stop()
public Rect getDocBounds()
public Rect getPageBounds()
public RMShape getShapeAtPoint(double aX, double aY, boolean goDeep)
public RMShape getShapeAtPoint(Point aPoint, boolean goDeep)
public double getZoomFactor()
public void setZoomFactor(double aFactor)
public RMViewer.ZoomMode getZoomMode()
public void setZoomMode(RMViewer.ZoomMode aZoomMode)
public boolean isZoomToFactor()
public double getZoomFactor(RMViewer.ZoomMode aMode)
public void setZoomToFitFactor()
public Rect getZoomFocusRect()
public double getZoomToActualSizeFactor()
public void zoomToggleLast()
public void setWidth(double aValue)
public void setHeight(double aValue)
public int getContentX()
public int getContentY()
public Point convertFromShape(double aX, double aY, RMShape aShape)
public Point convertToShape(double aX, double aY, RMShape aShape)
public Shape convertFromShape(Shape aShp, RMShape aShape)
public Shape convertToShape(Shape aShp, RMShape aShape)
public Transform getTransformFromShape(RMShape aShape)
public Transform getTransformToShape(RMShape aShape)
public void paintFront(Painter aPntr)
public com.reportmill.app.RMViewerEvents getEvents()
public double getPrefWidthImpl(double aH)
public double getPrefWidthBase()
public double getPrefHeightImpl(double aW)
public double getPrefHeightBase()
public Undoer getUndoer()
public void undoerSetUndoTitle(java.lang.String aTitle)
public boolean undoerHasUndos()
public boolean getShapeRepaintEnabled()
public void setShapeRepaintEnabled(boolean aFlag)
public void docShapeRepaint(RMShape aShape)
public Rect getRepaintBoundsForShape(RMShape aShape)
public void propertyChange(PropChange anEvent)
public RMShape getShape(java.lang.String aName)
public ViewEvent createShapeEvent(RMShape aShape, ViewEvent anEvent, ViewEvent.Type aType)
public void print()
public void print(java.lang.String aPrinterName, boolean runPanel)
public java.awt.print.Book getBook()