bookExamples.ch26Graphics.draw2d.shapes
Class Shapes
java.lang.Object
bookExamples.ch26Graphics.draw2d.shapes.DJShape
bookExamples.ch26Graphics.draw2d.shapes.Shapes
- All Implemented Interfaces:
- Containment, Drawable, java.io.Serializable
public class Shapes
- extends DJShape
- implements Containment
- See Also:
- Serialized Form
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)
|
void |
eraseSelected()
|
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()
|
DJShape |
getPolyLine()
|
static double |
getRefIndex()
|
Ray2d |
getReflectRay(Circle2d c,
Vec2d p,
Vec2d d)
|
Ray2d |
getRefractRay(Circle2d c,
Vec2d o,
Vec2d p,
Vec2d d)
|
DJShape[] |
getShapes()
|
java.lang.String[] |
getTags()
|
java.util.Vector |
getV()
|
java.lang.Object |
getValue()
|
void |
groupSelected()
|
boolean |
isPaintable()
|
java.util.Vector |
open()
|
void |
paintValue(java.awt.Graphics gfx,
java.awt.Rectangle box)
|
ImageShape |
removeImageShape()
|
DJShape |
removeLastShape()
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removeShape(DJShape shape)
|
void |
save()
|
void |
selectAll()
|
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()
|
void |
unselectAll()
|
Methods inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape |
drawLine, erase, getAffineTransform, getBackground, getCenterPoint, getDistance, getForeground, getForegroundColor, getOldAffineTransform, getPcs, getRunAffinePanel, getSize, getX1, getX2, getY1, getY2, isGrouped, isSelected, restoreState, saveState, setAffineTransform, setBackground, setForeground, setForegroundColor, setGrouped, setLocation, setOldAffineTransform, setPcs, setSelected, setSize, setX1, setX2, setY1, setY2 |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Shapes
public Shapes(int x1,
int y1,
int x2,
int y2)
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)
getShapes
public DJShape[] getShapes()
getPolyLine
public DJShape getPolyLine()
selectAll
public void selectAll()
unselectAll
public void unselectAll()
removeShape
public void removeShape(DJShape shape)
save
public void save()
open
public java.util.Vector open()
groupSelected
public void groupSelected()
eraseSelected
public void eraseSelected()