public class Diagram extends Object
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Diagram.Command
Commands used in RouteStep.
|
(package private) static class |
Diagram.LaneType
Types of lanes
|
(package private) class |
Diagram.RouteStep
Step in a schematic route through the intersection.
|
(package private) class |
Diagram.XYPair
Pack two integer coordinates in one object.
|
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BICYCLE
Bicycle lane.
|
(package private) static int |
BOUNDARY
Boundary of schematic intersection.
|
(package private) static int |
CAR_CENTER
No turn (center) lane(s).
|
(package private) static int |
CAR_LEFT
Left turn lane(s).
|
(package private) static int |
CAR_RIGHT
Right turn lane(s).
|
(package private) static int |
CAR_ROUNDABOUT_LEFT
Left turn area on roundabout.
|
(package private) static JPanel |
checkBoxPanel
JPanel that holds all the check boxes.
|
(package private) static int |
DIVIDER_1
Central divider.
|
(package private) static int |
DIVIDER_2
Divider between center public transit and left turn lane.
|
(package private) static int |
DIVIDER_3
Divider between right turn lane and bicycle lane.
|
(package private) static int |
DIVIDER_4
Divider.
|
(package private) static int |
DIVIDER_5
Divider.
|
(package private) static int |
DIVIDER_6
Divider.
|
(package private) static int |
DIVIDER_7
Divider.
|
(package private) static int |
PT_BICYCLE_SIDEWALK
Public transit between bicycle lane and right sidewalk.
|
(package private) static int |
PT_DIV_L
Public transit between divider and left turn lane.
|
(package private) static int |
PT_RIGHT_BICYCLE
Public transit between right turn lane and bicycle lane.
|
(package private) static int |
PT_SIDEWALK_SHOULDER
Public transit right of right sidewalk.
|
(package private) Map<Short,Diagram.XYPair[]> |
routes
The routes through the intersection.
|
(package private) static int |
SHOULDER
Shoulder right of right sidewalk.
|
(package private) static int |
SIDEWALK
Sidewalk.
|
(package private) List<Short> |
streams
The streams crossing the intersection.
|
(package private) static JPanel |
testPanel
JPanel used to render the intersection for testing.
|
Constructor and Description |
---|
Diagram(Set<Short> streams)
Construct a new diagram.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isGrass(int i)
Report if object is inaccessible to all traffic.
|
(package private) Diagram.LaneType |
laneType(int streamNumber)
Return the LaneType for a stream number.
|
static void |
main(String[] args)
Test the Diagram code.
|
static JCheckBox |
makeCheckBox(int stream,
boolean initialState)
Make a check box to switch a particular stream number on or off.
|
(package private) static void |
rebuildTestPanel()
Render the intersection.
|
BufferedImage |
render()
Create a BufferedImage and render the schematic on it.
|
(package private) int |
rotatedX(Diagram.XYPair xyPair,
int rotation)
Return the rotated x value.
|
(package private) int |
rotatedY(Diagram.XYPair xyPair,
int rotation)
Return the rotated y value.
|
static final int DIVIDER_1
static final int CAR_ROUNDABOUT_LEFT
static final int PT_DIV_L
static final int DIVIDER_2
static final int CAR_LEFT
static final int CAR_CENTER
static final int CAR_RIGHT
static final int DIVIDER_3
static final int PT_RIGHT_BICYCLE
static final int DIVIDER_4
static final int BICYCLE
static final int DIVIDER_5
static final int PT_BICYCLE_SIDEWALK
static final int DIVIDER_6
static final int SIDEWALK
static final int DIVIDER_7
static final int PT_SIDEWALK_SHOULDER
static final int SHOULDER
static final int BOUNDARY
final Map<Short,Diagram.XYPair[]> routes
static JPanel testPanel
static JPanel checkBoxPanel
public Diagram(Set<Short> streams) throws org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightException
streams
- Set<Short>; the streams (numbered according to the Dutch standard) that cross the intersection.org.opentrafficsim.road.network.lane.object.trafficlight.TrafficLightException
- when a route is invalidpublic static final boolean isGrass(int i)
i
- int; the number of the objectfinal Diagram.LaneType laneType(int streamNumber)
streamNumber
- int; the standard Dutch traffic stream numberfinal int rotatedX(Diagram.XYPair xyPair, int rotation)
xyPair
- XYPair; the XYPairrotation
- int; rotation in multiples of 90 degreesfinal int rotatedY(Diagram.XYPair xyPair, int rotation)
xyPair
- XYPair; the XYPairrotation
- int; rotation in multiples of 90 degreespublic BufferedImage render()
public static void main(String[] args)
args
- String[]; the command line arguments (not used)public static JCheckBox makeCheckBox(int stream, boolean initialState)
stream
- int; the stream numberinitialState
- boolean; if true; the check box will be checkedstatic void rebuildTestPanel()
Copyright © 2014–2017 Delft University of Technology. All rights reserved.