|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectComponent3D
edu.cmu.sun.components.TextComponent
public class TextComponent
TextComponent is a Component3D that displays a simple string at a specified size and weight (boldness). This is a wraper class for the extremely hacked Text2DView class. Unlike most components used in this application, this Class registers along the baseline of the font. It is useful to have text as a Component because it's attributes can be changed after it is created.
| Field Summary | |
|---|---|
(package private) boolean |
bold
Whether the string should be rendered in a bold font. |
(package private) static int |
DEFAULT_QUALITY
The default quality of the text to be rendered. |
static float |
DEFAULT_SIZE
The default size of the text to be rendered. |
(package private) float |
size
The size of the font to be rendered. |
(package private) java.lang.String |
string
The string to rendered. |
(package private) Text2DView |
textView
The Shape3D object that is actuially responsible for the rendering of the text. |
| Constructor Summary | |
|---|---|
TextComponent(java.lang.String string)
Create a text component at the default size, quality, and weight. |
|
TextComponent(java.lang.String string,
boolean bold)
|
|
TextComponent(java.lang.String string,
float size)
Render text at a specified size. |
|
| Method Summary | |
|---|---|
float |
getHeight()
The height of the resulting text component |
float |
getWidth()
The width of the resulting text component |
boolean |
isBold()
|
void |
setBold(boolean bold)
Allows user to change this Component to render text in a bold font. |
private void |
update()
Internal method for updating the state of the component. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int DEFAULT_QUALITY
Text2DView,
Constant Field Valuespublic static final float DEFAULT_SIZE
java.lang.String string
boolean bold
float size
Text2DView textView
| Constructor Detail |
|---|
public TextComponent(java.lang.String string)
string -
public TextComponent(java.lang.String string,
float size)
string - Text to be renderedsize - specified size (in meters?)Text2DView
public TextComponent(java.lang.String string,
boolean bold)
| Method Detail |
|---|
private void update()
public float getWidth()
public float getHeight()
public boolean isBold()
public void setBold(boolean bold)
bold - True if font is to be drawn in a bold font, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||