2 * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 package org
.lttng
.scope
.tmf2
.views
.ui
.timeline
.widgets
.timegraph
.toolbar
.nav
;
12 import static java
.util
.Objects
.requireNonNull
;
14 import org
.lttng
.scope
.tmf2
.views
.ui
.timeline
.widgets
.timegraph
.TimeGraphWidget
;
17 * Navigation mode using drawn arrows.
19 * If we are currently positioned at an arrow endpoint, it follow the arrow to
20 * its other endpoint, scrolling vertically if needed.
22 * If we are not at an arrow endpoint, following the current entry backwards or
23 * forwards until we find one. If we don't find any, do nothing.
25 * @author Alexandre Montplaisir
27 public class NavigationModeFollowArrows
extends NavigationMode
{
29 private static final String BACK_ICON_PATH
= "/icons/toolbar/nav_arrow_back.gif"; //$NON-NLS-1$
30 private static final String FWD_ICON_PATH
= "/icons/toolbar/nav_arrow_fwd.gif"; //$NON-NLS-1$
35 public NavigationModeFollowArrows() {
36 super(requireNonNull(Messages
.sfFollowArrowsNavModeName
),
42 public boolean isEnabled() {
47 public void navigateBackwards(TimeGraphWidget viewer
) {
49 System
.out
.println("Follow arrows backwards");
53 public void navigateForwards(TimeGraphWidget viewer
) {
55 System
.out
.println("Follow arrows forwards");