|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvisad.bom.SceneGraphRenderer
public class SceneGraphRenderer
Render the non-texture components of a scene graph to a Graphics2D. This does not handle any 3D aspect, rotation, etc.
| Nested Class Summary | |
|---|---|
class |
SceneGraphRenderer.ChartException
Chart exception |
class |
SceneGraphRenderer.Hatching
Provide a set of simple hatching patterns |
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
SceneGraphRenderer()
Default constructor |
|
| Method Summary | |
|---|---|
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. 8 bit PNG. |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public SceneGraphRenderer()
| Method Detail |
|---|
public float[][] getLonLatSamples(int xSize,
int ySize)
xSize - The size of the target X dimensionySize - The size of the target Y dimension
public 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 output
public 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 system
public void drawShapeReprojected(float[][] vertices,
Color colour,
float width,
Graphics2D graphics)
vertices - verticescolour - default colorwidth - line widthgraphics - the graphics
public void drawShapeReprojected(float[][] vertices,
Color colour,
float width,
int dashStyle,
Graphics2D graphics)
vertices - verticescolour - default colorwidth - line widthdashStyle - line dash stylegraphics - the graphics
public 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 coordinates
public 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 medium
VisADException
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 medium
VisADException
public void fillShapeReprojected(float[][] vertices,
Color colour,
Graphics2D graphics)
vertices - the vertices of the shapecolour - the colorgraphics - the graphics
public 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) coordinates
public 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 medium
VisADException
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 medium
public 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) coordinates
public 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 medium
VisADException - problem transforming from lat/lon
to display space
public 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 medium
VisADExceptionpublic void setTransformToScreenCoords(boolean value)
value - true to transform
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||