Class TimeGraphPresentationProvider
java.lang.Object
org.eclipse.tracecompass.tmf.ui.widgets.timegraph.TimeGraphPresentationProvider
- All Implemented Interfaces:
ITimeGraphPresentationProvider
- Direct Known Subclasses:
TimeChartAnalysisProvider
Provider class for the time graph provider
- Since:
- 3.4
- Author:
- Patrick Tasse
-
Field Summary
Fields inherited from interface org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider
INVISIBLE, TRANSPARENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColorListener(ITimeGraphColorListener listener) Adds a color settings listener, to be notified when the presentation provider's state colors change.booleanCheck whether time and duration should be displayed in tooltip (after items fromITimeGraphPresentationProvider.getEventHoverToolTipInfo(ITimeEvent)).Returns the drawing helper for this presentation provider.Returns a map of name and value providing additional information to display in the tool tip for this event.getEventHoverToolTipInfo(ITimeEvent event, long hoverTime) Returns a map of name and value providing additional information to display in the tool tip for this event.getEventName(ITimeEvent event) Returns the name of this event.intgetItemHeight(ITimeGraphEntry entry) Returns the height of this item.org.eclipse.swt.graphics.ImagegetItemImage(ITimeGraphEntry entry) Provides the image icon for a given entry.Returns table of states with state name to state color relationship.intgetStateTableIndex(ITimeEvent event) Returns the index in the state table corresponding to this time event.Returns the name of state types.getStateTypeName(ITimeGraphEntry entry) Returns the name of state type depending on the given entry.voidpostDrawControl(org.eclipse.swt.graphics.Rectangle bounds, org.eclipse.swt.graphics.GC gc) Called after drawing the controlvoidpostDrawEntry(ITimeGraphEntry entry, org.eclipse.swt.graphics.Rectangle bounds, org.eclipse.swt.graphics.GC gc) Called after drawing an entryvoidpostDrawEvent(ITimeEvent event, org.eclipse.swt.graphics.Rectangle bounds, org.eclipse.swt.graphics.GC gc) Called after drawing an eventvoidrefresh()Notifies listeners of the state table changevoidremoveColorListener(ITimeGraphColorListener listener) Removes a color settings listener.voidSets this presentation provider's drawing helper.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.tracecompass.tmf.ui.widgets.timegraph.ITimeGraphPresentationProvider
getEventStyle, getFilterInput, getLinkTypeName, getPreferenceKey, getSpecificEventStyle
-
Constructor Details
-
TimeGraphPresentationProvider
Constructor- Parameters:
stateTypeName- The state type name
-
TimeGraphPresentationProvider
public TimeGraphPresentationProvider()Constructor
-
-
Method Details
-
getStateTypeName
Description copied from interface:ITimeGraphPresentationProviderReturns the name of state types.- Specified by:
getStateTypeNamein interfaceITimeGraphPresentationProvider- Returns:
- the name of state types
-
getStateTypeName
Description copied from interface:ITimeGraphPresentationProviderReturns the name of state type depending on the given entry. Note that this overwrites the name which is return by getStateTypeName().- Specified by:
getStateTypeNamein interfaceITimeGraphPresentationProvider- Parameters:
entry- the entry- Returns:
- the name of state type depending on the given entry or null.
-
getStateTable
Description copied from interface:ITimeGraphPresentationProviderReturns table of states with state name to state color relationship.- Specified by:
getStateTablein interfaceITimeGraphPresentationProvider- Returns:
- table of states with color and name
- See Also:
-
getStateTableIndex
Description copied from interface:ITimeGraphPresentationProviderReturns the index in the state table corresponding to this time event. The index should correspond to a state in the state table, otherwise the color SWT.COLOR_BLACK will be used. If the index returned is TRANSPARENT, only the event borders will be drawn. If the index returned is INVISIBLE or another negative, the event will not be drawn.- Specified by:
getStateTableIndexin interfaceITimeGraphPresentationProvider- Parameters:
event- the time event- Returns:
- the corresponding state table index
- See Also:
-
getDrawingHelper
Description copied from interface:ITimeGraphPresentationProviderReturns the drawing helper for this presentation provider.- Specified by:
getDrawingHelperin interfaceITimeGraphPresentationProvider- Returns:
- The drawing helper
-
setDrawingHelper
Description copied from interface:ITimeGraphPresentationProviderSets this presentation provider's drawing helper. This helper be needed to know where to draw items, get its coordinates given a time, etc.- Specified by:
setDrawingHelperin interfaceITimeGraphPresentationProvider- Parameters:
helper- The drawing helper
-
postDrawControl
public void postDrawControl(org.eclipse.swt.graphics.Rectangle bounds, org.eclipse.swt.graphics.GC gc) Description copied from interface:ITimeGraphPresentationProviderCalled after drawing the control- Specified by:
postDrawControlin interfaceITimeGraphPresentationProvider- Parameters:
bounds- The drawing rectanglegc- The graphics context
-
postDrawEntry
public void postDrawEntry(ITimeGraphEntry entry, org.eclipse.swt.graphics.Rectangle bounds, org.eclipse.swt.graphics.GC gc) Description copied from interface:ITimeGraphPresentationProviderCalled after drawing an entry- Specified by:
postDrawEntryin interfaceITimeGraphPresentationProvider- Parameters:
entry- the entry that was drawnbounds- the drawing rectanglegc- the graphics context
-
postDrawEvent
public void postDrawEvent(ITimeEvent event, org.eclipse.swt.graphics.Rectangle bounds, org.eclipse.swt.graphics.GC gc) Description copied from interface:ITimeGraphPresentationProviderCalled after drawing an event- Specified by:
postDrawEventin interfaceITimeGraphPresentationProvider- Parameters:
event- the event that was drawnbounds- the drawing rectanglegc- the graphics context
-
getItemHeight
Description copied from interface:ITimeGraphPresentationProviderReturns the height of this item. This value is ignored if the time graph has a fixed item height.- Specified by:
getItemHeightin interfaceITimeGraphPresentationProvider- Parameters:
entry- the entry- Returns:
- the item height
- See Also:
-
getItemImage
Description copied from interface:ITimeGraphPresentationProviderProvides the image icon for a given entry.- Specified by:
getItemImagein interfaceITimeGraphPresentationProvider- Parameters:
entry- the entry- Returns:
- the image icon
-
getEventName
Description copied from interface:ITimeGraphPresentationProviderReturns the name of this event.- Specified by:
getEventNamein interfaceITimeGraphPresentationProvider- Parameters:
event- The event- Returns:
- The event name
-
getEventHoverToolTipInfo
Description copied from interface:ITimeGraphPresentationProviderReturns a map of name and value providing additional information to display in the tool tip for this event.- Specified by:
getEventHoverToolTipInfoin interfaceITimeGraphPresentationProvider- Parameters:
event- the time event- Returns:
- a map of tool tip information
-
getEventHoverToolTipInfo
Description copied from interface:ITimeGraphPresentationProviderReturns a map of name and value providing additional information to display in the tool tip for this event.- Specified by:
getEventHoverToolTipInfoin interfaceITimeGraphPresentationProvider- Parameters:
event- the time eventhoverTime- the time corresponding to the mouse hover position- Returns:
- a map of tool tip information
-
displayTimesInTooltip
public boolean displayTimesInTooltip()Description copied from interface:ITimeGraphPresentationProviderCheck whether time and duration should be displayed in tooltip (after items fromITimeGraphPresentationProvider.getEventHoverToolTipInfo(ITimeEvent)).- Specified by:
displayTimesInTooltipin interfaceITimeGraphPresentationProvider- Returns:
trueif times and duration should be displayed on tooltip,falseotherwise.
-
addColorListener
Description copied from interface:ITimeGraphPresentationProviderAdds a color settings listener, to be notified when the presentation provider's state colors change.- Specified by:
addColorListenerin interfaceITimeGraphPresentationProvider- Parameters:
listener- The new listener for color settings changes
-
removeColorListener
Description copied from interface:ITimeGraphPresentationProviderRemoves a color settings listener.- Specified by:
removeColorListenerin interfaceITimeGraphPresentationProvider- Parameters:
listener- The color settings listener to remove
-
refresh
public void refresh()Notifies listeners of the state table change- Specified by:
refreshin interfaceITimeGraphPresentationProvider- Since:
- 3.2
-