Documentation of 'visad.bom.SceneGraphRenderer' Java class
SceneGraphRenderer
visad.bom

Class SceneGraphRenderer



  • public class SceneGraphRenderer
    extends java.lang.Object
    Render the non-texture components of a scene graph to a Graphics2D. This does not handle any 3D aspect, rotation, etc.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int MODE_2D
      2D mode
      static int MODE_3D
      3D mode
    • Constructor Summary

      Constructors 
      Constructor and Description
      SceneGraphRenderer()
      Default constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void drawShape(float[][] vertices, java.awt.Color colour, float width, java.awt.Graphics2D graphics)
      Draw the outline of a shape onto the chart
      void drawShape(float[][] vertices, java.awt.Color colour, float width, int dashStyle, java.awt.Graphics2D graphics)
      Draw the outline of a shape onto the chart
      void drawShapeReprojected(float[][] vertices, java.awt.Color colour, float width, java.awt.Graphics2D graphics)
      Draw a reprojected shape
      void drawShapeReprojected(float[][] vertices, java.awt.Color colour, float width, int dashStyle, java.awt.Graphics2D graphics)
      Draw a reprojected shape
      void drawShapeReprojected(float[][] vertices, java.awt.Color colour, float width, int dashStyle, java.awt.Graphics2D graphics, boolean isScreen)
      Draw a reprojected shape
      void drawString(java.lang.String text, java.awt.Font font, java.awt.Color colour, float x, float y, java.awt.Graphics2D graphics)
      Draw text onto the chart
      void fillShape(float[][] vertices, java.awt.Color colour, java.awt.Graphics2D graphics)
      Fill a shape onto the chart
      void fillShape(float[][] data, int texture, java.awt.Graphics2D graphics)
      Fill a shape onto the chart
      void fillShapeReprojected(float[][] vertices, java.awt.Color colour, java.awt.Graphics2D graphics)
      Fill a reprojected shape
      void fillShapeReprojected(float[][] vertices, java.awt.Color colour, java.awt.Graphics2D graphics, boolean isScreen)
      Fill a reprojected shape
      void fillShapeReprojected(float[][] vertices, int texture, java.awt.Graphics2D graphics)
      Fill a reprojected shape from a texture
      void fillShapeReprojected(float[][] vertices, int texture, java.awt.Graphics2D graphics, boolean isScreen)
      Fill a reprojected shape from a texture
      java.awt.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(java.awt.Graphics2D graphics, DisplayImpl display, CoordinateSystem cs, int width, int height)
      Implements the Plottable interface.
      int print(java.awt.Graphics graphics, java.awt.print.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

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SceneGraphRenderer

        public SceneGraphRenderer()
        Default constructor
    • Method Detail

      • getLonLatSamples

        public float[][] getLonLatSamples(int xSize,
                                          int ySize)
        Return an array of Longitudes/Latitudes corresponding to the pixels of the chart. Based on the Charts CoordinateSystem and ViewPort. In the case of an A0 chart, the number of pixels may be huge, so supply an X and Y size allowing a smaller subset to be used if necessary The purpose of this method is to allow an image to be interpolated onto the chart as an overlay (eg. sat image)
        Parameters:
        xSize - The size of the target X dimension
        ySize - The size of the target Y dimension
        Returns:
        An array of Longitudes/Latitudes corresponding to the pixels of the chart, sampled to match the target x/y size. Based on the Charts CoordinateSystem and ViewPort
      • getColours

        public java.awt.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. The antialiasing and gradient fill used in some charts can easily grab all the available colours By taking the ones used specifically by the chart, the important colours can be reserved in the colour table ensuring that any colour loss has only minimal cosmetic effect
        Returns:
        The colours used by this chart
      • getLineWidth

        public float getLineWidth()
        Get the line width
        Returns:
        the line width
      • plot

        public void plot(java.awt.Graphics2D graphics,
                         DisplayImpl display,
                         CoordinateSystem cs,
                         int width,
                         int height)
        Implements the Plottable interface. This will plot the chart to a vector graphics file Don't use this method directly. It is called by the Plotter class
        Parameters:
        graphics - The java2d object used by the third party graphics library to render the graphics file
        display - the display to render
        cs - the display side coordinate system
        width - the width of the output
        height - the height of the output
      • print

        public int print(java.awt.Graphics graphics,
                         java.awt.print.PageFormat pageFormat,
                         int pageIndex,
                         DisplayImpl display,
                         CoordinateSystem cs)
        Print the display
        Parameters:
        graphics - Graphics to print to
        pageFormat - the page format
        pageIndex - the page index
        display - the display to render
        cs - the display side coordinate system
        Returns:
        flag for success
      • drawShapeReprojected

        public void drawShapeReprojected(float[][] vertices,
                                         java.awt.Color colour,
                                         float width,
                                         java.awt.Graphics2D graphics)
        Draw a reprojected shape
        Parameters:
        vertices - vertices
        colour - default color
        width - line width
        graphics - the graphics
      • drawShapeReprojected

        public void drawShapeReprojected(float[][] vertices,
                                         java.awt.Color colour,
                                         float width,
                                         int dashStyle,
                                         java.awt.Graphics2D graphics)
        Draw a reprojected shape
        Parameters:
        vertices - vertices
        colour - default color
        width - line width
        dashStyle - line dash style
        graphics - the graphics
      • drawShapeReprojected

        public void drawShapeReprojected(float[][] vertices,
                                         java.awt.Color colour,
                                         float width,
                                         int dashStyle,
                                         java.awt.Graphics2D graphics,
                                         boolean isScreen)
        Draw a reprojected shape
        Parameters:
        vertices - vertices
        colour - default color
        width - line width
        dashStyle - line dash style
        graphics - the graphics
        isScreen - vertices are in screen coordinates
      • drawShape

        public void drawShape(float[][] vertices,
                              java.awt.Color colour,
                              float width,
                              int dashStyle,
                              java.awt.Graphics2D graphics)
                       throws VisADException
        Draw the outline of a shape onto the chart
        Parameters:
        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 shape
        colour - The colour of the shape
        width - The thickness of the outline
        dashStyle - Set to 0 if the outline is to be drawn as dashes
        graphics - The java2d graphics object supplied by the plotting/printing medium
        Throws:
        VisADException
      • drawShape

        public void drawShape(float[][] vertices,
                              java.awt.Color colour,
                              float width,
                              java.awt.Graphics2D graphics)
                       throws VisADException
        Draw the outline of a shape onto the chart
        Parameters:
        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 shape
        colour - The colour of the shape
        width - The thickness of the outline
        graphics - The java2d graphics object supplied by the plotting/printing medium
        Throws:
        VisADException
      • fillShapeReprojected

        public void fillShapeReprojected(float[][] vertices,
                                         java.awt.Color colour,
                                         java.awt.Graphics2D graphics)
        Fill a reprojected shape
        Parameters:
        vertices - the vertices of the shape
        colour - the color
        graphics - the graphics
      • fillShapeReprojected

        public void fillShapeReprojected(float[][] vertices,
                                         java.awt.Color colour,
                                         java.awt.Graphics2D graphics,
                                         boolean isScreen)
        Fill a reprojected shape
        Parameters:
        vertices - the vertices of the shape
        colour - the color
        graphics - the graphics
        isScreen - true if vertices are in screen (AWT) coordinates
      • fillShape

        public void fillShape(float[][] vertices,
                              java.awt.Color colour,
                              java.awt.Graphics2D graphics)
                       throws VisADException
        Fill a shape onto the chart
        Parameters:
        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 shape
        colour - The colour of the shape
        graphics - The java2d graphics object supplied by the plotting/printing medium
        Throws:
        VisADException
      • fillShapeReprojected

        public void fillShapeReprojected(float[][] vertices,
                                         int texture,
                                         java.awt.Graphics2D graphics)
        Fill a reprojected shape from a texture
        Parameters:
        vertices - the shape vertices
        texture - The hatching texture to fill the shape with can be Hatching.DIAGONAL1, Hatching.DIAGONAL2, Hatching.DIAGONAL_BOTH, Hatching.HORIZONTAL = 3, Hatching.VERTICAL or Hatching.SQUARE
        graphics - The java2d graphics object supplied by the plotting/printing medium
      • fillShapeReprojected

        public void fillShapeReprojected(float[][] vertices,
                                         int texture,
                                         java.awt.Graphics2D graphics,
                                         boolean isScreen)
        Fill a reprojected shape from a texture
        Parameters:
        vertices - the shape vertices
        texture - The hatching texture to fill the shape with can be Hatching.DIAGONAL1, Hatching.DIAGONAL2, Hatching.DIAGONAL_BOTH, Hatching.HORIZONTAL = 3, Hatching.VERTICAL or Hatching.SQUARE
        graphics - The java2d graphics object supplied by the plotting/printing medium
        isScreen - true if vertices are in screen (AWT) coordinates
      • fillShape

        public void fillShape(float[][] data,
                              int texture,
                              java.awt.Graphics2D graphics)
                       throws VisADException
        Fill a shape onto the chart
        Parameters:
        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 shape
        texture - The hatching texture to fill the shape with can be Hatching.DIAGONAL1, Hatching.DIAGONAL2, Hatching.DIAGONAL_BOTH, Hatching.HORIZONTAL = 3, Hatching.VERTICAL or Hatching.SQUARE
        graphics - The java2d graphics object supplied by the plotting/printing medium
        Throws:
        VisADException - problem transforming from lat/lon to display space
      • drawString

        public void drawString(java.lang.String text,
                               java.awt.Font font,
                               java.awt.Color colour,
                               float x,
                               float y,
                               java.awt.Graphics2D graphics)
                        throws VisADException
        Draw text onto the chart
        Parameters:
        text - The text to draw onto the chart
        font - The font of the text
        colour - The colour of the text
        x - 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
        Throws:
        VisADException
      • setTransformToScreenCoords

        public void setTransformToScreenCoords(boolean value)
        Set whether the vertices should be transformed from display coords to screen coords before drawing. This ends up bypassing the use of the AffineTransform when drawing. Use this if you are in a rotated 3D display.
        Parameters:
        value - true to transform

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.