yu.ac.bg.etf.javaqx.qswing.graphics
Class QuadCurve

java.lang.Object
  extended byyu.ac.bg.etf.javaqx.qswing.graphics.QuadCurve
All Implemented Interfaces:
Shape

public class QuadCurve
extends java.lang.Object
implements Shape

Quad Curve Shape.

Version:
0.2.0
Author:
Slobodan Vrkacevic (slobodan.vrkacevic@gmail.com)

Nested Class Summary
protected static class QuadCurve.QuadPathIterator
          Quad Path Iterator.
 
Constructor Summary
QuadCurve()
          Constructs new QuadCurve object.
QuadCurve(int x1, int y1, int ctrlx, int ctrly, int x2, int y2)
          Constructs new QuadCurve object.
QuadCurve(Point p1, Point ctrl, Point p2)
          Constructs new CubicCurve object.
 
Method Summary
 boolean contains(int x, int y)
          Returns true if the specified coordinates lie in the shape.
 boolean equals(java.lang.Object obj)
          
 Rectangle getBounds()
          Returns a rectangle that completely encloses the shape.
 int getCtrlX()
          Returns the x coordinate of the curve's control point.
 int getCtrlY()
          Returns the y coordinate of the curve's control point.
 PathIterator getPathIterator()
          Returns path iterator that traverses the geometry of the Shape.
 int getX1()
          Returns the x coordinate of the curve's start point.
 int getX2()
          Returns the x coordinate of the curve's end point.
 int getY1()
          Returns the y coordinate of the curve's start point.
 int getY2()
          Returns the y coordinate of the curve's end point.
 int hashCode()
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuadCurve

public QuadCurve()
Constructs new QuadCurve object.


QuadCurve

public QuadCurve(int x1,
                 int y1,
                 int ctrlx,
                 int ctrly,
                 int x2,
                 int y2)
Constructs new QuadCurve object.

Parameters:
x1 - the x coordinate of the curve's start point
y1 - the y coordinate of the curve's start point
ctrlx - the x coordinate of the curve's control point
ctrly - the y coordinate of the curve's control point
x2 - the x coordinate of the curve's end point
y2 - the y coordinate of the curve's end point

QuadCurve

public QuadCurve(Point p1,
                 Point ctrl,
                 Point p2)
Constructs new CubicCurve object.

Parameters:
p1 - the curve's start point
ctrl - the curve's control point
p2 - the curve's end point
Method Detail

getX1

public int getX1()
Returns the x coordinate of the curve's start point.

Returns:
the x coordinate of the curve's start point

getY1

public int getY1()
Returns the y coordinate of the curve's start point.

Returns:
the y coordinate of the curve's start point

getCtrlX

public int getCtrlX()
Returns the x coordinate of the curve's control point.

Returns:
the x coordinate of the curve's control point

getCtrlY

public int getCtrlY()
Returns the y coordinate of the curve's control point.

Returns:
the y coordinate of the curve's control point

getX2

public int getX2()
Returns the x coordinate of the curve's end point.

Returns:
the x coordinate of the curve's end point

getY2

public int getY2()
Returns the y coordinate of the curve's end point.

Returns:
the y coordinate of the curve's end point

contains

public boolean contains(int x,
                        int y)
Returns true if the specified coordinates lie in the shape.

Specified by:
contains in interface Shape
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
true if the specified coordinates lie in the shape

getBounds

public Rectangle getBounds()
Returns a rectangle that completely encloses the shape.

Specified by:
getBounds in interface Shape
Returns:
a rectangle that completely encloses the shape

getPathIterator

public PathIterator getPathIterator()
Returns path iterator that traverses the geometry of the Shape.

Specified by:
getPathIterator in interface Shape
Returns:
path iterator that traverses the geometry of the Shape

equals

public boolean equals(java.lang.Object obj)


hashCode

public int hashCode()


toString

public java.lang.String toString()



Copyright © 2007 ETF and contributors. All Rights Reserved.