Search Results for

    Show / Hide Table of Contents

    Class XabcdAnnotationCreationModifier

    A modifier for creating XabcdAnnotation instances via a multipoint tap-to-place workflow.

    Each touch-up places the next base point (X, A, B, C, D). A rubber-band preview line is shown between the last confirmed point and the current touch position.

    After the fifth point is placed the annotation is finalized and the OnAnnotationCreatedListener is notified.

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

    • #createAnnotation(Context) \u2014 replace the XABCD annotation type
    • #createRubberBandAnnotation(Context) \u2014 replace the rubber-band preview line with any annotation type (e.g. a different line, arrow, or custom annotation)
    • #configureRubberBandAnnotation(IAnnotation) \u2014 configure the rubber-band annotation after creation (styling, etc.)
    • #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

    Rubber-band styling can also be changed without subclassing by using #setRubberBandStroke(PenStyle).

    Inheritance
    java.lang.Object
    ReceiveMotionEventsBase
    ChartModifierCore
    ChartModifierBase
    TouchModifierBase
    XabcdAnnotationCreationModifier
    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 XabcdAnnotationCreationModifier extends TouchModifierBase

    Constructors

    XabcdAnnotationCreationModifier()

    Declaration
    public XabcdAnnotationCreationModifier()

    Methods

    configureRubberBandAnnotation(IAnnotation annotation)

    Configures the rubber-band preview annotation after creation.

    By default, this sets the axis IDs, disables editing, and applies the current rubberBandStroke.

    Override this method to apply custom configuration to the rubber-band annotation (e.g. different colors per segment, opacity, etc.).

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

    the rubber-band annotation to configure

    createAnnotation(Context context)

    Creates a new XabcdAnnotation instance to be placed on the chart.

    Override this method to return a custom subclass of XabcdAnnotation with different default styling, behavior, or properties.

    Example:

    @Override
    protected XabcdAnnotation createAnnotation(Context context) {
        XabcdAnnotation annotation = new XabcdAnnotation(context);
        annotation.setStroke(new SolidPenStyle(Color.RED, true, 3f, null));
        annotation.setFill(new SolidBrushStyle(Color.argb(50, 255, 0, 0)));
        return annotation;
    }
    
    Declaration
    protected tradingAnnotations.XabcdAnnotation createAnnotation(Context context)
    Parameters
    Type Name Description
    Context context

    the Android context

    Returns
    Type Description
    tradingAnnotations.XabcdAnnotation

    a new XabcdAnnotation instance; must not be null

    createOrUpdateRubberBandAnnotation(PointF fromPoint)

    Creates or repositions the rubber-band preview annotation starting from the given point. This annotation is a separate entity managed by the modifier, NOT part of the XABCD annotation's internal structure, so it avoids ghost-line artifacts.

    Override this to change when or how the rubber-band annotation is created and positioned.

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

    the starting point for the rubber-band (last confirmed touch)

    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. Override this method to use any other annotation type (e.g. an arrow annotation, a custom drawn annotation, etc.).

    After creation, #configureRubberBandAnnotation(IAnnotation) is called to apply styling.

    Contract: The returned annotation must support having its coordinates set via #setRubberBandAnnotationPoints(IAnnotation, PointF, PointF). If you return a non-LineAnnotation type, you must also override #setRubberBandAnnotationPoints(IAnnotation, PointF, PointF).

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

    the Android context

    Returns
    Type Description
    IAnnotation

    a new annotation instance to use as the rubber-band preview

    getCurrentAnnotation()

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

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

    the current in-progress annotation, or null

    getCurrentPointIndex()

    Gets the index of the next base point to be placed (0-based).

    This is useful in subclasses to know which point is about to be placed.

    Declaration
    public final int getCurrentPointIndex()
    Returns
    Type Description
    int

    the current point index (0 = X, 1 = A, 2 = B, 3 = C, 4 = D)

    getRubberBandAnnotation()

    Gets the rubber-band preview annotation currently displayed, or null if none is visible.

    Declaration
    public final IAnnotation getRubberBandAnnotation()
    Returns
    Type Description
    IAnnotation

    the current rubber-band annotation, or null

    getRubberBandStroke()

    Gets the PenStyle currently used for the rubber-band preview line.

    Declaration
    public final PenStyle getRubberBandStroke()
    Returns
    Type Description
    PenStyle

    the current rubber-band pen style

    getXAxisId()

    Gets the xAxis id for annotations created by this modifier.

    Declaration
    public final String getXAxisId()
    Returns
    Type Description
    String

    getYAxisId()

    Gets the yAxis id for annotations created by this modifier.

    Declaration
    public final String getYAxisId()
    Returns
    Type Description
    String

    onAnnotationCreated(IAnnotation newAnnotation)

    Called when the XABCD annotation is fully created (all base points placed).

    Override this to perform additional post-creation actions (e.g. select the annotation, apply final styling, show a toolbar, etc.). Call super.onAnnotationCreated() to ensure the listener is notified.

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

    the completed annotation

    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()

    Removes the rubber-band preview annotation from the surface.

    Override this to perform additional cleanup when the rubber-band is removed (e.g. dispose resources, animate out, etc.).

    Declaration
    protected void removeRubberBandAnnotation()

    setAnnotationCreationListener(OnAnnotationCreatedListener listener)

    Sets the OnAnnotationCreatedListener called when the XABCD annotation is fully created (all 5 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 to avoid triggering internal ghost-line artifacts.

    Override this to apply coordinate transformations (e.g. snapping to data points, rounding, constraining to ranges, etc.).

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

    the trading annotation being created

    PointF point

    the touch position in pixel coordinates

    setLinePoint(LineAnnotation line, PointF point, boolean isStart)

    Sets either the start (X1/Y1) or end (X2/Y2) of a LineAnnotation from a touch-coordinate point.

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

    true to set X1/Y1, false to set X2/Y2

    setRubberBandAnnotationPoints(IAnnotation annotation, PointF fromPoint, PointF toPoint)

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

    By default, this handles LineAnnotation by setting X1/Y1 and X2/Y2. If you override #createRubberBandAnnotation(Context) to return a different annotation type, you must also override this method.

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

    the rubber-band annotation

    PointF fromPoint

    the start point (last confirmed touch position) in pixel coordinates

    PointF toPoint

    the end point (current touch position) in pixel coordinates

    setRubberBandStroke(PenStyle stroke)

    Sets the PenStyle used for the rubber-band preview line.

    This allows changing the color, thickness, dash pattern, etc. of the rubber-band line without subclassing.

    If a rubber-band line is currently visible, it will be updated on the next touch event.

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

    the pen style to use; must not be null

    setXAxisId(String xAxisId)

    Sets the xAxis id for annotations created by this modifier.

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

    setYAxisId(String yAxisId)

    Sets the yAxis id for annotations created by this modifier.

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

    updateRubberBandEndPoint(PointF toPoint)

    Updates the endpoint of the rubber-band annotation to follow the finger.

    Override this to change the tracking behavior (e.g. snap to grid, constrain to axis, etc.).

    Declaration
    protected void updateRubberBandEndPoint(PointF toPoint)
    Parameters
    Type Name Description
    PointF toPoint

    the current touch position in pixel coordinates

    Back to top © 2011-2025 SciChart. All rights reserved. | sitemap.xml