use of com.efficios.jabberwocky.views.timegraph.control.TimeGraphModelControl in project lttng-scope by lttng.
the class TimeGraphWidgetTestBase method getControl.
/**
* Return the control fixture.
*
* @return The control
*/
protected TimeGraphModelControl getControl() {
TimeGraphModelControl control = sfControl;
assertNotNull(control);
return control;
}
use of com.efficios.jabberwocky.views.timegraph.control.TimeGraphModelControl in project lttng-scope by lttng.
the class TimeGraphWidgetTestBase method setupClass.
/**
* Class initialization
*/
@BeforeClass
public static void setupClass() {
StubTrace trace = new StubTrace();
StubProject stubProject = new StubProject(trace);
Platform.setImplicitExit(false);
StubView view = new StubView();
TimeGraphModelControl control = view.getControl();
TimeGraphWidget viewer = view.getViewer();
assertNotNull(viewer);
JfxUtils.runLaterAndWait(() -> {
stage = new Stage();
stage.setScene(new Scene(viewer.getRootNode()));
stage.show();
/* Make sure the window has some reasonable dimensions. */
stage.setHeight(500);
stage.setWidth(1600);
});
JfxTestUtils.updateUI();
/* Disable automatic redraw. We'll trigger view painting manually. */
viewer.getDebugOptions().isPaintingEnabled.set(false);
/* Disable mouse listeners in case the mouse dwells inside the view. */
viewer.getDebugOptions().isScrollingListenersEnabled.set(false);
JfxTestUtils.updateUI();
control.getViewContext().switchProject(stubProject.getTraceProject());
JfxTestUtils.updateUI();
sfProject = stubProject;
sfView = view;
sfWidget = viewer;
sfControl = control;
}
use of com.efficios.jabberwocky.views.timegraph.control.TimeGraphModelControl in project lttng-scope by lttng.
the class TimeGraphWidgetTestBase method verifyVisibleRange.
/**
* Verify that both the control and viewer passed as parameters currently
* report the expected visible time range.
*
* @param expectedRange
* Expected time range
*/
protected static void verifyVisibleRange(TimeRange expectedRange) {
TimeGraphModelControl control = sfControl;
TimeGraphWidget widget = sfWidget;
assertNotNull(control);
assertNotNull(widget);
/* Check the control */
assertEquals(expectedRange, control.getViewContext().getVisibleTimeRange());
/* Check the view itself */
TimeRange timeRange = widget.getTimeGraphEdgeTimestamps(null);
long tsStart = timeRange.getStartTime();
long tsEnd = timeRange.getEndTime();
/* We will tolerate being off by a few pixels, due to rounding. */
double delta = widget.getCurrentNanosPerPixel() * 2;
assertEqualsWithin(expectedRange.getStartTime(), tsStart, delta);
assertEqualsWithin(expectedRange.getEndTime(), tsEnd, delta);
}
use of com.efficios.jabberwocky.views.timegraph.control.TimeGraphModelControl in project lttng-scope by lttng.
the class TimeGraphWidgetTestBase method seekVisibleRange.
/**
* See the timegraph to the given time range.
*
* @param timeRange
* The target time range
*/
protected void seekVisibleRange(TimeRange timeRange) {
TimeGraphModelControl control = sfControl;
assertNotNull(control);
control.getViewContext().setVisibleTimeRange(timeRange);
JfxTestUtils.updateUI();
}
Aggregations