Packages

 

com.aspose.cad

Class SizeF

  • java.lang.Object
    • com.aspose.ms.System.ValueType<T>
      • com.aspose.ms.lang.Struct<SizeF>
        • com.aspose.cad.SizeF


  • public class SizeF
    extends com.aspose.ms.lang.Struct<SizeF>

    Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle.

    • Constructor Summary

      Constructors 
      Constructor and Description
      SizeF() 
      SizeF(float width, float height)
      Initializes a new instance of the com.aspose.cad.SizeF object from the specified dimensions.
      SizeF(PointF point)
      Initializes a new instance of the com.aspose.cad.SizeF object from the specified com.aspose.cad.PointF.
      SizeF(SizeF size)
      Initializes a new instance of the com.aspose.cad.SizeF object from the specified com.aspose.cad.SizeF.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      static SizeF add(SizeF size1, SizeF size2)
      Adds the width and height of one com.aspose.cad.SizeF object to the width and height of another com.aspose.cad.SizeF object.
      Object clone() 
      SizeF Clone() 
      void CloneTo(SizeF that) 
      boolean equals(Object obj)
      Tests to see whether the specified object is a com.aspose.cad.SizeF with the same dimensions as this com.aspose.cad.SizeF.
      static SizeF getEmpty()
      Gets a new instance of the com.aspose.cad.SizeF object that has com.aspose.cad.SizeF.Width and com.aspose.cad.SizeF.Height values set to zero.
      float getHeight()
      Gets the vertical component of this com.aspose.cad.SizeF.
      float getWidth()
      Gets the horizontal component of this com.aspose.cad.SizeF.
      int hashCode()
      Returns a hash code for this com.aspose.cad.Size object.
      boolean isEmpty()
      Gets a value indicating whether this com.aspose.cad.SizeF has zero width and height.
      static SizeF op_Addition(SizeF size1, SizeF size2)
      Adds the width and height of one com.aspose.cad.SizeF object to the width and height of another com.aspose.cad.SizeF object.
      static boolean op_Equality(SizeF size1, SizeF size2)
      Tests whether two com.aspose.cad.SizeF objects are equal.
      static boolean op_Inequality(SizeF size1, SizeF size2)
      Tests whether two com.aspose.cad.SizeF objects are different.
      static SizeF op_Subtraction(SizeF size1, SizeF size2)
      Subtracts the width and height of one com.aspose.cad.SizeF object from the width and height of another com.aspose.cad.SizeF object.
      void setHeight(float value)
      Sets the vertical component of this com.aspose.cad.SizeF.
      void setWidth(float value)
      Sets the horizontal component of this com.aspose.cad.SizeF.
      static SizeF subtract(SizeF size1, SizeF size2)
      Subtracts the width and height of one com.aspose.cad.SizeF object from the width and height of another com.aspose.cad.SizeF object.
      static PointF to_PointF(SizeF size)
      Converts the specified com.aspose.cad.SizeF to a com.aspose.cad.PointF.
      PointF toPointF()
      Converts a com.aspose.cad.SizeF to a com.aspose.cad.PointF.
      Size toSize()
      Converts a com.aspose.cad.SizeF to a com.aspose.cad.Size object with truncated size values.
      String toString()
      Creates a human-readable string that represents this com.aspose.cad.SizeF.
    • Constructor Detail

      • SizeF

        public SizeF()
      • SizeF

        public SizeF(SizeF size)

        Initializes a new instance of the com.aspose.cad.SizeF object from the specified com.aspose.cad.SizeF.

        Parameters:
        size - The com.aspose.cad.SizeF from which to create the new com.aspose.cad.SizeF.
      • SizeF

        public SizeF(PointF point)

        Initializes a new instance of the com.aspose.cad.SizeF object from the specified com.aspose.cad.PointF.

        Parameters:
        point - The com.aspose.cad.PointF from which to initialize this com.aspose.cad.SizeF.
      • SizeF

        public SizeF(float width,
                     float height)

        Initializes a new instance of the com.aspose.cad.SizeF object from the specified dimensions.

        Parameters:
        width - The width component of the new com.aspose.cad.SizeF.
        height - The height component of the new com.aspose.cad.SizeF.
    • Method Detail

      • getEmpty

        public static SizeF getEmpty()

        Gets a new instance of the com.aspose.cad.SizeF object that has com.aspose.cad.SizeF.Width and com.aspose.cad.SizeF.Height values set to zero.

        Returns:
        The empty size (with and height are zero)
      • isEmpty

        public boolean isEmpty()

        Gets a value indicating whether this com.aspose.cad.SizeF has zero width and height.

        Returns:
        This property returns true when this com.aspose.cad.SizeF has both a width and height of zero; otherwise, false.
      • getWidth

        public float getWidth()

        Gets the horizontal component of this com.aspose.cad.SizeF.

        Returns:
        The horizontal component of this com.aspose.cad.SizeF, typically measured in pixels.
      • setWidth

        public void setWidth(float value)

        Sets the horizontal component of this com.aspose.cad.SizeF.

        Parameters:
        value - The new width value
      • getHeight

        public float getHeight()

        Gets the vertical component of this com.aspose.cad.SizeF.

        Returns:
        The vertical component of this com.aspose.cad.SizeF, typically measured in pixels.
      • setHeight

        public void setHeight(float value)

        Sets the vertical component of this com.aspose.cad.SizeF.

        Parameters:
        value - The height
      • op_Addition

        public static SizeF op_Addition(SizeF size1,
                                        SizeF size2)

        Adds the width and height of one com.aspose.cad.SizeF object to the width and height of another com.aspose.cad.SizeF object.

        Parameters:
        size1 - The first com.aspose.cad.SizeF to add.
        size2 - The second com.aspose.cad.SizeF to add.
        Returns:
        A com.aspose.cad.SizeF object that is the result of the addition operation.
      • op_Subtraction

        public static SizeF op_Subtraction(SizeF size1,
                                           SizeF size2)

        Subtracts the width and height of one com.aspose.cad.SizeF object from the width and height of another com.aspose.cad.SizeF object.

        Parameters:
        size1 - The com.aspose.cad.SizeF on the left side of the subtraction operator.
        size2 - The com.aspose.cad.SizeF on the right side of the subtraction operator.
        Returns:
        A com.aspose.cad.SizeF that is the result of the subtraction operation.
      • op_Equality

        public static boolean op_Equality(SizeF size1,
                                          SizeF size2)

        Tests whether two com.aspose.cad.SizeF objects are equal.

        Parameters:
        size1 - The com.aspose.cad.SizeF object on the left side of the equality operator.
        size2 - The com.aspose.cad.SizeF object on the right of the equality operator.
        Returns:
        This operator returns true if size1 and size2 have equal width and height; otherwise, false.
      • op_Inequality

        public static boolean op_Inequality(SizeF size1,
                                            SizeF size2)

        Tests whether two com.aspose.cad.SizeF objects are different.

        Parameters:
        size1 - The com.aspose.cad.SizeF object on the left of the inequality operator.
        size2 - The com.aspose.cad.SizeF object on the right of the inequality operator.
        Returns:
        This operator returns true if size1 and size2 differ either in width or height; false if size1 and size2 are equal.
      • to_PointF

        public static PointF to_PointF(SizeF size)

        Converts the specified com.aspose.cad.SizeF to a com.aspose.cad.PointF.

        Parameters:
        size - The com.aspose.cad.SizeF object to be converted
        Returns:
        The com.aspose.cad.PointF object to which this operator converts.
      • add

        public static SizeF add(SizeF size1,
                                SizeF size2)

        Adds the width and height of one com.aspose.cad.SizeF object to the width and height of another com.aspose.cad.SizeF object.

        Parameters:
        size1 - The first com.aspose.cad.SizeF to add.
        size2 - The second com.aspose.cad.SizeF to add.
        Returns:
        A com.aspose.cad.SizeF object that is the result of the addition operation.
      • subtract

        public static SizeF subtract(SizeF size1,
                                     SizeF size2)

        Subtracts the width and height of one com.aspose.cad.SizeF object from the width and height of another com.aspose.cad.SizeF object.

        Parameters:
        size1 - The com.aspose.cad.SizeF object on the left side of the subtraction operator.
        size2 - The com.aspose.cad.SizeF object on the right side of the subtraction operator.
        Returns:
        The com.aspose.cad.SizeF that is a result of the subtraction operation.
      • toPointF

        public PointF toPointF()

        Converts a com.aspose.cad.SizeF to a com.aspose.cad.PointF.

        Returns:
        Returns a com.aspose.cad.PointF object.
      • toSize

        public Size toSize()

        Converts a com.aspose.cad.SizeF to a com.aspose.cad.Size object with truncated size values.

        Returns:
        Returns a com.aspose.cad.Size object.
      • equals

        public boolean equals(Object obj)

        Tests to see whether the specified object is a com.aspose.cad.SizeF with the same dimensions as this com.aspose.cad.SizeF.

        Overrides:
        equals in class Object
        Parameters:
        obj - The System.Object to test.
        Returns:
        This method returns true if obj is a com.aspose.cad.SizeF and has the same width and height as this com.aspose.cad.SizeF; otherwise, false.
      • hashCode

        public int hashCode()

        Returns a hash code for this com.aspose.cad.Size object.

        Overrides:
        hashCode in class Object
        Returns:
        An integer value that specifies a hash value for this com.aspose.cad.Size object.
      • toString

        public String toString()

        Creates a human-readable string that represents this com.aspose.cad.SizeF.

        Overrides:
        toString in class Object
        Returns:
        A string that represents this com.aspose.cad.SizeF.
      • CloneTo

        public void CloneTo(SizeF that)
        Specified by:
        CloneTo in class com.aspose.ms.System.ValueType<SizeF>
      • Clone

        public SizeF Clone()
        Specified by:
        Clone in class com.aspose.ms.System.ValueType<SizeF>