ca.sqlpower.wabit.report
Class ChartRenderer

java.lang.Object
  extended by ca.sqlpower.object.AbstractSPObject
      extended by ca.sqlpower.wabit.AbstractWabitObject
          extended by ca.sqlpower.wabit.report.ChartRenderer
All Implemented Interfaces:
ca.sqlpower.object.SPObject, ReportContentRenderer, WabitObjectReportRenderer, WabitObject

public class ChartRenderer
extends AbstractWabitObject
implements WabitObjectReportRenderer

This class will render a chart from a query's result set in a chart format defined by the user.


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
ChartRenderer(Chart chart)
           
ChartRenderer(ChartRenderer renderer)
           
 
Method Summary
 boolean allowsChildren()
           
 int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
           
 ca.sqlpower.object.CleanupExceptions cleanup()
          Default cleanup method that does nothing.
 java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()
           
 java.awt.Color getBackgroundColour()
           
 java.util.List<? extends WabitObject> getChildren()
           
 Chart getContent()
          Returns the WabitObject that this is rendering
 java.util.List<WabitObject> getDependencies()
           
 ContentBox getParent()
          Returns the parent of this WabitObject.
 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.
 
Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject
commit, equals, generateNewUUID, 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, setParent, 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, commit, generateNewUUID, getChildren, getName, getSession, getUUID, removeChild, removeSPListener, rollback, setName, setParent, setUUID
 

Constructor Detail

ChartRenderer

public ChartRenderer(@Nonnull
                     ChartRenderer renderer)

ChartRenderer

public ChartRenderer(@Nonnull
                     Chart chart)
Method Detail

getBackgroundColour

public java.awt.Color getBackgroundColour()
Specified by:
getBackgroundColour in interface ReportContentRenderer

getContent

@Nonnull
public Chart getContent()
Description copied from interface: WabitObjectReportRenderer
Returns the WabitObject that this is rendering

Specified by:
getContent in interface WabitObjectReportRenderer

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

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

cleanup

public ca.sqlpower.object.CleanupExceptions cleanup()
Description copied from class: AbstractWabitObject
Default cleanup method that does nothing. Override and implement this method if cleanup is necessary.

Specified by:
cleanup in interface ca.sqlpower.object.SPObject
Overrides:
cleanup in class AbstractWabitObject

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

removeChildImpl

protected boolean removeChildImpl(ca.sqlpower.object.SPObject child)
Specified by:
removeChildImpl in class ca.sqlpower.object.AbstractSPObject

getParent

public ContentBox getParent()
Description copied from interface: WabitObject
Returns the parent of this WabitObject. This will be null when the object is first created until it is added as a child to another object. If this object is never added as a child to another object this will remain null and the object may be treated as the root node of a WabitObject tree.

Specified by:
getParent in interface ca.sqlpower.object.SPObject
Specified by:
getParent in interface WabitObject
Overrides:
getParent in class AbstractWabitObject
Returns:
The parent of this object.

getAllowedChildTypes

public java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()


Copyright © 2009. All Rights Reserved.