bookExamples.ch26Graphics.draw2d.shapes
Class Rhombus2d

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

public class Rhombus2d
extends DJShape
implements Containment


Field Summary
 
Fields inherited from class bookExamples.ch26Graphics.draw2d.shapes.DJShape
affineTransform
 
Constructor Summary
Rhombus2d(int _x1, int _y1, int _x2, int _y2)
           
 
Method Summary
 void addPoint(java.awt.geom.Point2D p1, java.awt.Polygon poly)
           
 boolean contains(double x, double y)
           
 void draw(java.awt.Graphics g)
           
 java.awt.Point getCenter()
           
 int getH()
           
 DJShape getInstance(int x1, int y1, int x2, int y2)
           
 java.awt.Polygon getPolygon()
           
 java.awt.Shape getShape()
           
 int getW()
           
 int getX1()
           
 int getY1()
           
 
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
 

Constructor Detail

Rhombus2d

public Rhombus2d(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

addPoint

public void addPoint(java.awt.geom.Point2D p1,
                     java.awt.Polygon poly)

getPolygon

public java.awt.Polygon getPolygon()

draw

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

contains

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

getShape

public java.awt.Shape getShape()