Class StackedTimePlot2D
- java.lang.Object
-
- com.metsci.glimpse.core.layout.GlimpseLayout
-
- com.metsci.glimpse.core.plot.stacked.StackedPlot2D
-
- com.metsci.glimpse.core.plot.timeline.StackedTimePlot2D
-
- All Implemented Interfaces:
GlimpseTarget
,GlimpseKeyListener
,Keyable
,GlimpseMouseListener
,GlimpseMouseMotionListener
,GlimpseMouseWheelListener
,Mouseable
,GlimpsePainter
- Direct Known Subclasses:
CollapsibleTimePlot2D
public class StackedTimePlot2D extends StackedPlot2D
AStackedPlot2D
which automatically creates a timeline axis at the bottom of the stack and uses aTaggedAxis1D
to define a selected time region.- Author:
- ulman
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.metsci.glimpse.core.plot.stacked.StackedPlot2D
StackedPlot2D.Orientation
-
-
Constructor Summary
Constructors Constructor Description StackedTimePlot2D()
StackedTimePlot2D(StackedPlot2D.Orientation orientation)
StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch)
StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch, TaggedAxis1D commonAxis)
StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch, TextureAtlas atlas)
StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch, TextureAtlas atlas, TaggedAxis1D commonAxis)
Creates a StackedTimePlot2D with specified orientation.StackedTimePlot2D(Epoch epoch)
Creates a vertical StackedTimePlot2D.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addPlotMouseListener(PlotMouseListener listener)
EventPlotInfo
createEventPlot()
EventPlotInfo
createEventPlot(Object id)
PlotInfo
createPlot(Object id, Axis1D axis)
TimelineInfo
createTimeline()
Creates a labeled timeline (with tick marks and date/time labels).TimelineInfo
createTimeline(Object id, TimeZone timeZone)
TimePlotInfo
createTimePlot()
TimePlotInfo
createTimePlot(Object id)
TimePlotInfo
createTimePlot(Object id, Axis1D axis)
Creates a plot similar tocreatePlot( String, Axis1D )
but with additional plot decorations, including: grid lines, axes labels for the data axis, and a text label describing the plot.double
fromTimeStamp(TimeStamp value)
Collection<TimePlotInfo>
getAllTimePlots()
Returns only the TimePlotInfo handles for plotting areas created with#createTimePlot(String)
.TimelineInfo
getDefaultTimeline()
Epoch
getEpoch()
EventPlotInfo
getEventPlot(Object id)
Returns the event plot handle for the plot identified via its unique string identifier.EventSelectionHandler
getEventSelectionHander()
Returns the common EventSelectionHandler shared between allEventPlotInfo
sub-plots for this StackedTimePlot2D.GlimpseLayout
getFullOverlayLayout()
int
getLabelSize()
GlimpseAxisLayout1D
getOverlayLayout()
StackedTimePlot2D provides a GlimpseAxisLayout1D which stretches over all the underlying plots and timeline.int
getOverlayLayoutOffsetX()
int
getOverlayLayoutOffsetY2()
PlotInfo
getSelectedPlot()
SelectedTimeRegionPainter
getSelectedTimePainter()
TextureAtlas
getTextureAtlas()
TimeStamp
getTime(GlimpseMouseEvent e)
TaggedAxis1D
getTimeAxis()
TimeAxisLabelHandler
getTimeAxisLabelHandler()
AxisMouseListener1D
getTimeAxisMouseListener()
TimelineInfo
getTimeline(Object id)
Returns the timeline handle for the timeline identified via its unique string identifier.TimePlotInfo
getTimePlot(Object id)
Returns the time plot handle for the plot identified via its unique string identifier.TimeStamp
getTimeSelection()
Get the currently selected time (usually equal to getTimeSelectionMax()).TimeStamp
getTimeSelectionMax()
Get the TimeStamp of latest endpoint of the selected time region.Tag
getTimeSelectionMaxTag()
Get the TaggedAxis1D Tag which defines the latest endpoint of the selected time region.TimeStamp
getTimeSelectionMin()
Get the TimeStamp of earliest endpoint of the selected time region.Tag
getTimeSelectionMinTag()
Get the TaggedAxis1D Tag which defines the earliest endpoint of the selected time region.Tag
getTimeSelectionTag()
Get the TaggedAxis1D Tag which defines the currently selected time.TooltipPainter
getTooltipPainter()
GlimpseAxisLayout1D
getUnderlayLayout()
boolean
isCurrentTimeLocked()
boolean
isLocked()
boolean
isSelectionLocked()
boolean
isShowLabels()
boolean
isShowTimeline()
boolean
isTimeAxisHorizontal()
GlimpseTargetStack
pushLayoutTargetStack(GlimpseTargetStack stack, Object id)
Pushes the layout stack for the named plot onto the provided GlimpseTargetStack.GlimpseTargetStack
pushPlotTargetStack(GlimpseTargetStack stack)
Pushes the layout stack for the base layout of this StackedTimePlot2D onto the provided GlimpseTargetStack.void
removePlotMouseListener(PlotMouseListener listener)
void
setAllowDragResizeLabel(boolean allow)
Sets whether to allow dragging to resize the label area.void
setAllowPanX(boolean lock)
Sets whether or not panning of the X axis is allowed for all timeline and plot axes.void
setAllowPanY(boolean lock)
Sets whether or not panning of the Y axis is allowed for all timeline and plot axes.void
setAllowSelectionLock(boolean lock)
Sets whether or not locking of the selected region is allowed for all timeline and plot axes.void
setAllowZoomX(boolean lock)
Sets whether or not zooming of the X axis is allowed for all timeline and plot axes.void
setAllowZoomY(boolean lock)
Sets whether or not zooming of the Y axis is allowed for all timeline and plot axes.void
setCurrentTimeLocked(boolean lock)
Fixes the selected time region and the timeline bounds with the current maximum of the selected time region at the far right of the timeline.void
setEpoch(Epoch epoch)
void
setLabelSize(int size)
void
setPlotSpacing(int size)
void
setSelectedPlot(PlotInfo layout)
void
setSelectedPlot(Object id)
void
setSelectionLocked(boolean lock)
Fixes the selected time region so that it will no longer follow the mouse cursor.void
setShowLabels(boolean show)
void
setShowTimeline(boolean showTimeline)
void
setTimeAxisBounds(TimeStamp minTime, TimeStamp maxTime)
void
setTimeAxisLabelHandler(TimeAxisLabelHandler handler)
void
setTimeAxisMouseListener(AxisMouseListener1D listener)
void
setTimeSelection(TimeStamp minTime, TimeStamp maxTime)
void
setTimeSelection(TimeStamp minTime, TimeStamp selectedTime, TimeStamp maxTime)
void
shiftTimeAxisBounds(TimeStamp maxTime)
void
shiftTimeSelection(TimeStamp maxTime)
void
showLabels(boolean show)
Deprecated.TimeStamp
toTimeStamp(double value)
-
Methods inherited from class com.metsci.glimpse.core.plot.stacked.StackedPlot2D
addPlot, createPlot, createPlot, deletePlot, getAllPlots, getBackgroundColor, getBorderSize, getCommonAxis, getCommonAxis, getLayoutManager, getOrientation, getOrthogonalAxis, getOverlayLayoutOffsetX2, getOverlayLayoutOffsetY, getPlot, getPlotSpacing, getSortedPlots, isAutoValidate, removePlot, setAutoValidate, setBackgroundColor, setBorderSize, setLookAndFeel, toString, validate, validateAxes, validateLayout
-
Methods inherited from class com.metsci.glimpse.core.layout.GlimpseLayout
addGlimpseKeyListener, addGlimpseMouseAllListener, addGlimpseMouseListener, addGlimpseMouseMotionListener, addGlimpseMouseWheelListener, addLayout, addLayout, addLayout, addLayout, addLayout, addPainter, addPainter, addPainter, addPainter, addPainter, addPainter, dispose, getGlimpseKeyListeners, getGlimpseMouseListeners, getGlimpseMouseMotionListeners, getGlimpseMouseWheelListeners, getLayoutByKey, getLock, getName, getPainterByKey, getTargetBounds, getTargetChildren, invalidateLayout, isDisposed, isEventConsumer, isEventGenerator, isVisible, keyPressed, keyReleased, layoutTo, layoutTo, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, paintTo, removeAll, removeAllGlimpseListeners, removeAllLayouts, removeGlimpseKeyListener, removeGlimpseMouseAllListener, removeGlimpseMouseListener, removeGlimpseMouseMotionListener, removeGlimpseMouseWheelListener, removeLayout, removeLayoutByKey, removePainter, removePainterByKey, setEventConsumer, setEventGenerator, setLayoutData, setLayoutManager, setName, setVisible, setZOrder, setZOrder
-
-
-
-
Field Detail
-
MIN_TIME
public static final String MIN_TIME
- See Also:
- Constant Field Values
-
MAX_TIME
public static final String MAX_TIME
- See Also:
- Constant Field Values
-
CURRENT_TIME
public static final String CURRENT_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StackedTimePlot2D
public StackedTimePlot2D()
-
StackedTimePlot2D
public StackedTimePlot2D(Epoch epoch)
Creates a vertical StackedTimePlot2D. The provided epoch determines what absolute timestamp corresponds to value 0.0 on the time Axis1D.
-
StackedTimePlot2D
public StackedTimePlot2D(StackedPlot2D.Orientation orientation)
-
StackedTimePlot2D
public StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch)
-
StackedTimePlot2D
public StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch, TextureAtlas atlas)
-
StackedTimePlot2D
public StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch, TaggedAxis1D commonAxis)
-
StackedTimePlot2D
public StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch, TextureAtlas atlas, TaggedAxis1D commonAxis)
Creates a StackedTimePlot2D with specified orientation. The provided epoch determines what absolute timestamp corresponds to value 0.0 on the time Axis1D.
-
-
Method Detail
-
setTimeAxisLabelHandler
public void setTimeAxisLabelHandler(TimeAxisLabelHandler handler)
-
getTimeAxisLabelHandler
public TimeAxisLabelHandler getTimeAxisLabelHandler()
-
getDefaultTimeline
public TimelineInfo getDefaultTimeline()
-
addPlotMouseListener
public void addPlotMouseListener(PlotMouseListener listener)
-
removePlotMouseListener
public void removePlotMouseListener(PlotMouseListener listener)
-
getEventSelectionHander
public EventSelectionHandler getEventSelectionHander()
Returns the common EventSelectionHandler shared between allEventPlotInfo
sub-plots for this StackedTimePlot2D.
-
setShowTimeline
public void setShowTimeline(boolean showTimeline)
-
isShowTimeline
public boolean isShowTimeline()
-
getOverlayLayoutOffsetX
public int getOverlayLayoutOffsetX()
- Overrides:
getOverlayLayoutOffsetX
in classStackedPlot2D
-
getOverlayLayoutOffsetY2
public int getOverlayLayoutOffsetY2()
- Overrides:
getOverlayLayoutOffsetY2
in classStackedPlot2D
-
setPlotSpacing
public void setPlotSpacing(int size)
- Overrides:
setPlotSpacing
in classStackedPlot2D
-
getOverlayLayout
public GlimpseAxisLayout1D getOverlayLayout()
StackedTimePlot2D provides a GlimpseAxisLayout1D which stretches over all the underlying plots and timeline. By default, it passes through mouse events to the underlying GlimpseLayouts and is used to display the blue time selection interval box. However, it can be used to perform arbitrary drawing on the timeline which must stretch across multiple plots.
-
getFullOverlayLayout
public GlimpseLayout getFullOverlayLayout()
-
getUnderlayLayout
public GlimpseAxisLayout1D getUnderlayLayout()
-
getTooltipPainter
public TooltipPainter getTooltipPainter()
-
getAllTimePlots
public Collection<TimePlotInfo> getAllTimePlots()
Returns only the TimePlotInfo handles for plotting areas created with
Note, this may not be all the plotting areas for this StackedPlot2D if some vanilla plots were created using#createTimePlot(String)
.#createPlot(String)
.
-
getTimeline
public TimelineInfo getTimeline(Object id)
Returns the timeline handle for the timeline identified via its unique string identifier.- Parameters:
id
- a timeline unique identifier- Returns:
- the TimelineInfo handle
-
getTimePlot
public TimePlotInfo getTimePlot(Object id)
Returns the time plot handle for the plot identified via its unique string identifier.- Parameters:
id
- a plot unique identifier- Returns:
- the TimePlotInfo handle
-
getEventPlot
public EventPlotInfo getEventPlot(Object id)
Returns the event plot handle for the plot identified via its unique string identifier.- Parameters:
id
- a plot unique identifier- Returns:
- the EventPlotInfo handle
-
setSelectedPlot
public void setSelectedPlot(Object id)
-
setSelectedPlot
public void setSelectedPlot(PlotInfo layout)
-
getSelectedPlot
public PlotInfo getSelectedPlot()
-
setTimeAxisMouseListener
public void setTimeAxisMouseListener(AxisMouseListener1D listener)
-
getTimeAxisMouseListener
public AxisMouseListener1D getTimeAxisMouseListener()
-
setAllowSelectionLock
public void setAllowSelectionLock(boolean lock)
Sets whether or not locking of the selected region is allowed for all timeline and plot axes. This setting will also affect newly created plots.- Parameters:
lock
- whether to allow locking of the selected region- See Also:
AxisMouseListener.setAllowSelectionLock(boolean)
-
setAllowDragResizeLabel
public void setAllowDragResizeLabel(boolean allow)
Sets whether to allow dragging to resize the label area.
-
setAllowZoomY
public void setAllowZoomY(boolean lock)
Sets whether or not zooming of the Y axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.- Parameters:
lock
- whether to allow zooming of the Y axis- See Also:
AxisMouseListener#setAllowZoomY(boolean)
-
setAllowZoomX
public void setAllowZoomX(boolean lock)
Sets whether or not zooming of the X axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.- Parameters:
lock
- whether to allow zooming of the X axis- See Also:
AxisMouseListener#setAllowZoomX(boolean)
-
setAllowPanY
public void setAllowPanY(boolean lock)
Sets whether or not panning of the Y axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.- Parameters:
lock
- whether to allow panning of the Y axis- See Also:
AxisMouseListener#setAllowPanY(boolean)
-
setAllowPanX
public void setAllowPanX(boolean lock)
Sets whether or not panning of the X axis is allowed for all timeline and plot axes. This setting will also affect newly created plots.- Parameters:
lock
- whether to allow panning of the X axis- See Also:
AxisMouseListener#setAllowPanX(boolean)
-
getTimeSelectionTag
public Tag getTimeSelectionTag()
Get the TaggedAxis1D Tag which defines the currently selected time.- Returns:
- the current time selection Tag
-
getTimeSelectionMinTag
public Tag getTimeSelectionMinTag()
Get the TaggedAxis1D Tag which defines the earliest endpoint of the selected time region.- Returns:
- the earliest time selection Tag
-
getTimeSelectionMaxTag
public Tag getTimeSelectionMaxTag()
Get the TaggedAxis1D Tag which defines the latest endpoint of the selected time region.- Returns:
- the latest time selection Tag
-
getTimeSelection
public TimeStamp getTimeSelection()
Get the currently selected time (usually equal to getTimeSelectionMax()).
-
getTimeSelectionMin
public TimeStamp getTimeSelectionMin()
Get the TimeStamp of earliest endpoint of the selected time region.
-
getTimeSelectionMax
public TimeStamp getTimeSelectionMax()
Get the TimeStamp of latest endpoint of the selected time region.
-
getEpoch
public Epoch getEpoch()
-
setEpoch
public void setEpoch(Epoch epoch)
-
toTimeStamp
public TimeStamp toTimeStamp(double value)
-
fromTimeStamp
public double fromTimeStamp(TimeStamp value)
-
getTimeAxis
public TaggedAxis1D getTimeAxis()
-
getSelectedTimePainter
public SelectedTimeRegionPainter getSelectedTimePainter()
-
setLabelSize
public void setLabelSize(int size)
-
setShowLabels
public void setShowLabels(boolean show)
-
showLabels
@Deprecated public void showLabels(boolean show)
Deprecated.Method name changed to be more consistent with other setters.
-
getLabelSize
public int getLabelSize()
-
isShowLabels
public boolean isShowLabels()
-
isTimeAxisHorizontal
public boolean isTimeAxisHorizontal()
-
pushLayoutTargetStack
public GlimpseTargetStack pushLayoutTargetStack(GlimpseTargetStack stack, Object id)
Pushes the layout stack for the named plot onto the provided GlimpseTargetStack.- Parameters:
id
- unique identifier for the plot- Returns:
- a relative GlimpseTargetStack for the named plot
-
pushPlotTargetStack
public GlimpseTargetStack pushPlotTargetStack(GlimpseTargetStack stack)
Pushes the layout stack for the base layout of this StackedTimePlot2D onto the provided GlimpseTargetStack.- Returns:
- a relative GlimpseTargetStack for the timeline plot background layout
-
createTimePlot
public TimePlotInfo createTimePlot()
- See Also:
StackedPlot2D.createPlot(Object )
-
createTimePlot
public TimePlotInfo createTimePlot(Object id)
- See Also:
createPlot(Object, Axis1D )
-
createTimePlot
public TimePlotInfo createTimePlot(Object id, Axis1D axis)
Creates a plot similar tocreatePlot( String, Axis1D )
but with additional plot decorations, including: grid lines, axes labels for the data axis, and a text label describing the plot.- See Also:
createPlot(Object, Axis1D )
-
createTimeline
public TimelineInfo createTimeline()
Creates a labeled timeline (with tick marks and date/time labels). This method may be called multiple times with different time zones if multiple timezone labels are desired.
-
createTimeline
public TimelineInfo createTimeline(Object id, TimeZone timeZone)
-
getTextureAtlas
public TextureAtlas getTextureAtlas()
-
createEventPlot
public EventPlotInfo createEventPlot()
-
createEventPlot
public EventPlotInfo createEventPlot(Object id)
-
isLocked
public boolean isLocked()
-
isSelectionLocked
public boolean isSelectionLocked()
-
setSelectionLocked
public void setSelectionLocked(boolean lock)
Fixes the selected time region so that it will no longer follow the mouse cursor.- Parameters:
lock
- whether to lock or unlock the selected time region
-
isCurrentTimeLocked
public boolean isCurrentTimeLocked()
-
setCurrentTimeLocked
public void setCurrentTimeLocked(boolean lock)
Fixes the selected time region and the timeline bounds with the current maximum of the selected time region at the far right of the timeline.- Parameters:
lock
-
-
setTimeSelection
public void setTimeSelection(TimeStamp minTime, TimeStamp selectedTime, TimeStamp maxTime)
-
shiftTimeAxisBounds
public void shiftTimeAxisBounds(TimeStamp maxTime)
-
shiftTimeSelection
public void shiftTimeSelection(TimeStamp maxTime)
-
getTime
public TimeStamp getTime(GlimpseMouseEvent e)
-
createPlot
public PlotInfo createPlot(Object id, Axis1D axis)
- Overrides:
createPlot
in classStackedPlot2D
-
-