|
||||||||||
| 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.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. |
| Field Summary | |
|---|---|
static int |
DPI
This is the Graphics2D standard for pixels-to-inches conversions. |
| 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(WabitObject child,
int index)
This is the object specific implementation of #addChild(WabitObject). |
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()
Returns true if this object may contain children. |
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 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. |
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()
Returns a list of all WabitObjects that this Wabit object is
dependent on. |
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(WabitObject child)
This is the object specific implementation of removeChild. |
void |
removeContentBox(ContentBox removeme)
|
void |
removeDependency(WabitObject dependency)
Removes the given object as a dependency of this object. |
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 |
|---|
addChild, addWabitListener, begin, beginTransaction, cleanup, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getParent, 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 |
| 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()
WabitObject
WabitObject.childPositionOffset(Class)public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
WabitObject
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()
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.
public void removeDependency(WabitObject dependency)
WabitObject
protected 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 | |||||||||