Class TrajectoryPlot

All Implemented Interfaces:
org.djutils.base.Identifiable, org.jfree.data.general.Dataset, org.jfree.data.general.SeriesDataset, org.jfree.data.xy.XYDataset

public class TrajectoryPlot extends AbstractSamplerPlot implements org.jfree.data.xy.XYDataset
Plot of trajectories along a path.

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

    • TrajectoryPlot

      public TrajectoryPlot(String caption, org.djunits.value.vdouble.scalar.Duration updateInterval, PlotScheduler scheduler, SamplerData<?> samplerData, GraphPath<? extends LaneData<?>> path)
      Constructor.
      Parameters:
      caption - String; caption
      updateInterval - Duration; regular update interval (simulation time)
      scheduler - PlotScheduler; scheduler.
      samplerData - SamplerData<?>; sampler data
      path - GraphPath<? extends LaneData>; path
  • Method Details

    • getGraphType

      public GraphType getGraphType()
      Return the graph type for transceiver.
      Specified by:
      getGraphType in class AbstractPlot
      Returns:
      GraphType; the graph type.
    • getStatusLabel

      public String getStatusLabel(double domainValue, double rangeValue)
      Returns the status label when the mouse is over the given location.
      Specified by:
      getStatusLabel in class AbstractPlot
      Parameters:
      domainValue - double; domain value (x-axis)
      rangeValue - double; range value (y-axis)
      Returns:
      String; status label when the mouse is over the given location
    • increaseTime

      protected void increaseTime(org.djunits.value.vdouble.scalar.Time time)
      Increase the simulated time span.
      Specified by:
      increaseTime in class AbstractPlot
      Parameters:
      time - Time; time to increase to
    • getSeriesCount

      public int getSeriesCount()
      Specified by:
      getSeriesCount in interface org.jfree.data.general.SeriesDataset
    • getSeriesKey

      public Comparable<Integer> getSeriesKey(int series)
      Specified by:
      getSeriesKey in interface org.jfree.data.general.SeriesDataset
    • indexOf

      public int indexOf(Comparable seriesKey)
      Specified by:
      indexOf in interface org.jfree.data.general.SeriesDataset
    • getDomainOrder

      public org.jfree.data.DomainOrder getDomainOrder()
      Specified by:
      getDomainOrder in interface org.jfree.data.xy.XYDataset
    • getItemCount

      public int getItemCount(int series)
      Specified by:
      getItemCount in interface org.jfree.data.xy.XYDataset
    • getX

      public Number getX(int series, int item)
      Specified by:
      getX in interface org.jfree.data.xy.XYDataset
    • getXValue

      public double getXValue(int series, int item)
      Specified by:
      getXValue in interface org.jfree.data.xy.XYDataset
    • getY

      public Number getY(int series, int item)
      Specified by:
      getY in interface org.jfree.data.xy.XYDataset
    • getYValue

      public double getYValue(int series, int item)
      Specified by:
      getYValue in interface org.jfree.data.xy.XYDataset
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getLegend

      public org.jfree.chart.LegendItemCollection getLegend()
      Retrieve the legend.
      Returns:
      LegendItemCollection; the legend
    • getLaneVisible

      public List<Boolean> getLaneVisible()
      Retrieve the lane visibility flags.
      Returns:
      List<Boolean>; the lane visibility flags