org.jdrawing.graphics
Class PolygonOperation

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsOperation
      extended byorg.jdrawing.graphics.PolygonOperation
All Implemented Interfaces:
DrawingElement
Direct Known Subclasses:
DrawPolygon, FillPolygon

public abstract class PolygonOperation
extends GraphicsOperation

Base class for operations, which get Polygon as argument.


Constructor Summary
PolygonOperation(java.awt.Polygon polygon)
          Returns ShapeOperation with given polygon.
PolygonOperation(java.awt.Polygon polygon, Style style)
          Returns ShapeOperation with given polygon.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks whether two polygon operations are equal.
 java.awt.Polygon getPolygon()
          Returns polygon currently used by this operation.
 int hashCode()
          Returns the hashcode for this polygon operation.
 void setPolygon(java.awt.Polygon polygon)
          Sets polygon for this operation.
 
Methods inherited from class org.jdrawing.graphics.GraphicsOperation
contains, getBounds, getBounds2D, getPosition, getShapeOfOperation, getStyle, intersects, paint, paintOperation, setPosition, setStyle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonOperation

public PolygonOperation(java.awt.Polygon polygon)
Returns ShapeOperation with given polygon.

Parameters:
polygon - polygon to be used for this operation

PolygonOperation

public PolygonOperation(java.awt.Polygon polygon,
                        Style style)
Returns ShapeOperation with given polygon.

Parameters:
polygon - polygon to be used for this operation
Method Detail

setPolygon

public void setPolygon(java.awt.Polygon polygon)
Sets polygon for this operation.

Parameters:
polygon - polygon to be used for this operation

getPolygon

public java.awt.Polygon getPolygon()
Returns polygon currently used by this operation.

Returns:
polygon currently used by this operation

equals

public boolean equals(java.lang.Object object)
Checks whether two polygon operations are equal. The result is true if and only if the argument is not null and is a PolygonOperation object that has the same attributes as this PolygonOperation.

Overrides:
equals in class GraphicsOperation
Parameters:
object - the Object to compare with this PolygonOperation
Returns:
true if the objects are equal; false otherwise.

hashCode

public int hashCode()
Returns the hashcode for this polygon operation.

Overrides:
hashCode in class GraphicsOperation
Returns:
a hash code for this polygon operation.