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

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

public class CubicCurve
extends java.lang.Object
implements Shape

Cubic Curve Shape.

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

Nested Class Summary
protected static class CubicCurve.CubicPathIterator
          Cubic Path Iterator.
 
Constructor Summary
CubicCurve()
          Constructs new CubicCurve object.
CubicCurve(int x1, int y1, int ctrlx1, int ctrly1, int ctrlx2, int ctrly2, int x2, int y2)
          Constructs new CubicCurve object.
CubicCurve(Point p1, Point ctrl1, Point ctrl2, 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 getCtrlX1()
          Returns the x coordinate of the curve's first control point.
 int getCtrlX2()
          Returns the x coordinate of the curve's second control point.
 int getCtrlY1()
          Returns the y coordinate of the curve's first control point.
 int getCtrlY2()
          Returns the y coordinate of the curve's second 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

CubicCurve

public CubicCurve()
Constructs new CubicCurve object.


CubicCurve

public CubicCurve(int x1,
                  int y1,
                  int ctrlx1,
                  int ctrly1,
                  int ctrlx2,
                  int ctrly2,
                  int x2,
                  int y2)
Constructs new CubicCurve object.

Parameters:
x1 - the x coordinate of the curve's start point
y1 - the y coordinate of the curve's start point
ctrlx1 - the x coordinate of the curve's first control point
ctrly1 - the y coordinate of the curve's first control point
ctrlx2 - the x coordinate of the curve's second control point
ctrly2 - the y coordinate of the curve's second control point
x2 - the x coordinate of the curve's end point
y2 - the y coordinate of the curve's end point

CubicCurve

public CubicCurve(Point p1,
                  Point ctrl1,
                  Point ctrl2,
                  Point p2)
Constructs new CubicCurve object.

Parameters:
p1 - the curve's start point
ctrl1 - the curve's first control point
ctrl2 - the curve's second 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

getCtrlX1

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

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

getCtrlY1

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

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

getCtrlX2

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

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

getCtrlY2

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

Returns:
the y coordinate of the curve's second 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.