|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolo.PNode
edu.umd.cs.piccolo.nodes.PText
PText is a multi-line text node. The text will flow to base on the width of the node's bounds.
Field Summary | |
static java.awt.Font |
DEFAULT_FONT
|
static double |
DEFAULT_GREEK_THRESHOLD
|
protected double |
greekThreshold
|
static java.lang.String |
PROPERTY_FONT
The property name that identifies a change of this node's font (see getFont ). |
static java.lang.String |
PROPERTY_TEXT
The property name that identifies a change of this node's text (see getText ). |
Fields inherited from class edu.umd.cs.piccolo.PNode |
PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE |
Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
PText()
|
|
PText(java.lang.String aText)
|
Method Summary | |
protected java.awt.font.TextLayout |
computeNextLayout(java.awt.font.LineBreakMeasurer measurer,
float availibleWidth,
int nextLineBreakOffset)
|
java.awt.Font |
getFont()
Returns the font of this PText. |
double |
getGreekThreshold()
Returns the current greek threshold. |
float |
getJustification()
Return the justificaiton of the text in the bounds. |
java.lang.String |
getText()
|
java.awt.Paint |
getTextPaint()
Get the paint used to paint this nodes text. |
protected void |
internalUpdateBounds(double x,
double y,
double width,
double height)
Gives nodes a chance to update their internal structure before bounds changed notifications are sent. |
boolean |
isConstrainHeightToTextHeight()
|
boolean |
isConstrainWidthToTextWidth()
|
protected void |
paint(PPaintContext paintContext)
Paint this node behind any of its children nodes. |
protected java.lang.String |
paramString()
Returns a string representing the state of this node. |
void |
recomputeLayout()
Compute the bounds of the text wrapped by this node. |
void |
setConstrainHeightToTextHeight(boolean constrainHeightToTextHeight)
Controls whether this node changes its height to fit the height of its text. |
void |
setConstrainWidthToTextWidth(boolean constrainWidthToTextWidth)
Controls whether this node changes its width to fit the width of its text. |
void |
setFont(java.awt.Font aFont)
Set the font of this PText. |
void |
setGreekThreshold(double threshold)
Sets the current greek threshold. |
void |
setJustification(float just)
Sets the justificaiton of the text in the bounds. |
void |
setText(java.lang.String aText)
Set the text for this node. |
void |
setTextPaint(java.awt.Paint textPaint)
Set the paint used to paint this node's text background. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTY_TEXT
getText
). Both old and new value will be set in any
property change event.
public static final java.lang.String PROPERTY_FONT
getFont
). Both old and new value will be set in any
property change event.
public static java.awt.Font DEFAULT_FONT
public static double DEFAULT_GREEK_THRESHOLD
protected double greekThreshold
Constructor Detail |
public PText()
public PText(java.lang.String aText)
Method Detail |
public float getJustification()
public void setJustification(float just)
just
- public java.awt.Paint getTextPaint()
public void setTextPaint(java.awt.Paint textPaint)
textPaint
- public boolean isConstrainWidthToTextWidth()
public void setConstrainWidthToTextWidth(boolean constrainWidthToTextWidth)
public boolean isConstrainHeightToTextHeight()
public void setConstrainHeightToTextHeight(boolean constrainHeightToTextHeight)
public double getGreekThreshold()
public void setGreekThreshold(double threshold)
threshold
- minimum screen font size.public java.lang.String getText()
public void setText(java.lang.String aText)
public java.awt.Font getFont()
public void setFont(java.awt.Font aFont)
public void recomputeLayout()
protected java.awt.font.TextLayout computeNextLayout(java.awt.font.LineBreakMeasurer measurer, float availibleWidth, int nextLineBreakOffset)
protected void paint(PPaintContext paintContext)
PNode
paint
in class PNode
paintContext
- the paint context to use for painting the nodeprotected void internalUpdateBounds(double x, double y, double width, double height)
PNode
internalUpdateBounds
in class PNode
protected java.lang.String paramString()
null
.
paramString
in class PNode
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |