|
||||||||||
| 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 and computing the bounds of a line. |
protected static class |
PStyledText.RunInfo
Simple class to represent an range within the document. |
protected static class |
PStyledText.SegmentInfo
Encapsulates information about a particular LineSegment. |
| Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
|---|
PNode.PSceneGraphDelegate |
| Field Summary | |
|---|---|
protected boolean |
constrainHeightToTextHeight
Whether width will be forced to match containing text's height. |
protected boolean |
constrainWidthToTextWidth
Whether width will be forced to match containing text's width. |
protected Document |
document
Underlying document used to handle the complexities involved with arbitrary text and formatting. |
protected boolean |
editing
Whether this node is currently being edited. |
protected Insets |
insets
Insets represent how far away from the bounding box text will be drawn. |
protected PStyledText.LineInfo[] |
lines
Tracks the information about line metrics within the document. |
protected static Line2D |
paintLine
Used while painting underlines. |
protected ArrayList |
stringContents
String contents of the document. |
protected static FontRenderContext |
SWING_FRC
Font rendering context used for all PStyledText instances. |
| Fields inherited from interface java.awt.print.Printable |
|---|
NO_SUCH_PAGE, PAGE_EXISTS |
| Constructor Summary | |
|---|---|
PStyledText()
Constructs an empty PStyledText element. |
|
| Method Summary | |
|---|---|
void |
fullPaint(PPaintContext paintContext)
Paint this node and all of its descendants. |
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. |
Document |
getDocument()
Get the document for this PStyledText. |
double |
getInitialFontHeight()
Get the height of the font at the beginning of the document. |
Insets |
getInsets()
Get the insets of the text. |
boolean |
isEditing()
Whether node is currently in editing state. |
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 width,
double height)
Set the bounds of this node to the given position and size. |
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(Document document)
Set the document on this PStyledText. |
void |
setEditing(boolean editing)
Set whether this node is current in editing mode. |
void |
setInsets(Insets insets)
Set the insets of the text. |
void |
syncWithDocument()
Enforce that the current display matches the styling of the underlying document as closely as possible. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static FontRenderContext SWING_FRC
protected static Line2D paintLine
protected Document document
protected transient ArrayList stringContents
protected transient PStyledText.LineInfo[] lines
protected boolean editing
protected Insets insets
protected boolean constrainHeightToTextHeight
protected boolean constrainWidthToTextWidth
| Constructor Detail |
|---|
public PStyledText()
| Method Detail |
|---|
public void setConstrainWidthToTextWidth(boolean constrainWidthToTextWidth)
constrainWidthToTextWidth - whether node's width should be
constrained to the width of its textpublic void setConstrainHeightToTextHeight(boolean constrainHeightToTextHeight)
constrainHeightToTextHeight - whether node's height should be
constrained to the height of its textpublic boolean getConstrainWidthToTextWidth()
public boolean getConstrainHeightToTextHeight()
public Document getDocument()
public void setDocument(Document document)
document - to be used as the model for this PStyledTextpublic void syncWithDocument()
public void recomputeLayout()
public double getInitialFontHeight()
protected void paint(PPaintContext paintContext)
paint in class PNodepaintContext - the paint context to use for painting the nodepublic void fullPaint(PPaintContext paintContext)
paint or
paintAfterChildren instead.
fullPaint in class PNodepaintContext - the paint context to use for painting this node and
its childrenpublic void setEditing(boolean editing)
editing - value to set editing flagpublic boolean isEditing()
public void setInsets(Insets insets)
insets - desired insetspublic Insets getInsets()
public boolean setBounds(double x,
double y,
double width,
double height)
setBounds in class PNodex - x position of boundsy - y position of boundswidth - width to apply to the boundsheight - height to apply to the bounds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||