Class Diagram
java.lang.Object
org.opentrafficsim.trafficcontrol.trafcod.Diagram
Functions that can draw a schematic diagram of an intersection given the list of traffic streams. The traffic stream numbers
must follow the Dutch conventions.
Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final booleanisGrass(int i) Report if object is inaccessible to all traffic.static voidTest the Diagram code.static JCheckBoxmakeCheckBox(int stream, boolean initialState) Make a check box to switch a particular stream number on or off.render()Create a BufferedImage and render the schematic on it.
-
Constructor Details
-
Diagram
Construct a new diagram.- Parameters:
streams- the streams (numbered according to the Dutch standard) that cross the intersection.- Throws:
TrafficControlException- when a route is invalid
-
-
Method Details
-
isGrass
public static final boolean isGrass(int i) Report if object is inaccessible to all traffic.- Parameters:
i- the number of the object- Returns:
- true if the object is inaccessible to all traffic
-
render
Create a BufferedImage and render the schematic on it.- Returns:
- BufferedImage
-
main
Test the Diagram code.- Parameters:
args- the command line arguments (not used)
-
makeCheckBox
Make a check box to switch a particular stream number on or off.- Parameters:
stream- the stream numberinitialState- if true; the check box will be checked- Returns:
- JCheckBox
-