Class StiRectangle

java.lang.Object
com.stimulsoft.base.system.geometry.StiRectangle
All Implemented Interfaces:
IStiSerializable, IStiSerializableToString

public class StiRectangle extends Object implements IStiSerializableToString
Class represent rectangle invalid input: '&' operations with it Copyright Stimulsoft
  • Field Details

    • width

      public double width
    • height

      public double height
    • y

      public double y
    • x

      public double x
  • Constructor Details

    • StiRectangle

      public StiRectangle()
    • StiRectangle

      public StiRectangle(StiRectangle rectangleD)
      Constructor, create StiRectangle form StiRectangle
      Parameters:
      rectangleD - StiRectangle
    • StiRectangle

      public StiRectangle(long x, long y, long width, long height)
      Constructor
      Parameters:
      x -
      y -
      width -
      height -
    • StiRectangle

      public StiRectangle(double x, double y, double width, double height)
      Constructor
      Parameters:
      x -
      y -
      width -
      height -
    • StiRectangle

      public StiRectangle(StiPoint location, StiSize size)
      Initializes a new instance of the RectangleD class with the specified location and size.
      Parameters:
      location - A StiPoint that represents the upper-left corner of the rectangular region.
      size - A StiSize that represents the width and height of the rectangular region.
  • Method Details

    • empty

      public static StiRectangle empty()
    • clone

      public StiRectangle clone()
      Clone current StiRectangle
      Overrides:
      clone in class Object
      Returns:
      StiRectangle
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • move

      public StiRectangle move(Double deltaX, Double deltaY)
      Move rectangle by delta values
      Parameters:
      deltaX -
      deltaY -
      Returns:
      this moved StiRectangle
    • inflate

      public StiRectangle inflate(Double width, Double height)
      Inflate current StiRectangle
      Parameters:
      width -
      height -
      Returns:
      this inflated StiRectangle
    • inflate

      public StiRectangle inflate(int width, int height)
      Inflate current StiRectangle
      Parameters:
      width -
      height -
      Returns:
      this inflated StiRectangle
    • isEmpty

      public Boolean isEmpty()
      Check if StiRectangle is empty
      Returns:
      is empty rectangle
    • alignSizeInRect

      public static StiRectangle alignSizeInRect(StiRectangle rect, StiSize size, StiContentAlignment alignment)
      Align rectangle to fit in rect
      Parameters:
      rect - StiRectangle Fitten rectangle
      size - StiSize Size to fitin
      alignment - StiContentAlignment
      Returns:
      Fitted rectangle
    • intersectsWith

      public Boolean intersectsWith(StiRectangle rect)
      Is this StiRectangle intersects with other rectangle
      Parameters:
      rect - StiRectangle
      Returns:
      intersects result
    • contains

      public Boolean contains(Double x, Double y)
      Is this StiRectangle contains point
      Parameters:
      x -
      y -
      Returns:
    • zoom

      public StiRectangle zoom(Double zoom)
      Parameters:
      zoom -
      Returns:
    • round

      public StiRectangle round(double digits)
      Round double x,y,width,height values to digits after point
      Parameters:
      digits -
      Returns:
      this rounded StiRectangle
    • round

      public StiRectangle round(Double digits, Boolean smartRound)
      Round double x,y,width,height values to digits after point with smart reound
      Parameters:
      digits -
      smartRound -
      Returns:
      this rounded StiRectangle
    • normalize

      public StiRectangle normalize()
      Normalize StiRectangle
      Returns:
    • toRectangle

      public Rectangle toRectangle()
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLeft

      public double getLeft()
      Returns:
      the left
    • getRight

      public double getRight()
      Returns:
      the right
    • getTop

      public double getTop()
      Returns:
      the top
    • getBottom

      public double getBottom()
      Returns:
      the bottom
    • setBottom

      public void setBottom(double bottom)
      Parameters:
      bottom - the bottom to set
    • getY

      public double getY()
      Returns:
      the y
    • setY

      public void setY(double y)
      Parameters:
      y - the y to set
    • getX

      public double getX()
      Returns:
      the x
    • setX

      public void setX(double x)
      Parameters:
      x - the x to set
    • getWidth

      public double getWidth()
      Returns:
      the width
    • setWidth

      public void setWidth(double width)
      Parameters:
      width - the width to set
    • getHeight

      public double getHeight()
      Returns:
      the height
    • setHeight

      public void setHeight(double height)
      Parameters:
      height - the height to set
    • setLeft

      public void setLeft(double left)
      Parameters:
      left -
    • setRight

      public void setRight(double right)
      Set right
      Parameters:
      right -
    • setTop

      public void setTop(double top)
      Set top
      Parameters:
      top -
    • getHi

      public int getHi()
      Return rounded Integer height value
      Returns:
    • getWi

      public int getWi()
      Return rounded Integer width value
      Returns:
    • getXi

      public int getXi()
      Return rounded Integer X value
      Returns:
    • getYi

      public int getYi()
      Return rounded Integer Y value
      Returns:
    • getRi

      public int getRi()
      Return rounded Integer right value
      Returns:
    • getBi

      public int getBi()
      Return rounded Integer bottom value
      Returns:
    • getLi

      public int getLi()
    • getTi

      public int getTi()
    • round

      public static StiRectangle round(StiRectangle labelRect)
    • getSize

      public StiSize getSize()
    • setSize

      public void setSize(StiSize value)
    • getLocation

      public StiPoint getLocation()
    • setLocation

      public void setLocation(StiPoint value)
    • union

      public static StiRectangle union(StiRectangle a, StiRectangle b)
    • contains

      public boolean contains(double x, double y)
    • contains

      public boolean contains(StiPoint pt)
    • getEmpty

      public static StiRectangle getEmpty()
    • getIsEmpty

      public boolean getIsEmpty()
      Tests whether all numeric properties of this StiRectangle have values of zero.
    • serialize

      public String serialize()
      Specified by:
      serialize in interface IStiSerializableToString
    • deserializeString

      public StiRectangle deserializeString(String strObject)
    • deserialize

      public void deserialize(String strObject)
      Specified by:
      deserialize in interface IStiSerializableToString
    • Multiply

      public StiRectangle Multiply(double multipleFactor)
    • getNormalize

      public StiRectangle getNormalize()
    • intersect

      public static StiRectangle intersect(StiRectangle rect1, StiRectangle rect2)
    • FitToRectangle

      public StiRectangle FitToRectangle(StiRectangle rectangle)
      Fit rectangle to rectangle.
      Parameters:
      rectangle - Rectangle, which will be fited.
      Returns:
      Result rectangle.
    • OffsetRect

      public StiRectangle OffsetRect(StiRectangle offsettingRectangle)
      Changes the sizes of the rectangle.
      Parameters:
      offsettingRectangle - Data for change the size.
      Returns:
      Changed rectangle.
    • AlignToGrid

      public StiRectangle AlignToGrid(double gridSize, boolean aligningToGrid)
      Align the rectangle to grid.
      Parameters:
      gridSize - Grid size.
      aligningToGrid - Align or no.
      Returns:
      Aligned rectangle.
    • IntersectsWith

      public boolean IntersectsWith(StiRectangle rect)
    • LoadFromJson

      public void LoadFromJson(JSONObject jObject) throws NumberFormatException, JSONException
      Throws:
      NumberFormatException
      JSONException