Class TimeBaseConverter
java.lang.Object
org.eclipse.nebula.widgets.timeline.TimeBaseConverter
public class TimeBaseConverter
extends java.lang.Object
-
Constructor Summary
Constructors Constructor Description TimeBaseConverter(RootFigure rootFigure)
-
Method Summary
Modifier and Type Method Description void
addEvent(org.eclipse.nebula.widgets.timeline.ITimed event)
Timing
getEventArea()
Total area to be displayed in eventTime.Timing
getVisibleEventArea()
Timing
overviewCoordinatesToEventTime(Timing screenCoordinates)
Convert overview screen coordinates to eventTime.void
resetDisplaySettings()
Reset scale factor and screen offset to defaults.void
resetEventArea()
void
revealEvent(Timing revealArea)
Reveal a given area on screen and center it.long
screenOffsetToEventTime(int screenOffset)
void
setOffset(double eventTime)
Set the offset to a defined value.void
setOverviewScreenWidth(int widthInPixels)
Set the width of the overview area.void
setScreenWidth(double screenWidth)
Timing
toDetailCoordinates(Timing eventTime)
Convert eventTime to detail screen coordinates.Timing
toOverviewScreenCoordinates(Timing eventTime)
Convert eventTime to overview screen coordinates.boolean
translateDetailAreaOffset(int screenPixels)
Translate the offset by pixels on the screen of the detail area.boolean
translateOverviewAreaOffset(int screenPixels)
Translate the offset by pixels on the screen of the overview area.void
zoom(double factor, int zoomCenterX)
-
Constructor Details
-
Method Details
-
resetDisplaySettings
public void resetDisplaySettings()Reset scale factor and screen offset to defaults. -
getVisibleEventArea
-
screenOffsetToEventTime
public long screenOffsetToEventTime(int screenOffset) -
getEventArea
Total area to be displayed in eventTime. Unit is [ns] as we get them directly from the events.- Returns:
- area containing all events in eventTime
-
resetEventArea
public void resetEventArea() -
addEvent
public void addEvent(org.eclipse.nebula.widgets.timeline.ITimed event) -
translateDetailAreaOffset
public boolean translateDetailAreaOffset(int screenPixels)Translate the offset by pixels on the screen of the detail area.- Parameters:
screenPixels
- pixels on the screen to translate- Returns:
true
when offset got changed
-
setScreenWidth
public void setScreenWidth(double screenWidth) -
zoom
public void zoom(double factor, int zoomCenterX) -
setOffset
public void setOffset(double eventTime)Set the offset to a defined value. The offset will automatically be adjusted regarding the total visible area.- Parameters:
eventTime
- time to set offset to
-
revealEvent
Reveal a given area on screen and center it. Zoom is adjusted in case the event cannot be displayed as a whole on screen.- Parameters:
revealArea
- area to reveal
-
translateOverviewAreaOffset
public boolean translateOverviewAreaOffset(int screenPixels)Translate the offset by pixels on the screen of the overview area.- Parameters:
screenPixels
- pixels on the screen to translate- Returns:
true
when offset got changed
-
overviewCoordinatesToEventTime
Convert overview screen coordinates to eventTime.- Parameters:
screenCoordinates
- x offset on the overview figure- Returns:
- coordinates in eventTime
-
toOverviewScreenCoordinates
Convert eventTime to overview screen coordinates.- Parameters:
eventTime
- eventTime to convert- Returns:
- x dimension screen coordinates for given eventTime
-
toDetailCoordinates
Convert eventTime to detail screen coordinates.- Parameters:
eventTime
- eventTime to convert- Returns:
- x dimension screen coordinates for given eventTime
-
setOverviewScreenWidth
public void setOverviewScreenWidth(int widthInPixels)Set the width of the overview area.- Parameters:
widthInPixels
- overview area width in pixels
-