|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.object.AbstractSPObject
ca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.report.Page
public class Page
A page is an arrangement of boxes and guides (usually page margins) on a container of a particular size. Boxes have data provided to them by content renderers, which can be fed by database queries, labels with variable substitution, or anything else. The actual report will be rendered to one or more pages--the content renderers specify whether or not they need another page to finish rendering their data.
| Nested Class Summary | |
|---|---|
static class |
Page.PageOrientation
Indicates the transformation that should be applied when this page is rendered. |
static class |
Page.WabitObjectOrder
FIXME This enum defines the WabitObject child classes a
Page takes as well as the ordinal order of these child
classes such that the class going before does not depend on the class
that goes after. |
| Field Summary | |
|---|---|
static int |
DPI
This is the Graphics2D standard for pixels-to-inches conversions. |
| Fields inherited from class ca.sqlpower.object.AbstractSPObject |
|---|
uuid |
| Constructor Summary | |
|---|---|
Page(Page page)
Copy constructor |
|
Page(java.lang.String name,
int width,
int height,
Page.PageOrientation orientation,
boolean startWithGuides)
Creates a page with the given custom width and height, and 1-inch margins. |
|
Page(java.lang.String name,
java.awt.print.PageFormat pageFormat)
Creates a new page whose dimensions and orientation are equivalent to the values in the pageFormat. |
|
| Method Summary | |
|---|---|
protected void |
addChildImpl(ca.sqlpower.object.SPObject child,
int index)
|
void |
addContentBox(ContentBox addme)
Adds a content box to this page at the end of the list of content boxes. |
void |
addContentBox(ContentBox addme,
int index)
Adds a content box to this page at the given index in the list of content boxes. |
void |
addGuide(Guide addme)
Adds a guide to the end of the list of guides. |
void |
addGuide(Guide addme,
int index)
Adds a guide to the list of guides at the given index. |
boolean |
allowsChildren()
|
void |
applyPageFormat(java.awt.print.PageFormat pageFormat)
Applies the given Java print API page format to this page object. |
int |
childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
|
java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> |
getAllowedChildTypes()
|
WabitObject |
getChildByName(java.lang.String getMe)
|
java.util.List<WabitObject> |
getChildren()
Returns an unmodifiable view of this page's boxes. |
java.util.List<ContentBox> |
getContentBoxes()
Returns an unmodifiable view of this page's content boxes. |
java.awt.Font |
getDefaultFont()
|
java.util.List<WabitObject> |
getDependencies()
|
int |
getHeight()
Returns the apparent height of the page. |
double |
getLeftMarginOffset()
|
double |
getLowerMarginOffset()
|
Page.PageOrientation |
getOrientation()
|
java.awt.print.PageFormat |
getPageFormat()
Gets a page format instance that describes this page's geometry in terms of the Java print API. |
double |
getRightMarginOffset()
|
double |
getUpperMarginOffset()
|
int |
getWidth()
Returns the apparent width of the page. |
protected boolean |
removeChildImpl(ca.sqlpower.object.SPObject child)
|
void |
removeContentBox(ContentBox removeme)
|
void |
removeDependency(ca.sqlpower.object.SPObject dependency)
|
boolean |
removeGuide(Guide removeme)
Removes the first instance of this guide from the Page. |
void |
setDefaultFont(java.awt.Font defaultFont)
|
void |
setHeight(int height)
Sets the apparent height of the page. |
void |
setOrientation(Page.PageOrientation orientation)
|
void |
setUniqueName(WabitObject addme,
java.lang.String maybeUniqueName)
If the name passed is already taken by children of this page (which at present, are Guides and ContentBoxes)then this method will generate a unique name for the WabitObject |
void |
setWidth(int width)
Sets the apparent width of the page. |
| 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, 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, getChildren, getName, getUUID, removeSPListener, setName, setParent, setUUID |
| Field Detail |
|---|
public static final int DPI
| Constructor Detail |
|---|
public Page(java.lang.String name,
int width,
int height,
Page.PageOrientation orientation,
boolean startWithGuides)
width - The page width in units of 1/72 inch. The is the real apparent
width of the page. If you are creating a landscape page, this
value should be larger than the one you specify for height.height - The page height in units of 1/72 inch. The is the real
apparent height of the page. If you are creating a landscape
page, this value should be smaller than the one you specify
for width.orientation - The page orientation. This value has a fun interplay with
width and height, so be sure to specify this correctly based
on the type of page you are creating.startWithGuides - If true guides will be added to the page defining a 1 inch
margin. If false the page will start guideless.public Page(Page page)
public Page(java.lang.String name,
java.awt.print.PageFormat pageFormat)
name - The name for this WabitObject.pageFormat - The Java printing API page format from which to read the
dimensions and orientation. This object is not retained by
this class, so subsequent changes you make to the pageFormat
object will not affect this page.| Method Detail |
|---|
public int getWidth()
public void setWidth(int width)
public int getHeight()
public void setHeight(int height)
public java.awt.Font getDefaultFont()
public void setDefaultFont(java.awt.Font defaultFont)
public Page.PageOrientation getOrientation()
public void setOrientation(Page.PageOrientation orientation)
public void addContentBox(ContentBox addme)
addme - The content box to add.
public void addContentBox(ContentBox addme,
int index)
addme - The content box to add.index - The index to add the content box at. This cannot be greater
than the number of content boxes currently in the page.public void removeContentBox(ContentBox removeme)
public void setUniqueName(WabitObject addme,
java.lang.String maybeUniqueName)
addme - maybeUniqueName - public WabitObject getChildByName(java.lang.String getMe)
public java.util.List<ContentBox> getContentBoxes()
public void addGuide(Guide addme)
addme - The guide to add as a child of this page.
public void addGuide(Guide addme,
int index)
addme - The guide to add to this page.index - The index in the list of guides to add this guide to. This
cannot be greater than the number of guides currently in the
page.public double getLeftMarginOffset()
public double getRightMarginOffset()
public double getUpperMarginOffset()
public double getLowerMarginOffset()
public boolean allowsChildren()
public int childPositionOffset(java.lang.Class<? extends ca.sqlpower.object.SPObject> childType)
public java.util.List<WabitObject> getChildren()
public boolean removeGuide(Guide removeme)
guide -
public java.awt.print.PageFormat getPageFormat()
public void applyPageFormat(java.awt.print.PageFormat pageFormat)
pageFormat - The page format to apply to this page.public java.util.List<WabitObject> getDependencies()
public void removeDependency(ca.sqlpower.object.SPObject dependency)
protected boolean removeChildImpl(ca.sqlpower.object.SPObject child)
removeChildImpl in class ca.sqlpower.object.AbstractSPObject
protected void addChildImpl(ca.sqlpower.object.SPObject child,
int index)
addChildImpl in class ca.sqlpower.object.AbstractSPObjectpublic java.util.List<java.lang.Class<? extends ca.sqlpower.object.SPObject>> getAllowedChildTypes()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||