lt.monarch.chart.engine
Class SimpleChartObjectsMap

java.lang.Object
  extended by lt.monarch.chart.engine.SimpleChartObjectsMap
All Implemented Interfaces:
ChartObjectsMap

public class SimpleChartObjectsMap
extends java.lang.Object
implements ChartObjectsMap


Nested Class Summary
Modifier and Type Class and Description
 class SimpleChartObjectsMap.HotSpot
          A simple hot spot, which maps some chart objects to some polygon.
protected  class SimpleChartObjectsMap.TaggedChartObjectImpl
          structure for chart object & paint tag
 
Nested classes/interfaces inherited from interface lt.monarch.chart.engine.ChartObjectsMap
ChartObjectsMap.TaggedChartObject
 
Field Summary
Modifier and Type Field and Description
protected  int lastId
          Last generated id
protected  java.util.List<SimpleChartObjectsMap.HotSpot> map
          array of chart objects mappings to polygons
 
Constructor Summary
Constructor and Description
SimpleChartObjectsMap()
           
 
Method Summary
Modifier and Type Method and Description
 void clear()
          Removes all chart objects
 void clearChartObject(StyleEditorEntity chartObject, AbstractPaintTags tag)
          Removes chart object & tag combination from map
 java.util.List<? extends ChartObjectsMap.TaggedChartObject> findAllObjectsAt(Point2D pt)
          Finds all chart objects & tags at the specified point.
 SimpleChartObjectsMap.TaggedChartObjectImpl findChartObjectAt(Point2D pt)
          Finds a chart object & tag at the specified point.
 int generateNextId()
          Returns an id which will be valid until the last clear call.
 java.util.List<? extends ChartObjectsMap.TaggedChartObject> getAllObjects()
          Gets all chart objects & tags
 java.util.List<java.awt.Shape> getChartObjectShapes(StyleEditorEntity chartObject, AbstractPaintTags tag)
          Returns shape for the specified chart object & tag.
 ChartObjectsMap.TaggedChartObject getObjectById(int id)
          Finds a chart object with specified id.
protected  void mapChartObject(SimpleChartObjectsMap.HotSpot spot)
          Adds HotSpot to map
 void mapChartObject(StyleEditorEntity chartObject, AbstractPaintTags tag, java.awt.Shape shape)
          Maps the specified chart object & tag to the specified polygon.
 void mapChartObject(StyleEditorEntity chartObject, AbstractPaintTags tag, java.awt.Shape shape, int id)
          Maps the specified chart object & tag to the specified polygon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected final java.util.List<SimpleChartObjectsMap.HotSpot> map
array of chart objects mappings to polygons


lastId

protected int lastId
Last generated id

Constructor Detail

SimpleChartObjectsMap

public SimpleChartObjectsMap()
Method Detail

clearChartObject

public void clearChartObject(StyleEditorEntity chartObject,
                             AbstractPaintTags tag)
Removes chart object & tag combination from map

Specified by:
clearChartObject in interface ChartObjectsMap
Parameters:
chartObject -
tag -

clear

public void clear()
Removes all chart objects

Specified by:
clear in interface ChartObjectsMap

mapChartObject

public void mapChartObject(StyleEditorEntity chartObject,
                           AbstractPaintTags tag,
                           java.awt.Shape shape,
                           int id)
Maps the specified chart object & tag to the specified polygon.

Specified by:
mapChartObject in interface ChartObjectsMap
Parameters:
chartObject - the chart object
tag - the paint tag
shape - the shape
id - id

mapChartObject

public void mapChartObject(StyleEditorEntity chartObject,
                           AbstractPaintTags tag,
                           java.awt.Shape shape)
Maps the specified chart object & tag to the specified polygon.

Specified by:
mapChartObject in interface ChartObjectsMap
Parameters:
chartObject - the chart object
tag - the paint tag
shape - the shape

mapChartObject

protected void mapChartObject(SimpleChartObjectsMap.HotSpot spot)
Adds HotSpot to map

Parameters:
spot - the HotSpot

findAllObjectsAt

public java.util.List<? extends ChartObjectsMap.TaggedChartObject> findAllObjectsAt(Point2D pt)
Finds all chart objects & tags at the specified point. If no entity was found, returns null.

Specified by:
findAllObjectsAt in interface ChartObjectsMap
Parameters:
pt - the point
Returns:
all objects at the specified point if search was successful, null otherwise

getAllObjects

public java.util.List<? extends ChartObjectsMap.TaggedChartObject> getAllObjects()
Gets all chart objects & tags

Specified by:
getAllObjects in interface ChartObjectsMap
Returns:
all objects

findChartObjectAt

public SimpleChartObjectsMap.TaggedChartObjectImpl findChartObjectAt(Point2D pt)
Finds a chart object & tag at the specified point. If no entity was found, returns null.

Specified by:
findChartObjectAt in interface ChartObjectsMap
Parameters:
pt - the point
Returns:
an object at the specified point if search was successful, null otherwise

getChartObjectShapes

public java.util.List<java.awt.Shape> getChartObjectShapes(StyleEditorEntity chartObject,
                                                           AbstractPaintTags tag)
Returns shape for the specified chart object & tag.

Specified by:
getChartObjectShapes in interface ChartObjectsMap
Parameters:
chartObject - the chart object
tag - the paint tag
Returns:
shape

getObjectById

public ChartObjectsMap.TaggedChartObject getObjectById(int id)
Description copied from interface: ChartObjectsMap
Finds a chart object with specified id. If no entity was found, returns null.

Specified by:
getObjectById in interface ChartObjectsMap
Parameters:
id - id to search for
Returns:
an object with specified if the search was successful, null otherwise

generateNextId

public int generateNextId()
Description copied from interface: ChartObjectsMap
Returns an id which will be valid until the last clear call.

Specified by:
generateNextId in interface ChartObjectsMap
Returns:
generated id