Package coconad

Class TrainPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TrainPanel extends JPanel
Class for a train panel (aka dot display).
Since:
2013.11.29
See Also:
  • Constructor Details

    • TrainPanel

      public TrainPanel()
      Create a train panel.
      Since:
      2013.11.29 (Christian Borgelt)
  • Method Details

    • setRowHeight

      public void setRowHeight(int ht)
      Set the height of a row for a train.
      Parameters:
      ht - the height of the row in pixels
      Since:
      2013.11.29 (Christian Borgelt)
    • setScale

      public void setScale(double scale)
      Set the scaling factor for the time dimension (horizontal).
      Parameters:
      scale - the number of pixels per time unit
      Since:
      2013.11.29 (Christian Borgelt)
    • setRange

      public void setRange(double beg, double end)
      Set the event/spike time range to display.
      Parameters:
      beg - the beginning of the time range to display
      end - the end of the time range to display
      Since:
      2013.11.30 (Christian Borgelt)
    • setColor

      public void setColor(Color color)
      Set the color for the events/spikes.
      Parameters:
      color - the color for the events/spikes
      Since:
      2013.11.29 (Christian Borgelt)
    • getTrains

      public TrainSet getTrains()
      Get the current train set.
      Returns:
      the set of trains
      Since:
      2013.11.29 (Christian Borgelt)
    • setTrains

      public void setTrains(TrainSet trains)
      Get the current train set to display.
      Parameters:
      trains - the current set of trains
      Since:
      2013.11.29 (Christian Borgelt)
    • paint

      public void paint(Graphics g)
      (Re)paint the train panel.
      Overrides:
      paint in class JComponent
      Parameters:
      g - the graphics to use for the painting
      Since:
      2013.11.29 (Christian Borgelt)
    • makeImage

      public BufferedImage makeImage()
      Create an image of the panel contents.
      Returns:
      an image of the panel contents
      Since:
      2013.11.29 (Christian Borgelt)