Up: Java Kali Source Code and Documentation

Class Segment

Class Segment

java.lang.Object
   |
   +----Segment

class Segment
extends Object
A Segment is simply a collection of two DVectors; it's the basic unit of drawing in Kali.

Constructor Index

 o Segment(double, double, double, double)
Create a new segment from 4 doubles
 o Segment(DVector, DVector)
Create a new segment from 2 DVectors.

Method Index

 o array(double, double, double, double)
Construct an array of Segments; the array method takes 4, 8, 12, or 16 doubles, and returns an array of 1,2,3, or 4 Segments, respectively.
 o array(double, double, double, double, double, double, double, double)
 o array(double, double, double, double, double, double, double, double, double, double, double, double)
 o array(double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double)
 o aString(Segment[])
Convert an array of Segments to a string
 o copy()
Return a new segment which is a copy of this one.
 o reverse()
Swap the two endpoints of this segment.
 o toString()
Convert this segment to a string

Constructors

 o Segment
  public Segment(double x0,
                 double y0,
                 double x1,
                 double y1)
Create a new segment from 4 doubles
 o Segment
  public Segment(DVector p0,
                 DVector p1)
Create a new segment from 2 DVectors.

Methods

 o copy
  public Segment copy()
Return a new segment which is a copy of this one.
 o reverse
  public void reverse()
Swap the two endpoints of this segment.
 o toString
  public String toString()
Convert this segment to a string
Overrides:
toString in class Object
 o array
  public static Segment[] array(double x0,
                                double y0,
                                double x1,
                                double y1)
Construct an array of Segments; the array method takes 4, 8, 12, or 16 doubles, and returns an array of 1,2,3, or 4 Segments, respectively.
 o array
  public static Segment[] array(double x0,
                                double y0,
                                double x1,
                                double y1,
                                double x2,
                                double y2,
                                double x3,
                                double y3)
 o array
  public static Segment[] array(double x0,
                                double y0,
                                double x1,
                                double y1,
                                double x2,
                                double y2,
                                double x3,
                                double y3,
                                double x4,
                                double y4,
                                double x5,
                                double y5)
 o array
  public static Segment[] array(double x0,
                                double y0,
                                double x1,
                                double y1,
                                double x2,
                                double y2,
                                double x3,
                                double y3,
                                double x4,
                                double y4,
                                double x5,
                                double y5,
                                double x6,
                                double y6,
                                double x7,
                                double y7)
 o aString
  public static String aString(Segment s[])
Convert an array of Segments to a string


Up: Java Kali Source Code and Documentation

[HOME] The Geometry Center Home Page

Author: Mark Phillips
Comments to: webmaster@www.geom.uiuc.edu
Created: Sep 16 1996 --- Last modified: Sep 18 1996