|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.j3d.renderer.java3d.overlay.OverlayBase
org.j3d.renderer.java3d.overlay.LabelOverlay
An overlay that renders a text label.
The text alignment relative to the label may be controlled in both the horizontal and vertical alignment.
By default, the font is Helvetica, Plain, 14 point, and the text colour is white. Alignment of the text is set to the top-left of the overlay.
| Field Summary | |
static int |
BOTTOM_ALIGN
The value for the BOTTOM vertical alignment |
static int |
CENTER_ALIGN
The value for the CENTER horizontal and vertical alignments |
static int |
LEFT_ALIGN
The value for the LEFT horizontal alignment |
static int |
RIGHT_ALIGN
The value for the RIGHT horizontal alignment |
static int |
TOP_ALIGN
The value for the TOP vertical alignment |
| Fields inherited from class org.j3d.renderer.java3d.overlay.OverlayBase |
activeBuffer, backgroundColor, backgroundMode, bottomInset, canvas, componentSize, consoleBG, consoleTG, DEFAULT_INSET, DIRTY_ACTIVE_BUFFER, DIRTY_POSITION, DIRTY_SIZE, DIRTY_VISIBLE, fieldOfView, fixedSize, leftInset, overlayBounds, overlayTexGrp, rightInset, subOverlay, topInset |
| Fields inherited from interface org.j3d.renderer.java3d.overlay.Overlay |
BACKGROUND_COPY, BACKGROUND_NONE |
| Constructor Summary | |
LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size)
Create a new, simple label overlay that does not contain any text. |
|
LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
java.lang.String str)
Create a label overlay that displays the given text on the given screen space. |
|
LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
java.lang.String str,
java.awt.Font font,
java.awt.Color color,
int hAlign,
int vAlign)
Create a customised label overlay that uses the given attributes of font and colour styles. |
|
LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
java.lang.String str,
java.awt.Font font,
java.awt.Color color,
int hAlign,
int vAlign,
UpdateManager manager)
Create a customised label overlay that includes a specialised update manager to control when items are updated. |
|
| Method Summary | |
int |
getHorizontalAlignment()
Fetch the current horizontal alignment setting. |
int |
getVerticalAlignment()
Fetch the current vertical alignment setting. |
int |
getVisibleLength()
Get the number of characters that are rendered from the given string. |
void |
paint(java.awt.Graphics2D g)
Repaint the overlay now. |
void |
setColor(java.awt.Color c)
Change the rendering color of the text to be rendered. |
void |
setFont(java.awt.Font f)
Change the font used by the text to be rendered. |
void |
setHorizontalAlignment(int align)
Set the horizontal alignment of the text in this overlay. |
void |
setInsets(int left,
int top,
int right,
int bottom)
Set the insets for this overlay. |
void |
setText(java.lang.String str)
Set the text to the new string. |
void |
setVerticalAlignment(int align)
Set the vertical alignment of the text in this overlay. |
void |
setVisibleLength(int length)
Set the number of visible characters to the given size. |
| Methods inherited from class org.j3d.renderer.java3d.overlay.OverlayBase |
componentHidden, componentMoved, componentResized, componentShown, contains, dirty, getBackgroundImage, getBounds, getGraphics, getRoot, getUpdateManager, initialize, isAntialiased, isVisible, repaint, setActiveBuffer, setAntialiased, setBackgroundColor, setBackgroundImage, setBackgroundMode, setComponentDetails, setInsets, setLocation, setSize, setUpdateManager, setVisible, update, updateBuffer |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int LEFT_ALIGN
public static final int RIGHT_ALIGN
public static final int CENTER_ALIGN
public static final int TOP_ALIGN
public static final int BOTTOM_ALIGN
| Constructor Detail |
public LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size)
canvas - The canvas for this overlay to live onsize - The size of the overlay in pixels
public LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
java.lang.String str)
canvas - The canvas for this overlay to live onsize - The size of the overlay in pixelsstr - The string to render or null
public LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
java.lang.String str,
java.awt.Font font,
java.awt.Color color,
int hAlign,
int vAlign)
canvas - The canvas for this overlay to live onsize - The size of the overlay in pixelsstr - The string to render or nullfont - The font to usecolor - the color to render the text inhAlign - The horizontal alignment (LEFT, RIGHT, CENTER)vAlign - The vertical alignment (TOP, BOTTOM, CENTER)
IllegalArguementException - The alignment value given is
not valid.
public LabelOverlay(javax.media.j3d.Canvas3D canvas,
java.awt.Dimension size,
java.lang.String str,
java.awt.Font font,
java.awt.Color color,
int hAlign,
int vAlign,
UpdateManager manager)
canvas - The canvas for this overlay to live onsize - The size of the overlay in pixelsstr - The string to render or nullfont - The font to usecolor - the color to render the text inhAlign - The horizontal alignment (LEFT, RIGHT, CENTER)vAlign - The vertical alignment (TOP, BOTTOM, CENTER)manager - The manger to use to control updates
IllegalArguementException - The alignment value given is
not valid.| Method Detail |
public void paint(java.awt.Graphics2D g)
paint in class OverlayBaseg - The graphics context to paint with
public void setInsets(int left,
int top,
int right,
int bottom)
setInsets in class OverlayBasepublic void setVerticalAlignment(int align)
align - One of TOP, BOTTOM, CENTER
IllegalArguementException - The alignment value given is
not valid.public int getVerticalAlignment()
public void setHorizontalAlignment(int align)
align - One of LEFT, RIGHT, CENTER
IllegalArguementException - The alignment value given is
not valid.public int getHorizontalAlignment()
public void setColor(java.awt.Color c)
c - The new colour to usepublic void setFont(java.awt.Font f)
f - The new font to usepublic void setText(java.lang.String str)
str - The new string to usepublic int getVisibleLength()
public void setVisibleLength(int length)
length - The number of characters to be shown
|
j3d.org Code | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||