|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.kolls.railworld.edit.SegmentEditPoint
public abstract class SegmentEditPoint
A segment edit point consists of a point on a segment as well as some extra abilities for editing, such as drawing temporary versions, moving the point (which should in turn move all segments connected to it) and determining if it should connect to other segments
Field Summary | |
---|---|
protected java.awt.Color |
c
The color that the handle should use. |
RailSegment[] |
myr
Segments involved in this edit point. |
protected int |
pidx
The point index of the segment we are editting |
Constructor Summary | |
---|---|
SegmentEditPoint(RailSegment[] segs,
int ptIndex,
java.awt.Color col)
Create a segment edit point. |
Method Summary | |
---|---|
abstract RailSegment |
anchor(RailSegment r)
Attachs a segment to this edit point. |
void |
draw(java.awt.Graphics2D gc)
Draws this edit point. |
java.awt.Color |
getColor()
Gets the color of this point. |
java.awt.geom.Point2D |
getPoint()
Returns the current location of this edit point. |
RailSegment |
getSegment()
Returns the railsegment this edit point is associated with. |
abstract 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) . |
void |
moveTo(java.awt.geom.Point2D p)
Moves this edit point. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int pidx
protected java.awt.Color c
public RailSegment[] myr
Constructor Detail |
---|
public SegmentEditPoint(RailSegment[] segs, int ptIndex, java.awt.Color col)
segs
- The segments involved. See myr
for details.ptIndex
- The index of the point on the owning segment. See pidx
col
- Color of the handle to display. See c
Method Detail |
---|
public abstract RailSegment anchor(RailSegment r)
r
- The RailSegment
to anchor to this point.
null
.public final java.awt.Color getColor()
public final RailSegment getSegment()
public final java.awt.geom.Point2D getPoint()
public final void moveTo(java.awt.geom.Point2D p)
p
- New location.public final void draw(java.awt.Graphics2D gc)
gc
- The graphics contextpublic abstract boolean isAnchorSource()
RailSegment.nearEditPoint(Point2D, RailSegment)
.
true
if we should snap-to and anchor onto other segments.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |