Class ImageMapArea

java.lang.Object
org.jCharts.imageMap.ImageMapArea
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CircleMapArea, PolyMapArea, RectMapArea

public abstract class ImageMapArea extends Object implements Serializable
See Also:
  • Field Details

    • x

      int[] x
    • y

      int[] y
    • value

      private double value
    • xAxisLabel

      private String xAxisLabel
    • legendLabel

      private String legendLabel
  • Constructor Details

    • ImageMapArea

      ImageMapArea(int numberOfPoints, double value, String xAxisLabel, String legendLabel)
      Parameters:
      numberOfPoints -
      value -
      xAxisLabel -
      legendLabel -
    • ImageMapArea

      ImageMapArea(int numberOfPoints, Point2D.Double point, String legendLabel)
      Parameters:
      numberOfPoints -
      point -
      legendLabel -
  • Method Details

    • getAreaShape

      abstract AreaShape getAreaShape()
      Returns:
      AreaShape
    • getNumberOfCoordinates

      public final int getNumberOfCoordinates()
      Returns the number of x,y coordinate pairs stored for the area
      Returns:
      int
    • getXCoordinate

      public final int getXCoordinate(int index)
      Returns the x coordinate at the specified index. Not returned as a Point Object so we can avoid uneeded Object creation/destruction overhead.
      Returns:
      int
    • getYCoordinate

      public final int getYCoordinate(int index)
      Returns the y coordinate at the specified index. Not returned as a Point Object so we can avoid uneeded Object creation/destruction overhead.
      Returns:
      int
    • getValue

      public final double getValue()
      Returns the data set value represented by this map.
      Returns:
      double
    • getXAxisLabel

      public final String getXAxisLabel()
      Rather than create an AxisChart specifc map area class just for this field, i put it here. This is not applicable for PieCharts.
      Returns:
      String will return NULL for PieCharts
    • getLengendLabel

      public final String getLengendLabel()
      Returns the legend label represented by this map area. Will be NULL if you did not pass a name to the data set constructor.
      Returns:
      String
    • getCoordinates

      protected void getCoordinates(StringBuffer html)
      Appends the coordinates to the passed html buffer. This is needed to facilitate the 'circle' map areas 'radius' value.
      Parameters:
      html - pass a reference to the StringBuffer so I can minimize Object creation
    • toHTML

      public final String toHTML(String mapElementAttributes)
      Returns a
      invalid input: '<'area shape="..." coords="....."  + mapElementAttributes >
      HTML element. The mapElementAttributes frees this method from having to declare all attributes of the HTML map element.
      Parameters:
      mapElementAttributes - allows you to place any map attributes you want: href, alt, onClick, onMouseOver, etc...
      Returns:
      String the HTML