|
||||||||||
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
|
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode |
---|
edu.umd.cs.piccolo.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 javax.swing.text.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 java.awt.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 java.awt.geom.Line2D |
paintLine
Used while painting underlines. |
protected java.util.ArrayList |
stringContents
String contents of the document. |
protected static java.awt.font.FontRenderContext |
SWING_FRC
|
Fields inherited from class edu.umd.cs.piccolo.PNode |
---|
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE |
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(edu.umd.cs.piccolo.util.PPaintContext paintContext)
|
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()
Whether node is currently in editing state. |
protected void |
paint(edu.umd.cs.piccolo.util.PPaintContext paintContext)
|
void |
recomputeLayout()
Compute the bounds of the text wrapped by this node. |
boolean |
setBounds(double x,
double y,
double width,
double height)
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()
Ensures that the current display matches the styling of the underlying document as closely as possible. |
Methods inherited from class edu.umd.cs.piccolo.PNode |
---|
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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(edu.umd.cs.piccolo.util.PPaintContext paintContext)
paint
in class edu.umd.cs.piccolo.PNode
public void fullPaint(edu.umd.cs.piccolo.util.PPaintContext paintContext)
fullPaint
in class edu.umd.cs.piccolo.PNode
public void setEditing(boolean editing)
editing
- value to set editing flagpublic boolean isEditing()
public void setInsets(java.awt.Insets insets)
insets
- desired insetspublic java.awt.Insets getInsets()
public boolean setBounds(double x, double y, double width, double height)
setBounds
in class edu.umd.cs.piccolo.PNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |