ca.sqlpower.wabit.report
Class ImageRenderer

java.lang.Object
  extended by ca.sqlpower.object.AbstractSPObject
      extended by ca.sqlpower.wabit.AbstractWabitObject
          extended by 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.


Nested Class Summary
 
Nested classes/interfaces inherited from interface ca.sqlpower.wabit.report.ReportContentRenderer
ReportContentRenderer.BackgroundColours
 
Field Summary
 
Fields inherited from class ca.sqlpower.object.AbstractSPObject
uuid
 
Constructor Summary
ImageRenderer()
           
ImageRenderer(ImageRenderer imageRenderer)
          Copy constructor
 
Method Summary
 boolean allowsChildren()
           
 int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
           
 java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()
           
 java.awt.Color getBackgroundColour()
           
 java.util.List<? extends WabitObject> getChildren()
           
 WabitObject getContent()
          Returns the WabitObject that this is rendering
 java.util.List<WabitObject> getDependencies()
           
 HorizontalAlignment getHAlign()
           
 WabitImage getImage()
           
 VerticalAlignment getVAlign()
           
 boolean isPreserveAspectRatioWhenResizing()
           
 boolean isPreservingAspectRatio()
           
 void refresh()
          Refreshes the data being rendered by this ReportContentRenderer so that it has the most recent data.
protected  boolean removeChildImpl(ca.sqlpower.object.SPObject child)
           
 void removeDependency(ca.sqlpower.object.SPObject dependency)
           
 boolean renderReportContent(java.awt.Graphics2D g, ContentBox contentBox, double scaleFactor, int pageIndex, boolean printing)
          Renders as much report content as will fit within the bounds of the given content box.
 void resetToFirstPage()
          Tells this content renderer that the next call to #renderReportContent(Graphics2D, ContentBox, double) should produce the first page of output again.
 void setHAlign(HorizontalAlignment hAlign)
           
 void setImage(WabitImage image)
           
 void setParent(ca.sqlpower.object.SPObject parent)
           
 void setPreserveAspectRatioWhenResizing(boolean preserveAspectRatioWhenResizing)
           
 void setPreservingAspectRatio(boolean preservingAspectRatio)
           
 void setVAlign(VerticalAlignment vAlign)
           
 
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.wabit.WabitObject
getParent
 
Methods inherited from interface ca.sqlpower.object.SPObject
addChild, addSPListener, begin, cleanup, commit, generateNewUUID, getChildren, getName, getSession, getUUID, removeChild, removeSPListener, rollback, setName, setUUID
 

Constructor Detail

ImageRenderer

public ImageRenderer()

ImageRenderer

public ImageRenderer(ImageRenderer imageRenderer)
Copy constructor

Method Detail

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:


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.