M
- the data type of the legend itempublic class LegendItem<M> extends SpriteList<Sprite>
modCount
Constructor and Description |
---|
LegendItem(Legend<M> legend,
Series<M> series,
int yFieldIndex)
Creates a legend item.
|
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
isOn()
Returns true if the legend item is currently enabled.
|
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.
|
add, add, clear, get, getBBox, getSurface, hide, remove, set, setSurface, show, size
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public Legend<M> getLegend()
public Series<M> getSeries()
public double getX()
public double getY()
public int getYFieldIndex()
public boolean isOn()
public void onMouseDown()
public void onMouseMove()
public void onMouseOut()
public void setLegend(Legend<M> legend)
legend
- the legend that the item is attachedpublic void setSeries(Series<M> series)
series
- the series that the item representspublic void setX(double x)
x
- the x-coordinate of the legend itempublic void setY(double y)
y
- the y-coordinate of the legend itempublic void setYFieldIndex(int yFieldIndex)
yFieldIndex
- the index of the y field of the series that the item
representspublic void updatePosition(double relativeX, double relativeY)
relativeX
- the relative x-coordinaterelativeY
- the relative y-coordinateCopyright © 2018. All rights reserved.