Class AbstractBoundedPlot

java.lang.Object
org.opentrafficsim.draw.graphs.AbstractPlot
org.opentrafficsim.draw.graphs.AbstractBoundedPlot
All Implemented Interfaces:
org.djutils.base.Identifiable, org.jfree.data.general.Dataset
Direct Known Subclasses:
AbstractSpaceTimePlot, FundamentalDiagram

public abstract class AbstractBoundedPlot extends AbstractPlot
Plot that allows hard bounds to be set, with upper and lower bound independent. Manual zooming and auto ranges are bounded within the bounds.

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

    • AbstractBoundedPlot

      public AbstractBoundedPlot(PlotScheduler scheduler, String caption, org.djunits.value.vdouble.scalar.Duration updateInterval, org.djunits.value.vdouble.scalar.Duration delay)
      Constructor.
      Parameters:
      scheduler - PlotScheduler; scheduler
      caption - String; caption
      updateInterval - Duration; regular update interval (simulation time)
      delay - Duration; amount of time that chart runs behind simulation to prevent gaps in the charted data
  • Method Details

    • setChart

      protected void setChart(org.jfree.chart.JFreeChart chart)
      Sets the chart and adds menus and listeners.
      Overrides:
      setChart in class AbstractPlot
      Parameters:
      chart - JFreeChart; chart
    • setLowerDomainBound

      public void setLowerDomainBound(Double bound)
      Sets the lower domain bound.
      Parameters:
      bound - Double; use null to disable bound
    • setUpperDomainBound

      public void setUpperDomainBound(Double bound)
      Sets the upper domain bound.
      Parameters:
      bound - Double; use null to disable bound
    • setLowerRangeBound

      public void setLowerRangeBound(Double bound)
      Sets the lower range bound.
      Parameters:
      bound - Double; use null to disable bound
    • setUpperRangeBound

      public void setUpperRangeBound(Double bound)
      Sets the upper range bound.
      Parameters:
      bound - Double; use null to disable bound
    • setAutoBoundDomain

      public void setAutoBoundDomain(org.jfree.chart.plot.XYPlot plot)
      Overridable; activates auto bounds on domain axis from user input. This class does not force the use of XYPlots, but the auto bounds command comes from the ChartPanel that this class creates. In case the used plot is a XYPlot, this method is then invoked. Sub classes with auto domain bounds that work with an XYPlot should implement this. The method is not abstract as the use of XYPlot is not obligated.
      Overrides:
      setAutoBoundDomain in class AbstractPlot
      Parameters:
      plot - XYPlot; plot
    • setAutoBoundRange

      public void setAutoBoundRange(org.jfree.chart.plot.XYPlot plot)
      Overridable; activates auto bounds on range axis from user input. This class does not force the use of XYPlots, but the auto bounds command comes from the ChartPanel that this class creates. In case the used plot is a XYPlot, this method is then invoked. Sub classes with auto range bounds that work with an XYPlot should implement this. The method is not abstract as the use of XYPlot is not obligated.
      Overrides:
      setAutoBoundRange in class AbstractPlot
      Parameters:
      plot - XYPlot; plot