Class ControlPoint


  • public final class ControlPoint
    extends AbstractNode
    This object is to set the control point of a line annotation, when set as curve.
    If curve is enabled, it configures the control point to drawn the curve, calculated in pixels.
    It can be set by a string in percentage format "number%" which are representing the percentage of the distance between the start and end point from the center.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • MINIMUN_PERCENTAGE

        public static final double MINIMUN_PERCENTAGE
        Maximum value as percentage, -1000.0
        See Also:
        Constant Field Values
      • MAXIMUN_PERCENTAGE

        public static final double MAXIMUN_PERCENTAGE
        Maximum value as percentage, 1000.0
        See Also:
        Constant Field Values
      • DEFAULT_X_PERCENTAGE

        public static final double DEFAULT_X_PERCENTAGE
        Default of X value as percentage, 0.0
        See Also:
        Constant Field Values
      • DEFAULT_Y_PERCENTAGE

        public static final double DEFAULT_Y_PERCENTAGE
        Default of Y value as percentage, -0.5
        See Also:
        Constant Field Values
    • Constructor Detail

      • ControlPoint

        public ControlPoint()
        Creates an object with default.
      • ControlPoint

        public ControlPoint​(double x)
        Creates an object with X value in pixels.
        Parameters:
        x - the X value of the control point in pixels
      • ControlPoint

        public ControlPoint​(double x,
                            double y)
        Creates an object with X and Y values in pixels.
        Parameters:
        x - the X value of the control point in pixels
        y - the Y value of the control point in pixels
      • ControlPoint

        public ControlPoint​(String x)
        Creates an object with X value as percentage.
        Parameters:
        x - the X value of the control point as percentage
      • ControlPoint

        public ControlPoint​(String x,
                            String y)
        Creates an object with X and Y values as percentage.
        Parameters:
        x - the X value of the control point as percentage
        y - the Y value of the control point as percentage
    • Method Detail

      • setX

        public void setX​(double x)
        Sets the X value of the control point in pixels.
        Parameters:
        x - the X value of the control point in pixels
      • setY

        public void setY​(double y)
        Sets the Y value of the control point in pixels.
        Parameters:
        y - the Y value of the control point in pixels
      • setX

        public void setX​(String x)
        Sets the X value of the control point as percentage.
        Parameters:
        x - the X value of the control point as percentage
      • setY

        public void setY​(String y)
        Sets the Y value of the control point as percentage.
        Parameters:
        y - the Y value of the control point as percentage
      • setXAsPercentage

        public void setXAsPercentage​(double percentage)
        Sets the X value of the control point as percentage.
        Parameters:
        percentage - the X value of the control point as percentage
      • setYAsPercentage

        public void setYAsPercentage​(double percentage)
        Sets the Y value of the control point as percentage.
        Parameters:
        percentage - the Y value of the control point as percentage
      • getX

        public double getX()
        Returns the X value of the control point in pixels.
        Returns:
        the X value of the control point in pixels.
      • getY

        public double getY()
        Returns the Y value of the control point in pixels.
        Returns:
        the Y value of the control point in pixels.
      • getXAsPercentageString

        public String getXAsPercentageString()
        Returns the X value of the control point as percentage.
        Returns:
        the X value of the control point as percentage.
      • getYAsPercentageString

        public String getYAsPercentageString()
        Returns the Y value of the control point as percentage.
        Returns:
        the Y value of the control point as percentage.
      • getXAsPercentage

        public double getXAsPercentage()
        Returns the X value of the control point as percentage.
        Returns:
        the X value of the control point as percentage.
      • getYAsPercentage

        public double getYAsPercentage()
        Returns the Y value of the control point as percentage.
        Returns:
        the Y value of the control point as percentage.