Search Results for

    Show / Hide Table of Contents

    Class StopLossTakeProfitAnnotationCreationModifier

    A modifier for creating StopLossTakeProfitAnnotation instances via a two-point tap-to-place or single continuous drag workflow.

    If the finger moves beyond a small threshold before the first touch-up, both anchor points are placed immediately from the drag gesture and the annotation is finalized. Otherwise, each touch-up places the next anchor point (start, then end) with a rubber-band preview line shown between the last confirmed point and the current touch position.

    Extensibility: This modifier is designed to be easily subclassed. Override any of the following protected methods to customize behavior:

    • #createAnnotation(Context) \u2014 replace the Stop Loss / Take Profit annotation type
    • #createRubberBandAnnotation(Context) \u2014 replace the rubber-band preview line
    • #configureRubberBandAnnotation(IAnnotation) \u2014 configure the rubber-band annotation after creation
    • #updateRubberBandEndPoint(PointF) \u2014 change how the rubber-band tracks the finger
    • #removeRubberBandAnnotation() \u2014 clean up the rubber-band annotation
    • #onAnnotationCreated(IAnnotation) \u2014 react to annotation completion
    Inheritance
    java.lang.Object
    ReceiveMotionEventsBase
    ChartModifierCore
    ChartModifierBase
    TouchModifierBase
    StopLossTakeProfitAnnotationCreationModifier
    Inherited Members
    ChartModifierBase.<T>getMasterModifier(T,IReceiveMotionEvents)
    ChartModifierBase.attachTo(IServiceContainer)
    ChartModifierBase.detach()
    ChartModifierBase.getAllXAxes()
    ChartModifierBase.getAllYAxes()
    ChartModifierBase.getContext()
    ChartModifierBase.getModifierSurface()
    ChartModifierBase.getParentSurface()
    ChartModifierBase.getPointRelativeTo(PointF,IHitTestable)
    ChartModifierBase.getRenderableSeries()
    ChartModifierBase.getRenderableSeriesArea()
    ChartModifierBase.getXAxes()
    ChartModifierBase.getXAxis()
    ChartModifierBase.getXAxis(String)
    ChartModifierBase.getYAxes()
    ChartModifierBase.getYAxis()
    ChartModifierBase.getYAxis(String)
    ChartModifierBase.includeAllAxes()
    ChartModifierBase.includeXAxis(IAxis,boolean)
    ChartModifierBase.includeYAxis(IAxis,boolean)
    ChartModifierBase.isWithinSourceBounds(float,float,boolean,IReceiveMotionEvents)
    ChartModifierBase.onAnnotationsCollectionChanged(CollectionChangedEventArgs<IAnnotation>)
    ChartModifierBase.onAnnotationsDrasticallyChanged()
    ChartModifierBase.onParentSurfaceResized(ResizedMessage)
    ChartModifierBase.onRenderSurfaceRendered(RenderedMessage)
    ChartModifierBase.onXAxesCollectionChanged(CollectionChangedEventArgs<IAxis>)
    ChartModifierBase.onXAxesDrasticallyChanged()
    ChartModifierBase.onYAxesCollectionChanged(CollectionChangedEventArgs<IAxis>)
    ChartModifierBase.onYAxesDrasticallyChanged()
    ChartModifierCore.applyThemeProvider(IThemeProvider)
    ChartModifierCore.checkPointerCounter(MotionEvent,int)
    ChartModifierCore.getEventsGroupTag()
    ChartModifierCore.getIsEnabled()
    ChartModifierCore.getReceiveHandledEvents()
    ChartModifierCore.getServices()
    ChartModifierCore.isAttached()
    ChartModifierCore.onGenericMotion(ModifierTouchEventArgs)
    ChartModifierCore.onIsEnabledChanged(boolean)
    ChartModifierCore.onRenderableSeriesCollectionChanged(CollectionChangedEventArgs<? extends renderableSeries.IRenderableSeriesCore>)
    ChartModifierCore.onRenderableSeriesDrasticallyChanged()
    ChartModifierCore.onSelectedSeriesCollectionChanged(CollectionChangedEventArgs<? extends renderableSeries.IRenderableSeriesCore>)
    ChartModifierCore.setEventsGroupTag(String)
    ChartModifierCore.setIsEnabled(boolean)
    ChartModifierCore.setReceiveHandledEvents(boolean)
    TouchModifierBase.onTouch(ModifierTouchEventArgs)
    TouchModifierBase.onTouchCancel(ModifierTouchEventArgs)
    TouchModifierBase.onTouchDown(ModifierTouchEventArgs)
    TouchModifierBase.onTouchMove(ModifierTouchEventArgs)
    TouchModifierBase.onTouchUp(ModifierTouchEventArgs)
    ReceiveMotionEventsBase.getName()
    Object.clone()
    Object.equals(Object)
    Object.finalize()
    Object.getClass()
    Object.hashCode()
    Object.notify()
    Object.notifyAll()
    Object.toString()
    Object.wait()
    Object.wait(long)
    Object.wait(long,int)
    Namespace:
    Assembly: .dll
    Syntax
    public class StopLossTakeProfitAnnotationCreationModifier extends TouchModifierBase

    Constructors

    StopLossTakeProfitAnnotationCreationModifier()

    Declaration
    public StopLossTakeProfitAnnotationCreationModifier()

    Methods

    configureRubberBandAnnotation(IAnnotation annotation)

    Configures the rubber-band preview annotation after creation.

    Declaration
    protected void configureRubberBandAnnotation(IAnnotation annotation)
    Parameters
    Type Name Description
    IAnnotation annotation

    createAnnotation(Context context)

    Creates a new StopLossTakeProfitAnnotation instance to be placed on the chart. Override this method to return a custom subclass with different default styling.

    Declaration
    protected tradingAnnotations.StopLossTakeProfitAnnotation createAnnotation(Context context)
    Parameters
    Type Name Description
    Context context
    Returns
    Type Description
    tradingAnnotations.StopLossTakeProfitAnnotation

    createOrUpdateRubberBandAnnotation(PointF fromPoint)

    Declaration
    protected void createOrUpdateRubberBandAnnotation(PointF fromPoint)
    Parameters
    Type Name Description
    PointF fromPoint

    createRubberBandAnnotation(Context context)

    Creates the rubber-band preview annotation used to show the next segment while the user is placing points. By default, this creates a LineAnnotation.

    Declaration
    protected IAnnotation createRubberBandAnnotation(Context context)
    Parameters
    Type Name Description
    Context context
    Returns
    Type Description
    IAnnotation

    getCurrentAnnotation()

    Gets the StopLossTakeProfitAnnotation currently being created, or null if no creation is in progress.

    Declaration
    public final tradingAnnotations.StopLossTakeProfitAnnotation getCurrentAnnotation()
    Returns
    Type Description
    tradingAnnotations.StopLossTakeProfitAnnotation

    getCurrentPointIndex()

    Gets the index of the next anchor point to be placed (0-based: 0 = start, 1 = end).

    Declaration
    public final int getCurrentPointIndex()
    Returns
    Type Description
    int

    getRubberBandAnnotation()

    Declaration
    public final IAnnotation getRubberBandAnnotation()
    Returns
    Type Description
    IAnnotation

    getRubberBandStroke()

    Declaration
    public final PenStyle getRubberBandStroke()
    Returns
    Type Description
    PenStyle

    getXAxisId()

    Declaration
    public final String getXAxisId()
    Returns
    Type Description
    String

    getYAxisId()

    Declaration
    public final String getYAxisId()
    Returns
    Type Description
    String

    onAnnotationCreated(IAnnotation newAnnotation)

    Called when the Stop Loss / Take Profit annotation is fully created (both anchor points placed).

    Declaration
    protected void onAnnotationCreated(IAnnotation newAnnotation)
    Parameters
    Type Name Description
    IAnnotation newAnnotation

    onTouchDown(ModifierTouchEventArgs args)

    Called when MotionEvent#ACTION_DOWN event occurs

    Declaration
    protected boolean onTouchDown(ModifierTouchEventArgs args)
    Parameters
    Type Name Description
    ModifierTouchEventArgs args
    Returns
    Type Description
    boolean
    Overrides
    TouchModifierBase.onTouchDown(ModifierTouchEventArgs args)

    onTouchMove(ModifierTouchEventArgs args)

    Called when MotionEvent#ACTION_MOVE event occurs

    Declaration
    protected boolean onTouchMove(ModifierTouchEventArgs args)
    Parameters
    Type Name Description
    ModifierTouchEventArgs args
    Returns
    Type Description
    boolean
    Overrides
    TouchModifierBase.onTouchMove(ModifierTouchEventArgs args)

    onTouchUp(ModifierTouchEventArgs args)

    Called when MotionEvent#ACTION_UP event occurs

    Declaration
    protected boolean onTouchUp(ModifierTouchEventArgs args)
    Parameters
    Type Name Description
    ModifierTouchEventArgs args
    Returns
    Type Description
    boolean
    Overrides
    TouchModifierBase.onTouchUp(ModifierTouchEventArgs args)

    removeRubberBandAnnotation()

    Declaration
    protected void removeRubberBandAnnotation()

    setAnnotationCreationListener(OnAnnotationCreatedListener listener)

    Sets the OnAnnotationCreatedListener called when the annotation is fully created (both points placed).

    Declaration
    public final void setAnnotationCreationListener(OnAnnotationCreatedListener listener)
    Parameters
    Type Name Description
    OnAnnotationCreatedListener listener

    setBasePointFor(tradingAnnotations.TradingAnnotationBase annotation, PointF point)

    Sets a base point on the trading annotation at the given touch position. Only called on touch-up (or from a resolved drag gesture) to avoid triggering internal ghost-line artifacts.

    Declaration
    protected void setBasePointFor(tradingAnnotations.TradingAnnotationBase annotation, PointF point)
    Parameters
    Type Name Description
    tradingAnnotations.TradingAnnotationBase annotation
    PointF point

    setLinePoint(LineAnnotation line, PointF point, boolean isStart)

    Declaration
    protected static void setLinePoint(LineAnnotation line, PointF point, boolean isStart)
    Parameters
    Type Name Description
    LineAnnotation line
    PointF point
    boolean isStart

    setRubberBandAnnotationPoints(IAnnotation annotation, PointF fromPoint, PointF toPoint)

    Sets both the start and end points of the rubber-band preview annotation.

    Declaration
    protected void setRubberBandAnnotationPoints(IAnnotation annotation, PointF fromPoint, PointF toPoint)
    Parameters
    Type Name Description
    IAnnotation annotation
    PointF fromPoint
    PointF toPoint

    setRubberBandStroke(PenStyle stroke)

    Declaration
    public final void setRubberBandStroke(PenStyle stroke)
    Parameters
    Type Name Description
    PenStyle stroke

    setXAxisId(String xAxisId)

    Declaration
    public final void setXAxisId(String xAxisId)
    Parameters
    Type Name Description
    String xAxisId

    setYAxisId(String yAxisId)

    Declaration
    public final void setYAxisId(String yAxisId)
    Parameters
    Type Name Description
    String yAxisId

    updateRubberBandEndPoint(PointF toPoint)

    Declaration
    protected void updateRubberBandEndPoint(PointF toPoint)
    Parameters
    Type Name Description
    PointF toPoint
    Back to top © 2011-2025 SciChart. All rights reserved. | sitemap.xml