Package hec.map

Class AbstractLegendItem

All Implemented Interfaces:
LegendItem, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
ColorContourLegendItem

public abstract class AbstractLegendItem extends JComponent implements LegendItem

Title: Hec Java Development

Description:

Copyright: Copyright (c) 2004

Company: Resource Management Assoc

See Also:
  • Field Details

    • BORDER_WIDTH

      protected static final int BORDER_WIDTH
      See Also:
    • _x

      protected int _x
      The x position of the component in the parent's coordinate system.
    • _y

      protected int _y
      The y position of the component in the parent's coordinate system.
    • _width

      protected int _width
      The width of the legend item.
    • _height

      protected int _height
      The height of the legend item.
    • _legendTitle

      protected String _legendTitle
      The title of the legend. Provides a text description of this legend to differentiate it from other legends.
    • _dirty

      protected boolean _dirty
  • Constructor Details

    • AbstractLegendItem

      public AbstractLegendItem()
  • Method Details

    • isDirty

      public boolean isDirty()
    • setLegendTitle

      public void setLegendTitle(String title)
    • getPreferredSize

      public Dimension getPreferredSize()
      Specified by:
      getPreferredSize in interface LegendItem
      Overrides:
      getPreferredSize in class JComponent
    • getLegendTitle

      public String getLegendTitle()
    • drawBorder

      public void drawBorder(Graphics g2)
    • setSize

      public void setSize(int width, int height)
      Resizes this component so that it has width width and height height.
      Specified by:
      setSize in interface LegendItem
      Overrides:
      setSize in class Component
      Parameters:
      width - the new width of this component in pixels
      height - the new height of this component in pixels
      Since:
      JDK1.1
      See Also:
    • setLocation

      public void setLocation(int x, int y)
      Description copied from interface: LegendItem
      Moves this component to a new location. The top-left corner of the new location is specified by point p. Point p is given in the parent's coordinate space.
      Specified by:
      setLocation in interface LegendItem
      Overrides:
      setLocation in class Component
      Parameters:
      x - the point defining the top-left corner of the new location, given in the coordinate space of this component's parent
      y - the point defining the top-left corner of the new location, given in the coordinate space of this component's parent
      See Also:
    • setBounds

      public void setBounds(Rectangle r)
      Specified by:
      setBounds in interface LegendItem
      Overrides:
      setBounds in class Component
    • draw

      public abstract void draw(Graphics g, MapScale scl)
      This method is the entry point for drawing. All drawing will be done to the graphics context passed in here as a parameter.
      Specified by:
      draw in interface LegendItem
      Parameters:
      g - Graphics
    • getHeight

      public int getHeight()
      Returns the current height of this component.
      Overrides:
      getHeight in class JComponent
      Returns:
      the current height of this component
    • getWidth

      public int getWidth()
      Returns the current width of this component.
      Overrides:
      getWidth in class JComponent
      Returns:
      the current width of this component
    • getPreferredLocation

      public LegendItem.LegendLocation getPreferredLocation()
      Specified by:
      getPreferredLocation in interface LegendItem