Class PerspectiveOrigin

  • All Implemented Interfaces:
    CssProperty, java.io.Serializable, java.lang.Cloneable


    public class PerspectiveOrigin
    extends AbstractCssProperty<PerspectiveOrigin>
     perspective-origin: x-axis y-axis|initial|inherit;
    
     The perspective-origin property defines where a 3D element is based in the x- and the y-axis. This property allows you to change the bottom position of 3D elements.
    
     When defining the perspective-origin property for an element, it is the CHILD elements that are positioned, NOT the element itself.
    
     Note: This property must be used together with the perspective property, and only affects 3D transformed elements!
    
     To better understand the perspective-origin property, view a demo.
     Default value:  50% 50%
     Inherited:      no
     Animatable:     yes
     Version:        CSS3
     JavaScript syntax:      object.style.perspectiveOrigin="10px 50%"
     
    Since:
    1.0.0
    See Also:
    Serialized Form
    • Constructor Detail

      • PerspectiveOrigin

        public PerspectiveOrigin​()
        The 0px will be set as the value
      • PerspectiveOrigin

        public PerspectiveOrigin​(java.lang.String cssValue)
        Parameters:
        cssValue - the css value to set.
      • PerspectiveOrigin

        public PerspectiveOrigin​(PerspectiveOrigin backgroundSize)
        Parameters:
        backgroundSize - the PerspectiveOrigin object from which the cssValue to set.And, null will throw NullValueException
      • PerspectiveOrigin

        public PerspectiveOrigin​(float xyAxis,
                                 CssLengthUnit cssLengthUnit)
        Parameters:
        xyAxis - the value to set.
        the - value unit to set.
        Since:
        1.0.0
      • PerspectiveOrigin

        public PerspectiveOrigin​(float xAxis,
                                 CssLengthUnit xAxisCssLengthUnit,
                                 float yAxis,
                                 CssLengthUnit yAxisCssLengthUnit)
        Parameters:
        xAxis -
        xAxisCssLengthUnit -
        yAxis -
        yAxisCssLengthUnit -
        Since:
        1.0.0
    • Method Detail

      • setValue

        public PerspectiveOrigin setValue​(float xAxis,
                                          CssLengthUnit xAxisCssLengthUnit,
                                          float yAxis,
                                          CssLengthUnit yAxisCssLengthUnit)
        Parameters:
        xAxis -
        xAxisCssLengthUnit -
        yAxis -
        yAxisCssLengthUnit -
        Returns:
        Since:
        1.0.0
      • setValue

        public PerspectiveOrigin setValue​(float xyAxis,
                                          CssLengthUnit cssLengthUnit)
        Parameters:
        xyAxis -
        cssLengthUnit -
        Returns:
        the current object
        Since:
        1.0.0
      • getCssName

        public java.lang.String getCssName​()
        Returns:
        the name portion in style, eg align-content for style align-content: center.
      • getCssValue

        public java.lang.String getCssValue​()
        Returns:
        the value portion in style, eg center for style align-content: center.
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object
      • getXAxis

        public java.lang.Float getXAxis​()
        gets the x-axis value in float value. PerspectiveOrigin#getXAxisUnit() should be used to get the cssLengthUnit for this value.
        Returns:
        the horizontal value in float or null if the value is any inbuilt value like inherit.
        Since:
        1.0.0
      • getYAxis

        public java.lang.Float getYAxis​()
        gets the y-axis value in float value. PerspectiveOrigin#getYAxisUnit() should be used to get the cssLengthUnit for this value.
        Returns:
        the vertical value in float or null if the value is any inbuilt value like inherit.
        Since:
        1.0.0
      • getXAxisUnit

        public CssLengthUnit getXAxisUnit​()
        Returns:
        the cssLengthUnit PX/PER, or null if the value is any inbuilt value like inherit.
        Since:
        1.0.0
      • getYAxisUnit

        public CssLengthUnit getYAxisUnit​()
        Returns:
        the cssLengthUnit PX/PER, or null if the value is any inbuilt value like inherit.
        Since:
        1.0.0
      • setCssValue

        public PerspectiveOrigin setCssValue​(java.lang.String cssValue)
        Specified by:
        setCssValue in class AbstractCssProperty<PerspectiveOrigin>
        Parameters:
        cssValue - the value should be in the format of 55px or 95%. null is considered as an invalid value and it will throw NullValueException.
        Returns:
        the current object.
        Since:
        1.0.0
      • setAsInitial

        public void setAsInitial​()
        sets as initial
        Since:
        1.0.0
      • setAsInherit

        public void setAsInherit​()
        sets as inherit
        Since:
        1.0.0
      • isValid

        public static boolean isValid​(java.lang.String cssValue)
        validates if the given cssValue is valid for this class.
        Parameters:
        cssValue - the value to check.
        Returns:
        true if valid and false if invalid.
        Since:
        1.0.0