public class Timeline extends DiversityAxis<TimelineObject>
Timeline.TimelineTracks and you
can add these with addTrack(TimelineTrack) and add objects to those tracks using
addTimelineObject(TimelineTrack, TimelineObject).
This class is an implementation of the DiversityAxis visualisation.
| Modifier and Type | Class and Description |
|---|---|
static class |
Timeline.TimelineMarker
Timeline markers that are drawn onto a timeline
|
static class |
Timeline.TimelineMarkerType
Different type of markers.
|
protected static class |
Timeline.TimelineObjectPlotter
This is an item plotter for
TimelineObjects. |
static class |
Timeline.TimelineTrack
Represents a track in the timeline.
|
XYPlotVisualisation.LocatedObject<O>JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyaxesRenderer2DclearBeforeDraw, data, visImagelistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
Timeline(int w,
int h)
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
Timeline.TimelineMarker |
addMarker(long timeMilliseconds)
Add a new marker
|
Timeline.TimelineMarker |
addMarker(long timeMilliseconds,
String label)
Add a new marker with a label.
|
Timeline.TimelineTrack |
addTimelineObject(Timeline.TimelineTrack tt,
TimelineObject obj)
Add an object to a track.
|
Timeline.TimelineTrack |
addTrack()
Add a new track to the timeline.
|
Timeline.TimelineTrack |
addTrack(String label)
Add a track with the given label.
|
Timeline.TimelineTrack |
addTrack(Timeline.TimelineTrack tt)
Add a new track to the timeline.
|
void |
bandSizeKnown(int bandSize)
Called once the band size has been calculated
|
int |
getTimePosition(long milliseconds)
Find the position of the given time on the panel.
|
double |
getTimeScalar()
Returns the scalar between milliseconds and pixels.
|
static void |
main(String[] args)
Main method test for the timeline
|
void |
setTimeScalar(double ts)
Set the time scalar of this timeline.
|
void |
update()
Called to update the visualisation.
|
addObject, beforeAxesRender, setDiversityAxisNameaddPoint, clearData, getAxesRenderer, isAutoPositionXAxis, isAutoScaleAxes, isRenderAxesLast, removePoint, setAutoPositionXAxis, setAutoScaleAxes, setData, setItemPlotter, setRenderAxesLast, validateDataaddOverlay, componentHidden, componentMoved, componentResized, componentShown, getRequiredSize, getVisualisationImage, isAllowResize, newVisualisationAvailable, paint, removeOverlay, setAllowResize, setClearBeforeDraw, setRequiredSize, showWindow, update, updateVis, updateVisgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardActionadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic Timeline(int w, int h)
w - Width of the visualisationh - Height of the visualisationpublic Timeline.TimelineTrack addTrack()
public Timeline.TimelineTrack addTrack(String label)
label - The labelpublic Timeline.TimelineTrack addTrack(Timeline.TimelineTrack tt)
tt - The track to add.public Timeline.TimelineTrack addTimelineObject(Timeline.TimelineTrack tt, TimelineObject obj)
tt - The track to add the object toobj - The timeline objec to addpublic Timeline.TimelineMarker addMarker(long timeMilliseconds, String label)
timeMilliseconds - The time at which the marker should be added.label - The label to put on the marker.public Timeline.TimelineMarker addMarker(long timeMilliseconds)
timeMilliseconds - The time at which to add the markerpublic double getTimeScalar()
public void setTimeScalar(double ts)
ts - The new time scalarpublic int getTimePosition(long milliseconds)
milliseconds - the number of millisecondspublic void update()
visImage member to be available and of the correct size.
The method simply needs to draw the visualisation to this MBFImage.
You should wrap any drawing code in a synchronized block, synchronized on
the visImage - this stops the image being repainted to the screen half way
through drawing.
Update is called from the paint() method so should ideally not force a repaint() as this will call a continuous repaint loop.
update in class XYPlotVisualisation<TimelineObject>VisualisationImpl.update()public void bandSizeKnown(int bandSize)
bandSizeKnown in class DiversityAxis<TimelineObject>bandSize - The band sizeDiversityAxis.bandSizeKnown(int)