|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Base interface for all layout engines. The primary task of the LayoutEngine is to fit LayoutArea objects into a rectangular region. The areas are managed by a LayoutContext object, which the engine will modify as it proceeds with its layout.
| Method Summary | |
void |
acceptArea(LayoutArea area)
Adds the area to the layout queue. |
LayoutArea[] |
clearQueue()
Empties out the layout queue. |
boolean |
fitsInRegion(LayoutArea area)
Checks to see if the given area will fit anywhere in the current layout region. |
boolean |
fitsInRegion(LayoutArea area,
java.awt.Rectangle region,
java.util.List areasInRegion)
Checks to see if the area will fit in the given region. |
java.awt.Shape |
getFreeSpace()
Returns the free space in the current layout region. |
int |
getQueueSize()
Returns the number of areas currently in the layout queue. |
java.awt.Dimension |
guessSize(LayoutArea area)
Estimates the size that the area "wants" to be. |
java.util.List |
layoutAreas(java.util.List areas)
Attempts to lay out all the areas in the supplied List. |
void |
layoutRegion(LayoutContext context,
java.awt.Rectangle region)
Attempts to lay out as many of the pending areas in the context as it can, into the provided region's bounding box. |
void |
setCurrentRegion(java.awt.Shape region)
Assigns a clipping region for the current rendering context. |
| Method Detail |
public void setCurrentRegion(java.awt.Shape region)
region - the new clipping region
java.lang.IllegalStateException - if called with areas in the queuepublic int getQueueSize()
public LayoutArea[] clearQueue()
public java.util.List layoutAreas(java.util.List areas)
areas - the list of areas to add to the current region
java.lang.IllegalStateException - if called without a valid current regionpublic void acceptArea(LayoutArea area)
area - the area to add to the layout queue
java.lang.IllegalStateException - if called without a valid current regionpublic java.awt.Shape getFreeSpace()
java.lang.IllegalStateException - if called without a valid current regionpublic java.awt.Dimension guessSize(LayoutArea area)
area - the area to examine
public boolean fitsInRegion(LayoutArea area)
area - the area to check
java.lang.IllegalStateException - if called without a valid current region
public boolean fitsInRegion(LayoutArea area,
java.awt.Rectangle region,
java.util.List areasInRegion)
area - the LayoutArea object to try to fitregion - the bounding area of the regionareasInRegion - optional list of areas already in the region
public void layoutRegion(LayoutContext context,
java.awt.Rectangle region)
context - the running context for this rendering passregion - the bounding area to render areas into
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||