net.kolls.railworld.segment
Class HiddenSegment

java.lang.Object
  extended by net.kolls.railworld.RailSegment
      extended by net.kolls.railworld.segment.TrackSegment
          extended by net.kolls.railworld.segment.HiddenSegment

public class HiddenSegment
extends TrackSegment

A hidden segment. Trains on this segment are not drawn.

Author:
Steve Kollmansberger

Nested Class Summary
 
Nested classes/interfaces inherited from class net.kolls.railworld.segment.TrackSegment
TrackSegment.TSEP
 
Field Summary
 
Fields inherited from class net.kolls.railworld.segment.TrackSegment
cap, coords, POINT_BEGIN, POINT_END, railBedStroke, railStroke
 
Fields inherited from class net.kolls.railworld.RailSegment
dests, ec, MOUSE_NEAR, pts, RAIL_BED_WIDTH, RAIL_WIDTH, trains
 
Constructor Summary
HiddenSegment(RailSegment bg, RailSegment en, java.awt.geom.Line2D crds)
          Create a hidden segment
 
Method Summary
 boolean carHidden()
          Should cars on this segment be drawn, or hidden? Defaults to false (not hidden).
 void draw(int z, java.awt.Graphics2D gc)
          Draw the segment.
 void recomp()
          Called when changes are made; recompute or update any associated values.
 
Methods inherited from class net.kolls.railworld.segment.TrackSegment
canErase, createSEP, dest, editPanel, getCoords, getPoint, length, mouseOver, setCap
 
Methods inherited from class net.kolls.railworld.RailSegment
click, destNZ, enter, getDest, getDests, getPoint, getPoints, isDynamic, nearEditPoint, pixelStep, setDest, setPoint, singleton, step, trains, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiddenSegment

public HiddenSegment(RailSegment bg,
                     RailSegment en,
                     java.awt.geom.Line2D crds)
Create a hidden segment

Parameters:
bg - Begin segment
en - End segment
crds - Line coords
Method Detail

recomp

public void recomp()
Description copied from class: RailSegment
Called when changes are made; recompute or update any associated values.

Overrides:
recomp in class TrackSegment

draw

public void draw(int z,
                 java.awt.Graphics2D gc)
Description copied from class: RailSegment
Draw the segment. Segments have several z-layers to allowed slightly overlaping pieces to still look nice. z = 1 is a static layer (lowest) z = 2 is a static layer (highest) z = 3 is reserved z = 4 is the dynamic layer. This is redrawn frequently, if requested by the segment.

Overrides:
draw in class TrackSegment
Parameters:
z - The currently z-layer to draw
gc - A Graphics2D graphics context.
See Also:
RailSegment.isDynamic()

carHidden

public boolean carHidden()
Description copied from class: RailSegment
Should cars on this segment be drawn, or hidden? Defaults to false (not hidden).

Overrides:
carHidden in class RailSegment
Returns:
A boolean indicating if cars are hidden or not.