ca.sqlpower.wabit.report
Class CellSetRenderer

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

public class CellSetRenderer
extends AbstractWabitObject
implements WabitObjectReportRenderer

Renders a CellSet from a MDX query on a report 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
CellSetRenderer(CellSetRenderer cellSetRenderer)
           
CellSetRenderer(OlapQuery olapQuery)
           
 
Method Summary
protected  void addChildImpl(ca.sqlpower.object.SPObject child, int index)
           
 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()
           
 HorizontalAlignment getBodyAlignment()
           
 java.awt.Font getBodyFont()
           
 java.text.DecimalFormat getBodyFormat()
           
 org.olap4j.CellSet getCellSet()
           
 java.util.List<? extends WabitObject> getChildren()
           
 OlapQuery getContent()
          Returns the WabitObject that this is rendering
 java.util.List<WabitObject> getDependencies()
           
 java.lang.String getErrorMessage()
           
 java.awt.Font getHeaderFont()
           
 OlapQuery getModifiedOlapQuery()
           
 ContentBox getParent()
          Returns the parent of this WabitObject.
 org.olap4j.metadata.Member getSelectedMember()
           
 void init()
           
 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)
          This method renders the report content in the CellSetRenderer
 void resetToFirstPage()
          Tells this content renderer that the next call to #renderReportContent(Graphics2D, ContentBox, double) should produce the first page of output again.
 void setBodyAlignment(HorizontalAlignment bodyAlignment)
           
 void setBodyFont(java.awt.Font bodyFont)
           
 void setBodyFormat(java.text.DecimalFormat bodyFormat)
           
 void setHeaderFont(java.awt.Font headerFont)
           
 void setMemberSelectedAtPoint(java.awt.geom.Point2D p)
          This method will look for a member located at the given point.
 void setModifiedOlapQuery(OlapQuery modifiedOlapQuery)
           
 void setSelectedMember(org.olap4j.metadata.Member selectedMember)
           
 void toggleSelectedMember()
          If the selected member is not null it will be expanded or collapsed depending on the current state of the member.
 
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, 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

CellSetRenderer

public CellSetRenderer(CellSetRenderer cellSetRenderer)

CellSetRenderer

public CellSetRenderer(OlapQuery olapQuery)
Method Detail

init

public void init()

getContent

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

Specified by:
getContent in interface WabitObjectReportRenderer

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

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)
This method renders the report content in the CellSetRenderer

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

addChildImpl

protected void addChildImpl(ca.sqlpower.object.SPObject child,
                            int index)
Overrides:
addChildImpl in class ca.sqlpower.object.AbstractSPObject

setHeaderFont

public void setHeaderFont(java.awt.Font headerFont)

getHeaderFont

public java.awt.Font getHeaderFont()

setBodyFont

public void setBodyFont(java.awt.Font bodyFont)

getBodyFont

public java.awt.Font getBodyFont()

setBodyAlignment

public void setBodyAlignment(HorizontalAlignment bodyAlignment)

setBodyFormat

public void setBodyFormat(java.text.DecimalFormat bodyFormat)

setSelectedMember

public void setSelectedMember(org.olap4j.metadata.Member selectedMember)

getSelectedMember

public org.olap4j.metadata.Member getSelectedMember()

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.

getCellSet

public org.olap4j.CellSet getCellSet()

getBodyAlignment

public HorizontalAlignment getBodyAlignment()

getBodyFormat

public java.text.DecimalFormat getBodyFormat()

getModifiedOlapQuery

public OlapQuery getModifiedOlapQuery()

setModifiedOlapQuery

public void setModifiedOlapQuery(OlapQuery modifiedOlapQuery)

getErrorMessage

public java.lang.String getErrorMessage()

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

setMemberSelectedAtPoint

public void setMemberSelectedAtPoint(java.awt.geom.Point2D p)
This method will look for a member located at the given point. If a member is found it will be defined to be the selected member. If no member exists at the given point the selected member will be null.

Parameters:
p - Used to locate the member to be defined as selected. Cannot be null. The origin of this point is the top left point of the parent content box.

toggleSelectedMember

public void toggleSelectedMember()
If the selected member is not null it will be expanded or collapsed depending on the current state of the member. If the selected member is null this is a no-op.


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

getAllowedChildTypes

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


Copyright © 2009. All Rights Reserved.