|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.kolls.railworld.RailSegment
net.kolls.railworld.segment.TrackSegment
net.kolls.railworld.segment.LUSegment
public class LUSegment
Load/unload segment.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class net.kolls.railworld.segment.TrackSegment |
|---|
TrackSegment.TSEP |
| Field Summary | |
|---|---|
protected boolean |
drawAc
Indicates if the segment should draw the cars it accepts. |
| 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 | |
|---|---|
LUSegment(RailSegment bg,
RailSegment en,
java.awt.geom.Line2D crds,
Car[] accept,
boolean drawAccept)
Create a load/unload segment. |
|
| Method Summary | |
|---|---|
boolean |
canLU(Car c)
|
boolean |
doesDrawAccept()
|
void |
draw(int z,
java.awt.Graphics2D gc)
Draw the segment. |
protected void |
drawAccept(java.awt.Graphics2D gc)
Draw the cars which this LU segment accepts. |
javax.swing.JPanel |
editPanel()
You are guaranteed that the variable RailSegment.ec will be set prior to this call. |
boolean |
isDynamic()
Dynamic segments receive additional events while the game is running; non-dynamic segments are only asked to draw z levels 1 and 2 at draw static time. |
Car[] |
lu()
|
java.lang.String |
mouseOver(java.awt.geom.Point2D pos)
Whenever a user mouses over the canvas, all dynamic segments receive this event. |
void |
recomp()
Called when changes are made; recompute or update any associated values. |
void |
setDrawAccept(boolean drawAccept)
|
| Methods inherited from class net.kolls.railworld.segment.TrackSegment |
|---|
canErase, createSEP, dest, getCoords, getPoint, length, setCap |
| Methods inherited from class net.kolls.railworld.RailSegment |
|---|
carHidden, click, destNZ, enter, getDest, getDests, getPoint, getPoints, 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 |
| Field Detail |
|---|
protected boolean drawAc
| Constructor Detail |
|---|
public LUSegment(RailSegment bg,
RailSegment en,
java.awt.geom.Line2D crds,
Car[] accept,
boolean drawAccept)
bg - Begin segmenten - End segmentcrds - Line coordsaccept - Which cars do we accept (load or unload) here.drawAccept - Draw cars that we accept?| Method Detail |
|---|
public Car[] lu()
Cars the segment accepts.public void setDrawAccept(boolean drawAccept)
drawAccept - Should the segment draw accepted cars or not?public boolean doesDrawAccept()
public void recomp()
RailSegment
recomp in class TrackSegmentpublic java.lang.String mouseOver(java.awt.geom.Point2D pos)
RailSegment
mouseOver in class TrackSegmentpos - The mouse position
RailSegment.isDynamic()public boolean isDynamic()
RailSegment
isDynamic in class RailSegmentdraw events
and click events.RailSegment.draw(int, Graphics2D),
RailSegment.click(Point2D, RailCanvas)protected void drawAccept(java.awt.Graphics2D gc)
gc - The graphics context to draw onpublic boolean canLU(Car c)
c - A Car
public void draw(int z,
java.awt.Graphics2D gc)
RailSegment
draw in class TrackSegmentz - The currently z-layer to drawgc - A Graphics2D graphics context.RailSegment.isDynamic()public javax.swing.JPanel editPanel()
RailSegmentRailSegment.ec will be set prior to this call.
So if you need to refresh the canvas or make any changes to it, you can use
that variable.
editPanel in class TrackSegmentJPanel to display in the sidebar to edit this segment's properties. Please keep width at 200 pixels top.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||