Class RootFigure
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.nebula.widgets.timeline.figures.RootFigure
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure
,IStyledFigure
public class RootFigure extends org.eclipse.draw2d.Figure implements IStyledFigure
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description RootFigure(org.eclipse.jface.resource.ResourceManager resourceManager)
-
Method Summary
Modifier and Type Method Description void
addCursorListener(ICursorListener listener)
Registers the given listener as a ICursorListener of this IFigure.void
clear()
Remove all tracks and cursors.org.eclipse.nebula.widgets.timeline.ICursor
createCursor(long eventTime)
Create a new cursor model instance.CursorFigure
createCursorFigure(org.eclipse.nebula.widgets.timeline.ICursor cursor)
Create a cursor figure.EventFigure
createEventFigure(LaneFigure parent, org.eclipse.nebula.widgets.timeline.ITimelineEvent event)
Create a new figure for the given event.LaneFigure
createLaneFigure(TrackFigure track)
TrackFigure
createTrackFigure(java.lang.String title)
void
deleteCursor(org.eclipse.nebula.widgets.timeline.ICursor cursor)
Delete a cursor.void
deleteCursorFigure(CursorFigure cursorFigure)
Delete a cursor figure from the detail and overview area.void
deleteEventFigure(EventFigure eventFigure)
Delete an eventFigure from its lane and the overview are.void
fireTimebaseChanged()
The offset or the scaling (or both) changed.static <T> T
getFigure(org.eclipse.draw2d.IFigure figure, java.lang.Class<T> clazz)
static int
getLaneCount(org.eclipse.draw2d.IFigure figure)
Get total number of lanes.static int
getLaneIndex(EventFigure figure)
Get the absolute index of the lane where figure belongs to.org.eclipse.jface.resource.ResourceManager
getResourceManager()
static RootFigure
getRootFigure(org.eclipse.draw2d.IFigure figure)
EventFigure
getSelection()
Get the selected figure.ITimelineStyleProvider
getStyleProvider()
TimeBaseConverter
getTimeViewDetails()
static TimeBaseConverter
getTimeViewDetails(org.eclipse.draw2d.IFigure parent)
void
removeCursorListener(ICursorListener listener)
Unregisters the given listener, so that it will no longer receive notifications of cursor eventsvoid
setSelection(EventFigure eventFigure)
Set the selection figure.void
setStyleProvider(ITimelineStyleProvider styleProvider)
void
updateCursorFigure(org.eclipse.draw2d.IFigure figure, org.eclipse.nebula.widgets.timeline.ICursor cursor)
Update a provided cursor figure with fresh cursor data.void
updateEventFigure(org.eclipse.draw2d.IFigure figure, org.eclipse.nebula.widgets.timeline.ITimelineEvent event)
Update a provided event figure with fresh event data.void
updateStyle(ITimelineStyleProvider styleProvider)
void
updateTrackFigure(org.eclipse.draw2d.IFigure figure, java.lang.String title)
Update the title of a given track figure.void
zoom(double factor, int zoomCenterX)
void
zoomIn(int zoomCenterX)
void
zoomOut(int zoomCenterX)
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Constructor Details
-
RootFigure
public RootFigure(org.eclipse.jface.resource.ResourceManager resourceManager)
-
-
Method Details
-
getRootFigure
-
getTimeViewDetails
-
getFigure
public static <T> T getFigure(org.eclipse.draw2d.IFigure figure, java.lang.Class<T> clazz) -
getLaneCount
public static int getLaneCount(org.eclipse.draw2d.IFigure figure)Get total number of lanes. Sums up lanes of all tracks.- Parameters:
figure
- any figure of the timeline diagram- Returns:
- total amount of lanes
-
getLaneIndex
Get the absolute index of the lane where figure belongs to.- Parameters:
figure
- EventFigure of the lane to retrieve index from- Returns:
- lane index
-
setStyleProvider
-
getResourceManager
public org.eclipse.jface.resource.ResourceManager getResourceManager() -
addCursorListener
Registers the given listener as a ICursorListener of this IFigure. Will be notified of cursor creation and deletion.- Parameters:
listener
- listener to register
-
removeCursorListener
Unregisters the given listener, so that it will no longer receive notifications of cursor events- Parameters:
listener
- listener to unregister
-
getStyleProvider
-
clear
public void clear()Remove all tracks and cursors. Leaves the view empty. -
getTimeViewDetails
-
fireTimebaseChanged
public void fireTimebaseChanged()The offset or the scaling (or both) changed. We need to update the detail area and the damaged part of the overview area. -
zoomIn
public void zoomIn(int zoomCenterX) -
zoomOut
public void zoomOut(int zoomCenterX) -
zoom
public void zoom(double factor, int zoomCenterX) -
updateStyle
- Specified by:
updateStyle
in interfaceIStyledFigure
-
createTrackFigure
-
createLaneFigure
-
createCursor
public org.eclipse.nebula.widgets.timeline.ICursor createCursor(long eventTime)Create a new cursor model instance.- Parameters:
eventTime
- time to set cursor to- Returns:
- cursor instance
-
deleteCursor
public void deleteCursor(org.eclipse.nebula.widgets.timeline.ICursor cursor)Delete a cursor.- Parameters:
cursor
- cursor to delete
-
setSelection
Set the selection figure. Stores the selected element and highlights the figure.- Parameters:
eventFigure
- event figure to select
-
getSelection
Get the selected figure.- Returns:
- selected figure or null
-
createEventFigure
public EventFigure createEventFigure(LaneFigure parent, org.eclipse.nebula.widgets.timeline.ITimelineEvent event)Create a new figure for the given event.- Parameters:
parent
- parent figure for new eventFigureevent
- event to create figure for- Returns:
- created eventFigure in detail area
-
deleteEventFigure
Delete an eventFigure from its lane and the overview are.- Parameters:
eventFigure
- figure to delete
-
createCursorFigure
Create a cursor figure.- Parameters:
cursor
- cursor to create- Returns:
- created figure in detail area
-
deleteCursorFigure
Delete a cursor figure from the detail and overview area.- Parameters:
cursorFigure
- figure to delete
-
updateCursorFigure
public void updateCursorFigure(org.eclipse.draw2d.IFigure figure, org.eclipse.nebula.widgets.timeline.ICursor cursor)Update a provided cursor figure with fresh cursor data.- Parameters:
figure
- figure to updatecursor
- new cursor data
-
updateEventFigure
public void updateEventFigure(org.eclipse.draw2d.IFigure figure, org.eclipse.nebula.widgets.timeline.ITimelineEvent event)Update a provided event figure with fresh event data.- Parameters:
figure
- figure to updateevent
- new cursor data
-
updateTrackFigure
public void updateTrackFigure(org.eclipse.draw2d.IFigure figure, java.lang.String title)Update the title of a given track figure.- Parameters:
figure
- figure to updatetitle
- title to set
-