|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.report.ResultSetRenderer
public class ResultSetRenderer
Renders a JDBC result set using configurable absolute column widths.
| Nested Class Summary | |
|---|---|
static class |
ResultSetRenderer.BorderStyles
These border styles gives a border to the result set. |
| Nested classes/interfaces inherited from interface ca.sqlpower.wabit.report.ReportContentRenderer |
|---|
ReportContentRenderer.BackgroundColours |
| Field Summary | |
|---|---|
static int |
BORDER_INDENT
This is the number of pixels each cell will be indented by if there is a border to the left of the cell. |
protected static java.lang.String |
QUERY
Notes a change to the query has occurred that would require a refresh to the renderer |
| Constructor Summary | |
|---|---|
ResultSetRenderer(QueryCache query)
|
|
ResultSetRenderer(QueryCache query,
java.util.List<ColumnInfo> columnInfoList)
|
|
ResultSetRenderer(ResultSetRenderer resultSetRenderer)
Copy constructor |
|
| Method Summary | |
|---|---|
protected void |
addChildImpl(WabitObject child,
int index)
This is the object specific implementation of #addChild(WabitObject). |
boolean |
allowsChildren()
Returns true if this object may contain children. |
int |
childPositionOffset(java.lang.Class<? extends WabitObject> childType)
Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type. |
CleanupExceptions |
cleanup()
Default cleanup method that does nothing. |
void |
clearResultSetLayout()
Call this method if something changes in the result set that causes the need to redefine the layout of the result set. |
boolean |
defineColumnBeingDragged(double mouseXPos)
This method will look for a column edge that is near the given x location. |
java.awt.Color |
getBackgroundColour()
|
java.awt.Font |
getBodyFont()
|
ResultSetRenderer.BorderStyles |
getBorderType()
|
java.util.List<? extends WabitObject> |
getChildren()
Returns an unmodifiable list of the children in this WabitObject. |
java.util.List<ColumnInfo> |
getColumnInfoList()
|
QueryCache |
getContent()
Returns the WabitObject that this is rendering |
java.util.List<WabitObject> |
getDependencies()
Returns a list of all WabitObjects that this Wabit object is
dependent on. |
java.awt.Font |
getHeaderFont()
|
java.lang.String |
getNullString()
|
ContentBox |
getParent()
Returns the parent of this WabitObject. |
boolean |
isPrintingGrandTotals()
|
boolean |
moveColumnBeingDragged(double moveDelta)
This will move the edge of the column defined to be dragged by the delta. |
void |
refresh()
Refreshes the data being rendered by this ReportContentRenderer so that it has the most recent data. |
protected boolean |
removeChildImpl(WabitObject child)
This is the object specific implementation of removeChild. |
void |
removeDependency(WabitObject dependency)
Removes the given object as a dependency of this object. |
boolean |
renderFailure(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex)
|
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. |
boolean |
renderSuccess(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex,
boolean printing)
|
java.lang.String |
replaceNull(java.lang.String string)
This will replace null values with the designated null string. |
void |
resetToFirstPage()
Tells this content renderer that the next call to #renderReportContent(Graphics2D, ContentBox, double) should
produce the first page of output again. |
void |
setBackgroundColour(java.awt.Color backgroundColour)
|
void |
setBodyFont(java.awt.Font bodyFont)
|
void |
setBorderType(ResultSetRenderer.BorderStyles borderType)
|
void |
setColBeingDragged(ColumnInfo colBeingDragged)
|
void |
setHeaderFont(java.awt.Font headerFont)
|
void |
setNullString(java.lang.String nullString)
|
void |
setParent(WabitObject parent)
Sets the parent of this object to the given object. |
void |
setPrintingGrandTotals(boolean isPrintingGrandTotals)
|
| Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject |
|---|
addChild, addWabitListener, begin, beginTransaction, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getSession, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setUUID, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ca.sqlpower.wabit.WabitObject |
|---|
addChild, addWabitListener, begin, commit, generateNewUUID, getChildren, getName, getUUID, removeChild, removeWabitListener, rollback, setName, setUUID |
| Field Detail |
|---|
public static final int BORDER_INDENT
protected static final java.lang.String QUERY
| Constructor Detail |
|---|
public ResultSetRenderer(@Nonnull
QueryCache query)
public ResultSetRenderer(@Nonnull
QueryCache query,
@Nonnull
java.util.List<ColumnInfo> columnInfoList)
public ResultSetRenderer(ResultSetRenderer resultSetRenderer)
| Method Detail |
|---|
public QueryCache getContent()
WabitObjectReportRendererWabitObject that this is rendering
getContent in interface WabitObjectReportRendererpublic CleanupExceptions cleanup()
AbstractWabitObject
cleanup in interface WabitObjectcleanup in class AbstractWabitObjectpublic void resetToFirstPage()
ReportContentRenderer#renderReportContent(Graphics2D, ContentBox, double) should
produce the first page of output again.
resetToFirstPage in interface ReportContentRenderer
public boolean renderReportContent(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex,
boolean printing)
ReportContentRendererReport content renderers can be implemented in two different ways:
renderReportContent in interface ReportContentRendererg - 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.
public boolean renderFailure(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex)
public boolean renderSuccess(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex,
boolean printing)
public void clearResultSetLayout()
public java.lang.String replaceNull(java.lang.String string)
public boolean allowsChildren()
WabitObject
allowsChildren in interface WabitObjectWabitObject.childPositionOffset(Class)public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
WabitObject
childPositionOffset in interface WabitObjectpublic java.util.List<? extends WabitObject> getChildren()
WabitObject
getChildren in interface WabitObjectpublic java.awt.Font getHeaderFont()
public void setHeaderFont(java.awt.Font headerFont)
public java.awt.Font getBodyFont()
public void setBodyFont(java.awt.Font bodyFont)
public java.lang.String getNullString()
public void setNullString(java.lang.String nullString)
public ContentBox getParent()
WabitObjectWabitObject
tree.
getParent in interface WabitObjectgetParent in class AbstractWabitObjectpublic void setBackgroundColour(java.awt.Color backgroundColour)
public java.awt.Color getBackgroundColour()
getBackgroundColour in interface ReportContentRendererpublic ResultSetRenderer.BorderStyles getBorderType()
public void setBorderType(ResultSetRenderer.BorderStyles borderType)
public java.util.List<ColumnInfo> getColumnInfoList()
public boolean defineColumnBeingDragged(double mouseXPos)
mouseXPos - The distance from the left side of the parent content box to
look for an edge of a column. This cannot be null.
public boolean moveColumnBeingDragged(double moveDelta)
moveDelta - The amount to resize the column width. Cannot be null.
public java.util.List<WabitObject> getDependencies()
WabitObjectWabitObjects that this Wabit object is
dependent on. Children of a WabitObject are not dependencies and will not
be returned in this list. If there are no objects this Wabit object is
dependent on an empty list should be returned. These are only the
immediate dependencies of this object. If you want to find the
dependencies of this object's dependencies as well it may be useful to
look at WorkspaceGraphModel to make a full graph of all of the
dependencies.
getDependencies in interface WabitObjectpublic void removeDependency(WabitObject dependency)
WabitObject
removeDependency in interface WabitObjectpublic void setParent(WabitObject parent)
WabitObject
setParent in interface WabitObjectsetParent in class AbstractWabitObjectparent - The new parent of this object.public void setColBeingDragged(ColumnInfo colBeingDragged)
public void setPrintingGrandTotals(boolean isPrintingGrandTotals)
public boolean isPrintingGrandTotals()
public void refresh()
ReportContentRenderer
refresh in interface ReportContentRendererprotected boolean removeChildImpl(WabitObject child)
AbstractWabitObject
removeChildImpl in class AbstractWabitObjectAbstractWabitObject.removeChild(WabitObject)
protected void addChildImpl(WabitObject child,
int index)
AbstractWabitObject#addChild(WabitObject). There are checks in the
#addChild(WabitObject) method to ensure that the object given
here is a valid child type of this object.
This method should be overwritten if children are allowed.
addChildImpl in class AbstractWabitObjectchild - The child to add to this object.index - The index to add the child at.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||