net.kolls.railworld.segment
Class Curve.CSEP

java.lang.Object
  extended by net.kolls.railworld.edit.SegmentEditPoint
      extended by net.kolls.railworld.segment.Curve.CSEP
Enclosing class:
Curve

public class Curve.CSEP
extends SegmentEditPoint

Edit point for setting up cubic curves

Author:
Steve Kollmansberger

Field Summary
 
Fields inherited from class net.kolls.railworld.edit.SegmentEditPoint
c, myr, pidx
 
Constructor Summary
Curve.CSEP(Curve t, RailSegment an, int pt)
          Construct a curve segment edit point.
 
Method Summary
 RailSegment anchor(RailSegment r)
          Attachs a segment to this edit point.
 boolean disconnect()
           
 boolean isAnchorSource()
          If this segment is being moved, should it offer to anchor onto other segments? Note that the other segment will be asked to approve with RailSegment.nearEditPoint(Point2D, RailSegment).
 
Methods inherited from class net.kolls.railworld.edit.SegmentEditPoint
draw, getColor, getPoint, getSegment, moveTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Curve.CSEP

public Curve.CSEP(Curve t,
                  RailSegment an,
                  int pt)
Construct a curve segment edit point. These are only constructed by Curve.createSEP(int, RailSegment).

Parameters:
t - Curve segment
an - Railsegment connecting
pt - Point index
Method Detail

disconnect

public boolean disconnect()
Returns:
true if the segment was connected at this end and has been disconnected.

isAnchorSource

public boolean isAnchorSource()
Description copied from class: SegmentEditPoint
If this segment is being moved, should it offer to anchor onto other segments? Note that the other segment will be asked to approve with RailSegment.nearEditPoint(Point2D, RailSegment).

Specified by:
isAnchorSource in class SegmentEditPoint
Returns:
true if we should snap-to and anchor onto other segments.

anchor

public RailSegment anchor(RailSegment r)
Description copied from class: SegmentEditPoint
Attachs a segment to this edit point.

Specified by:
anchor in class SegmentEditPoint
Parameters:
r - The RailSegment to anchor to this point.
Returns:
Returns a new segment if that segment should be added to the array of segments, and also anything else that wanted to anchor here should anchor at the returned segment. May return null.