Class AnnotationElement

  • All Implemented Interfaces:
    IsPoint

    public final class AnnotationElement
    extends ChartElement
    Maps all properties of the annotation element, the implementation of the annotation options in the plugin.
    It provides all dimensions of the element and sub elements.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • AnnotationElement

        public AnnotationElement​(AnnotationEnvelop<NativeObject> envelop)
        Creates the item using an envelop of the native java script object which contains all properties.
        Parameters:
        envelop - envelop of the nativeObject native java script object which contains all properties.
    • Method Detail

      • getLabel

        public AnnotationElement getLabel()
        Returns the inner label element of the element.
        Returns:
        the inner label element of the element
      • setCenterPoint

        public void setCenterPoint​(IsPoint point)
        Sets the center point of the element.
        Parameters:
        point - the center point of the element.
      • setCenterPoint

        public void setCenterPoint​(double x,
                                   double y)
        Sets the center point of the element.
        Parameters:
        x - the X value of center point of the element.
        y - the Y value of center point of the element.
      • inRange

        public boolean inRange​(IsPoint point)
        Returns whether the coordinates, passed as arguments, are inside the element or not.
        Parameters:
        point - the point instance to check.
        Returns:
        true if point is inside the element
      • inRange

        public boolean inRange​(IsPoint point,
                               boolean useFinalPosition)
        Returns whether the coordinates, passed as arguments, are inside the element or not.
        Parameters:
        point - the point instance to check.
        useFinalPosition - if the position must be calculated with final dimensions or also during the animation.
        Returns:
        true if point is inside the element
      • inRange

        public boolean inRange​(double x,
                               double y)
        Returns whether the coordinates, passed as arguments, are inside the element or not.
        Parameters:
        x - coordinate x of the point to check.
        y - coordinate y of the point to check.
        Returns:
        true if point is inside the element
      • inRange

        public boolean inRange​(double x,
                               double y,
                               boolean useFinalPosition)
        Returns whether the coordinates, passed as arguments, are inside the element or not.
        Parameters:
        x - coordinate x of the point to check.
        y - coordinate y of the point to check.
        useFinalPosition - if the position must be calculated with final dimensions or also during the animation.
        Returns:
        true if point is inside the element
      • getOptions

        public OptionsElement getOptions()
        Returns the element options or null if options are not stored in the element.
        Overrides:
        getOptions in class ChartElement
        Returns:
        the element options or null if options are not stored in the element.
      • setX

        public void setX​(double x)
        Sets the X location of element in pixel.
        Parameters:
        x - the X location of element in pixel.
      • setY

        public void setY​(double y)
        Sets the Y location of element in pixel.
        Parameters:
        y - the Y location of element in pixel.
      • getX2

        public double getX2()
        Returns the X2 location of element in pixel.
        Returns:
        the X2 location of element in pixel.
      • setX2

        public void setX2​(double x2)
        Sets the X2 location of element in pixel.
        Parameters:
        x2 - the X2 location of element in pixel.
      • getY2

        public double getY2()
        Returns the Y location of element in pixel.
        Returns:
        the Y location of element in pixel.
      • setY2

        public void setY2​(double y2)
        Sets the Y2 location of element in pixel.
        Parameters:
        y2 - the Y2 location of element in pixel.
      • getWidth

        public double getWidth()
        Returns the width of element in pixel.
        Returns:
        the width of element in pixel.
      • setWidth

        public void setWidth​(double width)
        Sets the width of element in pixel.
        Parameters:
        width - the width of element in pixel.
      • getHeight

        public double getHeight()
        Returns the height of element in pixel.
        Returns:
        the height of element in pixel.
      • setHeight

        public void setHeight​(double height)
        Sets the height of element in pixel.
        Parameters:
        height - the height of element in pixel.
      • getRadius

        public double getRadius()
        Returns the radius of element in pixel.
        Returns:
        the radius of element in pixel.
      • setRadius

        public void setRadius​(double radius)
        Sets the radius of element in pixel.
        Parameters:
        radius - the radius of element in pixel.
      • getPointX

        public double getPointX()
        Returns the X location of element point in pixel.
        Returns:
        the X location of element point in pixel.
      • getPointY

        public double getPointY()
        Returns the Y location of element point in pixel.
        Returns:
        the Y location of element point in pixel.