|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.layout.LayoutArea
Lightweight component for expressing final renderable content. The LayoutArea contains the visible text, an immutable Constraint object to define where the area wants to appear, and positioning extents to declare where the area really is in the final rendered product. By default, the text is managed as a simple String, but more complex inlined stylings can be managed with the optional StyledText property.
LayoutArea implements the Composite pattern, which treats each object as a
potential node in a larger tree. Leaf nodes are interchangeable with
branch nodes, although in the case of LayoutArea, each area is either one
or the other. Thus, a text area (LayoutText) is a node and cannot
contain children, while a group area (LayoutGroup) is a branch and
can contain children, but not content.
LayoutArea objects are created by a RenderTemplate and populated with constraints; the LayoutEngine analyzes the constraints and fills up all the final extents.
| Constructor Summary | |
LayoutArea(AreaStyle style)
Creates a new instance of LayoutArea. |
|
| Method Summary | |
void |
addChildren(LayoutArea area)
Appends a new child LayoutArea object into this area. |
void |
addChildren(LayoutArea[] areas)
Appends an array of child LayoutArea objects into this area. |
boolean |
canBreakAt(int height)
Determines if this area can be broken at the given height, measured from the top of the area. |
LayoutArea[] |
getChildren()
Getter for property children, the child layout areas. |
LayoutArea |
getChildren(int index)
Indexed getter for property children, the child layout areas. |
java.awt.Rectangle |
getExtents()
Getter for property extents, the actual extents for this area. |
int |
getHeight()
Getter for property height, the final calculated height to render this area. |
java.lang.String |
getHint()
Getter for property hint, an optional field for descriptive info. |
java.awt.Rectangle |
getRenderableExtents()
Retrieves a Rectangle of the valid rendering extents for this area, the normal extents minus the insets. |
AreaStyle |
getStyle()
Getter for property style, the layout constraints set up by the template for this area. |
int |
getWidth()
Getter for property width, the final calculated width to render this area. |
int |
getX()
Getter for property x, the final calculated x-axis origin to render this area. |
int |
getY()
Getter for property y, the final calculated y-axis origin to render this area. |
boolean |
isBreakable()
Getter for property breakable, whether the area can be split or not. |
boolean |
isRenderable()
Determines if this area has renderable content. |
void |
setChildren(int index,
LayoutArea areas)
Indexed setter for property children, the child layout areas. |
void |
setChildren(LayoutArea[] areas)
Setter for property children, the child layout areas. |
void |
setExtents(java.awt.Rectangle extents)
Setter for property extents, the actual extents for this area. |
void |
setHeight(int height)
Setter for property height, the final calculated height to render this area. |
void |
setHint(java.lang.String hint)
Setter for property hint, an optional field for descriptive info. |
void |
setWidth(int width)
Setter for property width, the final calculated width to render this area. |
void |
setX(int x)
Setter for property x, the final calculated x-axis origin to render this area. |
void |
setY(int y)
Setter for property y, the final calculated y-axis origin to render this area. |
java.lang.String |
toString()
Converts the area object into String form. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public LayoutArea(AreaStyle style)
style - the base style for this area| Method Detail |
public AreaStyle getStyle()
public boolean isRenderable()
public void setWidth(int width)
width - New value of property width.public int getWidth()
public void setHeight(int height)
height - New value of property height.public int getHeight()
public void setX(int x)
x - New value of property x.public int getX()
public void setY(int y)
y - New value of property y.public int getY()
public java.awt.Rectangle getExtents()
public void setExtents(java.awt.Rectangle extents)
extents - New value of property extents.public java.awt.Rectangle getRenderableExtents()
public boolean isBreakable()
public boolean canBreakAt(int height)
LayoutGroup might override this method to account for more subtle
breakage rules.
height - the height to attempt the break at
public void setHint(java.lang.String hint)
hint - New value of property hint.public java.lang.String getHint()
public LayoutArea getChildren(int index)
index - Index of the property.
index.public LayoutArea[] getChildren()
public void setChildren(int index,
LayoutArea areas)
index - Index of the property.areas - New value of the property at index.public void setChildren(LayoutArea[] areas)
areas - New value of property children.public void addChildren(LayoutArea area)
area - new LayoutArea object to appendpublic void addChildren(LayoutArea[] areas)
areas - new LayoutArea objects to appendpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||