com.approximatrix.charting.render.shape
Class Diamond2D

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by com.approximatrix.charting.render.shape.Diamond2D
All Implemented Interfaces:
java.awt.Shape, java.lang.Cloneable

public class Diamond2D
extends java.awt.geom.RectangularShape

This class implements a diamond like Shape object.

Version:
1.0
Author:
mueller

Field Summary
protected  double height
           
protected  double width
           
protected  double x
           
protected  double y
           
 
Constructor Summary
Diamond2D(double x, double y, double width, double height)
          Creates a Diamond shape with the specified coordinates.
 
Method Summary
 boolean contains(double x, double y)
           
 boolean contains(double x, double y, double w, double h)
           
 java.awt.geom.Rectangle2D getBounds2D()
           
 double getHeight()
          Returns the height.
 java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
          Returns the object's PathIterator.
 double getWidth()
          Returns the width.
 double getX()
          Returns the x-coordinate.
 double getY()
          Returns the y-coordinate.
 boolean intersects(double x, double y, double w, double h)
           
 boolean isEmpty()
          Returns true if the bounding box is empty.
 void setFrame(double x, double y, double width, double height)
          Sets the framing rectangle.
 
Methods inherited from class java.awt.geom.RectangularShape
clone, contains, contains, getBounds, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, getPathIterator, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected double x

y

protected double y

width

protected double width

height

protected double height
Constructor Detail

Diamond2D

public Diamond2D(double x,
                 double y,
                 double width,
                 double height)
Creates a Diamond shape with the specified coordinates.

Method Detail

getHeight

public double getHeight()
Returns the height.

Specified by:
getHeight in class java.awt.geom.RectangularShape

getWidth

public double getWidth()
Returns the width.

Specified by:
getWidth in class java.awt.geom.RectangularShape

getX

public double getX()
Returns the x-coordinate.

Specified by:
getX in class java.awt.geom.RectangularShape

getY

public double getY()
Returns the y-coordinate.

Specified by:
getY in class java.awt.geom.RectangularShape

isEmpty

public boolean isEmpty()
Returns true if the bounding box is empty.

Specified by:
isEmpty in class java.awt.geom.RectangularShape

setFrame

public void setFrame(double x,
                     double y,
                     double width,
                     double height)
Sets the framing rectangle.

Specified by:
setFrame in class java.awt.geom.RectangularShape

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()

getPathIterator

public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
Returns the object's PathIterator.


contains

public boolean contains(double x,
                        double y,
                        double w,
                        double h)

contains

public boolean contains(double x,
                        double y)

intersects

public boolean intersects(double x,
                          double y,
                          double w,
                          double h)