visad.bom.annotations
Class JLabelJ3D
- java.lang.Object
-
- visad.bom.annotations.JLabelJ3D
-
- All Implemented Interfaces:
- ScreenAnnotation
public class JLabelJ3D extends java.lang.Object implements ScreenAnnotation
Meant to encapsulate information representing a label which is going to be rendered on a VisAD display without being subject to the usual VisAD transformations. Thus the label should stick in Screen Coordinates. It should render using the Java3D Text3D class. Java3D dependent only in needing Text3D.
-
-
Constructor Summary
Constructors Constructor and Description JLabelJ3D(java.lang.String text)It constructs a JLabelJ3D with text at the origin, coloured white.JLabelJ3D(java.lang.String text, int xLocation, int yLocation, float[] colour, java.awt.Font font, double zValue, double fontSizeInPixels, int align, int path)Constructor for a JLabel3D - It is filled and should have non null Font.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidsetAlign(int align)voidsetColour(float[] colour)voidsetFont(java.awt.Font font)voidsetFontSize(double fontSizeInPixels)voidsetLocation(int xLocation, int yLocation)voidsetPath(int path)voidsetText(java.lang.String text)voidsetZValue(double zValue)java.lang.ObjecttoDrawable(DisplayImpl display)Make the JLabelJ3D into aShape3D.
-
-
-
Constructor Detail
-
JLabelJ3D
public JLabelJ3D(java.lang.String text)
It constructs a JLabelJ3D with text at the origin, coloured white.- Parameters:
text- text of the JLabelJ3D.
-
JLabelJ3D
public JLabelJ3D(java.lang.String text, int xLocation, int yLocation, float[] colour, java.awt.Font font, double zValue, double fontSizeInPixels, int align, int path)Constructor for a JLabel3D - It is filled and should have non null Font.- Parameters:
text- text of the JLabelJ3D.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-Fontto use.zValue- Virtual world value; larger z is in front.fontSizeInPixels- font size.align- one of:- Text3D.ALIGN_FIRST
- Text3D.ALIGN_CENTER
- Text3D.ALIGN_LAST
path- one of:- Text3D.PATH_RIGHT
- Text3D.PATH_LEFT
- Text3D.PATH_DOWN
- Text3D.PATH_UP
-
-
Method Detail
-
setText
public void setText(java.lang.String text)
- Parameters:
text- text of the JLabelJ3D.
-
setLocation
public void setLocation(int xLocation, int yLocation)- Parameters:
xLocation- x position in screen coordinates.yLocation- y position in screen coordinates.
-
setColour
public void setColour(float[] colour)
- Parameters:
colour- red green blue triple; each value in [0.0, 1.0].
-
setFont
public void setFont(java.awt.Font font)
- Parameters:
font-Fontto use.
-
setZValue
public void setZValue(double zValue)
- Parameters:
zValue- Virtual world value; larger z is in front.
-
setFontSize
public void setFontSize(double fontSizeInPixels)
- Parameters:
fontSizeInPixels- font size; by default characters are 12 pixels in size.
-
setAlign
public void setAlign(int align)
- Parameters:
align- one of:- Text3D.ALIGN_FIRST
- Text3D.ALIGN_CENTER
- Text3D.ALIGN_LAST
-
setPath
public void setPath(int path)
- Parameters:
path- one of:- Text3D.PATH_RIGHT
- Text3D.PATH_LEFT
- Text3D.PATH_DOWN
- Text3D.PATH_UP
-
toDrawable
public java.lang.Object toDrawable(DisplayImpl display) throws VisADException
Make the JLabelJ3D into aShape3D.- Specified by:
toDrawablein interfaceScreenAnnotation- Parameters:
display- the VisAD display for this Label.- Returns:
- the JLabelJ3D description as a
Shape3D. - Throws:
VisADException- - VisAD couldn't make the geometry array.
-
-
DMelt 3.0 © DataMelt by jWork.ORG