Class RelativeRectangle

  • All Implemented Interfaces:
    com.aspose.csporter.helpers.Struct<RelativeRectangle>, java.io.Serializable, java.lang.Cloneable

    public final class RelativeRectangle
    extends java.lang.Object
    implements com.aspose.csporter.helpers.Struct<RelativeRectangle>, java.io.Serializable
    Relative rectangle The formula between relative component to absolute value is: Scale * (Reference Width) + offset So if we want it to represent an absolute value, leave all scale fields zero, and use offset fields instead.
    See Also:
    Serialized Form
    • Method Summary

      Modifier and Type Method Description
      RelativeRectangle clone()  
      void copyFrom​(RelativeRectangle src)  
      boolean equals​(java.lang.Object obj)  
      static RelativeRectangle fromScale​(float scaleX, float scaleY, float scaleWidth, float scaleHeight)
      Construct a RelativeRectangle with all offset fields zero and scale fields from given parameters.
      int getOffsetHeight()
      Gets the offset for height
      int getOffsetWidth()
      Gets the offset for width
      int getOffsetX()
      Gets the offset for coordinate X
      int getOffsetY()
      Gets the offset for coordinate Y
      float getScaleHeight()
      Relative height
      float getScaleWidth()
      Relative width
      float getScaleX()
      Relative coordinate X
      float getScaleY()
      Relative coordinate Y
      int hashCode()  
      void setOffsetHeight​(int value)
      Sets the offset for height
      void setOffsetWidth​(int value)
      Sets the offset for width
      void setOffsetX​(int value)
      Sets the offset for coordinate X
      void setOffsetY​(int value)
      Sets the offset for coordinate Y
      void setScaleHeight​(float value)
      Relative height
      void setScaleWidth​(float value)
      Relative width
      void setScaleX​(float value)
      Relative coordinate X
      void setScaleY​(float value)
      Relative coordinate Y
      java.awt.Rectangle toAbsolute​(java.awt.Dimension rect)
      Convert the relative rectangle to absolute rectangle
      java.awt.Rectangle toAbsolute​(java.awt.Rectangle rect)
      Convert the relative rectangle to absolute rectangle
      java.lang.String toString()
      Converts the value of this instance to a String.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RelativeRectangle

        public RelativeRectangle()
    • Method Detail

      • getScaleX

        public float getScaleX()
        Relative coordinate X
      • setScaleX

        public void setScaleX​(float value)
        Relative coordinate X
        Parameters:
        value - New value
      • getScaleY

        public float getScaleY()
        Relative coordinate Y
      • setScaleY

        public void setScaleY​(float value)
        Relative coordinate Y
        Parameters:
        value - New value
      • getScaleWidth

        public float getScaleWidth()
        Relative width
      • setScaleWidth

        public void setScaleWidth​(float value)
        Relative width
        Parameters:
        value - New value
      • getScaleHeight

        public float getScaleHeight()
        Relative height
      • setScaleHeight

        public void setScaleHeight​(float value)
        Relative height
        Parameters:
        value - New value
      • getOffsetX

        public int getOffsetX()
        Gets the offset for coordinate X
      • setOffsetX

        public void setOffsetX​(int value)
        Sets the offset for coordinate X
        Parameters:
        value - New value
      • getOffsetY

        public int getOffsetY()
        Gets the offset for coordinate Y
      • setOffsetY

        public void setOffsetY​(int value)
        Sets the offset for coordinate Y
        Parameters:
        value - New value
      • getOffsetWidth

        public int getOffsetWidth()
        Gets the offset for width
      • setOffsetWidth

        public void setOffsetWidth​(int value)
        Sets the offset for width
        Parameters:
        value - New value
      • getOffsetHeight

        public int getOffsetHeight()
        Gets the offset for height
      • setOffsetHeight

        public void setOffsetHeight​(int value)
        Sets the offset for height
        Parameters:
        value - New value
      • toAbsolute

        public java.awt.Rectangle toAbsolute​(java.awt.Dimension rect)
        Convert the relative rectangle to absolute rectangle
        Parameters:
        rect -
      • toAbsolute

        public java.awt.Rectangle toAbsolute​(java.awt.Rectangle rect)
        Convert the relative rectangle to absolute rectangle
        Parameters:
        rect -
      • fromScale

        public static RelativeRectangle fromScale​(float scaleX,
                                                  float scaleY,
                                                  float scaleWidth,
                                                  float scaleHeight)
        Construct a RelativeRectangle with all offset fields zero and scale fields from given parameters.
        Parameters:
        scaleX -
        scaleY -
        scaleWidth -
        scaleHeight -
      • toString

        public java.lang.String toString()
        Converts the value of this instance to a String.
        Overrides:
        toString in class java.lang.Object
      • clone

        public RelativeRectangle clone()
        Specified by:
        clone in interface com.aspose.csporter.helpers.Struct<RelativeRectangle>
        Overrides:
        clone in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object