bookExamples.ch26Graphics.draw2d.shapes
Class Pentagon

java.lang.Object
  extended by bookExamples.ch26Graphics.draw2d.shapes.DJShape
      extended by bookExamples.ch26Graphics.draw2d.shapes.Pentagon
All Implemented Interfaces:
Containment, Drawable, java.beans.PropertyEditor

public class Pentagon
extends DJShape
implements java.beans.PropertyEditor, Containment

Created by IntelliJ IDEA. User: John Jacocks Date: Dec 1, 2005 Time: 5:11:04 PM Note: Modifying class Pentagon by Dave Pavlik to add interfaces for (?Intersects, Movable, &?) Containment for 'prequel' to Final for ECE430, Fall 2005 using Triangle2d (by Enrique iturralde, Doug Lyon) as template


Field Summary
 
Fields inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape
affineTransform
 
Constructor Summary
Pentagon(int _x1, int _y1, int _diameter)
           
Pentagon(int _x1, int _y1, int _x2, int _y2)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 boolean contains(double x, double y)
           
 void draw(java.awt.Graphics g)
           
 java.lang.String getAsText()
           
 java.awt.Point getCenter()
           
 java.awt.Component getCustomEditor()
           
 DJShape getInstance(int x1, int y1, int x2, int y2)
           
 java.lang.String getJavaInitializationString()
           
 java.awt.Shape getShape()
           
 java.awt.Shape getShape(java.awt.geom.Point2D p1, java.awt.geom.Point2D p2, java.awt.geom.Point2D p3, java.awt.geom.Point2D p4, java.awt.geom.Point2D p5)
           
 java.lang.String[] getTags()
           
 java.lang.Object getValue()
           
 boolean isPaintable()
           
 void move(double x, double y)
           
 void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void setAsText(java.lang.String text)
           
 void setCenter()
           
 void setValue(java.lang.Object value)
           
 boolean supportsCustomEditor()
           
 java.lang.String toString()
           
 
Methods inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape
drawLine, erase, getAffineTransform, getBackground, getCenterPoint, getDistance, getForeground, getForegroundColor, getPcs, getRunAffinePanel, getSize, getX1, getX2, getY1, getY2, isSelected, restoreState, setAffineTransform, setBackground, setForeground, setForegroundColor, setLocation, setPcs, setSelected, setSize, setX1, setX2, setY1, setY2
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Pentagon

public Pentagon(int _x1,
                int _y1,
                int _x2,
                int _y2)

Pentagon

public Pentagon(int _x1,
                int _y1,
                int _diameter)
Method Detail

getInstance

public DJShape getInstance(int x1,
                           int y1,
                           int x2,
                           int y2)
Specified by:
getInstance in class DJShape

getCenter

public java.awt.Point getCenter()
Specified by:
getCenter in class DJShape

setCenter

public void setCenter()

getCustomEditor

public java.awt.Component getCustomEditor()
Specified by:
getCustomEditor in interface java.beans.PropertyEditor

setValue

public void setValue(java.lang.Object value)
Specified by:
setValue in interface java.beans.PropertyEditor

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface java.beans.PropertyEditor

isPaintable

public boolean isPaintable()
Specified by:
isPaintable in interface java.beans.PropertyEditor

paintValue

public void paintValue(java.awt.Graphics gfx,
                       java.awt.Rectangle box)
Specified by:
paintValue in interface java.beans.PropertyEditor

getJavaInitializationString

public java.lang.String getJavaInitializationString()
Specified by:
getJavaInitializationString in interface java.beans.PropertyEditor

getAsText

public java.lang.String getAsText()
Specified by:
getAsText in interface java.beans.PropertyEditor

setAsText

public void setAsText(java.lang.String text)
               throws java.lang.IllegalArgumentException
Specified by:
setAsText in interface java.beans.PropertyEditor
Throws:
java.lang.IllegalArgumentException

getTags

public java.lang.String[] getTags()
Specified by:
getTags in interface java.beans.PropertyEditor

supportsCustomEditor

public boolean supportsCustomEditor()
Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface java.beans.PropertyEditor
Overrides:
addPropertyChangeListener in class DJShape

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface java.beans.PropertyEditor
Overrides:
removePropertyChangeListener in class DJShape

draw

public void draw(java.awt.Graphics g)
Specified by:
draw in interface Drawable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

move

public void move(double x,
                 double y)

contains

public boolean contains(double x,
                        double y)
Specified by:
contains in interface Containment

getShape

public java.awt.Shape getShape()

getShape

public java.awt.Shape getShape(java.awt.geom.Point2D p1,
                               java.awt.geom.Point2D p2,
                               java.awt.geom.Point2D p3,
                               java.awt.geom.Point2D p4,
                               java.awt.geom.Point2D p5)