Package org.robolectric.shadows
Class RoundRectangle
- java.lang.Object
-
- java.awt.geom.RectangularShape
-
- org.robolectric.shadows.RoundRectangle
-
public class RoundRectangle extends RectangularShape
Defines a rectangle with rounded corners, where the sizes of the corners are potentially different.Copied from https://github.com/aosp-mirror/platform_frameworks_base/blob/oreo-release/tools/layoutlib/bridge/src/android/graphics/RoundRectangle.java
-
-
Constructor Summary
Constructors Constructor Description RoundRectangle(float x, float y, float width, float height, float[] cornerDimensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)booleancontains(double x, double y, double w, double h)Rectangle2DgetBounds2D()doublegetHeight()PathIteratorgetPathIterator(AffineTransform at)doublegetWidth()doublegetX()doublegetY()booleanintersects(double x, double y, double w, double h)booleanisEmpty()voidsetFrame(double x, double y, double w, double h)-
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
-
-
-
-
Field Detail
-
x
public double x
-
y
public double y
-
width
public double width
-
height
public double height
-
ulWidth
public double ulWidth
-
ulHeight
public double ulHeight
-
urWidth
public double urWidth
-
urHeight
public double urHeight
-
lrWidth
public double lrWidth
-
lrHeight
public double lrHeight
-
llWidth
public double llWidth
-
llHeight
public double llHeight
-
-
Constructor Detail
-
RoundRectangle
public RoundRectangle(float x, float y, float width, float height, float[] cornerDimensions)- Parameters:
cornerDimensions- array of 8 floating-point number corresponding to the width and the height of each corner in the following order: upper-left, upper-right, lower-right, lower-left. It assumes for the size the same convention asRoundRectangle2D, that is that the width and height of a corner correspond to the total width and height of the ellipse that corner is a quarter of.
-
-
Method Detail
-
getX
public double getX()
- Specified by:
getXin classRectangularShape
-
getY
public double getY()
- Specified by:
getYin classRectangularShape
-
getWidth
public double getWidth()
- Specified by:
getWidthin classRectangularShape
-
getHeight
public double getHeight()
- Specified by:
getHeightin classRectangularShape
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin classRectangularShape
-
setFrame
public void setFrame(double x, double y, double w, double h)- Specified by:
setFramein classRectangularShape
-
getBounds2D
public Rectangle2D getBounds2D()
-
contains
public boolean contains(double x, double y)
-
intersects
public boolean intersects(double x, double y, double w, double h)
-
contains
public boolean contains(double x, double y, double w, double h)
-
getPathIterator
public PathIterator getPathIterator(AffineTransform at)
-
-