public class LabelJ3D extends Object implements ScreenAnnotation
Constructor and Description |
---|
LabelJ3D(String text)
It constructs a LabelJ3D with the given text at the
origin, coloured white, left justified, horizontally aligned
with no character rotation.
|
LabelJ3D(String text,
int xLocation,
int yLocation)
It constructs a LabelJ3D with the given text at the
specified location, coloured white, left justified,
horizontally aligned with no character rotation.
|
LabelJ3D(String text,
int xLocation,
int yLocation,
float[] colour,
Font font,
HersheyFont hfont,
double zValue,
double fontSizeInPixels,
boolean filled,
double thickness,
double orientation,
TextControl.Justification horizontalJustification,
TextControl.Justification verticalJustification,
double charRotation)
Constructor for LabelJ3D.
|
LabelJ3D(String text,
int xLocation,
int yLocation,
float[] colour,
Font font,
HersheyFont hfont,
double zValue,
double fontSizeInPixels,
boolean filled,
double thickness,
TextControl.Justification horizontalJustification,
TextControl.Justification verticalJustification)
Constructor for a filled or unfilled font.
|
LabelJ3D(String text,
int xLocation,
int yLocation,
float[] colour,
Font font,
HersheyFont hfont,
double zValue,
double fontSizeInPixels,
TextControl.Justification horizontalJustification,
TextControl.Justification verticalJustification)
Constructor for a filled font.
|
Modifier and Type | Method and Description |
---|---|
void |
setCharRotation(double charRotation)
Set the amount each character is rotated.
|
void |
setColour(float[] colour)
Set the colour used for the text.
|
void |
setFilled(boolean filled)
Set the flag to control whether the text is filled or not.
|
void |
setFont(Font font)
Set the font to use for the text.
|
void |
setFontSize(double fontSizeInPixels)
Set the font size in pixels.
|
void |
setHersheyFont(HersheyFont hfont)
Set the Hershey font to use for the text.
|
void |
setHorizontalJustification(TextControl.Justification justification)
Set the horizontal justification of the text.
|
void |
setLocation(int xLocation,
int yLocation)
Set the position on the screen at which the text is rendered.
|
void |
setOrientation(double orientation)
Set the orientation of the text (in degrees).
|
void |
setText(String text)
Set the text to render.
|
void |
setThickness(double thickness)
Set the line thickness for rendering the font.
|
void |
setVerticalJustification(TextControl.Justification justification)
Set the vertical justification of the text.
|
void |
setZValue(double zValue)
Set the virtual world z value.
|
Object |
toDrawable(DisplayImpl display)
Make the LabelJ3D into a
Shape3D . |
public LabelJ3D(String text)
text
- text of the LabelJ3D.public LabelJ3D(String text, int xLocation, int yLocation)
text
- text of the LabelJ3D.xLocation
- x position in screen coordinates.yLocation
- y position in screen coordinates.public LabelJ3D(String text, int xLocation, int yLocation, float[] colour, Font font, HersheyFont hfont, double zValue, double fontSizeInPixels, TextControl.Justification horizontalJustification, TextControl.Justification verticalJustification)
text
- text of the LabelJ3D.xLocation
- x position in screen coordinates.yLocation
- y position in screen coordinates.colour
- red green blue triple; each value in [0.0, 1.0].font
- Font
to use.hfont
- Hershey font to use; if both fonts are null
then use the default VisAD line font.zValue
- Virtual world value; larger z is in front.fontSizeInPixels
- font size; by default characters
are 12 pixels in size.horizontalJustification
- one of verticalJustification
- one of public LabelJ3D(String text, int xLocation, int yLocation, float[] colour, Font font, HersheyFont hfont, double zValue, double fontSizeInPixels, boolean filled, double thickness, TextControl.Justification horizontalJustification, TextControl.Justification verticalJustification)
text
- text of the LabelJ3D.xLocation
- x position in screen coordinates.yLocation
- y position in screen coordinates.colour
- red green blue triple; each value in [0.0, 1.0].font
- java.awt.Font to use.hfont
- Hershey font to use; if both fonts are null
then use the default VisAD line font.zValue
- Virtual world value; larger z is in front.fontSizeInPixels
- font size; by default characters
are 12 pixels in size.filled
- if true
the font is rendered as filled,
if false
just the triangles are drawn.thickness
- line width to use if just drawing triangles;
usually 1.0 is the most useful.horizontalJustification
- one of verticalJustification
- one of public LabelJ3D(String text, int xLocation, int yLocation, float[] colour, Font font, HersheyFont hfont, double zValue, double fontSizeInPixels, boolean filled, double thickness, double orientation, TextControl.Justification horizontalJustification, TextControl.Justification verticalJustification, double charRotation)
Font
if it
is not null, otherwise it will use the Hershey font. If both are
null it will use the VisAD line font.text
- text of the LabelJ3D.xLocation
- x position in screen coordinates.yLocation
- y position in screen coordinates.colour
- red green blue triple; each value in [0.0, 1.0].font
- Font
to use.hfont
- Hershey font to use; if both fonts are null
then use the default VisAD line font.zValue
- Virtual world value; larger z is in front.fontSizeInPixels
- font size; by default characters
are 12 pixels in size.filled
- if true
the font is rendered as filled,
if false
just the triangles are drawn.thickness
- line width to use if just drawing triangles;
usually 1.0 is the most useful.orientation
- anticlockwise from x-axis in degrees.horizontalJustification
- one of verticalJustification
- one of charRotation
- rotate each character
charRotation
degrees clockwise
from base line.public void setText(String text)
text
- text of the LabelJ3D.public void setLocation(int xLocation, int yLocation)
xLocation
- x position in screen coordinates.yLocation
- y position in screen coordinates.public void setColour(float[] colour)
colour
- red green blue triple; each value in [0.0, 1.0].public void setFont(Font font)
font
- Font
to use.public void setHersheyFont(HersheyFont hfont)
hfont
- Hershey font to use; any java.awt.Font is ignored.public void setZValue(double zValue)
zValue
- Virtual world value; larger z is in front.public void setFontSize(double fontSizeInPixels)
fontSizeInPixels
- font size; by default characters
are 12 pixels in size.public void setThickness(double thickness)
thickness
- line width to use if just drawing triangles;
usually 1.0 is the most useful.public void setFilled(boolean filled)
filled
- if true
the font is rendered as filled,
if false
just the triangles are drawn.public void setOrientation(double orientation)
orientation
- anticlockwise from x-axis in degrees.public void setHorizontalJustification(TextControl.Justification justification)
justification
- one of TextControl.Justification.LEFT
TextControl.Justification.CENTER
TextControl.Justification.RIGHTpublic void setVerticalJustification(TextControl.Justification justification)
justification
- one of TextControl.Justification.BOTTOM
TextControl.Justification.CENTER
TextControl.Justification.TOPpublic void setCharRotation(double charRotation)
charRotation
- rotate each character
charRotation
degrees clockwise
from base line.public Object toDrawable(DisplayImpl display) throws VisADException
Shape3D
.toDrawable
in interface ScreenAnnotation
display
- the VisAD display for this Label.VisADException
- - VisAD couldn't make the geometry array.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.