public class ShapeUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AIRPLANE
Id for a 2-D airplane shape
|
static java.lang.String |
AIRPLANE3D
Id for a 3-D airplane shape
|
static float |
B_Y
coordinates
|
static float |
C_X
coordinates
|
static float |
C_Y
coordinates
|
static float |
C_Z
coordinates
|
static java.lang.String |
CIRCLE
shape name from WeatherSymbols
|
static java.lang.String |
CROSS
Id for a cross shape
|
static java.lang.String |
CUBE
Id for a cube shape
|
static float |
D_Z
coordinates
|
static java.lang.String |
DIAMOND
shape name from WeatherSymbols
|
static java.lang.String |
DOWNARROW
Id for a plus shape
|
static java.lang.String |
DOWNLINE
Id for a plus shape
|
static java.lang.String |
FILLED_CIRCLE
shape name from WeatherSymbols
|
static java.lang.String |
FILLED_DIAMOND
shape name from WeatherSymbols
|
static java.lang.String |
FILLED_SPHERE
Id for a filled triangle shape
|
static java.lang.String |
FILLED_SQUARE
Id for a filled square shape
|
static java.lang.String |
FILLED_STAR
shape name from WeatherSymbols
|
static java.lang.String |
FILLED_TRIANGLE
Id for a filled triangle shape
|
static java.lang.String |
HORLINE
Id for a horizontal line shape
|
static java.lang.String |
HURRICANE
Hurricane symbol
|
static float |
L_X
coordinates
|
static java.lang.String |
LEFTARROW
Id for a plus shape
|
static float |
MB_Y
coordinates
|
static java.lang.String |
MINUS
Id for a plus shape
|
static int |
MISC_ID_CIRCLE
The identifier for a circle station location marker
|
static int |
MISC_ID_DIAMOND
The identifier for a diamond station location marker
|
static int |
MISC_ID_FILLED_CIRCLE
The identifier for a filled circle station location marker
|
static int |
MISC_ID_FILLED_DIAMOND
The identifier for a filled diamond station location marker
|
static int |
MISC_ID_FILLED_SQUARE
The identifier for a filled square station location marker
|
static int |
MISC_ID_FILLED_STAR
The identifier for a filled start station location marker
|
static int |
MISC_ID_FILLED_TRIANGLE
The identifier for a filled triangle station location marker
|
static int |
MISC_ID_HURRICANE
The identifier for hurricane
|
static int |
MISC_ID_MINUS
The identifier for a minus station location marker
|
static int |
MISC_ID_PIN
The identifier for a pin station location marker
|
static int |
MISC_ID_PLUS
The identifier for a plus station location marker
|
static int |
MISC_ID_SQUARE
The identifier for a square station location marker
|
static int |
MISC_ID_STAR
The identifier for a star station location marker
|
static int |
MISC_ID_TRIANGLE
The identifier for a triangle station location marker
|
static int |
MISC_ID_TROPICALSTORM
Id for tropical storm
|
static int[] |
MISC_IDS
shape ids from WeatherSymbols
|
static java.lang.String[] |
MISC_NAMES
shape names from WeatherSymbols
|
static float |
ML_X
coordinates
|
static float |
MR_X
coordinates
|
static float |
MT_Y
coordinates
|
static java.lang.String |
NONE
Id for a null shape
|
static java.lang.String |
PIN
shape id
|
static java.lang.String |
PLUS
Id for a plus shape
|
static java.lang.String |
PYRAMID_4FACE
Id for a pyramid of 4 faces (triangular base)
|
static java.lang.String |
PYRAMID_5FACE
Id for a pyramid of 5 faces (square base)
|
static float |
R_X
coordinates
|
static java.lang.String |
RIGHTARROW
Id for a plus shape
|
static TwoFacedObject[] |
SHAPES
Array of all of the shapes
|
static java.lang.String |
SQUARE
Id for a square (unfilled) shape
|
static java.lang.String |
STAR
shape name from WeatherSymbols
|
static float |
T_Y
coordinates
|
static double[] |
TEXT_BASE
use in text calls
|
static double[] |
TEXT_START
use in text calls
|
static double[] |
TEXT_UP
use in text calls
|
static java.lang.String |
TRIANGLE
Id for a triangle (unfilled) shape
|
static java.lang.String |
TROPICALSTORM
tropical storm symbol
|
static float |
U_Z
coordinates
|
static java.lang.String |
UPARROW
Id for a plus shape
|
static java.lang.String |
VERTLINE
Id for a vertical line shape
|
Constructor and Description |
---|
ShapeUtility()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
blendColor(visad.VisADGeometryArray shape,
java.awt.Color color)
Blend the color for the shape specified with color.
|
static void |
blendColor(visad.VisADGeometryArray shape,
float R,
float G,
float B)
Blend the color for the shape specified with RGB components specified
|
static java.awt.geom.Rectangle2D |
bounds2d(visad.VisADGeometryArray shape)
Return the bounds of this shape
|
static java.awt.geom.Rectangle2D |
bounds2d(visad.VisADGeometryArray[] shapes)
Return the bounds of array of shapes
|
static java.awt.geom.Rectangle2D |
bounds2d(visad.VisADGeometryArray shape,
java.awt.geom.Rectangle2D rect)
Return the bounds of this shape
|
static visad.VisADGeometryArray[] |
clone(visad.VisADGeometryArray[] shapes)
Do a deep clone of the given shapes array
|
static visad.VisADGeometryArray[] |
createShape(java.lang.String s)
Create a shape from a string name
|
static visad.VisADGeometryArray |
makeShape(java.lang.String s)
Deprecated.
Use create shape
|
static visad.VisADGeometryArray |
offset(visad.VisADGeometryArray shape,
float[] off)
Offset the shape by the amounts in off.
|
static visad.VisADGeometryArray |
offset(visad.VisADGeometryArray shape,
float dx,
float dy,
float dz)
Offset the shape by the amounts in off.
|
static void |
reScale(visad.VisADGeometryArray[] shapes,
double scale)
Rescale the shapes
|
static void |
reScale(visad.VisADGeometryArray[] shapes,
double[] scale)
Rescale the shapes
|
static void |
reScale(visad.VisADGeometryArray[] shapes,
double[] scaleArray,
double scale)
Rescale the shapes
|
static void |
reScale(visad.VisADGeometryArray shape,
double scale)
Rescale the shape
|
static void |
reScale(visad.VisADGeometryArray shape,
double[] scale)
Rescale the shape
|
static void |
reScale(visad.VisADGeometryArray shape,
double[] scaleArray,
double scale)
Rescale the shape
|
static void |
rotate(visad.VisADGeometryArray shape,
float angle)
Rotate the given shape about the z axis the given angle (in radians).
|
static void |
rotate(visad.VisADGeometryArray shape,
javax.media.j3d.Transform3D transform)
Rotate a shape
|
static void |
rotate(visad.VisADGeometryArray shape,
javax.media.j3d.Transform3D transform,
float deltax,
float deltay,
float deltaz)
Rotate a shape
|
static void |
rotateX(visad.VisADGeometryArray shape,
float angle)
Rotate the given shape about the x axis the given angle (in radians).
|
static void |
rotateY(visad.VisADGeometryArray shape,
float angle)
Rotate the given shape about the y axis the given angle (in radians).
|
static void |
rotateZ(visad.VisADGeometryArray shape,
float angle)
Rotate the given shape about the z axis the given angle (in radians).
|
static void |
setColor(visad.VisADGeometryArray[] shapes,
java.awt.Color color)
Set the color for the shapes in the array.
|
static void |
setColor(visad.VisADGeometryArray[] shapes,
float[] RGB)
Set the color for the shapes in the array.
|
static void |
setColor(visad.VisADGeometryArray shape,
java.awt.Color color)
Set the color for the shape specified.
|
static void |
setColor(visad.VisADGeometryArray shape,
float[] RGB)
Set the color for the shape specified.
|
static void |
setColor(visad.VisADGeometryArray shape,
float R,
float G,
float B)
Set the color for the shape specified.
|
static void |
setColor(visad.VisADGeometryArray shape,
float R,
float G,
float B,
float A)
Set the color for the shape specified.
|
static visad.VisADGeometryArray[] |
setSize(visad.VisADGeometryArray[] shapes,
float size)
Set the size of the shapes.
|
static visad.VisADGeometryArray |
setSize(visad.VisADGeometryArray shape,
float size)
Set the size of the shapes.
|
static visad.VisADGeometryArray |
setSize(visad.VisADGeometryArray shape,
float x,
float y,
float z)
Set the size of the shapes.
|
static visad.VisADGeometryArray |
shapeFont(java.lang.String s,
java.awt.Font f)
Wrapper for PlotText using font.
|
static visad.VisADGeometryArray |
shapeFont(java.lang.String s,
java.awt.Font f,
boolean center)
Wrapper for PlotText.
|
static visad.VisADGeometryArray |
shapeText(java.lang.String s)
Wrapper for PlotText.
|
static visad.VisADGeometryArray |
shapeText(java.lang.String s,
boolean center)
Wrapper for PlotText.
|
static visad.VisADGeometryArray |
shapeText(java.lang.String s,
int fontSize,
boolean center)
Wrapper for PlotText.
|
public static final double[] TEXT_START
public static final double[] TEXT_BASE
public static final double[] TEXT_UP
public static final java.lang.String PLUS
public static final java.lang.String MINUS
public static final java.lang.String DOWNLINE
public static final java.lang.String RIGHTARROW
public static final java.lang.String LEFTARROW
public static final java.lang.String UPARROW
public static final java.lang.String DOWNARROW
public static final java.lang.String HORLINE
public static final java.lang.String VERTLINE
public static final java.lang.String CROSS
public static final java.lang.String SQUARE
public static final java.lang.String NONE
public static final java.lang.String FILLED_SQUARE
public static final java.lang.String CUBE
public static final java.lang.String PYRAMID_4FACE
public static final java.lang.String PYRAMID_5FACE
public static final java.lang.String TRIANGLE
public static final java.lang.String FILLED_TRIANGLE
public static final java.lang.String FILLED_SPHERE
public static final java.lang.String AIRPLANE
public static final java.lang.String AIRPLANE3D
public static final java.lang.String PIN
public static final java.lang.String HURRICANE
public static final java.lang.String TROPICALSTORM
public static final int MISC_ID_SQUARE
public static final int MISC_ID_FILLED_SQUARE
public static final int MISC_ID_CIRCLE
public static final int MISC_ID_FILLED_CIRCLE
public static final int MISC_ID_TRIANGLE
public static final int MISC_ID_FILLED_TRIANGLE
public static final int MISC_ID_DIAMOND
public static final int MISC_ID_FILLED_DIAMOND
public static final int MISC_ID_STAR
public static final int MISC_ID_FILLED_STAR
public static final int MISC_ID_PLUS
public static final int MISC_ID_PIN
public static final int MISC_ID_MINUS
public static final int MISC_ID_TROPICALSTORM
public static final int MISC_ID_HURRICANE
public static final java.lang.String CIRCLE
public static final java.lang.String FILLED_CIRCLE
public static final java.lang.String DIAMOND
public static final java.lang.String FILLED_DIAMOND
public static final java.lang.String STAR
public static final java.lang.String FILLED_STAR
public static final java.lang.String[] MISC_NAMES
public static final int[] MISC_IDS
public static final TwoFacedObject[] SHAPES
public static final float L_X
public static final float ML_X
public static final float C_X
public static final float MR_X
public static final float R_X
public static final float T_Y
public static final float MT_Y
public static final float C_Y
public static final float MB_Y
public static final float B_Y
public static final float D_Z
public static final float C_Z
public static final float U_Z
public static visad.VisADGeometryArray makeShape(java.lang.String s)
setSize()
methods to rescale.s
- shape to createpublic static visad.VisADGeometryArray[] createShape(java.lang.String s)
s
- name of the staringpublic static visad.VisADGeometryArray shapeText(java.lang.String s)
s
- string to turn into a shape.public static visad.VisADGeometryArray shapeText(java.lang.String s, boolean center)
s
- string to turn into a shape.center
- center the textpublic static visad.VisADGeometryArray shapeText(java.lang.String s, int fontSize, boolean center)
s
- string to turn into a shape.fontSize
- the font sizecenter
- center the textpublic static visad.VisADGeometryArray shapeFont(java.lang.String s, java.awt.Font f)
s
- string to turn into a shape.f
- font to usepublic static visad.VisADGeometryArray shapeFont(java.lang.String s, java.awt.Font f, boolean center)
s
- string to turn into a shape.f
- font to usecenter
- center the textpublic static visad.VisADGeometryArray[] setSize(visad.VisADGeometryArray[] shapes, float size)
shapes
- shapes to resizesize
- scaling factorpublic static visad.VisADGeometryArray setSize(visad.VisADGeometryArray shape, float size)
shape
- shapes to resizesize
- scaling factorpublic static visad.VisADGeometryArray setSize(visad.VisADGeometryArray shape, float x, float y, float z)
shape
- shapes to resizex
- scaling factory
- scaling factorz
- scaling factorpublic static visad.VisADGeometryArray offset(visad.VisADGeometryArray shape, float[] off)
shape
- shape to offsetoff
- offset (x, y, z)public static visad.VisADGeometryArray offset(visad.VisADGeometryArray shape, float dx, float dy, float dz)
shape
- shape to offsetdx
- delta xdy
- delta ydz
- delta zpublic static java.awt.geom.Rectangle2D bounds2d(visad.VisADGeometryArray shape)
shape
- shape to boundpublic static java.awt.geom.Rectangle2D bounds2d(visad.VisADGeometryArray shape, java.awt.geom.Rectangle2D rect)
shape
- shape to boundrect
- The rectangle to set. If null then create a new one.public static java.awt.geom.Rectangle2D bounds2d(visad.VisADGeometryArray[] shapes)
shapes
- shape to boundpublic static void setColor(visad.VisADGeometryArray[] shapes, java.awt.Color color)
shapes
- array of shapes to colorcolor
- color to use.public static void setColor(visad.VisADGeometryArray[] shapes, float[] RGB)
shapes
- array of shapes to colorRGB
- array of color components (R, G, B) to use.public static void setColor(visad.VisADGeometryArray shape, java.awt.Color color)
shape
- shape to colorcolor
- color to use.public static void setColor(visad.VisADGeometryArray shape, float[] RGB)
shape
- shape to colorRGB
- array of color components (R, G, B) to use.public static void setColor(visad.VisADGeometryArray shape, float R, float G, float B)
shape
- shape to colorR
- red color componentG
- green color componentB
- blue color componentpublic static void setColor(visad.VisADGeometryArray shape, float R, float G, float B, float A)
shape
- shape to colorR
- red color componentG
- green color componentB
- blue color componentA
- alpha componentpublic static void blendColor(visad.VisADGeometryArray shape, java.awt.Color color)
shape
- shape to colorcolor
- color to use for blending.public static void blendColor(visad.VisADGeometryArray shape, float R, float G, float B)
shape
- shape to colorR
- red color componentG
- green color componentB
- blue color componentpublic static void reScale(visad.VisADGeometryArray[] shapes, double scale)
shapes
- shapes to scalescale
- scale factorpublic static void reScale(visad.VisADGeometryArray shape, double scale)
shape
- shape to scalescale
- scale factorpublic static void reScale(visad.VisADGeometryArray[] shapes, double[] scale)
shapes
- shapes to scalescale
- xyz scale factorpublic static void reScale(visad.VisADGeometryArray[] shapes, double[] scaleArray, double scale)
shapes
- shapes to scalescaleArray
- xyz scale factorscale
- extra scale factorpublic static visad.VisADGeometryArray[] clone(visad.VisADGeometryArray[] shapes)
shapes
- shape to clonepublic static void reScale(visad.VisADGeometryArray shape, double[] scale)
shape
- shape to scalescale
- xyz scale factorpublic static void reScale(visad.VisADGeometryArray shape, double[] scaleArray, double scale)
shape
- shape to scalescaleArray
- xyz scale factorscale
- scale factorpublic static void rotate(visad.VisADGeometryArray shape, float angle)
shape
- The shape to rotateangle
- Radianspublic static void rotateZ(visad.VisADGeometryArray shape, float angle)
shape
- The shape to rotateangle
- Radianspublic static void rotate(visad.VisADGeometryArray shape, javax.media.j3d.Transform3D transform)
shape
- the shapetransform
- the 3D transformpublic static void rotate(visad.VisADGeometryArray shape, javax.media.j3d.Transform3D transform, float deltax, float deltay, float deltaz)
shape
- the shapetransform
- the transformdeltax
- delta xdeltay
- delta ydeltaz
- delta zpublic static void rotateX(visad.VisADGeometryArray shape, float angle)
shape
- The shape to rotateangle
- Radianspublic static void rotateY(visad.VisADGeometryArray shape, float angle)
shape
- The shape to rotateangle
- Radians