visad.bom.annotations
Class LineJ3D
- java.lang.Object
-
- visad.bom.annotations.LineJ3D
-
- All Implemented Interfaces:
- ScreenAnnotation
public class LineJ3D extends java.lang.Object implements ScreenAnnotation
Meant to encapsulate information representing a Line 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.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDASHline style DASHstatic intDASH_DOTline style DASH_DOTstatic intDOTline style DOTstatic intSOLIDline style SOLID
-
Constructor Summary
Constructors Constructor and Description LineJ3D()Simple constructor which makes a zero length line at (0, 0) coloured white.LineJ3D(int style, int[][] points, float[] colour, double zValue, double thickness)Constructs a LineJ3D from 2 points specified in screen coordinates.LineJ3D(int x1, int y1, int x2, int y2, float[] colour, double zValue, double thickness)Constructs a solid LineJ3D from 2 points specified in screen coordinates.LineJ3D(int style, int x1, int y1, int x2, int y2, float[] colour, double zValue, double thickness)Constructs a LineJ3D from 2 points specified in screen coordinates.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidsetColour(float[] colour)Set the colour for the LineJ3D.voidsetPoints(int[][] points)Set the coordinates for the start and end points of the LineJ3D.voidsetPoints(int x1, int y1, int x2, int y2)Set the coordinates for the start and end points of the LineJ3D.voidsetStyle(int style)Set the line style for the LineJ3D.voidsetZValue(double zValue)Set the Z value for the LineJ3D.java.lang.ObjecttoDrawable(DisplayImpl display)Make the LineJ3D into aShape3D.
-
-
-
Field Detail
-
SOLID
public static final int SOLID
line style SOLID- See Also:
- Constant Field Values
-
DASH
public static final int DASH
line style DASH- See Also:
- Constant Field Values
-
DOT
public static final int DOT
line style DOT- See Also:
- Constant Field Values
-
DASH_DOT
public static final int DASH_DOT
line style DASH_DOT- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LineJ3D
public LineJ3D()
Simple constructor which makes a zero length line at (0, 0) coloured white. More meaningful values can be set after construction.
-
LineJ3D
public LineJ3D(int x1, int y1, int x2, int y2, float[] colour, double zValue, double thickness)Constructs a solid LineJ3D from 2 points specified in screen coordinates.- Parameters:
x1- x screen coordinate of the first point.y1- y screen coordinate of the first point.x2- x screen coordinate of the second point.y2- y screen coordinate of the second point.colour- red green blue triple; each value in [0.0, 1.0].zValue- Virtual world value; larger z is in front.thickness- of the line.
-
LineJ3D
public LineJ3D(int style, int[][] points, float[] colour, double zValue, double thickness)Constructs a LineJ3D from 2 points specified in screen coordinates.- Parameters:
style- one of:- LineJ3D.SOLID
- LineJ3D.DASH
- LineJ3D.DOT
- LineJ3D.DASH_DOT
points- 2 rows with each column containing a point in screen coordinates; requires 2 points (columns).colour- red green blue triple; each value in [0.0, 1.0].zValue- Virtual world value; larger z is in frontthickness- of the line.
-
LineJ3D
public LineJ3D(int style, int x1, int y1, int x2, int y2, float[] colour, double zValue, double thickness)Constructs a LineJ3D from 2 points specified in screen coordinates.- Parameters:
style- one of:- LineJ3D.SOLID
- LineJ3D.DASH
- LineJ3D.DOT
- LineJ3D.DASH_DOT
x1- x screen coordinate of the first point.y1- y screen coordinate of the first point.x2- x screen coordinate of the second point.y2- y screen coordinate of the second point.colour- red green blue triple; each value in [0.0, 1.0].zValue- Virtual world value; larger z is in front.thickness- of the line.
-
-
Method Detail
-
setPoints
public void setPoints(int x1, int y1, int x2, int y2)Set the coordinates for the start and end points of the LineJ3D.- Parameters:
x1- x screen coordinate of the first point.y1- y screen coordinate of the first point.x2- x screen coordinate of the second point.y2- y screen coordinate of the second point.
-
setPoints
public void setPoints(int[][] points)
Set the coordinates for the start and end points of the LineJ3D.- Parameters:
points- 2 rows with each column containing a point in screen coordinates; requires 2 points (columns).
-
setStyle
public void setStyle(int style)
Set the line style for the LineJ3D.- Parameters:
style- one of:- LineJ3D.SOLID
- LineJ3D.DASH
- LineJ3D.DOT
- LineJ3D.DASH_DOT
-
setColour
public void setColour(float[] colour)
Set the colour for the LineJ3D.- Parameters:
colour- red green blue triple; each value in [0.0, 1.0].
-
setZValue
public void setZValue(double zValue)
Set the Z value for the LineJ3D.- Parameters:
zValue- Virtual world value; larger z is in front.
-
toDrawable
public java.lang.Object toDrawable(DisplayImpl display)
Make the LineJ3D into aShape3D.- Specified by:
toDrawablein interfaceScreenAnnotation- Parameters:
display- the VisAD display for this Line.- Returns:
- the LineJ3D description as a Shape3D object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG