org.jdrawing.graphics
Class ShapeOperation

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsOperation
      extended byorg.jdrawing.graphics.ShapeOperation
All Implemented Interfaces:
DrawingElement
Direct Known Subclasses:
Draw, Fill

public abstract class ShapeOperation
extends GraphicsOperation

Base class for operations, which get Shape as argument.


Constructor Summary
ShapeOperation(java.awt.Shape shape)
          Returns ShapeOperation with given shape.
ShapeOperation(java.awt.Shape shape, Style style)
          Returns ShapeOperation with given shape.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks whether two shape operations are equal.
 java.awt.Shape getShape()
          Returns shape currently used by this operation.
 int hashCode()
          Returns the hashcode for this shape operation.
 void setShape(java.awt.Shape shape)
          Sets shape 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

ShapeOperation

public ShapeOperation(java.awt.Shape shape)
Returns ShapeOperation with given shape.

Parameters:
shape - shape to be used for this operation

ShapeOperation

public ShapeOperation(java.awt.Shape shape,
                      Style style)
Returns ShapeOperation with given shape.

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

setShape

public void setShape(java.awt.Shape shape)
Sets shape for this operation.

Parameters:
shape - shape to be used for this operation

getShape

public java.awt.Shape getShape()
Returns shape currently used by this operation.

Returns:
shape currently used by this operation

equals

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

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

hashCode

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

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