|
||||||||||
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.piccolox.nodes.PStyledText
public class PStyledText
Nested Class Summary | |
---|---|
protected static class |
PStyledText.LineInfo
The info for rendering a and computing the bounds of a line |
protected static class |
PStyledText.MetricsRunInfo
Class to represent an integer run and the font in that run |
protected static class |
PStyledText.RunInfo
Simple class to represent an integer run |
protected static class |
PStyledText.SegmentInfo
|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
PNode.PSceneGraphDelegate |
Field Summary | |
---|---|
protected boolean |
constrainHeightToTextHeight
|
protected boolean |
constrainWidthToTextWidth
|
protected javax.swing.text.Document |
document
|
protected boolean |
editing
|
protected java.awt.Insets |
insets
|
protected PStyledText.LineInfo[] |
lines
|
protected static java.awt.geom.Line2D |
paintLine
|
protected java.util.ArrayList |
stringContents
|
protected static java.awt.font.FontRenderContext |
SWING_FRC
|
Fields inherited from interface java.awt.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Constructor Summary | |
---|---|
PStyledText()
Constructor for PStyledText. |
Method Summary | |
---|---|
void |
fullPaint(PPaintContext paintContext)
Paint this node and all of its descendents. |
boolean |
getConstrainHeightToTextHeight()
Controls whether this node changes its height to fit the height of its text. |
boolean |
getConstrainWidthToTextWidth()
Controls whether this node changes its width to fit the width of its text. |
javax.swing.text.Document |
getDocument()
Get the document for this PStyledText |
double |
getInitialFontHeight()
Get the height of the font at the beginning of the document |
java.awt.Insets |
getInsets()
Get the insets of the text |
boolean |
isEditing()
Is this document editing |
protected void |
paint(PPaintContext paintContext)
Paint this node behind any of its children nodes. |
void |
recomputeLayout()
Compute the bounds of the text wrapped by this node. |
boolean |
setBounds(double x,
double y,
double w,
double h)
Add a call to recompute the layout after each bounds change |
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 |
setDocument(javax.swing.text.Document document)
Set the document on this PStyledText |
void |
setEditing(boolean editing)
Set whether this text is editing |
void |
setInsets(java.awt.Insets insets)
Set the insets of the text |
void |
syncWithDocument()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.awt.font.FontRenderContext SWING_FRC
protected static java.awt.geom.Line2D paintLine
protected javax.swing.text.Document document
protected transient java.util.ArrayList stringContents
protected transient PStyledText.LineInfo[] lines
protected boolean editing
protected java.awt.Insets insets
protected boolean constrainHeightToTextHeight
protected boolean constrainWidthToTextWidth
Constructor Detail |
---|
public PStyledText()
Method Detail |
---|
public void setConstrainWidthToTextWidth(boolean constrainWidthToTextWidth)
public void setConstrainHeightToTextHeight(boolean constrainHeightToTextHeight)
public boolean getConstrainWidthToTextWidth()
public boolean getConstrainHeightToTextHeight()
public javax.swing.text.Document getDocument()
public void setDocument(javax.swing.text.Document document)
public void syncWithDocument()
public void recomputeLayout()
public double getInitialFontHeight()
protected void paint(PPaintContext paintContext)
PNode
paint
in class PNode
paintContext
- the paint context to use for painting the nodepublic void fullPaint(PPaintContext paintContext)
PNode
paint
or
paintAfterChildren
instead.
fullPaint
in class PNode
paintContext
- the paint context to use for painting this node and its childrenpublic void setEditing(boolean editing)
public boolean isEditing()
public void setInsets(java.awt.Insets insets)
public java.awt.Insets getInsets()
public boolean setBounds(double x, double y, double w, double h)
setBounds
in class PNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |