com.metsci.glimpse.plot.timeline
Class StackedTimePlot2D

java.lang.Object
  extended by com.metsci.glimpse.layout.GlimpseLayout
      extended by com.metsci.glimpse.plot.timeline.StackedTimePlot2D
All Implemented Interfaces:
GlimpseTarget, GlimpseMouseListener, GlimpseMouseMotionListener, GlimpseMouseWheelListener, Mouseable, GlimpsePainter

public class StackedTimePlot2D
extends GlimpseLayout

A StackedPlot2D which automatically creates a timeline axis at the bottom of the stack and uses a TaggedAxis1D to define a selected time region.

Author:
ulman

Field Summary
static java.lang.String BACKGROUND
           
static java.lang.String CURRENT_TIME
           
static java.lang.String MAX_TIME
           
static java.lang.String MIN_TIME
           
static java.lang.String TIMELINE
           
 
Constructor Summary
StackedTimePlot2D()
           
StackedTimePlot2D(Epoch epoch)
          Creates a vertical StackedTimePlot2D.
StackedTimePlot2D(StackedPlot2D.Orientation orientation)
           
StackedTimePlot2D(StackedPlot2D.Orientation orientation, Epoch epoch)
          Creates a StackedTimePlot2D with specified orientation.
 
Method Summary
 StackedPlot2D.PlotInfo createPlot(java.lang.String name)
           
 StackedPlot2D.PlotInfo createPlot(java.lang.String name, Axis1D axis)
          Creates a plotting area with one common time axis and attaches a mouse listener which handles properly adjusting the time selection on the time axis.
 TimePlotInfo createTimePlot(java.lang.String name)
           
 TimePlotInfo createTimePlot(java.lang.String name, Axis1D axis)
          Creates a plot similar to createPlot( String, Axis1D ) but with additional plot decorations, including: grid lines, axes labels for the data axis, and a text label describing the plot.
 void deletePlot(java.lang.String name)
           
 double fromTimeStamp(TimeStamp value)
           
 java.util.Collection<StackedPlot2D.PlotInfo> getAllPlots()
           
 Epoch getEpoch()
           
 StackedPlot2D.Orientation getOrientation()
           
 StackedPlot2D.PlotInfo getPlot(java.lang.String name)
           
 StackedPlot2D.PlotInfo getSelectedPlot()
           
 TaggedAxis1D getTimeAxis()
           
 TimeAxisPainter getTimeAxisPainter()
           
 Tag getTimeSelection()
          Get the TaggedAxis1D Tag which defines the currently selected time.
 Tag getTimeSelectionMax()
          Get the TaggedAxis1D Tag which defines the latest endpoint of the selected time region.
 Tag getTimeSelectionMin()
          Get the TaggedAxis1D Tag which defines the earliest endpoint of the selected time region.
 boolean isCurrentTimeLocked()
           
 boolean isLocked()
           
 boolean isSelectionLocked()
           
 GlimpseTargetStack pushLayoutTargetStack(GlimpseTargetStack stack, java.lang.String name)
          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 setAxisColor(float[] rgba)
           
 void setAxisFont(java.awt.Font font)
           
 void setBackgroundColor(float[] rgba)
           
 void setBorderSize(int size)
           
 void setCurrentTimeColor(float[] rgba)
           
 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 setSelectedPlot(StackedPlot2D.PlotInfo layout)
           
 void setSelectedPlot(java.lang.String name)
           
 void setSelectionLocked(boolean lock)
          Fixes the selected time region so that it will no longer follow the mouse cursor.
 void setShowCurrentTime(boolean show)
           
 void setTimeAxisBounds(TimeStamp minTime, TimeStamp maxTime)
           
 void setTimeAxisPainter(TimeAxisPainter painter)
           
 void setTimeSelection(TimeStamp minTime, TimeStamp maxTime)
           
 void setTimeSelection(TimeStamp minTime, TimeStamp selectedTime, TimeStamp maxTime)
           
 void shiftTimeAxisBounds(TimeStamp maxTime)
           
 void shiftTimeSelection(TimeStamp maxTime)
           
 TimeStamp toTimeStamp(double value)
           
 void validate()
           
 
Methods inherited from class com.metsci.glimpse.layout.GlimpseLayout
addGlimpseMouseAllListener, addGlimpseMouseListener, addGlimpseMouseMotionListener, addGlimpseMouseWheelListener, addLayout, addLayout, addPainter, addPainter, dispose, getGlimpseMouseListeners, getGlimpseMouseMotionListeners, getGlimpseMouseWheelListeners, getLayoutManager, getName, getTargetBounds, getTargetChildren, invalidateLayout, isDisposed, isEventConsumer, isEventGenerator, isVisible, layoutTo, layoutTo, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, paintTo, removeAllGlimpseListeners, removeGlimpseMouseAllListener, removeGlimpseMouseListener, removeGlimpseMouseMotionListener, removeGlimpseMouseWheelListener, removeLayout, removePainter, setEventConsumer, setEventGenerator, setLayoutData, setLayoutManager, setLookAndFeel, setName, setVisible, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_TIME

public static final java.lang.String MIN_TIME
See Also:
Constant Field Values

MAX_TIME

public static final java.lang.String MAX_TIME
See Also:
Constant Field Values

CURRENT_TIME

public static final java.lang.String CURRENT_TIME
See Also:
Constant Field Values

BACKGROUND

public static final java.lang.String BACKGROUND
See Also:
Constant Field Values

TIMELINE

public static final java.lang.String TIMELINE
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)
Creates a StackedTimePlot2D with specified orientation. The provided epoch determines what absolute timestamp corresponds to value 0.0 on the time Axis1D.

Method Detail

getAllPlots

public java.util.Collection<StackedPlot2D.PlotInfo> getAllPlots()

deletePlot

public void deletePlot(java.lang.String name)

getPlot

public StackedPlot2D.PlotInfo getPlot(java.lang.String name)

setSelectedPlot

public void setSelectedPlot(java.lang.String name)

setSelectedPlot

public void setSelectedPlot(StackedPlot2D.PlotInfo layout)

getSelectedPlot

public StackedPlot2D.PlotInfo getSelectedPlot()

getTimeSelection

public Tag getTimeSelection()
Get the TaggedAxis1D Tag which defines the currently selected time.

Returns:
the current time selection Tag

getTimeSelectionMin

public Tag getTimeSelectionMin()
Get the TaggedAxis1D Tag which defines the earliest endpoint of the selected time region.

Returns:
the earliest time selection Tag

getTimeSelectionMax

public Tag getTimeSelectionMax()
Get the TaggedAxis1D Tag which defines the latest endpoint of the selected time region.

Returns:
the latest time selection Tag

getOrientation

public StackedPlot2D.Orientation getOrientation()

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()

setTimeAxisPainter

public void setTimeAxisPainter(TimeAxisPainter painter)

getTimeAxisPainter

public TimeAxisPainter getTimeAxisPainter()

setAxisColor

public void setAxisColor(float[] rgba)

setAxisFont

public void setAxisFont(java.awt.Font font)

setShowCurrentTime

public void setShowCurrentTime(boolean show)

setCurrentTimeColor

public void setCurrentTimeColor(float[] rgba)

setBackgroundColor

public void setBackgroundColor(float[] rgba)

setBorderSize

public void setBorderSize(int size)

validate

public void validate()

pushLayoutTargetStack

public GlimpseTargetStack pushLayoutTargetStack(GlimpseTargetStack stack,
                                                java.lang.String name)
Pushes the layout stack for the named plot onto the provided GlimpseTargetStack.

Parameters:
name - the name of 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

createPlot

public StackedPlot2D.PlotInfo createPlot(java.lang.String name)

createPlot

public StackedPlot2D.PlotInfo createPlot(java.lang.String name,
                                         Axis1D axis)
Creates a plotting area with one common time axis and attaches a mouse listener which handles properly adjusting the time selection on the time axis. Returns a handle which may be used for adding GlimpsePainter to the plot or adjusting its size, order, and other display characteristics.

Parameters:
name - the unique identifier of the plot to create
axis - the non-shared / non-time data axis for the plot
Returns:
a handle to the newly created plot

createTimePlot

public TimePlotInfo createTimePlot(java.lang.String name)
See Also:
createPlot(String, Axis1D )

createTimePlot

public TimePlotInfo createTimePlot(java.lang.String name,
                                   Axis1D axis)
Creates a plot similar to createPlot( 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(String, Axis1D )

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)

setTimeAxisBounds

public void setTimeAxisBounds(TimeStamp minTime,
                              TimeStamp maxTime)

shiftTimeAxisBounds

public void shiftTimeAxisBounds(TimeStamp maxTime)

setTimeSelection

public void setTimeSelection(TimeStamp minTime,
                             TimeStamp maxTime)

shiftTimeSelection

public void shiftTimeSelection(TimeStamp maxTime)


Copyright © 2012 Metron, Inc.. All Rights Reserved.