bookExamples.ch26Graphics.draw2d.shapes
Class Shapes

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

public class Shapes
extends DJShape
implements Containment


Field Summary
 
Fields inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape
affineTransform
 
Constructor Summary
Shapes(int x1, int y1, int x2, int y2)
           
 
Method Summary
 void addLineToLastCircle()
           
 void addLineToLastCircle(Ray2d r)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addShape(DJShape d)
           
 boolean contains(double x, double y)
           
 void draw(java.awt.Graphics g)
           
 void eraseLastShape(DJShape shape)
           
 java.lang.String getAsText()
           
 java.awt.Point getCenter()
           
 Circle2d getClosestCircle()
           
 Vec2d getClosestPoint(Ray2d ray)
           
 DJShape getClosestShape(java.awt.Point p)
           
 java.awt.Component getCustomEditor()
           
 ImageShape getImageShape()
           
 DJShape getInstance(int x1, int y1, int x2, int y2)
           
 java.lang.String getJavaInitializationString()
           
 Circle2d getLastCircle()
           
 Line2d getLastLine()
           
 Rect2d getLastRectangle()
           
static int getMaxCount()
           
static double getRefIndex()
           
 Ray2d getReflectRay(Circle2d c, Vec2d p, Vec2d d)
           
 Ray2d getRefractRay(Circle2d c, Vec2d o, Vec2d p, Vec2d d)
           
 java.lang.String[] getTags()
           
 java.util.Vector getV()
           
 java.lang.Object getValue()
           
 boolean isPaintable()
           
 void paintValue(java.awt.Graphics gfx, java.awt.Rectangle box)
           
 ImageShape removeImageShape()
           
 DJShape removeLastShape()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void setAsText(java.lang.String text)
           
 void setClosestCircle(Circle2d closestCircle)
           
 void setLastShape(DJShape js)
           
 void setV(java.util.Vector v)
           
 void setValue(java.lang.Object value)
           
 boolean supportsCustomEditor()
           
 
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, toString, wait, wait, wait
 

Constructor Detail

Shapes

public Shapes(int x1,
              int y1,
              int x2,
              int y2)
Method Detail

getCenter

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

getInstance

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

removeImageShape

public ImageShape removeImageShape()

getImageShape

public ImageShape getImageShape()

addShape

public void addShape(DJShape d)

draw

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

getLastLine

public Line2d getLastLine()

removeLastShape

public DJShape removeLastShape()

setLastShape

public void setLastShape(DJShape js)

getLastCircle

public Circle2d getLastCircle()

getLastRectangle

public Rect2d getLastRectangle()

getClosestPoint

public Vec2d getClosestPoint(Ray2d ray)

addLineToLastCircle

public void addLineToLastCircle()

addLineToLastCircle

public void addLineToLastCircle(Ray2d r)

getReflectRay

public Ray2d getReflectRay(Circle2d c,
                           Vec2d p,
                           Vec2d d)

getRefractRay

public Ray2d getRefractRay(Circle2d c,
                           Vec2d o,
                           Vec2d p,
                           Vec2d d)

getClosestShape

public DJShape getClosestShape(java.awt.Point p)

isPaintable

public boolean isPaintable()

supportsCustomEditor

public boolean supportsCustomEditor()

getCustomEditor

public java.awt.Component getCustomEditor()

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Overrides:
addPropertyChangeListener in class DJShape

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Overrides:
removePropertyChangeListener in class DJShape

getValue

public java.lang.Object getValue()

setValue

public void setValue(java.lang.Object value)

getAsText

public java.lang.String getAsText()

getJavaInitializationString

public java.lang.String getJavaInitializationString()

getTags

public java.lang.String[] getTags()

setAsText

public void setAsText(java.lang.String text)
               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

paintValue

public void paintValue(java.awt.Graphics gfx,
                       java.awt.Rectangle box)

eraseLastShape

public void eraseLastShape(DJShape shape)

contains

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

getMaxCount

public static int getMaxCount()

getRefIndex

public static double getRefIndex()

getClosestCircle

public Circle2d getClosestCircle()

setClosestCircle

public void setClosestCircle(Circle2d closestCircle)

getV

public java.util.Vector getV()

setV

public void setV(java.util.Vector v)