public abstract class TextComponentBase extends RenderableComponentBase
Modifier and Type | Class and Description |
---|---|
static class |
TextComponentBase.HorizontalAlignment |
static class |
TextComponentBase.VerticalAlignment |
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static java.awt.Font |
defaultFont |
static java.lang.String |
defaultFontName |
static int |
defaultFontSize |
static TextComponentBase.HorizontalAlignment |
defaultHAlignment |
static double |
defaultTextSize |
static TextComponentBase.VerticalAlignment |
defaultVAlignment |
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
TextComponentBase() |
Modifier and Type | Method and Description |
---|---|
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
java.awt.Font |
getFont() |
TextComponentBase.HorizontalAlignment |
getHorizontalAlignment()
Gets the horizontal alignment
|
double |
getTextSize()
Gets the size of the text
|
TextComponentBase.VerticalAlignment |
getVerticalAlignment()
Gets the vertical alignment
|
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 |
setFont(java.awt.Font font)
Explicitly set the font for this text component
|
void |
setHorizontalAlignment(TextComponentBase.HorizontalAlignment hAlignment)
Sets the horizontal alignment, one of
LEFT, CENTRE, RIGHT |
void |
setTextColor(java.awt.Color c) |
void |
setTextSize(double size)
Sets the size of the text
|
void |
setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
Sets the vertical alignment, one of
TOP, CENTRE, BOTTOM |
copy, defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isVisible, prerender, render, 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 java.lang.String defaultFontName
public static java.awt.Font defaultFont
public static TextComponentBase.HorizontalAlignment defaultHAlignment
public static TextComponentBase.VerticalAlignment defaultVAlignment
public static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class RenderableComponentBase
public java.awt.Font getFont()
public void setFont(java.awt.Font font)
font
- the base font. The font size affects the
resolution of the displayed text. It should be at least 32pt.public void setTextSize(double size)
public double getTextSize()
public TextComponentBase.HorizontalAlignment getHorizontalAlignment()
public void setHorizontalAlignment(TextComponentBase.HorizontalAlignment hAlignment)
LEFT, CENTRE, RIGHT
public TextComponentBase.VerticalAlignment getVerticalAlignment()
public void setVerticalAlignment(TextComponentBase.VerticalAlignment vAlignment)
TOP, CENTRE, BOTTOM
public RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class RenderableComponentBase
public boolean isSelectable()
RenderableComponentBase
isSelectable
in interface IsSelectable
isSelectable
in class RenderableComponentBase
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 RenderableComponentBase
public void setTextColor(java.awt.Color c)