package org.opentrafficsim.draw.graphs; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Paint; import java.awt.Shape; import java.awt.Stroke; import java.awt.geom.CubicCurve2D; import java.awt.geom.Line2D; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.djunits.value.vdouble.scalar.Duration; import org.djunits.value.vdouble.scalar.Length; import org.djunits.value.vdouble.scalar.Time; import org.djutils.exceptions.Try; import org.jfree.chart.JFreeChart; import org.jfree.chart.LegendItem; import org.jfree.chart.LegendItemCollection; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.entity.EntityCollection; import org.jfree.chart.entity.XYItemEntity; import org.jfree.chart.labels.XYToolTipGenerator; import org.jfree.chart.plot.XYPlot; import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; import org.jfree.data.DomainOrder; import org.jfree.data.xy.XYDataset; import org.opentrafficsim.core.animation.gtu.colorer.IdGtuColorer; import org.opentrafficsim.core.dsol.OTSSimulatorInterface; import org.opentrafficsim.draw.core.BoundsPaintScale; import org.opentrafficsim.draw.graphs.GraphPath.Section; import org.opentrafficsim.kpi.sampling.KpiLaneDirection; import org.opentrafficsim.kpi.sampling.SamplerData; import org.opentrafficsim.kpi.sampling.SamplingException; import org.opentrafficsim.kpi.sampling.Trajectory; import org.opentrafficsim.kpi.sampling.TrajectoryGroup; /** * Plot of trajectories along a path. *

* Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License. *

* @version $Revision$, $LastChangedDate$, by $Author$, initial version 13 okt. 2018
* @author Alexander Verbraeck * @author Peter Knoppers * @author Wouter Schakel */ public class TrajectoryPlot extends AbstractSamplerPlot implements XYDataset { /** Single shape to provide due to non-null requirement, but actually not used. */ private static final Shape NO_SHAPE = new Line2D.Float(0, 0, 0, 0); /** Color map. */ private static final Color[] COLORMAP; /** Strokes. */ private static final BasicStroke[] STROKES; /** Shape for the legend entries to draw the line over. */ private static final Shape LEGEND_LINE = new CubicCurve2D.Float(-20, 7, -10, -7, 0, 7, 20, -7); /** Updater for update times. */ private final GraphUpdater