shady.common.multi
Class MultiSegment

java.lang.Object
  extended by shady.common.AbstractSegment
      extended by shady.common.Segment
          extended by shady.common.multi.MultiSegment
All Implemented Interfaces:
java.io.Serializable

public class MultiSegment
extends Segment

A Segment for MultiShady.

Unlike regular Segments, MultiSegments can be un-grounded, and they can keep track of the connected members.

Copyright (C) 2006 Marsette A. Vona, III

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Author:
Marsette (Marty) A. Vona, III
See Also:
Serialized Form

Field Summary
private static java.lang.String cvsid
          CVS id.
 boolean grounded
          Whether this MultiSegment is grounded.
(package private)  double lengthInEnvironment
          Memo of the length of this segment in its environment, for performance in MultiEnvironment.placeChild(shady.common.multi.MultiSegment, shady.common.Point.OnSegment, shady.common.Point.OnSegment, double, double, double).
 java.util.Set members
          A set in which the connected Shadys can be kept.
(package private)  boolean placed
          Whether this MultiSegment is placed (see MultiEnvironment.place()).
 
Fields inherited from class shady.common.Segment
end, index, start
 
Constructor Summary
MultiSegment()
          Create a new unitialized grounded segment.
MultiSegment(Point start, Point end)
          Create a new grounded MultiSegment.
MultiSegment(Point start, Point end, boolean grounded)
          Create a new MultiSegment.
 
Method Summary
 java.lang.String toString(DoubleFormatter formatter)
          Return a human-readable String representation of this Segment.
 
Methods inherited from class shady.common.Segment
getEnd, getEndX, getEndY, getStart, getStartX, getStartY, interpolateX, interpolateY, invalidate, isValid, set, set
 
Methods inherited from class shady.common.AbstractSegment
getLength, getLengthSq, getOrientation, interpolate, interpolateCartesian, interpolateCartesian, interpolateOnSegment, interpolateOnSegment, project, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cvsid

private static final java.lang.String cvsid

CVS id.

See Also:
Constant Field Values

grounded

public boolean grounded

Whether this MultiSegment is grounded.


placed

boolean placed

Whether this MultiSegment is placed (see MultiEnvironment.place()).


lengthInEnvironment

double lengthInEnvironment

Memo of the length of this segment in its environment, for performance in MultiEnvironment.placeChild(shady.common.multi.MultiSegment, shady.common.Point.OnSegment, shady.common.Point.OnSegment, double, double, double). Maintained by MultiEnvironment.


members

public java.util.Set members

A set in which the connected Shadys can be kept.

Constructor Detail

MultiSegment

public MultiSegment(Point start,
                    Point end)

Create a new grounded MultiSegment.

Parameters:
start - the start Point, a copy will be made
end - the end Point, a copy will be made

MultiSegment

public MultiSegment(Point start,
                    Point end,
                    boolean grounded)

Create a new MultiSegment.

Parameters:
start - the start Point, a copy will be made
end - the end Point, a copy will be made
grounded - whether this MultiSegment is grounded

MultiSegment

public MultiSegment()

Create a new unitialized grounded segment.

Method Detail

toString

public java.lang.String toString(DoubleFormatter formatter)

Return a human-readable String representation of this Segment.

Overrides:
toString in class Segment
Parameters:
formatter - the formatter to use, null if none
Returns:
a human-readable String representation of this Segment