public class PHtmlView extends PNode
PNode.PSceneGraphDelegate
Modifier and Type | Field and Description |
---|---|
static Font |
DEFAULT_FONT
Default font if not otherwise specified in the HTML text, 12 point
"SansSerif" . |
static Color |
DEFAULT_TEXT_COLOR
Default text color if not otherwise specified in the HTML text,
Color.BLACK . |
static int |
PROPERTY_CODE_FONT
The property code that identifies a change of this node's font (see
getFont ). |
static int |
PROPERTY_CODE_TEXT
The property code that identifies a change of this node's HTML text (see
getText ). |
static int |
PROPERTY_CODE_TEXT_COLOR
The property code that identifies a change of this node's HTML text color
(see
getTextColor ). |
static String |
PROPERTY_FONT
The property name that identifies a change of this node's font (see
getFont ). |
static String |
PROPERTY_TEXT
The property name that identifies a change of this node's HTML text (see
getText ). |
static String |
PROPERTY_TEXT_COLOR
The property name that identifies a change of this node's HTML text color
(see
getTextColor ). |
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
NO_SUCH_PAGE, PAGE_EXISTS
Constructor and Description |
---|
PHtmlView()
Create an empty HTML text node with the default font and text color.
|
PHtmlView(String text)
Create a HTML text node with the specified HTML text and the default font
and text color.
|
PHtmlView(String text,
Font font,
Color textColor)
Create a HTML text node with the specified HTML text, font, and text
color.
|
Modifier and Type | Method and Description |
---|---|
Font |
getFont()
Return the font for this HTML text node.
|
String |
getLinkAddressAt(double x,
double y)
Return the address specified in the HTML link at the specified x and y
coordinates in this node's local coordinate system, if any.
|
String |
getLinkAddressAt(Point2D point)
Return the address specified in the HTML link at the specified point in
this node's local coordinate system, if any.
|
String |
getText()
Return the HTML text for this HTML text node.
|
Color |
getTextColor()
Return the text color for this HTML text node.
|
protected void |
paint(PPaintContext paintContext)
Paint this node behind any of its children nodes.
|
boolean |
setBounds(double x,
double y,
double width,
double height)
Set the bounds of this node to the given position and size.
|
boolean |
setBounds(Rectangle2D newBounds)
Set the bounds of this node to the given value.
|
void |
setFont(Font font)
Set the font for this HTML text node to
font . |
void |
setText(String text)
Set the HTML text for this HTML text node to
text . |
void |
setTextColor(Color textColor)
Set the text color for this HTML text node to
textColor . |
addActivity, addAttribute, addChild, addChild, addChildren, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPaint, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientPropertyKeysEnumeration, 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, lower, lower, lowerBelow, lowerToBottom, lowerToBottom, offset, paintAfterChildren, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, pickAfterChildren, print, print, raise, raise, raiseAbove, raiseToTop, raiseToTop, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaintFrom, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, 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
public static final Font DEFAULT_FONT
"SansSerif"
.public static final Color DEFAULT_TEXT_COLOR
Color.BLACK
.public static final String PROPERTY_FONT
getFont
). Both old and new value will be set in any
property change event.public static final int PROPERTY_CODE_FONT
getFont
). Both old and new value will be set in any
property change event.public static final String PROPERTY_TEXT
getText
). Both old and new value will be set in any
property change event.public static final int PROPERTY_CODE_TEXT
getText
). Both old and new value will be set in any
property change event.public static final String PROPERTY_TEXT_COLOR
getTextColor
). Both old and new value will be set
in any property change event.public static final int PROPERTY_CODE_TEXT_COLOR
getTextColor
). Both old and new value will be set
in any property change event.public PHtmlView()
public PHtmlView(String text)
text
- HTML text for this HTML text nodepublic PHtmlView(String text, Font font, Color textColor)
text
- HTML text for this HTML text nodefont
- font for this HTML text nodetextColor
- text color for this HTML text nodepublic String getText()
public void setText(String text)
text
.
This is a bound property.
text
- HTML text for this HTML text nodepublic Font getFont()
DEFAULT_FONT
.public void setFont(Font font)
font
. This font is
used to render the HTML text if not otherwise specified via CSS.
This is a bound property.
font
- font for this HTML text nodepublic Color getTextColor()
DEFAULT_TEXT_COLOR
.public void setTextColor(Color textColor)
textColor
.
This text color is used to render the HTML text if not otherwise
specified via CSS.
This is a bound property.textColor
- text color for this HTML text nodepublic boolean setBounds(double x, double y, double width, double height)
public boolean setBounds(Rectangle2D newBounds)
protected void paint(PPaintContext paintContext)
The HTML text is painted last, so it will appear on top of any child nodes.
public String getLinkAddressAt(Point2D point)
point
- point in this node's local coordinate systemnull
if no
such HTML link existspublic String getLinkAddressAt(double x, double y)
x
- x coordinate in this node's local coordinate systemy
- y coordinate in this node's local coordinate systemnull
if no such HTML link existsCopyright © 1995-2013 Piccolo2D. All Rights Reserved.