prefuse.util.ui
Class PolarLine2D

java.lang.Object
  extended by java.awt.geom.Line2D
      extended by prefuse.util.ui.PolarLine2D
All Implemented Interfaces:
java.awt.Shape, java.lang.Cloneable

public class PolarLine2D
extends java.awt.geom.Line2D

A line defined by polar coordinates (a start position, a radius and an angle).

Author:
Anton Marsden

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Line2D
java.awt.geom.Line2D.Double, java.awt.geom.Line2D.Float
 
Constructor Summary
PolarLine2D(double x, double y, double r, double theta)
          Construct a new line.
PolarLine2D(java.awt.geom.Line2D line)
          Construct a new line from an existing line.
PolarLine2D(java.awt.geom.Point2D start, java.awt.geom.Point2D end)
          Construct a new line.
 
Method Summary
 java.awt.geom.Rectangle2D getBounds2D()
           
 java.awt.geom.Point2D getP1()
           
 java.awt.geom.Point2D getP2()
           
 double getRadius()
           
 double getTheta()
           
 double getX1()
           
 double getX2()
           
 double getY1()
           
 double getY2()
           
 void setLine(double x1, double y1, double x2, double y2)
           
 void setRadius(double radius)
          Set the radius (length) of the line.
 void setTheta(double theta)
          Set the angle of the line
 void setX1(double x1)
           
 void setY1(double y1)
           
 
Methods inherited from class java.awt.geom.Line2D
clone, contains, contains, contains, contains, getBounds, getPathIterator, getPathIterator, intersects, intersects, intersectsLine, intersectsLine, linesIntersect, ptLineDist, ptLineDist, ptLineDist, ptLineDistSq, ptLineDistSq, ptLineDistSq, ptSegDist, ptSegDist, ptSegDist, ptSegDistSq, ptSegDistSq, ptSegDistSq, relativeCCW, relativeCCW, relativeCCW, setLine, setLine
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolarLine2D

public PolarLine2D(java.awt.geom.Point2D start,
                   java.awt.geom.Point2D end)
Construct a new line.

Parameters:
start - the start coordinate of the line
end - the end coordinate of the line

PolarLine2D

public PolarLine2D(java.awt.geom.Line2D line)
Construct a new line from an existing line.

Parameters:
line - the line to get the coordinates from.

PolarLine2D

public PolarLine2D(double x,
                   double y,
                   double r,
                   double theta)
Construct a new line.

Parameters:
x - the starting X coordinate
y - the starting Y coordinate
r - the radius (length) of the line
theta - the angle of the line
Method Detail

getRadius

public double getRadius()
Returns:
the radius (length) of the line

setRadius

public void setRadius(double radius)
Set the radius (length) of the line.

Parameters:
radius - the radius (length) of the line

getTheta

public double getTheta()
Returns:
the angle of the line (in radians)

setTheta

public void setTheta(double theta)
Set the angle of the line

Parameters:
theta - the angle of the line, in radians

setX1

public void setX1(double x1)

getX1

public double getX1()
Specified by:
getX1 in class java.awt.geom.Line2D

setY1

public void setY1(double y1)

getY1

public double getY1()
Specified by:
getY1 in class java.awt.geom.Line2D

getP1

public java.awt.geom.Point2D getP1()
Specified by:
getP1 in class java.awt.geom.Line2D

getX2

public double getX2()
Specified by:
getX2 in class java.awt.geom.Line2D

getY2

public double getY2()
Specified by:
getY2 in class java.awt.geom.Line2D

getP2

public java.awt.geom.Point2D getP2()
Specified by:
getP2 in class java.awt.geom.Line2D

setLine

public void setLine(double x1,
                    double y1,
                    double x2,
                    double y2)
Specified by:
setLine in class java.awt.geom.Line2D

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D()


Copyright © 2008 Regents of the University of California