Class AnnotationOptions


  • public final class AnnotationOptions
    extends AbstractPluginOptions
    This is the AnnotationPlugin.ID plugin options where to set all configuration items needed to the plugin.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • AnnotationOptions

        public AnnotationOptions()
        Creates new AnnotationPlugin.ID plugin options.
      • AnnotationOptions

        public AnnotationOptions​(IsChart chart)
        Creates new AnnotationPlugin.ID plugin options, relating to chart instance for default.
        Parameters:
        chart - chart instance related to the plugin options
    • Method Detail

      • setClip

        public void setClip​(boolean clip)
        Sets how to clip relative to the chart area.
        If false allows overflow, otherwise true clips that many pixels inside the chart area.
        Parameters:
        clip - If false allows overflow, otherwise true clips that many pixels inside the chart area.
      • isClip

        public boolean isClip()
        Returns if clips relative to the chart area.
        Returns:
        true if clips relative to the chart area.
      • setDrawTime

        public void setDrawTime​(DrawTime drawTime)
        Sets the draw time which defines when the annotations are drawn.
        Parameters:
        drawTime - the draw time which defines when the annotations are drawn
      • getDrawTime

        public DrawTime getDrawTime()
        Returns the draw time which defines when the annotations are drawn.
        Returns:
        the draw time which defines when the annotations are drawn
      • setDoubleClickSpeed

        public void setDoubleClickSpeed​(int speed)
        Sets the double-click speed in milliseconds used to distinguish single-clicks from double-clicks whenever you need to capture both.
        Parameters:
        speed - the double-click speed in milliseconds
      • getDoubleClickSpeed

        public int getDoubleClickSpeed()
        Returns the double-click speed in milliseconds used to distinguish single-clicks from double-clicks whenever you need to capture both.
        Returns:
        the double-click speed in milliseconds
      • hasAnnotation

        public boolean hasAnnotation​(String id)
        Returns true if the annotation with the id passed as argument exists.
        Parameters:
        id - annotation id to check
        Returns:
        true if the annotation with the id passed as argument exists
      • hasAnnotation

        public boolean hasAnnotation​(AnnotationId id)
        Returns true if the annotation with the id passed as argument exists.
        Parameters:
        id - annotation id to check
        Returns:
        true if the annotation with the id passed as argument exists
      • removeAnnotation

        public void removeAnnotation​(String id)
        Removes the annotation by the id passed as argument, if exists.
        Parameters:
        id - annotation id to check
      • removeAnnotation

        public void removeAnnotation​(AnnotationId id)
        Removes the annotation by the id passed as argument, if exists.
        Parameters:
        id - annotation id to check
      • addAnnotations

        public void addAnnotations​(AbstractAnnotation... annotations)
        Adds an annotations for plugin.
        Parameters:
        annotations - set of annotations.
      • setAnnotations

        public void setAnnotations​(AbstractAnnotation... annotations)
        Sets a set of annotations for plugin. If argument is null, removes all annotations.
        Parameters:
        annotations - set of annotations. If null, removes all annotations
      • getAnnotations

        public List<AbstractAnnotation> getAnnotations()
        Returns the collection of annotations.
        Returns:
        the collection of annotations
      • getAnnotation

        public AbstractAnnotation getAnnotation​(String id)
        Returns the annotation with the id passed as argument or null if not exist.
        Parameters:
        id - annotation id to use to retrieve the annotation
        Returns:
        the annotation or null if not exist
      • getAnnotation

        public AbstractAnnotation getAnnotation​(AnnotationId id)
        Returns the annotation with the id passed as argument or null if not exist.
        Parameters:
        id - annotation id to check
        Returns:
        the annotation with the id passed as argument or null if not exist