public class PieSegmentSelectionModifier extends PieChartMasterSlaveTouchModifierBase
PieSegmentSelectionModifier
provides the ability to select PieRenderableSeries
or DonutRenderableSeries
segments via a Chart Modifier.Constructor and Description |
---|
PieSegmentSelectionModifier() |
Modifier and Type | Method and Description |
---|---|
void |
attachTo(com.scichart.core.IServiceContainer services) |
protected void |
clearAll()
When overridden in a derived class, this method should clear all markers and tooltips from the
SciPieChartSurface.chartModifierSurface . |
protected void |
deselectAll()
Deselects all selected
IPieSegment 's in each IPieRenderableSeries instance. |
void |
detach() |
IStyle<IPieSegment> |
getSelectedSegmentStyle()
Gets a
IStyle for the selected IPieSegment . |
protected void |
handleMasterTouchDownEvent(android.graphics.PointF point)
When overridden in a derived class, called to handle the Master
ChartModifierBase MotionEvent.ACTION_DOWN |
protected void |
handleMasterTouchMoveEvent(android.graphics.PointF point)
When overridden in a derived class, called to handle the Master
ChartModifierBase MotionEvent.ACTION_MOVE |
protected void |
handleMasterTouchUpEvent(android.graphics.PointF point)
When overridden in a derived class, called to handle the Master
ChartModifierBase MotionEvent.ACTION_UP |
protected void |
handleSlaveTouchDownEvent(android.graphics.PointF point)
When overridden in a derived class, called to handle the Slave
ChartModifierBase MotionEvent.ACTION_DOWN |
protected void |
handleSlaveTouchMoveEvent(android.graphics.PointF point)
When overridden in a derived class, called to handle the Slave
ChartModifierBase MotionEvent.ACTION_MOVE |
protected void |
handleSlaveTouchUpEvent(android.graphics.PointF point)
When overridden in a derived class, called to handle the Slave
ChartModifierBase MotionEvent.ACTION_UP |
protected boolean |
isHitPointValid(PieHitTestInfo hitTestInfo)
When overridden in derived classes, indicates whether
PieHitTestInfo result of hit-test
should be returned from the updateSeriesInfos(List, Action2) method. |
protected boolean |
isSeriesValid(IPieRenderableSeries series)
When overridden in derived classes, indicates whether the
IPieRenderableSeries should be inspected
in order to update PieSeriesInfo inside the updateSeriesInfos(List, Action2) method. |
void |
onPieRenderableSeriesDrasticallyChanged(ISciPieChartSurface surface)
Called when parent
SciPieChartSurface.getRenderableSeries() collection drastically changed. |
void |
onSelectedSegmentsCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<IPieSegment> args)
Called when parent
PieDonutRenderableSeriesBase.getSelectedSegmentsCollection() collection changes. |
void |
setSelectedSegmentStyle(IStyle<IPieSegment> selectedSegmentStyle)
Sets a
IStyle for the selected IPieSegment . |
protected void |
trySetStyle(IPieSegment segment)
Tries to set
getSelectedSegmentStyle() on the passed in IPieSegment instance. |
protected void |
updateSeriesInfos(java.util.List<PieSeriesInfo> seriesInfos,
com.scichart.core.common.Action2<IPieRenderableSeries,PieHitTestInfo> hitTestMethod)
Called internally, gets the
PieSeriesInfo on all IPieRenderableSeries collection
on the parent PieChartModifierBase.parentSurface using the provided hit-test function. |
protected void |
updateSeriesInfos(java.util.List<PieSeriesInfo> seriesInfos,
float x,
float y)
Enumerates
IPieRenderableSeries collection on the parent PieChartModifierBase.parentSurface and
updates the PieSeriesInfo objects in given x y values of the point. |
isEnabledAt, onTouchDown, onTouchMove, onTouchUp, updateCurrentPoint
onTouch, onTouchCancel
applyThemeProvider, getContext, getEventsGroupTag, getIsEnabled, getModifierSurface, getParentSurface, getPointRelativeTo, getReceiveHandledEvents, getRenderableSeries, getServices, isAttached, onGenericMotion, onIsEnabledChanged, onParentPieSurfaceResized, onPieRenderableSeriesCollectionChanged, onPieRenderSurfaceRendered, onSegmentCollectionDrasticallyChanged, onSegmentsCollectionChanged, onSelectedPieSeriesCollectionChanged, setIsEnabled, setReceiveHandledEvents
public void attachTo(@NonNull com.scichart.core.IServiceContainer services)
attachTo
in interface com.scichart.core.framework.IAttachable
attachTo
in class PieChartModifierBase
public void detach()
detach
in interface com.scichart.core.framework.IAttachable
detach
in class PieChartModifierBase
public final IStyle<IPieSegment> getSelectedSegmentStyle()
IStyle
for the selected IPieSegment
.IStyle
for the selected IPieSegment
.public final void setSelectedSegmentStyle(IStyle<IPieSegment> selectedSegmentStyle)
IStyle
for the selected IPieSegment
.selectedSegmentStyle
- The new IPieSegment
for selected series.protected void trySetStyle(IPieSegment segment)
getSelectedSegmentStyle()
on the passed in IPieSegment
instance.segment
- The IPieSegment
instance to set style on.protected void handleMasterTouchDownEvent(android.graphics.PointF point)
ChartModifierBase
MotionEvent.ACTION_DOWN
handleMasterTouchDownEvent
in class PieChartMasterSlaveTouchModifierBase
point
- The current touch pointprotected void handleMasterTouchMoveEvent(android.graphics.PointF point)
ChartModifierBase
MotionEvent.ACTION_MOVE
handleMasterTouchMoveEvent
in class PieChartMasterSlaveTouchModifierBase
point
- The current touch pointprotected void updateSeriesInfos(java.util.List<PieSeriesInfo> seriesInfos, float x, float y)
IPieRenderableSeries
collection on the parent PieChartModifierBase.parentSurface
and
updates the PieSeriesInfo
objects in given x y values of the point.seriesInfos
- The PieSeriesInfo
collection to update.x
- The x value of the point to update the PieSeriesInfo
objects.y
- The x value of the point to update the PieSeriesInfo
objects.protected final void updateSeriesInfos(java.util.List<PieSeriesInfo> seriesInfos, com.scichart.core.common.Action2<IPieRenderableSeries,PieHitTestInfo> hitTestMethod)
PieSeriesInfo
on all IPieRenderableSeries
collection
on the parent PieChartModifierBase.parentSurface
using the provided hit-test function.seriesInfos
- The PieSeriesInfo
objects to update.hitTestMethod
- The Hit-test function.protected boolean isSeriesValid(IPieRenderableSeries series)
IPieRenderableSeries
should be inspected
in order to update PieSeriesInfo
inside the updateSeriesInfos(List, Action2)
method.series
- The IPieRenderableSeries
instance which will be checked.IPieRenderableSeries
is valid, else - false.protected boolean isHitPointValid(PieHitTestInfo hitTestInfo)
PieHitTestInfo
result of hit-test
should be returned from the updateSeriesInfos(List, Action2)
method.hitTestInfo
- The PieHitTestInfo
instance which will be checked.PieHitTestInfo
is valid, else - false.protected void deselectAll()
IPieSegment
's in each IPieRenderableSeries
instance.protected void handleMasterTouchUpEvent(android.graphics.PointF point)
ChartModifierBase
MotionEvent.ACTION_UP
handleMasterTouchUpEvent
in class PieChartMasterSlaveTouchModifierBase
point
- The current touch pointprotected void handleSlaveTouchDownEvent(android.graphics.PointF point)
ChartModifierBase
MotionEvent.ACTION_DOWN
handleSlaveTouchDownEvent
in class PieChartMasterSlaveTouchModifierBase
point
- The current touch pointprotected void handleSlaveTouchMoveEvent(android.graphics.PointF point)
ChartModifierBase
MotionEvent.ACTION_MOVE
handleSlaveTouchMoveEvent
in class PieChartMasterSlaveTouchModifierBase
point
- The current touch pointprotected void handleSlaveTouchUpEvent(android.graphics.PointF point)
ChartModifierBase
MotionEvent.ACTION_UP
handleSlaveTouchUpEvent
in class PieChartMasterSlaveTouchModifierBase
point
- The current touch pointprotected void clearAll()
SciPieChartSurface.chartModifierSurface
.clearAll
in class PieChartMasterSlaveTouchModifierBase
public void onPieRenderableSeriesDrasticallyChanged(ISciPieChartSurface surface)
SciPieChartSurface.getRenderableSeries()
collection drastically changed.onPieRenderableSeriesDrasticallyChanged
in interface ISciPieChartSurfaceChangeListener
onPieRenderableSeriesDrasticallyChanged
in class PieChartModifierBase
surface
- The parent surface.public void onSelectedSegmentsCollectionChanged(com.scichart.core.observable.CollectionChangedEventArgs<IPieSegment> args)
PieDonutRenderableSeriesBase.getSelectedSegmentsCollection()
collection changes.onSelectedSegmentsCollectionChanged
in interface ISciPieChartSurfaceChangeListener
onSelectedSegmentsCollectionChanged
in class PieChartModifierBase
args
- The collection changed event args.