Class DefaultTimelineStyleProvider
java.lang.Object
org.eclipse.nebula.widgets.timeline.jface.DefaultTimelineStyleProvider
- All Implemented Interfaces:
ITimelineStyleProvider
public class DefaultTimelineStyleProvider extends java.lang.Object implements ITimelineStyleProvider
-
Constructor Summary
Constructors Constructor Description DefaultTimelineStyleProvider(org.eclipse.jface.resource.ResourceManager resourceManager)
-
Method Summary
Modifier and Type Method Description org.eclipse.swt.graphics.Color
getBackgroundColor()
Get diagram background color.org.eclipse.swt.graphics.Color
getColor(org.eclipse.swt.graphics.RGB rgb)
Get a color for the given RGB value.org.eclipse.swt.graphics.Color
getCursorColor()
Get the color for a non-selected cursor.org.eclipse.draw2d.Border
getDetailAreaBorder()
Get the border for the detail area.org.eclipse.swt.graphics.Color
getGridColor()
Get the color of the grid.int
getGridLineStyle()
Get the line style for the grid.org.eclipse.swt.graphics.Color
getLaneColor()
Get the color for the next lane.int
getLaneHeight()
Get height for a given lane.org.eclipse.draw2d.Border
getOverviewAreaBorder()
Get the border for the overview area.org.eclipse.draw2d.geometry.Insets
getOverviewInsets()
Get the insets for the overview area.int
getOverviewLaneHeight()
Get height for a given lane in overview.int
getOverviewSelectionBackgroundAlpha()
Get the alpha value for the overview selection figure.org.eclipse.swt.graphics.Color
getOverviewSelectionBackgroundColor()
Get the background color for the overview selection.org.eclipse.draw2d.Border
getOverviewSelectionBorder()
Get the border for the overview selection figure.org.eclipse.swt.graphics.Color
getSelectedCursorColor()
Get the color for a selected cursor.java.lang.String
getTimeLabel(double timestamp, java.util.concurrent.TimeUnit unit)
Get a human readable timestamp for a given time.org.eclipse.draw2d.Border
getTrackBorder(java.lang.String title)
Get the border for a track.double
getZoomFactor()
Get the multiplier for the zoom factor to be applied on a zoomIn/zoomOut operation.void
selectEvent(EventFigure eventFigure)
Apply styling to select an event figure.boolean
showGrid()
Display the grid in the detail area.boolean
showOverview()
Display the overview area.boolean
showTimeAxis()
Display the time axis below the detail area.void
unselectEvent(EventFigure eventFigure)
Revert styling of an event figure selection.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.nebula.widgets.timeline.jface.ITimelineStyleProvider
dispose
-
Constructor Details
-
DefaultTimelineStyleProvider
public DefaultTimelineStyleProvider(org.eclipse.jface.resource.ResourceManager resourceManager)
-
-
Method Details
-
getBackgroundColor
public org.eclipse.swt.graphics.Color getBackgroundColor()Description copied from interface:ITimelineStyleProvider
Get diagram background color.- Specified by:
getBackgroundColor
in interfaceITimelineStyleProvider
- Returns:
- background color
-
getDetailAreaBorder
public org.eclipse.draw2d.Border getDetailAreaBorder()Description copied from interface:ITimelineStyleProvider
Get the border for the detail area.- Specified by:
getDetailAreaBorder
in interfaceITimelineStyleProvider
- Returns:
- detail area border
-
getOverviewAreaBorder
public org.eclipse.draw2d.Border getOverviewAreaBorder()Description copied from interface:ITimelineStyleProvider
Get the border for the overview area.- Specified by:
getOverviewAreaBorder
in interfaceITimelineStyleProvider
- Returns:
- overview area border
-
getGridColor
public org.eclipse.swt.graphics.Color getGridColor()Description copied from interface:ITimelineStyleProvider
Get the color of the grid.- Specified by:
getGridColor
in interfaceITimelineStyleProvider
- Returns:
- grid color
-
getGridLineStyle
public int getGridLineStyle()Description copied from interface:ITimelineStyleProvider
Get the line style for the grid.- Specified by:
getGridLineStyle
in interfaceITimelineStyleProvider
- Returns:
- grid line style
-
getOverviewSelectionBorder
public org.eclipse.draw2d.Border getOverviewSelectionBorder()Description copied from interface:ITimelineStyleProvider
Get the border for the overview selection figure.- Specified by:
getOverviewSelectionBorder
in interfaceITimelineStyleProvider
- Returns:
- overview selection figure border
-
getOverviewSelectionBackgroundColor
public org.eclipse.swt.graphics.Color getOverviewSelectionBackgroundColor()Description copied from interface:ITimelineStyleProvider
Get the background color for the overview selection.- Specified by:
getOverviewSelectionBackgroundColor
in interfaceITimelineStyleProvider
- Returns:
- figure background color
-
getOverviewSelectionBackgroundAlpha
public int getOverviewSelectionBackgroundAlpha()Description copied from interface:ITimelineStyleProvider
Get the alpha value for the overview selection figure.- Specified by:
getOverviewSelectionBackgroundAlpha
in interfaceITimelineStyleProvider
- Returns:
- alpha value
-
getTrackBorder
public org.eclipse.draw2d.Border getTrackBorder(java.lang.String title)Description copied from interface:ITimelineStyleProvider
Get the border for a track.- Specified by:
getTrackBorder
in interfaceITimelineStyleProvider
- Parameters:
title
- track title- Returns:
- track border
-
getCursorColor
public org.eclipse.swt.graphics.Color getCursorColor()Description copied from interface:ITimelineStyleProvider
Get the color for a non-selected cursor.- Specified by:
getCursorColor
in interfaceITimelineStyleProvider
- Returns:
- cursor color
-
getSelectedCursorColor
public org.eclipse.swt.graphics.Color getSelectedCursorColor()Description copied from interface:ITimelineStyleProvider
Get the color for a selected cursor.- Specified by:
getSelectedCursorColor
in interfaceITimelineStyleProvider
- Returns:
- selected cursor color
-
showGrid
public boolean showGrid()Description copied from interface:ITimelineStyleProvider
Display the grid in the detail area.- Specified by:
showGrid
in interfaceITimelineStyleProvider
- Returns:
true
to display the grid,false
to hide
-
showTimeAxis
public boolean showTimeAxis()Description copied from interface:ITimelineStyleProvider
Display the time axis below the detail area.- Specified by:
showTimeAxis
in interfaceITimelineStyleProvider
- Returns:
true
to display the time axis,false
to hide
-
getLaneColor
public org.eclipse.swt.graphics.Color getLaneColor()Description copied from interface:ITimelineStyleProvider
Get the color for the next lane.- Specified by:
getLaneColor
in interfaceITimelineStyleProvider
- Returns:
- lane color
-
getLaneHeight
public int getLaneHeight()Description copied from interface:ITimelineStyleProvider
Get height for a given lane.- Specified by:
getLaneHeight
in interfaceITimelineStyleProvider
- Returns:
- height in pixels
-
selectEvent
Description copied from interface:ITimelineStyleProvider
Apply styling to select an event figure.- Specified by:
selectEvent
in interfaceITimelineStyleProvider
- Parameters:
eventFigure
- figure to style
-
unselectEvent
Description copied from interface:ITimelineStyleProvider
Revert styling of an event figure selection.- Specified by:
unselectEvent
in interfaceITimelineStyleProvider
- Parameters:
eventFigure
- figure to revert style
-
getZoomFactor
public double getZoomFactor()Description copied from interface:ITimelineStyleProvider
Get the multiplier for the zoom factor to be applied on a zoomIn/zoomOut operation.- Specified by:
getZoomFactor
in interfaceITimelineStyleProvider
- Returns:
- zoom factor multiplier
-
getColor
public org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)Description copied from interface:ITimelineStyleProvider
Get a color for the given RGB value. The style provider should take care to buffer colors and to dispose them when the widget gets disposed.- Specified by:
getColor
in interfaceITimelineStyleProvider
- Parameters:
rgb
- RGB value to get color for- Returns:
- color
-
showOverview
public boolean showOverview()Description copied from interface:ITimelineStyleProvider
Display the overview area.- Specified by:
showOverview
in interfaceITimelineStyleProvider
- Returns:
true
to display the overview area,false
to hide
-
getOverviewLaneHeight
public int getOverviewLaneHeight()Description copied from interface:ITimelineStyleProvider
Get height for a given lane in overview.- Specified by:
getOverviewLaneHeight
in interfaceITimelineStyleProvider
- Returns:
- height in pixels
-
getOverviewInsets
public org.eclipse.draw2d.geometry.Insets getOverviewInsets()Description copied from interface:ITimelineStyleProvider
Get the insets for the overview area. These insets will be applied within the border acquired fromITimelineStyleProvider.getOverviewAreaBorder()
. The top inset will also be used for lane spacing.- Specified by:
getOverviewInsets
in interfaceITimelineStyleProvider
- Returns:
- insets to be used for the overview area
-
getTimeLabel
public java.lang.String getTimeLabel(double timestamp, java.util.concurrent.TimeUnit unit)Description copied from interface:ITimelineStyleProvider
Get a human readable timestamp for a given time. The provided label will be used for axis labels and cursor popups.- Specified by:
getTimeLabel
in interfaceITimelineStyleProvider
- Parameters:
timestamp
- timestamp in eventTimeunit
- time unit to be used- Returns:
- time value
-