org.writersforge.catalan.layout
Class LayoutText

java.lang.Object
  |
  +--org.writersforge.catalan.layout.LayoutArea
        |
        +--org.writersforge.catalan.layout.LayoutText

public class LayoutText
extends LayoutArea

A portion of renderable text. Provides some accessors for plain text, and others for mixed style text via the StyledText object.

Author:
jsheets

Constructor Summary
LayoutText(AreaStyle style)
          Creates a new instance of LayoutText.
LayoutText(AreaStyle style, java.lang.String text)
          Creates a new instance of LayoutText.
LayoutText(AreaStyle style, StyledText styledText)
          Creates a new instance of LayoutText.
 
Method Summary
 StyledText getStyledText()
          Getter for property styledText, the multi-style text content of this area.
 java.lang.String getText()
          Getter for property text, the raw text content of 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 setStyledText(StyledText styledText)
          Setter for property styledText, the multi-style text content of this area.
 void setText(java.lang.String text)
          Setter for property text, the raw text content of this area.
 java.lang.String toString()
          Converts the area object into String form.
 
Methods inherited from class org.writersforge.catalan.layout.LayoutArea
addChildren, addChildren, canBreakAt, getChildren, getChildren, getExtents, getHeight, getHint, getRenderableExtents, getStyle, getWidth, getX, getY, setChildren, setChildren, setExtents, setHeight, setHint, setWidth, setX, setY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LayoutText

public LayoutText(AreaStyle style)
Creates a new instance of LayoutText.

Parameters:
style - the style for this area

LayoutText

public LayoutText(AreaStyle style,
                  java.lang.String text)
Creates a new instance of LayoutText.

Parameters:
style - the style for this area
text - the text content for this area

LayoutText

public LayoutText(AreaStyle style,
                  StyledText styledText)
Creates a new instance of LayoutText.

Parameters:
style - the style for this area
styledText - the styled text content for this area
Method Detail

isRenderable

public boolean isRenderable()
Determines if this area has renderable content. Layout engines can use this to optimize area traversals. Areas which are not renderable should not expect to pass through to the Renderer.

Overrides:
isRenderable in class LayoutArea
Returns:
true if this area has visible content

getText

public java.lang.String getText()
Getter for property text, the raw text content of this area.

Returns:
Value of property text.

setText

public void setText(java.lang.String text)
Setter for property text, the raw text content of this area.

Parameters:
text - New value of property text.

getStyledText

public final StyledText getStyledText()
Getter for property styledText, the multi-style text content of this area.

Returns:
Value of property styledText.

setStyledText

public final void setStyledText(StyledText styledText)
Setter for property styledText, the multi-style text content of this area.

Parameters:
styledText - New value of property styledText.

isBreakable

public boolean isBreakable()
Getter for property breakable, whether the area can be split or not.

Overrides:
isBreakable in class LayoutArea
Returns:
Value of property breakable.

toString

public java.lang.String toString()
Converts the area object into String form.

Overrides:
toString in class LayoutArea
Returns:
a String representation of this object