Class SegmentContext


  • public final class SegmentContext
    extends ChartContext
    The callback or handler context wrapper, created and passed by Segment which contains the line charts references.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • SegmentContext

        public SegmentContext​(NativeObject nativeObject)
        Creates the object with native object instance to be wrapped, called by configuration package.
        Parameters:
        nativeObject - native object instance to be wrapped.
    • Method Detail

      • getStartPoint

        public PointElement getStartPoint()
        Returns the PointElement related to the data as starting point of segment.
        Returns:
        the PointElement related to the data as starting point of segment
      • getEndPoint

        public PointElement getEndPoint()
        Returns the PointElement related to the data as ending point of segment.
        Returns:
        the PointElement related to the data as ending point of segment
      • getDatasetIndex

        public int getDatasetIndex()
        Returns the index of the current data set.
        Returns:
        the index of the current data set.
      • getStartDataIndex

        public int getStartDataIndex()
        Returns the index of the current data of starting point of segment.
        Returns:
        the index of the current data of starting point of segment
      • getEndDataIndex

        public int getEndDataIndex()
        Returns the index of the current data of ending point of segment.
        Returns:
        the index of the current data of ending point of segment
      • isConsistent

        protected boolean isConsistent()
        Description copied from class: ChartContext
        Returns true if the context is consistent.
        Custom context (the plugin ones) should extend it and check if the context is consistent before invoking the callback.
        Overrides:
        isConsistent in class ChartContext
        Returns:
        true if the context is consistent
      • checkIfPropertyIsValid

        protected boolean checkIfPropertyIsValid​(Key property)
        Description copied from class: ChartContext
        Checks if the key passed as argument is a key already used for other context properties.
        Overrides:
        checkIfPropertyIsValid in class ChartContext
        Parameters:
        property - property to use to store a custom attribute
        Returns:
        true if the property can be used to store an attribute.