org.jcae.viewer3d
Class RasterTextLabel

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Leaf
              extended by javax.media.j3d.Shape3D
                  extended by org.jcae.viewer3d.RasterTextLabel

public class RasterTextLabel
extends javax.media.j3d.Shape3D

A text label for labelling objects on screen that uses a Java 3D Raster to produce the overlay effect.

If the label text is null, then no label will be displayed. All of the setup will be done, but no raster will be created.

The current implementation does not allow updating the text or colors


Field Summary
 
Fields inherited from class javax.media.j3d.Shape3D
ALLOW_APPEARANCE_OVERRIDE_READ, ALLOW_APPEARANCE_OVERRIDE_WRITE, ALLOW_APPEARANCE_READ, ALLOW_APPEARANCE_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE, ALLOW_GEOMETRY_READ, ALLOW_GEOMETRY_WRITE
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
RasterTextLabel()
          Create a new blank label with no text.
RasterTextLabel(java.lang.String label, java.awt.Color col)
          Create a new blank label with the given text located at the origin.
RasterTextLabel(java.lang.String label, java.awt.Color col, float x, float y, float z)
          Create a new blank label with the given text located at a specific point in 3D world coordinates.
RasterTextLabel(java.lang.String label, java.awt.Color col, float x, float y, float z, java.awt.Color border, java.awt.Font font)
          Create a new blank label with the given text located at a specific point in 3D world coordinates and an option to show a border and selected font.
 
Method Summary
 void fixSize(boolean fixed)
          Set the condition of whether the implementation should resize the canvas after each new label is set or just stick to a fixed size canvas.
 void setLabel(java.lang.String label)
          Set the label string that is to be rendered.
 void setLabel(java.lang.String label, java.awt.Color col)
          Set the label string that is to be rendered and changes the color to the new value.
 
Methods inherited from class javax.media.j3d.Shape3D
addGeometry, cloneNode, duplicateNode, getAllGeometries, getAppearance, getAppearanceOverrideEnable, getBounds, getCollisionBounds, getGeometry, getGeometry, indexOfGeometry, insertGeometry, intersect, intersect, intersect, numGeometries, removeAllGeometries, removeGeometry, removeGeometry, setAppearance, setAppearanceOverrideEnable, setCollisionBounds, setGeometry, setGeometry
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RasterTextLabel

public RasterTextLabel()
Create a new blank label with no text. It is located at the origin.


RasterTextLabel

public RasterTextLabel(java.lang.String label,
                       java.awt.Color col)
Create a new blank label with the given text located at the origin. If the text color is not specified, white is used.

Parameters:
label - The string to use on the label
col - The text color to be drawn in

RasterTextLabel

public RasterTextLabel(java.lang.String label,
                       java.awt.Color col,
                       float x,
                       float y,
                       float z)
Create a new blank label with the given text located at a specific point in 3D world coordinates.

Parameters:
label - The string to use on the label
col - The text color to be drawn in
x - The x world coordinate to place the label
y - The y world coordinate to place the label
z - The z world coordinate to place the label

RasterTextLabel

public RasterTextLabel(java.lang.String label,
                       java.awt.Color col,
                       float x,
                       float y,
                       float z,
                       java.awt.Color border,
                       java.awt.Font font)
Create a new blank label with the given text located at a specific point in 3D world coordinates and an option to show a border and selected font. If the border color is specified, it will show a 1 pixel wide border in that color. If no font is defined, the system default font will be used.

Parameters:
label - The string to use on the label
col - The text color to be drawn in
x - The x world coordinate to place the label
y - The y world coordinate to place the label
z - The z world coordinate to place the label
border - The color to use for the border or null for none
font - The font to draw the string in or null for default
Method Detail

setLabel

public void setLabel(java.lang.String label)
Set the label string that is to be rendered. This maintains the current text color.

Parameters:
label - to be used

setLabel

public void setLabel(java.lang.String label,
                     java.awt.Color col)
Set the label string that is to be rendered and changes the color to the new value.

Parameters:
label - to be used
col - The new color to be used or null for the default

fixSize

public void fixSize(boolean fixed)
Set the condition of whether the implementation should resize the canvas after each new label is set or just stick to a fixed size canvas. A fixed size label is useful when you are making fast updates such as a counter. When this is called, the label will not be resized from it's current dimensions.

Parameters:
fixed - true if the label size should remain fixed