public class SceneGraphRenderer extends Object
Modifier and Type | Class and Description |
---|---|
class |
SceneGraphRenderer.ChartException
Chart exception
|
class |
SceneGraphRenderer.Hatching
Provide a set of simple hatching patterns
|
Modifier and Type | Field and Description |
---|---|
protected ArrayList |
colours
list of colours
|
protected boolean |
gradientFill
flag for gradient fill
|
protected int |
height
actual height
|
static int |
MODE_2D
2D mode
|
static int |
MODE_3D
3D mode
|
protected boolean |
monochrome
flag for monochrome
|
protected float |
pixelWidth
pixel width
|
protected boolean |
plotMap
plot map flag
|
protected boolean |
useTransparency
flag for transparency
|
protected AffineTransform |
viewPort
the viewport
|
protected int |
width
actual width
|
Constructor and Description |
---|
SceneGraphRenderer()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
drawShape(float[][] vertices,
Color colour,
float width,
Graphics2D graphics)
Draw the outline of a shape onto the chart
|
void |
drawShape(float[][] vertices,
Color colour,
float width,
int dashStyle,
Graphics2D graphics)
Draw the outline of a shape onto the chart
|
void |
drawShapeReprojected(float[][] vertices,
Color colour,
float width,
Graphics2D graphics)
Draw a reprojected shape
|
void |
drawShapeReprojected(float[][] vertices,
Color colour,
float width,
int dashStyle,
Graphics2D graphics)
Draw a reprojected shape
|
void |
drawShapeReprojected(float[][] vertices,
Color colour,
float width,
int dashStyle,
Graphics2D graphics,
boolean isScreen)
Draw a reprojected shape
|
void |
drawString(String text,
Font font,
Color colour,
float x,
float y,
Graphics2D graphics)
Draw text onto the chart
|
void |
fillShape(float[][] vertices,
Color colour,
Graphics2D graphics)
Fill a shape onto the chart
|
void |
fillShape(float[][] data,
int texture,
Graphics2D graphics)
Fill a shape onto the chart
|
void |
fillShapeReprojected(float[][] vertices,
Color colour,
Graphics2D graphics)
Fill a reprojected shape
|
void |
fillShapeReprojected(float[][] vertices,
Color colour,
Graphics2D graphics,
boolean isScreen)
Fill a reprojected shape
|
void |
fillShapeReprojected(float[][] vertices,
int texture,
Graphics2D graphics)
Fill a reprojected shape from a texture
|
void |
fillShapeReprojected(float[][] vertices,
int texture,
Graphics2D graphics,
boolean isScreen)
Fill a reprojected shape from a texture
|
Color[] |
getColours()
Get a list of the colours used in the chart
This may be necessary if the chart is being plotted to a medium
with limited colours, eg.
|
float |
getLineWidth()
Get the line width
|
float[][] |
getLonLatSamples(int xSize,
int ySize)
Return an array of Longitudes/Latitudes corresponding to the
pixels of the chart.
|
void |
plot(Graphics2D graphics,
DisplayImpl display,
CoordinateSystem cs,
int width,
int height)
Implements the Plottable interface.
|
int |
print(Graphics graphics,
PageFormat pageFormat,
int pageIndex,
DisplayImpl display,
CoordinateSystem cs)
Print the display
|
void |
setTransformToScreenCoords(boolean value)
Set whether the vertices should be transformed from display coords
to screen coords before drawing.
|
protected int width
protected int height
public static final int MODE_2D
public static final int MODE_3D
protected float pixelWidth
protected boolean monochrome
protected boolean gradientFill
protected boolean useTransparency
protected ArrayList colours
protected boolean plotMap
protected AffineTransform viewPort
public float[][] getLonLatSamples(int xSize, int ySize)
xSize
- The size of the target X dimensionySize
- The size of the target Y dimensionpublic Color[] getColours()
public float getLineWidth()
public void plot(Graphics2D graphics, DisplayImpl display, CoordinateSystem cs, int width, int height)
graphics
- The java2d object used by the third party graphics
library to render the graphics filedisplay
- the display to rendercs
- the display side coordinate systemwidth
- the width of the outputheight
- the height of the outputpublic int print(Graphics graphics, PageFormat pageFormat, int pageIndex, DisplayImpl display, CoordinateSystem cs)
graphics
- Graphics to print topageFormat
- the page formatpageIndex
- the page indexdisplay
- the display to rendercs
- the display side coordinate systempublic void drawShapeReprojected(float[][] vertices, Color colour, float width, Graphics2D graphics)
vertices
- verticescolour
- default colorwidth
- line widthgraphics
- the graphicspublic void drawShapeReprojected(float[][] vertices, Color colour, float width, int dashStyle, Graphics2D graphics)
vertices
- verticescolour
- default colorwidth
- line widthdashStyle
- line dash stylegraphics
- the graphicspublic void drawShapeReprojected(float[][] vertices, Color colour, float width, int dashStyle, Graphics2D graphics, boolean isScreen)
vertices
- verticescolour
- default colorwidth
- line widthdashStyle
- line dash stylegraphics
- the graphicsisScreen
- vertices are in screen coordinatespublic void drawShape(float[][] vertices, Color colour, float width, int dashStyle, Graphics2D graphics) throws VisADException
vertices
- The vertices of the shape. A 2-Dimensional array.
The first dimension contains the longitude values of the shape
The second dimension contains the latitude values of the shapecolour
- The colour of the shapewidth
- The thickness of the outlinedashStyle
- Set to 0 if the outline is to be drawn as dashesgraphics
- The java2d graphics object supplied by the
plotting/printing mediumVisADException
public void drawShape(float[][] vertices, Color colour, float width, Graphics2D graphics) throws VisADException
vertices
- The vertices of the shape. A 2-Dimensional array.
The first dimension contains the longitude values of the shape
The second dimension contains the latitude values of the shapecolour
- The colour of the shapewidth
- The thickness of the outlinegraphics
- The java2d graphics object supplied by the
plotting/printing mediumVisADException
public void fillShapeReprojected(float[][] vertices, Color colour, Graphics2D graphics)
vertices
- the vertices of the shapecolour
- the colorgraphics
- the graphicspublic void fillShapeReprojected(float[][] vertices, Color colour, Graphics2D graphics, boolean isScreen)
vertices
- the vertices of the shapecolour
- the colorgraphics
- the graphicsisScreen
- true if vertices are in screen (AWT) coordinatespublic void fillShape(float[][] vertices, Color colour, Graphics2D graphics) throws VisADException
vertices
- The vertices of the shape. A 2-Dimensional array.
The first dimension contains the longitude values of the shape
The second dimension contains the latitude values of the shapecolour
- The colour of the shapegraphics
- The java2d graphics object supplied by the
plotting/printing mediumVisADException
public void fillShapeReprojected(float[][] vertices, int texture, Graphics2D graphics)
vertices
- the shape verticestexture
- The hatching texture to fill the shape with
can be Hatching.DIAGONAL1, Hatching.DIAGONAL2,
Hatching.DIAGONAL_BOTH, Hatching.HORIZONTAL = 3, Hatching.VERTICAL
or Hatching.SQUAREgraphics
- The java2d graphics object supplied by the
plotting/printing mediumpublic void fillShapeReprojected(float[][] vertices, int texture, Graphics2D graphics, boolean isScreen)
vertices
- the shape verticestexture
- The hatching texture to fill the shape with
can be Hatching.DIAGONAL1, Hatching.DIAGONAL2,
Hatching.DIAGONAL_BOTH, Hatching.HORIZONTAL = 3, Hatching.VERTICAL
or Hatching.SQUAREgraphics
- The java2d graphics object supplied by the
plotting/printing mediumisScreen
- true if vertices are in screen (AWT) coordinatespublic void fillShape(float[][] data, int texture, Graphics2D graphics) throws VisADException
data
- The vertices of the shape. A 2-Dimensional array.
The first dimension contains the longitude values of the shape
The second dimension contains the latitude values of the shapetexture
- The hatching texture to fill the shape with
can be Hatching.DIAGONAL1, Hatching.DIAGONAL2,
Hatching.DIAGONAL_BOTH, Hatching.HORIZONTAL = 3, Hatching.VERTICAL
or Hatching.SQUAREgraphics
- The java2d graphics object supplied by the
plotting/printing mediumVisADException
- problem transforming from lat/lon
to display spacepublic void drawString(String text, Font font, Color colour, float x, float y, Graphics2D graphics) throws VisADException
text
- The text to draw onto the chartfont
- The font of the textcolour
- The colour of the textx
- The x position of the text (longitude)y
- The y position of the text (latitude)graphics
- The java2d graphics object supplied by the
plotting/printing mediumVisADException
public void setTransformToScreenCoords(boolean value)
value
- true to transformCopyright © 1996–2023 The SSEC Visualization Project. All rights reserved.