Bezier (JGraph v5.12.4.2 API Specification)
Keywords: org.jgraph.util.Bezier class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.12.4.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jgraph.util
Class Bezier

    java.lang.Object
      org.jgraph.util.Bezier

public class Bezier
extends Object

Interpolates given points by a bezier curve. The first and the last two points are interpolated by a quadratic bezier curve; the other points by a cubic bezier curve. Let p a list of given points and b the calculated bezier points, then one get the whole curve by: sharedPath.moveTo(p[0]) sharedPath.quadTo(b[0].x, b[0].getY(), p[1].x, p[1].getY()); for(int i = 2; i < p.length - 1; i++ ) { Point b0 = b[2*i-3]; Point b1 = b[2*i-2]; sharedPath.curveTo(b0.x, b0.getY(), b1.x, b1.getY(), p[i].x, p[i].getY()); } sharedPath.quadTo(b[b.length-1].x, b[b.length-1].getY(), p[n - 1].x, p[n - 1].getY());

Constructor Summary
`Bezier(Point2D[] points)` Creates a new Bezier curve.

Method Summary
`Point2D` | `getPoint(int i)` Returns the bezier points at position i.
`int` | `getPointCount()` Returns the number of bezier points.
`Point2D[]` | `getPoints()` Returns the calculated bezier points.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Bezier

    public Bezier(Point2D[] points)

  Creates a new Bezier curve.

Parameters:
  `points` -

Method Detail

### getPoints

    public Point2D[] getPoints()

  Returns the calculated bezier points.

  Returns:
    the calculated bezier points

### getPointCount

    public int getPointCount()

  Returns the number of bezier points.

  Returns:
    number of bezier points

### getPoint

    public Point2D getPoint(int i)

  Returns the bezier points at position i.

  Parameters:
    `i` -
  Returns:
    the bezier point at position i

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph v5.12.4.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (C) 2001-2008 Gaudenz Alder. All rights reserved.