edu.neu.ccs.gui
Class PolygonShape

java.lang.Object
  extended byedu.neu.ccs.gui.BaseShape
      extended byedu.neu.ccs.gui.BaseVertexShape
          extended byedu.neu.ccs.gui.PolygonShape
All Implemented Interfaces:
Shape, SupportsPropertyChange

public class PolygonShape
extends BaseVertexShape

Class PolygonShape defines a polygon using vertex data.

This class is a BaseVertexShape whose Path.Strategy is fixed to be Path.POLYGON.

This class does not use the tangent array inherited from BaseShape.

To avoid confusion with the class java.awt.Polygon, we name this class PolygonShape. Our version of a polygon is more general than the Java class since the internal coordinates are floating point and since the user may choose the closure mode and winding rule.

Since:
2.4.0
Version:
2.4.0

Field Summary
static String ADD_VERTEX
          Bound property name to add one vertex.
static String REMOVE_VERTEX
          Bound property name to remove one vertex.
static String SET_VERTEX
          Bound property name to set one vertex.
static String SET_VERTEX_DATA
          Bound property name to set the vertex data.
 
Fields inherited from class edu.neu.ccs.gui.BaseShape
REMOVE_SHAPE_DATA, SET_CLOSURE_MODE, SET_PATH_STRATEGY, SET_WINDING_RULE, tangent, vertex
 
Constructor Summary
PolygonShape()
          The default constructor that creates an empty polygon with the following defaults.
PolygonShape(float[][] vertex)
          The constructor that creates a polygon with the given vertex array and the following defaults.
PolygonShape(float[][] vertex, ClosureMode closuremode)
          The constructor that creates a polygon with the given vertex array, the given closure mode, and the following default.
PolygonShape(float[][] vertex, ClosureMode closuremode, WindingRule windingrule)
          The constructor that creates a polygon with the given vertex array, the given closure mode, and the given winding rule.
PolygonShape(float[][] vertex, WindingRule windingrule)
          The constructor that creates a polygon with the given vertex array, the given winding rule, and the following default.
 
Method Summary
 void setPathStrategy(Path.Strategy pathstrategy)
          Since the Path.Strategy of this class is fixed to be Path.POLYGON, this method overrides the inherited method to do nothing.
 
Methods inherited from class edu.neu.ccs.gui.BaseVertexShape
addVertex, addVertex, addVertices, appendVertex, appendVertex, appendVertices, removeAllVertices, removeVertex, removeVertices, setVertex, setVertex, setVertexData
 
Methods inherited from class edu.neu.ccs.gui.BaseShape
addForwardingListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListeners, addPropertyChangeListeners, bezierTangentSegmentPoints, closedBezierControlPoints, closedBezierFramePoints, contains, contains, contains, contains, findControlA, findControlA, findControlB, findControlB, findVertex, findVertex, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAX, getAY, getBezierTangentSegmentData, getBounds, getBounds2D, getBX, getBY, getClosedBezierControlData, getClosedBezierFrameData, getClosureMode, getControlA, getControlB, getCubicCurvePoint, getForwardingListener, getOpenBezierControlData, getOpenBezierFrameData, getPath, getPathIterator, getPathIterator, getPathStrategy, getPolygonPoint, getPropertyChangeListeners, getPropertyChangeListeners, getTangent, getTangentData, getTransformedShape, getTransformedShape, getTX, getTY, getVertex, getVertexData, getVertexTangent, getVertexTangentData, getVX, getVY, getWindingRule, hasListeners, intersects, intersects, isTangentNull, length, makeBezierTangentSegments, makeClosedBezierFrame, makeClosedControlDots, makeClosedPolygon, makeOpenBezierFrame, makeOpenControlDots, makeOpenPolygon, makePath, makePolygonDots, openBezierControlPoints, openBezierFramePoints, removeAndAddForwardingListener, removeForwardingListener, removePropertyChangeListener, removePropertyChangeListener, removeShapeData, setClosureMode, setWindingRule, setWindingRule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET_VERTEX_DATA

public static final String SET_VERTEX_DATA
Bound property name to set the vertex data.

See Also:
Constant Field Values

SET_VERTEX

public static final String SET_VERTEX
Bound property name to set one vertex.

See Also:
Constant Field Values

ADD_VERTEX

public static final String ADD_VERTEX
Bound property name to add one vertex.

See Also:
Constant Field Values

REMOVE_VERTEX

public static final String REMOVE_VERTEX
Bound property name to remove one vertex.

See Also:
Constant Field Values
Constructor Detail

PolygonShape

public PolygonShape()

The default constructor that creates an empty polygon with the following defaults.


PolygonShape

public PolygonShape(float[][] vertex)

The constructor that creates a polygon with the given vertex array and the following defaults.

Parameters:
vertex - the vertex data

PolygonShape

public PolygonShape(float[][] vertex,
                    ClosureMode closuremode)

The constructor that creates a polygon with the given vertex array, the given closure mode, and the following default.

Parameters:
vertex - the vertex data
closuremode - the closure mode

PolygonShape

public PolygonShape(float[][] vertex,
                    WindingRule windingrule)

The constructor that creates a polygon with the given vertex array, the given winding rule, and the following default.

Parameters:
vertex - the vertex data
windingrule - the winding rule

PolygonShape

public PolygonShape(float[][] vertex,
                    ClosureMode closuremode,
                    WindingRule windingrule)

The constructor that creates a polygon with the given vertex array, the given closure mode, and the given winding rule.

Parameters:
vertex - the vertex data
closuremode - the closure mode
windingrule - the winding rule
Method Detail

setPathStrategy

public final void setPathStrategy(Path.Strategy pathstrategy)

Since the Path.Strategy of this class is fixed to be Path.POLYGON, this method overrides the inherited method to do nothing.

Overrides:
setPathStrategy in class BaseShape
Parameters:
pathstrategy - the path strategy to set