|
||||||||||
| 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.Label
public class Label
A simple report content item that prints out some text with optional variable
substitution. Variables are described in the documentation for the
Variables class.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface ca.sqlpower.wabit.report.ReportContentRenderer |
|---|
ReportContentRenderer.BackgroundColours |
| Constructor Summary | |
|---|---|
Label()
|
|
Label(Label label)
Copy constructor |
|
Label(java.lang.String text)
Creates a new label with the given initial text. |
|
| Method Summary | |
|---|---|
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. |
java.awt.Color |
getBackgroundColour()
|
java.util.List<? extends WabitObject> |
getChildren()
Returns an unmodifiable list of the children in this WabitObject. |
java.util.List<WabitObject> |
getDependencies()
Returns a list of all WabitObjects that this Wabit object is
dependent on. |
java.awt.Font |
getFont()
|
HorizontalAlignment |
getHorizontalAlignment()
|
ContentBox |
getParent()
Returns the parent of this WabitObject. |
java.lang.String |
getText()
Returns the text of this label without substituting the variables. |
VariableContext |
getVariableContext()
|
VerticalAlignment |
getVerticalAlignment()
|
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 |
renderReportContent(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex,
boolean printing)
Renders this label to the given graphics, with the baseline centered in the 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 |
setBackgroundColour(java.awt.Color backgroundColour)
|
void |
setFont(java.awt.Font font)
|
void |
setHorizontalAlignment(HorizontalAlignment alignment)
|
void |
setText(java.lang.String text)
Sets the new text for this label. |
void |
setVariableContext(VariableContext variableContext)
ONLY USED FOR TESTING |
void |
setVerticalAlignment(VerticalAlignment alignment)
|
| Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject |
|---|
addChild, addChildImpl, addWabitListener, begin, beginTransaction, cleanup, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getSession, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setParent, 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, cleanup, commit, generateNewUUID, getChildren, getName, getUUID, removeChild, removeWabitListener, rollback, setName, setParent, setUUID |
| Constructor Detail |
|---|
public Label(java.lang.String text)
variableContext - text - public Label(Label label)
public Label()
| Method Detail |
|---|
public void setText(java.lang.String text)
Variables.
public java.lang.String getText()
public HorizontalAlignment getHorizontalAlignment()
public void setHorizontalAlignment(HorizontalAlignment alignment)
public VerticalAlignment getVerticalAlignment()
public void setVerticalAlignment(VerticalAlignment alignment)
public void setFont(java.awt.Font font)
public java.awt.Font getFont()
public void setVariableContext(VariableContext variableContext)
public boolean renderReportContent(java.awt.Graphics2D g,
ContentBox contentBox,
double scaleFactor,
int pageIndex,
boolean printing)
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 ContentBox getParent()
WabitObjectWabitObject
tree.
getParent in interface WabitObjectgetParent in class AbstractWabitObjectpublic 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 void resetToFirstPage()
ReportContentRenderer#renderReportContent(Graphics2D, ContentBox, double) should
produce the first page of output again.
resetToFirstPage in interface ReportContentRendererpublic java.awt.Color getBackgroundColour()
getBackgroundColour in interface ReportContentRendererpublic void setBackgroundColour(java.awt.Color backgroundColour)
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 VariableContext getVariableContext()
public void refresh()
ReportContentRenderer
refresh in interface ReportContentRendererprotected boolean removeChildImpl(WabitObject child)
AbstractWabitObject
removeChildImpl in class AbstractWabitObjectAbstractWabitObject.removeChild(WabitObject)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||