Class StiRectangle
java.lang.Object
com.stimulsoft.base.system.geometry.StiRectangle
- All Implemented Interfaces:
IStiSerializable,IStiSerializableToString
Class represent rectangle invalid input: '&' operations with it
Copyright Stimulsoft
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStiRectangle(double x, double y, double width, double height) ConstructorStiRectangle(long x, long y, long width, long height) ConstructorStiRectangle(StiPoint location, StiSize size) Initializes a new instance of the RectangleD class with the specified location and size.StiRectangle(StiRectangle rectangleD) Constructor, create StiRectangle formStiRectangle -
Method Summary
Modifier and TypeMethodDescriptionstatic StiRectanglealignSizeInRect(StiRectangle rect, StiSize size, StiContentAlignment alignment) Align rectangle to fit in rectAlignToGrid(double gridSize, boolean aligningToGrid) Align the rectangle to grid.clone()Clone current StiRectanglebooleancontains(double x, double y) booleanIs thisStiRectanglecontains pointvoiddeserialize(String strObject) deserializeString(String strObject) static StiRectangleempty()booleanFitToRectangle(StiRectangle rectangle) Fit rectangle to rectangle.intgetBi()Return rounded Integer bottom valuedoublestatic StiRectanglegetEmpty()doubleintgetHi()Return rounded Integer height valuebooleanTests whether all numeric properties of this StiRectangle have values of zero.doublegetLeft()intgetLi()intgetRi()Return rounded Integer right valuedoublegetRight()getSize()intgetTi()doublegetTop()intgetWi()Return rounded Integer width valuedoublegetWidth()doublegetX()intgetXi()Return rounded Integer X valuedoublegetY()intgetYi()Return rounded Integer Y valueinflate(int width, int height) Inflate currentStiRectangleInflate currentStiRectanglestatic StiRectangleintersect(StiRectangle rect1, StiRectangle rect2) intersectsWith(StiRectangle rect) Is thisStiRectangleintersects with other rectanglebooleanIntersectsWith(StiRectangle rect) isEmpty()Check ifStiRectangleis emptyvoidLoadFromJson(JSONObject jObject) Move rectangle by delta valuesMultiply(double multipleFactor) NormalizeStiRectangleOffsetRect(StiRectangle offsettingRectangle) Changes the sizes of the rectangle.round(double digits) Round double x,y,width,height values to digits after pointstatic StiRectangleround(StiRectangle labelRect) Round double x,y,width,height values to digits after point with smart reoundvoidsetBottom(double bottom) voidsetHeight(double height) voidsetLeft(double left) voidsetLocation(StiPoint value) voidsetRight(double right) Set rightvoidvoidsetTop(double top) Set topvoidsetWidth(double width) voidsetX(double x) voidsetY(double y) ConvertStiRectangletoRectangletoString()static StiRectangleunion(StiRectangle a, StiRectangle b) ZoomStiRectangle
-
Field Details
-
width
public double width -
height
public double height -
y
public double y -
x
public double x
-
-
Constructor Details
-
StiRectangle
public StiRectangle() -
StiRectangle
Constructor, create StiRectangle formStiRectangle- 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
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
-
clone
Clone current StiRectangle- Overrides:
clonein classObject- Returns:
StiRectangle
-
equals
-
move
Move rectangle by delta values- Parameters:
deltaX-deltaY-- Returns:
- this moved
StiRectangle
-
inflate
Inflate currentStiRectangle- Parameters:
width-height-- Returns:
- this inflated
StiRectangle
-
inflate
Inflate currentStiRectangle- Parameters:
width-height-- Returns:
- this inflated
StiRectangle
-
isEmpty
Check ifStiRectangleis empty- Returns:
- is empty rectangle
-
alignSizeInRect
public static StiRectangle alignSizeInRect(StiRectangle rect, StiSize size, StiContentAlignment alignment) Align rectangle to fit in rect- Parameters:
rect-StiRectangleFitten rectanglesize-StiSizeSize to fitinalignment-StiContentAlignment- Returns:
- Fitted rectangle
-
intersectsWith
Is thisStiRectangleintersects with other rectangle- Parameters:
rect-StiRectangle- Returns:
- intersects result
-
contains
Is thisStiRectanglecontains point- Parameters:
x-y-- Returns:
-
zoom
ZoomStiRectangle- Parameters:
zoom-- Returns:
-
round
Round double x,y,width,height values to digits after point- Parameters:
digits-- Returns:
- this rounded
StiRectangle
-
round
Round double x,y,width,height values to digits after point with smart reound- Parameters:
digits-smartRound-- Returns:
- this rounded
StiRectangle
-
normalize
NormalizeStiRectangle- Returns:
-
toRectangle
ConvertStiRectangletoRectangle- Returns:
-
toString
-
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
-
getSize
-
setSize
-
getLocation
-
setLocation
-
union
-
contains
public boolean contains(double x, double y) -
contains
-
getEmpty
-
getIsEmpty
public boolean getIsEmpty()Tests whether all numeric properties of this StiRectangle have values of zero. -
serialize
- Specified by:
serializein interfaceIStiSerializableToString
-
deserializeString
-
deserialize
- Specified by:
deserializein interfaceIStiSerializableToString
-
Multiply
-
getNormalize
-
intersect
-
FitToRectangle
Fit rectangle to rectangle.- Parameters:
rectangle- Rectangle, which will be fited.- Returns:
- Result rectangle.
-
OffsetRect
Changes the sizes of the rectangle.- Parameters:
offsettingRectangle- Data for change the size.- Returns:
- Changed rectangle.
-
AlignToGrid
Align the rectangle to grid.- Parameters:
gridSize- Grid size.aligningToGrid- Align or no.- Returns:
- Aligned rectangle.
-
IntersectsWith
-
LoadFromJson
- Throws:
NumberFormatExceptionJSONException
-