public class RoundedRectangle extends Rectangle
| Modifier and Type | Field and Description |
|---|---|
static int |
ALL
Indicates the all cornders should be rounded
|
static int |
BOTTOM_LEFT
Indicates the bottom left corner should be rounded
|
static int |
BOTTOM_RIGHT
Indicates the bottom right corner should be rounded
|
static int |
TOP_LEFT
Indicates the top left corner should be rounded
|
static int |
TOP_RIGHT
Indicates the top right corner should be rounded
|
boundingCircleRadius, center, maxX, maxY, minX, minY, points, pointsDirty, trianglesDirty, tris, x, y| Constructor and Description |
|---|
RoundedRectangle(float x,
float y,
float width,
float height,
float cornerRadius)
Construct a rectangle with rounded corners.
|
RoundedRectangle(float x,
float y,
float width,
float height,
float cornerRadius,
int segmentCount)
Construct a rectangle with rounded corners.
|
RoundedRectangle(float x,
float y,
float width,
float height,
float cornerRadius,
int segmentCount,
int cornerFlags)
Construct a rectangle with rounded corners.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createPoints()
Subclasses implement this to create the points of the shape.
|
float |
getCornerRadius()
Get the radius for each corner.
|
float |
getHeight()
Get the height of this rectangle.
|
float |
getWidth()
Get the width of this rectangle.
|
void |
setCornerRadius(float cornerRadius)
Set the radius for each corner.
|
void |
setHeight(float height)
Set the height of this rectangle.
|
void |
setWidth(float width)
Set the width of this rectangle.
|
Shape |
transform(Transform transform)
Apply a transformation and return a new shape.
|
contains, contains, grow, intersects, scaleGrow, setBounds, setBounds, setSize, toStringcalculateRadius, calculateTriangles, checkPoints, closed, contains, findCenter, getBoundingCircleRadius, getCenter, getCenterX, getCenterY, getLocation, getMaxX, getMaxY, getMinX, getMinY, getNormal, getPoint, getPointCount, getPoints, getTriangles, getX, getY, hasVertex, includes, increaseTriangulation, indexOf, preCache, prune, setCenterX, setCenterY, setLocation, setLocation, setX, setY, subtract, unionpublic static final int TOP_LEFT
public static final int TOP_RIGHT
public static final int BOTTOM_RIGHT
public static final int BOTTOM_LEFT
public static final int ALL
public RoundedRectangle(float x,
float y,
float width,
float height,
float cornerRadius)
x - The x position of the rectangle.y - The y position of the rectangle.width - The width of the rectangle.height - The hieght of the rectangle.cornerRadius - The radius to use for the arc in each corner.public RoundedRectangle(float x,
float y,
float width,
float height,
float cornerRadius,
int segmentCount)
x - The x position of the rectangle.y - The y position of the rectangle.width - The width of the rectangle.height - The hieght of the rectangle.cornerRadius - The radius to use for the arc in each corner.segmentCount - The number of segments to use to draw each corner arc.public RoundedRectangle(float x,
float y,
float width,
float height,
float cornerRadius,
int segmentCount,
int cornerFlags)
x - The x position of the rectangle.y - The y position of the rectangle.width - The width of the rectangle.height - The hieght of the rectangle.cornerRadius - The radius to use for the arc in each corner.segmentCount - The number of segments to use to draw each corner arc.cornerFlags - Indicates which corners should be roundedpublic float getCornerRadius()
public void setCornerRadius(float cornerRadius)
cornerRadius - The radius for each corner to set.public float getHeight()
public void setHeight(float height)
public float getWidth()
public void setWidth(float width)
protected void createPoints()
ShapecreatePoints in class Rectangle