Class ShapeGlyph

Direct Known Subclasses:
TransectGlyph

public class ShapeGlyph extends LineGlyph
Class ShapeGlyph. Displays a shape.
Version:
$Revision: 1.33 $
Author:
IDV Development Team
  • Field Details

    • ATTR_SHAPETYPE

      public static final String ATTR_SHAPETYPE
      Xml attribute name
      See Also:
    • SHAPE_RECTANGLE

      public static final int SHAPE_RECTANGLE
      Shape type
      See Also:
    • SHAPE_OVAL

      public static final int SHAPE_OVAL
      Shape type
      See Also:
    • SHAPE_LINE

      public static final int SHAPE_LINE
      Shape type
      See Also:
    • SHAPE_DIAMOND

      public static final int SHAPE_DIAMOND
      Shape type
      See Also:
    • SHAPE_HARROW

      public static final int SHAPE_HARROW
      Shape type
      See Also:
    • SHAPE_VARROW

      public static final int SHAPE_VARROW
      Shape type
      See Also:
    • SHAPES

      public static final int[] SHAPES
      Shape types
    • SHAPE_NAMES

      public static final String[] SHAPE_NAMES
      Shape type names
  • Constructor Details

  • Method Details

    • canShowDistance

      public boolean canShowDistance()
      Can we display distance
      Overrides:
      canShowDistance in class DrawingGlyph
      Returns:
      can do distance
    • canShowArea

      public boolean canShowArea()
      Can we display area
      Overrides:
      canShowArea in class DrawingGlyph
      Returns:
      can do area
    • isValid

      public boolean isValid()
      Do we have a valid number of points
      Overrides:
      isValid in class DrawingGlyph
      Returns:
      Is this glyph valid
    • handleMouseDragged

      public DrawingGlyph handleMouseDragged(DisplayEvent event) throws VisADException, RemoteException
      Handle event
      Overrides:
      handleMouseDragged in class DrawingGlyph
      Parameters:
      event - The display event.
      Returns:
      This or null
      Throws:
      RemoteException - When bad things happen
      VisADException - When bad things happen
    • initFromXml

      public void initFromXml(DrawingControl control, Element node) throws VisADException, RemoteException
      Init from xml
      Overrides:
      initFromXml in class LineGlyph
      Parameters:
      control - The control I'm in.
      node - The xml node
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • constrainedTo2D

      protected boolean constrainedTo2D()
      Is glyph constrained to 2d
      Overrides:
      constrainedTo2D in class DrawingGlyph
      Returns:
      Constrained to 2d
    • addAttributes

      protected void addAttributes(Element e)
      Populate the xml node with attrs
      Overrides:
      addAttributes in class LineGlyph
      Parameters:
      e - Xml node
    • getTagName

      public String getTagName()
      Get xml tag name to use
      Specified by:
      getTagName in class DrawingGlyph
      Returns:
      Xml tag name
    • getNumInterpolationPoints

      protected int getNumInterpolationPoints()
      By default we don't interpolate
      Returns:
      0
    • interpolate

      public static float[][] interpolate(int cnt, float[] startXYZ, float[] endXYZ)
      Utility to interpolate cnt number of times between the start and end points
      Parameters:
      cnt - Number of interpolation points inculding start and end point
      startXYZ - Start point
      endXYZ - End point
      Returns:
      Interpolated points
    • updateLocation

      public void updateLocation() throws VisADException, RemoteException
      The glyph moved. Update location.
      Overrides:
      updateLocation in class DrawingGlyph
      Throws:
      RemoteException - On badness
      VisADException - On badness
    • makeRectangle

      public static float[][] makeRectangle(float[][] lineVals)
      Utility to make a rectangle from 2 points
      Parameters:
      lineVals - The 2 points
      Returns:
      5 points
    • makeRectangle2D

      public static Rectangle2D.Float makeRectangle2D(float[][] pts)
      Make a rectangle from the points
      Parameters:
      pts - the points
      Returns:
      the rectangle
    • handleMousePressed

      public DrawingGlyph handleMousePressed(DisplayEvent event) throws VisADException, RemoteException
      Handle event
      Overrides:
      handleMousePressed in class DrawingGlyph
      Parameters:
      event - The display event.
      Returns:
      This or null
      Throws:
      RemoteException - When bad things happen
      VisADException - When bad things happen
    • getTypeName

      public String getTypeName()
      Name to use for this glyph
      Specified by:
      getTypeName in class DrawingGlyph
      Returns:
      The glyph type name
    • getDescription

      public String getDescription()
      Get the description of this glyph
      Overrides:
      getDescription in class DrawingGlyph
      Returns:
      The description
    • getShapeType

      public int getShapeType()
      Get the shape type
      Returns:
      Shape type
    • setShapeType

      public void setShapeType(int s)
      Set the shapea
      Parameters:
      s - Shape type