|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartisynth.core.modelbase.ModelComponentBase
artisynth.core.modelbase.RenderableComponentBase
artisynth.core.renderables.TextComponentBase
artisynth.core.renderables.TextComponent2d
public class TextComponent2d
Allows adding 2D text to a root model
Nested Class Summary |
---|
Nested classes/interfaces inherited from class artisynth.core.renderables.TextComponentBase |
---|
TextComponentBase.FontStyle, TextComponentBase.HorizontalAlignment, TextComponentBase.VerticalAlignment |
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent |
---|
ModelComponent.NavpanelVisibility |
Field Summary | |
---|---|
static int |
defaultFontSize
|
static Point2d |
defaultNormPos
|
static Point2d |
defaultPos
|
static double |
defaultTextSize
|
static PropertyList |
myProps
|
Fields inherited from class artisynth.core.renderables.TextComponentBase |
---|
defaultFontName, defaultHAlignment, defaultVAlignment |
Fields inherited from class artisynth.core.modelbase.ModelComponentBase |
---|
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames |
Fields inherited from interface maspack.render.GLRenderable |
---|
TRANSLUCENT, TWO_DIMENSIONAL |
Constructor Summary | |
---|---|
TextComponent2d(java.lang.String name)
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 (pixel) position. |
Method Summary | |
---|---|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by this object. |
Point2d |
getNormalizedPosition()
Returns normalized position by reference |
Point2d |
getPositionOverride()
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(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL. |
void |
setNormalizedPosition(Point2d pos)
Sets normalized position to display text, (x,y) in [0,1]x[0,1] |
void |
setPositionOverride(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 |
Methods inherited from class artisynth.core.renderables.TextComponentBase |
---|
createDefaultRenderProps, createRenderProps, dispose, getFontFamily, getFontSize, getFontStyle, getHorizontalAlignment, getTextSize, getVerticalAlignment, setFont, setFontFamily, setFontSize, setFontStyle, setHorizontalAlignment, setTextColor, setTextRenderer, setTextSize, setVerticalAlignment |
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase |
---|
copy, getRenderProps, getSelection, prerender, setRenderProps, updateBounds, updateRenderProps |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface artisynth.core.modelbase.ModelComponent |
---|
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences |
Methods inherited from interface maspack.properties.HasProperties |
---|
getProperty |
Methods inherited from interface maspack.properties.HierarchyNode |
---|
getChildren, hasChildren |
Methods inherited from interface maspack.util.Scannable |
---|
isWritable, write |
Field Detail |
---|
public static int defaultFontSize
public static double defaultTextSize
public static Point2d defaultPos
public static Point2d defaultNormPos
public static PropertyList myProps
Constructor Detail |
---|
public TextComponent2d(java.lang.String name)
name
- public TextComponent2d(java.lang.String text, Point2d pos)
setPositionOverride(Point2d)
.
public TextComponent2d(java.lang.String name, java.lang.String text, Point2d pos)
setPositionOverride(Point2d)
.
Method Detail |
---|
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 setPositionOverride(Point2d pos)
public void setNormalizedPosition(Point2d pos)
public Point2d getPositionOverride()
public Point2d getNormalizedPosition()
public double getRotation()
public void setRotation(double deg)
public int getRenderHints()
GLRenderable
TRANSLUCENT
.
getRenderHints
in interface GLRenderable
getRenderHints
in class RenderableComponentBase
public void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
render
in class RenderableComponentBase
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.public boolean isSelectable()
RenderableComponentBase
isSelectable
in interface GLSelectable
isSelectable
in class TextComponentBase
public int numSelectionQueriesNeeded()
GLSelectable
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 GLSelectable
numSelectionQueriesNeeded
in class TextComponentBase
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |