java.lang.Object
org.opentrafficsim.trafficcontrol.trafcod.Diagram

public class Diagram extends Object
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 Details

  • 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

      public BufferedImage render()
      Create a BufferedImage and render the schematic on it.
      Returns:
      BufferedImage
    • main

      public static void main(String[] args)
      Test the Diagram code.
      Parameters:
      args - the command line arguments (not used)
    • makeCheckBox

      public static JCheckBox makeCheckBox(int stream, boolean initialState)
      Make a check box to switch a particular stream number on or off.
      Parameters:
      stream - the stream number
      initialState - if true; the check box will be checked
      Returns:
      JCheckBox