public class PolygonShape extends Shape implements IOrderedShape
Represents a polygon shape.
Constructor and Description |
---|
PolygonShape()
Initializes a new instance of the
PolygonShape class. |
PolygonShape(PointF[] points)
Initializes a new instance of the
PolygonShape class. |
PolygonShape(PointF[] points,
boolean isClosed)
Initializes a new instance of the
PolygonShape class. |
Modifier and Type | Method and Description |
---|---|
RectangleF |
getBounds()
Gets the object's bounds.
|
RectangleF |
getBounds(Matrix matrix)
Gets the object's bounds.
|
RectangleF |
getBounds(Matrix matrix,
Pen pen)
Gets the object's bounds.
|
PointF |
getCenter()
Gets the shape's center.
|
PointF |
getEndPoint()
Gets the ending shape point.
|
PointF[] |
getPoints()
Gets or sets the curve points.
|
ShapeSegment[] |
getSegments()
Gets the shape segments.
|
PointF |
getStartPoint()
Gets the starting shape point.
|
boolean |
hasSegments()
Gets a value indicating whether shape has segments.
|
boolean |
isClosed()
Gets or sets a value indicating whether shape is closed.
|
void |
reverse()
Reverses the order of points for this shape.
|
void |
setClosed(boolean value)
Gets or sets a value indicating whether shape is closed.
|
void |
setPoints(PointF[] value)
Gets or sets the curve points.
|
void |
transform(Matrix transform)
Applies the specified transformation to the shape.
|
public PolygonShape()
Initializes a new instance of the PolygonShape
class.
public PolygonShape(PointF[] points)
Initializes a new instance of the PolygonShape
class.
points
- The points array.public PolygonShape(PointF[] points, boolean isClosed)
Initializes a new instance of the PolygonShape
class.
points
- The points array.isClosed
- If set to true
the polygon is closed.public PointF[] getPoints()
Gets or sets the curve points.
Value: The curve points.public void setPoints(PointF[] value)
Gets or sets the curve points.
Value: The curve points.public boolean isClosed()
Gets or sets a value indicating whether shape is closed.
Value:true
if shape is closed; otherwise, false
.isClosed
in interface IOrderedShape
true
if this ordered shape is closed; otherwise, false
.public void setClosed(boolean value)
Gets or sets a value indicating whether shape is closed.
Value:true
if shape is closed; otherwise, false
.setClosed
in interface IOrderedShape
value
- true
if this ordered shape is closed; otherwise, false
.public RectangleF getBounds()
Gets the object's bounds.
Value: The object's bounds.getBounds
in class ObjectWithBounds
public PointF getCenter()
Gets the shape's center.
Value: The shape's center.public ShapeSegment[] getSegments()
Gets the shape segments.
Value: The shape segments.getSegments
in class Shape
public boolean hasSegments()
Gets a value indicating whether shape has segments.
Value:True
if shape has segments; otherwise, false
.hasSegments
in class Shape
True
if shape has segments; otherwise, false
.public PointF getStartPoint()
Gets the starting shape point.
Value: The starting shape point.getStartPoint
in interface IOrderedShape
public PointF getEndPoint()
Gets the ending shape point.
Value: The ending shape point.getEndPoint
in interface IOrderedShape
public void reverse()
Reverses the order of points for this shape.
reverse
in interface IOrderedShape
public RectangleF getBounds(Matrix matrix)
Gets the object's bounds.
getBounds
in class ObjectWithBounds
matrix
- The matrix to apply before bounds will be calculated.public RectangleF getBounds(Matrix matrix, Pen pen)
Gets the object's bounds.
getBounds
in class ObjectWithBounds
matrix
- The matrix to apply before bounds will be calculated.pen
- The pen to use for object. This can influence the object's bounds size.public void transform(Matrix transform)
Applies the specified transformation to the shape.
transform
in class ObjectWithBounds
transform
- The transformation to apply.