com.sencha.gxt.chart.client.chart
Class LegendItem<M>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<S>
          extended by com.sencha.gxt.chart.client.draw.sprite.SpriteList<Sprite>
              extended by com.sencha.gxt.chart.client.chart.LegendItem<M>
Type Parameters:
M - the data type of the legend item
All Implemented Interfaces:
Iterable<Sprite>, Collection<Sprite>, List<Sprite>

public class LegendItem<M>
extends SpriteList<Sprite>

Item representing a legend element.


Constructor Summary
LegendItem(Legend<M> legend, Series<M> series, int yFieldIndex)
          Creates a legend item.
 
Method Summary
 Legend<M> getLegend()
          Returns the legend that the item is attached.
 Series<M> getSeries()
          Returns the series that the item represents.
 double getX()
          Returns the x-coordinate of the legend item.
 double getY()
          Returns the y-coordinate of the legend item.
 int getYFieldIndex()
          Returns the index of the y field of the series that the item represents.
 void onMouseDown()
          Method used when the legend item is clicked.
 void onMouseMove()
          Method used when mouse over the legend item.
 void onMouseOut()
          Method used when the mouse leaves the legend item.
 void setLegend(Legend<M> legend)
          Sets the legend that the item is attached.
 void setSeries(Series<M> series)
          Sets the series that the item represents.
 void setX(double x)
          Sets the x-coordinate of the legend item.
 void setY(double y)
          Sets the y-coordinate of the legend item.
 void setYFieldIndex(int yFieldIndex)
          Sets the index of the y field of the series that the item represents.
 void updatePosition(double relativeX, double relativeY)
          Updates the position of the legend item based on the given relative point.
 
Methods inherited from class com.sencha.gxt.chart.client.draw.sprite.SpriteList
add, add, clear, get, getBBox, getSurface, hide, remove, set, setSurface, show, size
 
Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

LegendItem

public LegendItem(Legend<M> legend,
                  Series<M> series,
                  int yFieldIndex)
Creates a legend item.

Parameters:
legend - the legend that the item is attached
series - the series represented by the item
yFieldIndex - the index of the y field the item represents
Method Detail

getLegend

public Legend<M> getLegend()
Returns the legend that the item is attached.

Returns:
the legend that the item is attached

getSeries

public Series<M> getSeries()
Returns the series that the item represents.

Returns:
the series that the item represents

getX

public double getX()
Returns the x-coordinate of the legend item.

Returns:
the x-coordinate of the legend item

getY

public double getY()
Returns the y-coordinate of the legend item.

Returns:
the y-coordinate of the legend item

getYFieldIndex

public int getYFieldIndex()
Returns the index of the y field of the series that the item represents.

Returns:
the index of the y field of the series that the item represents

onMouseDown

public void onMouseDown()
Method used when the legend item is clicked.


onMouseMove

public void onMouseMove()
Method used when mouse over the legend item.


onMouseOut

public void onMouseOut()
Method used when the mouse leaves the legend item.


setLegend

public void setLegend(Legend<M> legend)
Sets the legend that the item is attached.

Parameters:
legend - the legend that the item is attached

setSeries

public void setSeries(Series<M> series)
Sets the series that the item represents.

Parameters:
series - the series that the item represents

setX

public void setX(double x)
Sets the x-coordinate of the legend item.

Parameters:
x - the x-coordinate of the legend item

setY

public void setY(double y)
Sets the y-coordinate of the legend item.

Parameters:
y - the y-coordinate of the legend item

setYFieldIndex

public void setYFieldIndex(int yFieldIndex)
Sets the index of the y field of the series that the item represents.

Parameters:
yFieldIndex - the index of the y field of the series that the item represents

updatePosition

public void updatePosition(double relativeX,
                           double relativeY)
Updates the position of the legend item based on the given relative point.

Parameters:
relativeX - the relative x-coordinate
relativeY - the relative y-coordinate


Copyright © 2011. All Rights Reserved.