ca.sqlpower.wabit.report
Class ImageRenderer
java.lang.Object
ca.sqlpower.object.AbstractSPObject
ca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.report.ImageRenderer
- All Implemented Interfaces:
- ca.sqlpower.object.SPObject, ReportContentRenderer, WabitObjectReportRenderer, WabitObject
public class ImageRenderer
- extends AbstractWabitObject
- implements WabitObjectReportRenderer
This class will let users import an image into their layout.
| Fields inherited from class ca.sqlpower.object.AbstractSPObject |
uuid |
| Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject |
cleanup, commit, equals, generateNewUUID, getParent, getSession, isForegroundThread, removeChild, rollback, runInBackground, runInForeground, toString |
| Methods inherited from class ca.sqlpower.object.AbstractSPObject |
addChild, addChildImpl, addSPListener, begin, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, getChildren, getName, getUUID, removeSPListener, setName, setUUID |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ca.sqlpower.object.SPObject |
addChild, addSPListener, begin, cleanup, commit, generateNewUUID, getChildren, getName, getSession, getUUID, removeChild, removeSPListener, rollback, setName, setUUID |
ImageRenderer
public ImageRenderer()
ImageRenderer
public ImageRenderer(ImageRenderer imageRenderer)
- Copy constructor
getContent
public WabitObject getContent()
- Description copied from interface:
WabitObjectReportRenderer
- Returns the
WabitObject that this is rendering
- Specified by:
getContent in interface WabitObjectReportRenderer
getBackgroundColour
public java.awt.Color getBackgroundColour()
- Specified by:
getBackgroundColour in interface ReportContentRenderer
renderReportContent
public boolean renderReportContent(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex,
boolean printing)
- Description copied from interface:
ReportContentRenderer
- Renders as much report content as will fit within the bounds of the given
content box.
Report content renderers can be implemented in two different ways:
- Label-like renderers attempt to show all their content every time
they are called, and never ask for another page. These renderers don't
necessarily render exactly the same content on every page--a footer label
with a page number variable is a good example.
- Resultset-like renderers that show as much content as possible each
time they are called, and keep track of what to start rendering on the
next call. These types of renderers ask for more pages until they have
nothing left to render. If called again, they simply do not draw
anything.
- Specified by:
renderReportContent in interface ReportContentRenderer
- Parameters:
g - The graphics to render into. The origin (top left corner or
(0,0)) of this graphics is translated to the top-left corner
of the content box.contentBox - The box that determines the size and shape that the rendered
data must fit within. You can ignore the X and Y coordinates
of the box because the given graphics object's origin is
already set to this box's origin.scaleFactor - The amount of scaling currently in effect. The nominal size of
a unit when displayed via the given graphics is scaleFactor/72
inches.pageIndex - The zero-based page number for which the corresponding report
content will be rendered.printing - This tells the renderer if the report is being printed. If
set to true the full report will be built, otherwise a cached
result will be used. Set this to true if the report is being
printed.
- Returns:
- True if this renderer has more data to render, and would like to
be called upon again. Returning true will typically cause the
report to grow by another page. The final page of the report is
the first one where all content renderers involved return false.
resetToFirstPage
public void resetToFirstPage()
- Description copied from interface:
ReportContentRenderer
- Tells this content renderer that the next call to
#renderReportContent(Graphics2D, ContentBox, double) should
produce the first page of output again.
- Specified by:
resetToFirstPage in interface ReportContentRenderer
allowsChildren
public boolean allowsChildren()
- Specified by:
allowsChildren in interface ca.sqlpower.object.SPObject
childPositionOffset
public int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
- Specified by:
childPositionOffset in interface ca.sqlpower.object.SPObject
getChildren
public java.util.List<? extends WabitObject> getChildren()
- Specified by:
getChildren in interface ca.sqlpower.object.SPObject
getImage
public WabitImage getImage()
setImage
public void setImage(WabitImage image)
getDependencies
public java.util.List<WabitObject> getDependencies()
- Specified by:
getDependencies in interface ca.sqlpower.object.SPObject
removeDependency
public void removeDependency(ca.sqlpower.object.SPObject dependency)
- Specified by:
removeDependency in interface ca.sqlpower.object.SPObject
setParent
public void setParent(ca.sqlpower.object.SPObject parent)
- Specified by:
setParent in interface ca.sqlpower.object.SPObject- Overrides:
setParent in class ca.sqlpower.object.AbstractSPObject
setPreserveAspectRatioWhenResizing
public void setPreserveAspectRatioWhenResizing(boolean preserveAspectRatioWhenResizing)
isPreserveAspectRatioWhenResizing
public boolean isPreserveAspectRatioWhenResizing()
setPreservingAspectRatio
public void setPreservingAspectRatio(boolean preservingAspectRatio)
isPreservingAspectRatio
public boolean isPreservingAspectRatio()
refresh
public void refresh()
- Description copied from interface:
ReportContentRenderer
- Refreshes the data being rendered by this ReportContentRenderer so that
it has the most recent data. If the data this renderer renders is static,
then it doesn't need to do anything (no-op).
- Specified by:
refresh in interface ReportContentRenderer
setHAlign
public void setHAlign(HorizontalAlignment hAlign)
getHAlign
public HorizontalAlignment getHAlign()
setVAlign
public void setVAlign(VerticalAlignment vAlign)
getVAlign
public VerticalAlignment getVAlign()
removeChildImpl
protected boolean removeChildImpl(ca.sqlpower.object.SPObject child)
- Specified by:
removeChildImpl in class ca.sqlpower.object.AbstractSPObject
getAllowedChildTypes
public java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()
Copyright © 2009. All Rights Reserved.