com.aspose.imaging.shapes
Class PolygonShape

java.lang.Object
  extended by com.aspose.imaging.ObjectWithBounds
      extended by com.aspose.imaging.Shape
          extended by com.aspose.imaging.shapes.PolygonShape
All Implemented Interfaces:
IOrderedShape
Direct Known Subclasses:
BezierShape, CurveShape

public class PolygonShape
extends Shape
implements IOrderedShape

Represents a polygon shape.


Constructor Summary
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.
 
Method Summary
 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 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 a value indicating whether shape is closed.
 void isClosed(boolean value)
           Sets a value indicating whether shape is closed.
 void reverse()
           Reverses the order of points for this shape.
 void setPoints(PointF[] value)
           Sets the curve points.
 void transform(Matrix transform)
           Applies the specified transformation to the shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonShape

public PolygonShape()

Initializes a new instance of the PolygonShape class.


PolygonShape

public PolygonShape(PointF[] points)

Initializes a new instance of the PolygonShape class.

Parameters:
points - The points array.

PolygonShape

public PolygonShape(PointF[] points,
                    boolean isClosed)

Initializes a new instance of the PolygonShape class.

Parameters:
points - The points array.
isClosed - If set to true the polygon is closed.
Method Detail

getBounds

public RectangleF getBounds()

Gets the object's bounds.

Value: The object's bounds.

Specified by:
getBounds in class ObjectWithBounds

getBounds

public RectangleF getBounds(Matrix matrix)

Gets the object's bounds.

Specified by:
getBounds in class ObjectWithBounds
Parameters:
matrix - The matrix to apply before bounds will be calculated.
Returns:
The estimated object's bounds.

getBounds

public RectangleF getBounds(Matrix matrix,
                            Pen pen)

Gets the object's bounds.

Specified by:
getBounds in class ObjectWithBounds
Parameters:
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.
Returns:
The estimated object's bounds.

getCenter

public PointF getCenter()

Gets the shape's center.

Value: The shape's center.

Specified by:
getCenter in class Shape

getEndPoint

public PointF getEndPoint()

Gets the ending shape point.

Value: The ending shape point.

Specified by:
getEndPoint in interface IOrderedShape

getPoints

public PointF[] getPoints()

Gets the curve points.

Value: The curve points.


getSegments

public ShapeSegment[] getSegments()

Gets the shape segments.

Value: The shape segments.

Specified by:
getSegments in class Shape

getStartPoint

public PointF getStartPoint()

Gets the starting shape point.

Value: The starting shape point.

Specified by:
getStartPoint in interface IOrderedShape

hasSegments

public boolean hasSegments()

Gets a value indicating whether shape has segments.

Value: True if shape has segments; otherwise, false.

Specified by:
hasSegments in class Shape

isClosed

public boolean isClosed()

Gets a value indicating whether shape is closed.

Value: true if shape is closed; otherwise, false.

Specified by:
isClosed in interface IOrderedShape

isClosed

public void isClosed(boolean value)

Sets a value indicating whether shape is closed.

Value: true if shape is closed; otherwise, false.

Specified by:
isClosed in interface IOrderedShape

reverse

public void reverse()

Reverses the order of points for this shape.

Specified by:
reverse in interface IOrderedShape

setPoints

public void setPoints(PointF[] value)

Sets the curve points.

Value: The curve points.


transform

public void transform(Matrix transform)

Applies the specified transformation to the shape.

Specified by:
transform in class ObjectWithBounds
Parameters:
transform - The transformation to apply.