bookExamples.ch26Graphics.draw2d.shapes
Class Square2d

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

public class Square2d
extends DJShape
implements java.beans.PropertyEditor


Field Summary
 
Fields inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape
affineTransform
 
Constructor Summary
Square2d(int _x1, int _y1, int _x2, int _y2)
           
 
Method Summary
 void draw(java.awt.Graphics g)
           
 java.lang.String getAsText()
           
 java.awt.Point getCenter()
           
 java.awt.Component getCustomEditor()
           
 int getH()
           
 DJShape getInstance(int x1, int y1, int x2, int y2)
           
 java.lang.String getJavaInitializationString()
           
 java.lang.String[] getTags()
           
 java.lang.Object getValue()
           
 int getW()
           
 int getX1()
           
 int getY1()
           
 boolean isPaintable()
           
 void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)
           
 void setAsText(java.lang.String text)
           
 void setValue(java.lang.Object newValue)
           
 boolean supportsCustomEditor()
           
 
Methods inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape
addPropertyChangeListener, drawLine, erase, getAffineTransform, getBackground, getCenterPoint, getDistance, getForeground, getForegroundColor, getPcs, getRunAffinePanel, getSize, getX2, getY2, isSelected, removePropertyChangeListener, 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, toString, wait, wait, wait
 
Methods inherited from interface java.beans.PropertyEditor
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

Square2d

public Square2d(int _x1,
                int _y1,
                int _x2,
                int _y2)
Method Detail

getInstance

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

getX1

public int getX1()
Overrides:
getX1 in class DJShape

getY1

public int getY1()
Overrides:
getY1 in class DJShape

getW

public int getW()

getH

public int getH()

getCenter

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

draw

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

getCustomEditor

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

isPaintable

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

supportsCustomEditor

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

getValue

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

setValue

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

getAsText

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

getJavaInitializationString

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

getTags

public java.lang.String[] getTags()
Specified by:
getTags 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

paintValue

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