Import views plugins
[deliverable/tracecompass.git] / tmf / org.lttng.scope.tmf2.views.ui / src / org / lttng / scope / tmf2 / views / ui / timeline / widgets / timegraph / toolbar / ZoomOutButton.java
1 /*
2 * Copyright (C) 2017 EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
3 *
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
8 */
9
10 package org.lttng.scope.tmf2.views.ui.timeline.widgets.timegraph.toolbar;
11
12 import org.lttng.scope.tmf2.views.ui.jfx.JfxImageFactory;
13 import org.lttng.scope.tmf2.views.ui.timeline.widgets.timegraph.TimeGraphWidget;
14
15 import javafx.scene.control.Button;
16 import javafx.scene.control.Tooltip;
17 import javafx.scene.image.Image;
18 import javafx.scene.image.ImageView;
19
20 /**
21 * Button for zooming out. It should do the same action as one
22 * ctrl+mouse-scroll.
23 *
24 * @author Alexandre Montplaisir
25 */
26 class ZoomOutButton extends Button {
27
28 private static final String ZOOM_OUT_ICON_PATH = "/icons/toolbar/zoom_out.gif"; //$NON-NLS-1$
29
30 public ZoomOutButton(TimeGraphWidget viewer) {
31 Image icon = JfxImageFactory.instance().getImageFromResource(ZOOM_OUT_ICON_PATH);
32 setGraphic(new ImageView(icon));
33 setTooltip(new Tooltip(Messages.sfZoomOutActionDescription));
34 setOnAction(e -> {
35 viewer.getZoomActions().zoom(false, false, null);
36 });
37 }
38 }
This page took 0.036508 seconds and 5 git commands to generate.