|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.umber.crucible.old.layout.LayoutContext
Context for an ongoing iterative layout process. Manages an array of LayoutArea objects as they are split, reformatted, and reflowed onto a series of page regions. The context maintains a running tally of which areas have been used, and allows for a partial area to be carried forward to the next Page, if necessary. Keeps a separate list of finished, accepted areas which are ready to be rendered to a Page.
The context object does not deal directly with Page objects. It merely provides easy access to the "fiddling" actions that are a part of layout generation. Typically, a LayoutEngine will take a LayoutContext object, cram as much into the current region as it can, and return the context for the RenderTemplate to populate a new Page.
Constructor Summary | |
LayoutContext(LayoutArea[] areas)
Creates a new instance of LayoutContext |
Method Summary | |
void |
acceptArea(LayoutArea area)
Adds an area to the list of renderable areas for the current page. |
void |
flush()
Removes all renderable areas from the queue. |
LayoutArea[] |
getAcceptedAreas()
Returns an array of areas ready to be rendered onto a Page. |
LayoutArea |
getCurrentArea()
Returns the LayoutArea object most recently pulled off the stack. |
java.awt.Rectangle |
getCurrentRegion()
Retrieves the cached current rendering region. |
java.awt.Rectangle |
getOuterRegion()
Retrieves the the top-level layout region. |
int |
getStackCount()
Returns the number of unhandled areas left in the queue. |
LayoutArea |
nextArea()
Pulls the next area off the stack. |
void |
rejectArea(LayoutArea reject)
Puts the area into the reject pile, to be deferred to the next page. |
void |
setCurrentRegion(java.awt.Rectangle region)
Caches the current rendering region in the LayoutContext. |
void |
setOuterRegion(java.awt.Rectangle region)
Caches the top-level layout region in the LayoutContext. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LayoutContext(LayoutArea[] areas)
areas
- an array of areas to initialize the context toMethod Detail |
public void setCurrentRegion(java.awt.Rectangle region)
region
- the current rendering regionpublic java.awt.Rectangle getCurrentRegion()
public void setOuterRegion(java.awt.Rectangle region)
region
- the current outer regionpublic java.awt.Rectangle getOuterRegion()
public int getStackCount()
public LayoutArea nextArea()
public LayoutArea getCurrentArea()
public void rejectArea(LayoutArea reject)
reject
- an area to bump to the next pagepublic void acceptArea(LayoutArea area)
area
- a valid renderable area for the current pagepublic LayoutArea[] getAcceptedAreas()
public void flush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |