org.jdrawing.graphics
Class DrawPolygon

java.lang.Object
  extended byorg.jdrawing.graphics.GraphicsOperation
      extended byorg.jdrawing.graphics.PolygonOperation
          extended byorg.jdrawing.graphics.DrawPolygon
All Implemented Interfaces:
DrawingElement

public class DrawPolygon
extends PolygonOperation

Graphics element which corresponds to Graphics.drawPolygon(Polygon)


Constructor Summary
DrawPolygon(java.awt.Polygon polygon)
          Returns DrawPolygon with given polygon.
DrawPolygon(java.awt.Polygon polygon, Style style)
          Returns DrawPolygon with given polygon.
 
Method Summary
 java.awt.Shape getShapeOfOperation()
          Returns shape of the area updated by this operation.
 void paintOperation(java.awt.Graphics2D graphics)
          Performs drawing operation.
 
Methods inherited from class org.jdrawing.graphics.PolygonOperation
getPolygon, setPolygon
 
Methods inherited from class org.jdrawing.graphics.GraphicsOperation
contains, getBounds, getBounds2D, getPosition, getStyle, intersects, paint, setPosition, setStyle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DrawPolygon

public DrawPolygon(java.awt.Polygon polygon)
Returns DrawPolygon with given polygon.

Parameters:
polygon - polygon to be used for this operation

DrawPolygon

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

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

paintOperation

public void paintOperation(java.awt.Graphics2D graphics)
Performs drawing operation. This implementation invokes graphics.drawPolygon ().

Specified by:
paintOperation in class GraphicsOperation
Parameters:
graphics - graphics context to use for painting

getShapeOfOperation

public java.awt.Shape getShapeOfOperation()
Returns shape of the area updated by this operation.

Specified by:
getShapeOfOperation in class GraphicsOperation
Returns:
the shape of updated area