Package hec.gfx2d

Class G2dGlyph

java.lang.Object
hec.gfx2d.G2dGlyph
All Implemented Interfaces:
Serializable, Observer
Direct Known Subclasses:
BarGlyph, ComplexSeasonalDataGlyph, DataSetGlyph, DefaultG2dGlyph, G2dEditGlyph, LocalDSSTimeSeriesCollectionGlyph, PairedDataGlyph, PairedValuesExtDataGlyph, ProfileDataG2dGlyph, SimpleArrayGlyph, SimpleJTableBarGlyph, SimpleJTableGlyph, SimpleJTableSeasonalGlyph, SimpleJTableStepGlyph, SimplePairedValuesDataGlyph, SimpleSeasonalDataGlyph, TimeSeriesGlyph, TimeWindowPlotGlyph

public abstract class G2dGlyph extends Object implements Observer, Serializable
Abstract base class for specific glyphs that performs drawing and editing functions for Map objects.
See Also:
  • Field Details

    • _viewport

      protected transient Viewport _viewport
    • _g2dObject

      protected G2dObject _g2dObject
    • _scale

      protected transient Scale _scale
    • _drawProp

      protected G2dGlyphDrawProp _drawProp
    • _line

      protected G2dLine _line
    • _lineArray

      protected G2dLine[] _lineArray
    • _polygon

      protected G2dPolygon _polygon
    • _bounds

      protected WorldRect _bounds
    • maxPtArraySz

      protected static final int maxPtArraySz
      See Also:
    • xarray

      protected static final int[] xarray
    • yarray

      protected static final int[] yarray
  • Constructor Details

  • Method Details

    • createG2dLine

      protected G2dLine createG2dLine()
    • buildLineArray

      protected void buildLineArray()
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • isVisible

      public boolean isVisible()
    • setVisible

      public void setVisible(boolean visible)
    • getVisibleRect

      public Rectangle getVisibleRect()
      Computes a bounding rectangle of the visible region of the glyph. Ranges from the max/min X-Y Axis values
    • getViewport

      public Viewport getViewport()
    • getScale

      public Scale getScale()
    • update

      public void update(Observable o, Object arg)
      Specified by:
      update in interface Observer
    • getName

      public String getName()
    • getBounds

      public WorldRect getBounds()
    • dataAtPoint

      public boolean dataAtPoint(LocalPt pt)
    • objectPopupMenu

      public boolean objectPopupMenu(LocalPt pt, int modifiers)
    • pointerOver

      public boolean pointerOver(LocalPt pt)
    • objectSelect

      public boolean objectSelect(LocalPt pt, int modifiers)
    • objectDoubleClick

      public boolean objectDoubleClick(LocalPt pt, int modifiers)
    • mouseDragged

      public boolean mouseDragged(LocalPt pt)
      Method called when the mouse is dragged.
      Parameters:
      pt - the new point of where the mouse was dragged to.
      Returns:
      true if the mouse dragged event was accepted and consumed otherwise false.
    • clearSelection

      public void clearSelection()
    • getToolTipText

      public String getToolTipText(MouseEvent e)
      Returns a tool tip text for this glyph. Returns null if there is none
    • getDeviceResolution

      public int getDeviceResolution()
    • draw

      public abstract void draw(Graphics g)
    • showPopup

      public void showPopup(Component c, int x, int y)
      Description of the Method
      Parameters:
      c - Description of Parameter
      x - Description of Parameter
      y - Description of Parameter
    • getLegendPictSize

      protected Dimension getLegendPictSize(G2dLineProperties prop)
    • showAllCurvesOnLegend

      public boolean showAllCurvesOnLegend()
      Returns true if all curves are to be displayed on the lenged. If false is returned, just display one legend item that represents all curves. Usefull for trying to compact the legend.
      Returns:
    • setShowAllCurvesOnLegend

      public void setShowAllCurvesOnLegend(boolean b)
    • isLegendItemsVisible

      public boolean isLegendItemsVisible()
    • setLegendItemsVisible

      public void setLegendItemsVisible(boolean b)
    • isLineVisible

      public boolean isLineVisible()
    • setLineVisible

      public void setLineVisible(boolean visible)
    • setLineColor

      public void setLineColor(Color c)
    • setFillColor

      public void setFillColor(Color c)
    • setColor

      public void setColor(Color c)
    • setProperties

      public void setProperties(G2dGlyphDrawProp prop)
    • getProperties

      public G2dGlyphDrawProp getProperties()
    • getG2dObject

      public G2dObject getG2dObject()
    • getLine

      public G2dLine getLine()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • editLineProperties

      public void editLineProperties()
      edit the first line in the Glyph.
    • editLineProperties

      public void editLineProperties(int curveNum)
      edit the curve in the Glyph specified by curveNum
      Parameters:
      curveNum - the curve number.
    • getOKListeners

      protected List getOKListeners()
    • createPopupMenu

      protected void createPopupMenu()
    • getLine

      public G2dLine getLine(int index)
      Returns a references to a line. If the index is to small or too large then null is returned.
      Parameters:
      index -
      Returns:
    • getCurveCount

      public int getCurveCount()
    • getCurveName

      public String getCurveName(int curveIndex)
    • drawLegendPict

      public void drawLegendPict(Graphics g, int curveIndex, Dimension dim)
    • getLegendPictSize

      public Dimension getLegendPictSize(int curveIndex)
    • isCurveDrawn

      public boolean isCurveDrawn(int curveNumber)
      is a curve drawn or not. Sub-classes need to implement this functionality
      Parameters:
      curveNumber -
      Returns:
      true if the curve should be drawn.
    • setCurveDrawn

      public void setCurveDrawn(int curveNumber, boolean drawn)
      set a curve drawn or not. Sub-classes need to implement this functionality
      Parameters:
      curveNumber -
      drawn -