public final class GraphUtil extends Object
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
static boolean |
considerTrajectory(Trajectory<?> trajectory,
Length startPosition,
Length endPosition)
Helper method for quick filtering of trajectories by checking if the position of the trajectory has overlap with the
given range.
|
static boolean |
considerTrajectory(Trajectory<?> trajectory,
Time startTime,
Time endTime)
Helper method for quick filtering of trajectories by checking if the time of the trajectory has overlap with the given
time.
|
static double[] |
ensureCapacity(double[] data,
int capacity)
Ensures that the given capacity is available in the array.
|
static float[] |
ensureCapacity(float[] data,
int capacity)
Ensures that the given capacity is available in the array.
|
static int[] |
ensureCapacity(int[] data,
int capacity)
Ensures that the given capacity is available in the array.
|
static <K> ChartMouseListener |
getToggleSeriesByLegendListener(LegendItemCollection legend,
List<Boolean> visibility)
Returns a chart listener that allows the series to be enabled and disabled by clicking on the respective legend item.
|
public static boolean considerTrajectory(Trajectory<?> trajectory, Time startTime, Time endTime)
trajectory
- Trajectory<?>; trajectorystartTime
- Time; start timeendTime
- Time; end timepublic static boolean considerTrajectory(Trajectory<?> trajectory, Length startPosition, Length endPosition)
trajectory
- Trajectory<?>; trajectorystartPosition
- Length; start positionendPosition
- Length; end positionpublic static double[] ensureCapacity(double[] data, int capacity)
data
- double[]; data arraycapacity
- int; required capacitypublic static float[] ensureCapacity(float[] data, int capacity)
data
- float[]; data arraycapacity
- int; required capacitypublic static int[] ensureCapacity(int[] data, int capacity)
data
- int[]; data arraycapacity
- int; required capacitypublic static <K> ChartMouseListener getToggleSeriesByLegendListener(LegendItemCollection legend, List<Boolean> visibility)
K
- underlying key type of the serieslegend
- LegendItemCollection; legendvisibility
- List<Boolean>; visibility of each series; the listener will store visibility in this list, which
an AbstractRenderer
can use in isSeriesVisible(series)
to show or hide the seriesCopyright © 2014–2019 Delft University of Technology. All rights reserved.