public class TextComponent2d extends TextComponentBase
TextComponentBase.HorizontalAlignment, TextComponentBase.VerticalAlignment
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static int |
defaultFontSize |
static Point2d |
defaultPos |
static double |
defaultTextSize |
static PropertyList |
myProps |
defaultFont, defaultFontName, defaultHAlignment, defaultVAlignment
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
TextComponent2d() |
TextComponent2d(java.lang.String str)
Sets both name and text to the provided string
|
TextComponent2d(java.lang.String text,
Point2d pos)
Sets both name (if valid) and text to provided string.
|
TextComponent2d(java.lang.String name,
java.lang.String text,
Point2d pos)
Main constructor, setting name, text and screen position;
|
Modifier and Type | Method and Description |
---|---|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
Point2d |
getPosition()
Returns position by reference
|
int |
getRenderHints()
Returns a bit code giving rendering hints about this renderable.
|
double |
getRotation()
Gets the text angle
|
java.lang.String |
getText() |
boolean |
isSelectable()
Returns true if this object is in fact selectable.
|
int |
numSelectionQueriesNeeded()
If this selectable manages its own selection (by issuing selection
queries within its
render method), then this method should
return the maximum number of selection queries that will be
required. |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
void |
setPosition(Point2d pos)
Sets world position to display text.
|
void |
setRotation(double deg)
Sets the text angle, in degrees
|
void |
setText(java.lang.String text)
Sets the text to display
|
createRenderProps, getFont, getHorizontalAlignment, getTextSize, getVerticalAlignment, setFont, setHorizontalAlignment, setTextColor, setTextSize, setVerticalAlignment
copy, defaultRenderPropsAreNull, getRenderProps, getSelection, isVisible, prerender, setRenderProps, setVisible, updateBounds, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
public static int defaultFontSize
public static double defaultTextSize
public static Point2d defaultPos
public static PropertyList myProps
public TextComponent2d()
public TextComponent2d(java.lang.String str)
str
- name and text stringpublic TextComponent2d(java.lang.String text, Point2d pos)
public TextComponent2d(java.lang.String name, java.lang.String text, Point2d pos)
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class TextComponentBase
public void setText(java.lang.String text)
public java.lang.String getText()
public void setPosition(Point2d pos)
public Point2d getPosition()
public double getRotation()
public void setRotation(double deg)
public int getRenderHints()
IsRenderable
TRANSPARENT
and
TWO_DIMENSIONAL
.getRenderHints
in interface IsRenderable
getRenderHints
in class RenderableComponentBase
public void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class RenderableComponentBase
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.public boolean isSelectable()
RenderableComponentBase
isSelectable
in interface IsSelectable
isSelectable
in class TextComponentBase
public int numSelectionQueriesNeeded()
IsSelectable
render
method), then this method should
return the maximum number of selection queries that will be
required. Otherwise, this method should return -1.numSelectionQueriesNeeded
in interface IsSelectable
numSelectionQueriesNeeded
in class TextComponentBase