T
- The modifier to which this behavior will be attached.public abstract class ModifierBehavior<T extends IChartModifier> extends java.lang.Object implements com.scichart.core.framework.IAttachable, IThemeable
IChartModifier
implementors.Modifier and Type | Field and Description |
---|---|
protected android.graphics.PointF |
lastUpdatePoint |
protected T |
modifier |
protected java.lang.Class<T> |
modifierType |
protected ISciChartSurface |
parentSurface |
protected com.scichart.core.AttachableServiceContainer |
services |
Modifier | Constructor and Description |
---|---|
protected |
ModifierBehavior(java.lang.Class<T> modifierType)
Creates a new instance of
ModifierBehavior class. |
Modifier and Type | Method and Description |
---|---|
void |
applyThemeProvider(IThemeProvider themeProvider)
Applies specified theme to current instance
|
void |
attachTo(com.scichart.core.IServiceContainer services) |
static void |
attachTo(ModifierBehavior behavior,
IChartModifier modifier,
boolean isEnabled)
Attaches the
ModifierBehavior instance to the IChartModifier instance with isEnabled value passed in. |
void |
clear()
Clears
lastUpdatePoint x and y to NaN values. |
void |
detach() |
boolean |
getIsEnabled()
Gets a value indicating whether the current
ModifierBehavior instance is enabled on the related IChartModifier instance. |
boolean |
isAttached() |
protected boolean |
isLastPointValid()
Gets a value indicating whether the
lastUpdatePoint is valid. |
void |
onBeginUpdate(android.graphics.PointF point,
boolean isMaster)
Called when associated
IChartModifier instance handle touch down event. |
void |
onEndUpdate(android.graphics.PointF point,
boolean isMaster)
Called when associated
IChartModifier instance handle touch up event. |
protected void |
onIsEnabledChanged(boolean isEnabled)
Called when is enabled has changed.
|
void |
onUpdate(android.graphics.PointF point,
boolean isMaster)
Called when associated
IChartModifier instance handle touch move event. |
protected void |
resetLastUpdatePoint()
Resets
lastUpdatePoint x and y to NaN values. |
void |
setIsEnabled(boolean isEnabled)
Sets a value indicating whether the current
ModifierBehavior instance is enabled on the related IChartModifier instance. |
protected final java.lang.Class<T extends IChartModifier> modifierType
protected final com.scichart.core.AttachableServiceContainer services
protected T extends IChartModifier modifier
protected ISciChartSurface parentSurface
protected android.graphics.PointF lastUpdatePoint
protected ModifierBehavior(java.lang.Class<T> modifierType)
ModifierBehavior
class.modifierType
- Type of the modifier to which this modifier will be attached.public final boolean getIsEnabled()
ModifierBehavior
instance is enabled on the related IChartModifier
instance.ModifierBehavior
instance is enabled.public final void setIsEnabled(boolean isEnabled)
ModifierBehavior
instance is enabled on the related IChartModifier
instance.isEnabled
- Enabled or not enabled.protected void onIsEnabledChanged(boolean isEnabled)
isEnabled
- Enabled or not enabled.protected boolean isLastPointValid()
lastUpdatePoint
is valid.lastUpdatePoint
is valid.public void attachTo(@NonNull com.scichart.core.IServiceContainer services)
attachTo
in interface com.scichart.core.framework.IAttachable
protected final void resetLastUpdatePoint()
lastUpdatePoint
x and y to NaN values.public void detach()
detach
in interface com.scichart.core.framework.IAttachable
public void applyThemeProvider(IThemeProvider themeProvider)
applyThemeProvider
in interface IThemeable
themeProvider
- The IThemeProvider
instance which provides new theme for current instancepublic final boolean isAttached()
isAttached
in interface com.scichart.core.framework.IAttachable
public void onBeginUpdate(android.graphics.PointF point, boolean isMaster)
IChartModifier
instance handle touch down event.point
- The current touch point.isMaster
- Indicates whether this behavior is called on the master chart.public void onUpdate(android.graphics.PointF point, boolean isMaster)
IChartModifier
instance handle touch move event.point
- The current touch point.isMaster
- Indicates whether this behavior is called on the master chart.public void onEndUpdate(android.graphics.PointF point, boolean isMaster)
IChartModifier
instance handle touch up event.point
- The current touch point.isMaster
- Indicates whether this behavior is called on the master chart.public void clear()
lastUpdatePoint
x and y to NaN values.public static void attachTo(ModifierBehavior behavior, IChartModifier modifier, boolean isEnabled)
ModifierBehavior
instance to the IChartModifier
instance with isEnabled value passed in.behavior
- The ModifierBehavior
instance which will be attached to the passed in IChartModifier
instance.modifier
- The IChartModifier
instance to which the passed in ModifierBehavior
instance will be attached.isEnabled
- Value which identifies whether the ModifierBehavior
instance is enabled or not.