M
- the data type of the seriespublic abstract class Series<M> extends Object implements SeriesHandler.HasSeriesHandlers<M>, SeriesSelectionEvent.HasSeriesSelectionHandlers<M>, SeriesItemOutEvent.HasSeriesItemOutHandlers<M>, SeriesItemOverEvent.HasSeriesItemOverHandlers<M>, SeriesItemUpEvent.HasSeriesItemUpHandlers<M>
Modifier and Type | Class and Description |
---|---|
static class |
Series.LabelPosition
Enumeration used for labels positioned on the series.
|
Modifier and Type | Field and Description |
---|---|
protected PreciseRectangle |
bbox |
protected Chart<M> |
chart |
protected HandlerManager |
handlerManager |
protected SeriesHighlighter |
highlighter |
protected boolean |
highlighting |
protected SeriesLabelConfig<M> |
labelConfig |
protected Map<Integer,Sprite> |
labels |
protected int |
lastHighlighted |
protected Map<Integer,String> |
legendNames |
protected List<String> |
legendTitles |
protected SeriesRenderer<M> |
renderer |
protected List<Sprite> |
shadowAttributes |
protected boolean |
shadowed |
protected List<SpriteList<Sprite>> |
shadowGroups |
protected SeriesRenderer<M> |
shadowRenderer |
protected boolean |
shownInLegend |
protected SpriteList<Sprite> |
sprites |
protected Color |
stroke |
protected double |
strokeWidth |
protected ToolTip |
toolTip |
protected SeriesToolTipConfig<M> |
toolTipConfig |
protected ValueProvider<? super M,? extends Number> |
xField |
Constructor and Description |
---|
Series()
Creates a series.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addSeriesHandler(SeriesHandler<M> handler)
Adds a
SeriesHandler handler for SeriesSelectionEvent ,
SeriesItemOutEvent , SeriesItemOverEvent and
SeriesItemUpEvent events. |
HandlerRegistration |
addSeriesItemOutHandler(SeriesItemOutEvent.SeriesItemOutHandler<M> handler)
Adds a
SeriesItemOutEvent.SeriesItemOutHandler handler for
SeriesItemOutEvent events. |
HandlerRegistration |
addSeriesItemOverHandler(SeriesItemOverEvent.SeriesItemOverHandler<M> handler)
Adds a
SeriesItemOverEvent.SeriesItemOverHandler handler for
SeriesItemOverEvent events. |
HandlerRegistration |
addSeriesItemUpHandler(SeriesItemUpEvent.SeriesItemUpHandler<M> handler)
Adds a
SeriesItemUpEvent.SeriesItemUpHandler handler for SeriesItemUpEvent
events. |
HandlerRegistration |
addSeriesSelectionHandler(SeriesSelectionEvent.SeriesSelectionHandler<M> handler)
Adds a
SeriesSelectionEvent.SeriesSelectionHandler handler for
SeriesSelectionEvent events. |
void |
calculateBBox(boolean gutter)
Calculates the bounding the box of the series and stores the result.
|
void |
clear()
Removes all the sprites of the series from the surface.
|
abstract void |
drawSeries()
Draws the series for the current chart.
|
protected HandlerManager |
ensureHandlers() |
PreciseRectangle |
getBBox()
Returns the bounding box of the series.
|
Chart<M> |
getChart()
Returns the chart that the series is attached.
|
double[] |
getGutters()
Returns the axis insets of the series.
|
SeriesHighlighter |
getHighlighter()
Return the
SeriesHighlighter used by the series. |
protected abstract int |
getIndex(PrecisePoint point)
Returns the series index from the given point.
|
SeriesLabelConfig<M> |
getLabelConfig()
Returns the configuration for labels on the series.
|
Map<Integer,String> |
getLegendNames()
Returns the map of names used in the legend.
|
List<String> |
getLegendTitles()
Returns the list of titles used in the legend of the series.
|
protected PrecisePoint |
getPointFromCommand(PathCommand command)
Returns the end point of the given command.
|
SeriesRenderer<M> |
getRenderer()
Return the custom sprite renderer on the series.
|
SeriesRenderer<M> |
getShadowRenderer()
Return the custom shadow sprite renderer on the series.
|
protected abstract int |
getStoreIndex(int index)
Returns the appropriate index on the store for the given series index.
|
Color |
getStroke()
Return the stroke color of the series.
|
double |
getStrokeWidth()
Return the stroke width of the series.
|
ToolTip |
getToolTip()
Return the generated tool tip from the tool tip config.
|
SeriesToolTipConfig<M> |
getToolTipConfig()
Returns the tooltip configuration.
|
protected abstract ValueProvider<? super M,? extends Number> |
getValueProvider(int index)
Returns the value at the given series index.
|
String |
getValueProviderName(ValueProvider<? super M,? extends Number> provider,
int index)
Attempts to get a simplified yet meaningful string from the given
ValueProvider . |
ValueProvider<? super M,? extends Number> |
getXField()
Returns the value provider for the x-axis of the series.
|
abstract void |
hide(int yFieldIndex)
Hides the given y field index from the series.
|
protected void |
hideShadows() |
void |
hideToolTip()
Immediately hides the tool tip shown in the series.
|
abstract void |
highlight(int index)
Highlights the series at the given series index.
|
abstract void |
highlightAll(int index)
Highlights all of the items in the series.
|
boolean |
highlightedState()
Returns whether or not the series is actively highlighted.
|
boolean |
isHighlighting()
Returns whether or not the series uses highlighting.
|
boolean |
isShownInLegend()
Returns whether or not the series is shown in the legend.
|
void |
onMouseDown(PrecisePoint point,
Event event)
Method used when the series is clicked.
|
int |
onMouseMove(PrecisePoint point,
Event event)
Method used when the series is moused over.
|
void |
onMouseOut(PrecisePoint point,
Event event)
Method used when the mouse leaves the series.
|
void |
onMouseUp(PrecisePoint point,
Event event)
Method used when the series is clicked.
|
void |
removeToolTip()
Removes the components tooltip (if one exists).
|
void |
setChart(Chart<M> chart)
Sets the chart that the series is attached.
|
void |
setHighlighter(SeriesHighlighter highlighter)
Set the
SeriesHighlighter used by the series. |
void |
setHighlighting(boolean highlighting)
Sets whether or not the series uses highlighting.
|
void |
setLabelConfig(SeriesLabelConfig<M> labelConfig)
Sets the configuration for labels on the series.
|
protected void |
setLabelContrast(Sprite label,
SeriesLabelConfig<M> config,
Sprite sprite) |
protected void |
setLabelText(Sprite sprite,
int index)
Generates label text for the given sprite at the given series index.
|
void |
setRenderer(SeriesRenderer<M> renderer)
Sets a custom sprite renderer on the series.
|
void |
setShadowRenderer(SeriesRenderer<M> shadowRenderer)
Sets a custom shadow sprite renderer on the series.
|
void |
setShownInLegend(boolean showInLegend)
Sets whether or not the series is shown in the legend.
|
void |
setStroke(Color stroke)
Sets the stroke color of the series.
|
void |
setStrokeWidth(double strokeWidth)
Sets the stroke width of the series.
|
void |
setToolTipConfig(SeriesToolTipConfig<M> config)
Sets the tooltip configuration.
|
void |
setXField(ValueProvider<? super M,? extends Number> xField)
Sets the value provider for the x-axis of the series.
|
abstract void |
show(int yFieldIndex)
Shows the given y field index from the series.
|
abstract void |
unHighlight(int index)
Removes highlighting from the given series index.
|
abstract void |
unHighlightAll(int index)
UnHighlights all items in the series.
|
abstract boolean |
visibleInLegend(int index)
Returns whether or not the given series index is visible in legend.
|
protected ValueProvider<? super M,? extends Number> xField
protected SpriteList<Sprite> sprites
protected List<SpriteList<Sprite>> shadowGroups
protected PreciseRectangle bbox
protected boolean shownInLegend
protected boolean highlighting
protected int lastHighlighted
protected SeriesHighlighter highlighter
protected SeriesRenderer<M> renderer
protected SeriesRenderer<M> shadowRenderer
protected ToolTip toolTip
protected SeriesToolTipConfig<M> toolTipConfig
protected SeriesLabelConfig<M> labelConfig
protected HandlerManager handlerManager
protected Color stroke
protected double strokeWidth
protected boolean shadowed
public HandlerRegistration addSeriesHandler(SeriesHandler<M> handler)
SeriesHandler.HasSeriesHandlers
SeriesHandler
handler for SeriesSelectionEvent
,
SeriesItemOutEvent
, SeriesItemOverEvent
and
SeriesItemUpEvent
events.addSeriesHandler
in interface SeriesHandler.HasSeriesHandlers<M>
handler
- the handlerpublic HandlerRegistration addSeriesItemOutHandler(SeriesItemOutEvent.SeriesItemOutHandler<M> handler)
SeriesItemOutEvent.HasSeriesItemOutHandlers
SeriesItemOutEvent.SeriesItemOutHandler
handler for
SeriesItemOutEvent
events.addSeriesItemOutHandler
in interface SeriesItemOutEvent.HasSeriesItemOutHandlers<M>
handler
- the handlerpublic HandlerRegistration addSeriesItemOverHandler(SeriesItemOverEvent.SeriesItemOverHandler<M> handler)
SeriesItemOverEvent.HasSeriesItemOverHandlers
SeriesItemOverEvent.SeriesItemOverHandler
handler for
SeriesItemOverEvent
events.addSeriesItemOverHandler
in interface SeriesItemOverEvent.HasSeriesItemOverHandlers<M>
handler
- the handlerpublic HandlerRegistration addSeriesSelectionHandler(SeriesSelectionEvent.SeriesSelectionHandler<M> handler)
SeriesSelectionEvent.HasSeriesSelectionHandlers
SeriesSelectionEvent.SeriesSelectionHandler
handler for
SeriesSelectionEvent
events.addSeriesSelectionHandler
in interface SeriesSelectionEvent.HasSeriesSelectionHandlers<M>
handler
- the handlerpublic HandlerRegistration addSeriesItemUpHandler(SeriesItemUpEvent.SeriesItemUpHandler<M> handler)
SeriesItemUpEvent.HasSeriesItemUpHandlers
SeriesItemUpEvent.SeriesItemUpHandler
handler for SeriesItemUpEvent
events.addSeriesItemUpHandler
in interface SeriesItemUpEvent.HasSeriesItemUpHandlers<M>
handler
- the handlerpublic void calculateBBox(boolean gutter)
getBBox()
.gutter
- true if to use the series gutter in the calculationpublic void clear()
public abstract void drawSeries()
public PreciseRectangle getBBox()
public Chart<M> getChart()
public double[] getGutters()
public SeriesHighlighter getHighlighter()
SeriesHighlighter
used by the series.public SeriesLabelConfig<M> getLabelConfig()
public Map<Integer,String> getLegendNames()
public List<String> getLegendTitles()
public SeriesRenderer<M> getRenderer()
public SeriesRenderer<M> getShadowRenderer()
public Color getStroke()
public double getStrokeWidth()
public ToolTip getToolTip()
public SeriesToolTipConfig<M> getToolTipConfig()
public String getValueProviderName(ValueProvider<? super M,? extends Number> provider, int index)
ValueProvider
.provider
- the value providerindex
- the index to be used if no pathpublic ValueProvider<? super M,? extends Number> getXField()
public abstract void hide(int yFieldIndex)
yFieldIndex
- the index of the y fieldpublic void hideToolTip()
public abstract void highlight(int index)
index
- the series index to be highlightedpublic abstract void highlightAll(int index)
index
- the index of the seriespublic boolean highlightedState()
public boolean isHighlighting()
public boolean isShownInLegend()
public void onMouseDown(PrecisePoint point, Event event)
point
- the point clickedpublic int onMouseMove(PrecisePoint point, Event event)
point
- the point moused overpublic void onMouseOut(PrecisePoint point, Event event)
point
- the point leftpublic void onMouseUp(PrecisePoint point, Event event)
point
- the point clickedpublic void removeToolTip()
public void setChart(Chart<M> chart)
chart
- the chart that the series is attachedpublic void setHighlighter(SeriesHighlighter highlighter)
SeriesHighlighter
used by the series.highlighter
- the series highlighterpublic void setHighlighting(boolean highlighting)
highlighting
- whether or not the series uses highlightingpublic void setLabelConfig(SeriesLabelConfig<M> labelConfig)
labelConfig
- the label configurationpublic void setRenderer(SeriesRenderer<M> renderer)
renderer
- the rendererpublic void setShadowRenderer(SeriesRenderer<M> shadowRenderer)
shadowRenderer
- the rendererpublic void setShownInLegend(boolean showInLegend)
showInLegend
- true if the series is shown in the legendpublic void setStroke(Color stroke)
stroke
- the stroke color of the seriespublic void setStrokeWidth(double strokeWidth)
strokeWidth
- the stroke width of the seriespublic void setToolTipConfig(SeriesToolTipConfig<M> config)
config
- the tooltip configurationpublic void setXField(ValueProvider<? super M,? extends Number> xField)
xField
- the value provider for the x-axis of the seriespublic abstract void show(int yFieldIndex)
yFieldIndex
- the index of the y fieldpublic abstract void unHighlight(int index)
index
- the index to have its highlighting removedpublic abstract void unHighlightAll(int index)
index
- the index of the seriespublic abstract boolean visibleInLegend(int index)
index
- the series index to determine visibleprotected HandlerManager ensureHandlers()
protected abstract int getIndex(PrecisePoint point)
point
- the point get the series indexprotected PrecisePoint getPointFromCommand(PathCommand command)
command
- the command to get the point fromprotected abstract int getStoreIndex(int index)
index
- the series indexprotected abstract ValueProvider<? super M,? extends Number> getValueProvider(int index)
index
- the series indexprotected void hideShadows()
protected void setLabelContrast(Sprite label, SeriesLabelConfig<M> config, Sprite sprite)
protected void setLabelText(Sprite sprite, int index)
sprite
- the sprite to be setindex
- the series index of the label dataCopyright © 2018. All rights reserved.