1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.scenegraph.g2d.events.command;
14 import java.awt.geom.Point2D;
17 * Static commands are listed in this class
20 * @see CommandKeyBinding Command to key binding and default bindings
21 * @see KeyToCommand Participant that transforms key presses to commands
23 * @author Toni Kalajainen
25 public class Commands {
27 public static final Command ENABLE_PAINTING = new Command("enablePainting");
29 public static final Command FULL_SCREEN = new Command("fullScreen");
31 public static final Command PAN_LEFT = new Command("panLeft");
32 public static final Command PAN_RIGHT = new Command("panRight");
33 public static final Command PAN_UP = new Command("panUp");
34 public static final Command PAN_DOWN = new Command("panDown");
35 public static final Command ZOOM_IN = new Command("zoomIn");
36 public static final Command ZOOM_OUT = new Command("zoomOut");
37 public static final Command ZOOM_TO_FIT = new Command("zoomToFit");
38 public static final Command ZOOM_TO_FIT_HORIZ = new Command("org.simantics.chart.zoomToFitHoriz");
39 public static final Command ZOOM_TO_FIT_VERT = new Command("org.simantics.chart.zoomToFitVert");
40 public static final Command ZOOM_TO_SELECTION = new Command("zoomToSelection");
41 public static final Command AUTOSCALE = new Command("org.simantics.chart.autoscale");
42 public static final Command ZOOM_TO_AREA = new Command("zoomToArea");
43 public static final Command ZOOM_TO_PAGE = new Command("zoomToPage");
45 public static final Command UNDO = new Command("org.eclipse.ui.edit.undo");
46 public static final Command REDO = new Command("org.eclipse.ui.edit.redo");
48 public static final Command CLOSE = new Command("org.eclipse.ui.file.close");
49 public static final Command IMPORT = new Command("org.eclipse.ui.file.import");
50 public static final Command EXPORT = new Command("org.eclipse.ui.file.export");
51 public static final Command PRINT = new Command("org.eclipse.ui.file.print");
52 public static final Command PDFPRINT = new Command("org.simantics.ui.file.pdfprint");
53 public static final Command REFRESH = new Command("org.eclipse.ui.file.refresh");
55 public static final Command BACK = new Command("org.eclipse.ui.navigate.back");
56 public static final Command FORWARD = new Command("org.eclipse.ui.navigate.forward");
57 public static final Command UP = new Command("org.eclipse.ui.navigate.up");
59 public static final Command RENAME = new Command("org.eclipse.ui.edit.rename");
61 public static final Command DELETE = new Command("org.eclipse.ui.edit.delete");
62 public static final Command CUT = new Command("org.eclipse.ui.edit.cut");
63 public static final Command COPY = new Command("org.eclipse.ui.edit.copy");
64 public static final Command PASTE = new Command("org.eclipse.ui.edit.paste");
65 public static final Command ROTATE_ELEMENT_CW = new Command("rotateElementCW");
66 public static final Command ROTATE_ELEMENT_CCW = new Command("rotateElementCCW");
67 public static final Command FLIP_ELEMENT_HORIZONTAL = new Command("flipElementHorizontal");
68 public static final Command FLIP_ELEMENT_VERTICAL = new Command("flipElementVertical");
69 public static final Command SCALE_ELEMENT = new Command("scaleElement");
71 public static final Command ROTATE_CANVAS_CW = new Command("rotateCW");
72 public static final Command ROTATE_CANVAS_CCW = new Command("rotateCCW");
74 public static final Command CANCEL = new Command("cancel");
75 public static final Command SELECT_ALL = new Command("org.eclipse.ui.edit.selectAll");
76 public static final Command INVERT_SELECTION = new Command("invertSelection");
77 public static final Command EXPAND_SELECTION = new Command("expandSelection");
79 public static final Command BRING_TO_TOP = new Command("bringToTop");
80 public static final Command SEND_TO_BOTTOM = new Command("sendToBottom");
81 public static final Command BRING_UP = new Command("bringUp");
82 public static final Command SEND_DOWN = new Command("sendDown");
84 public static final Command GRID_TOGGLE = new Command("gridToggle");
85 public static final Command GRID_ENABLE = new Command("gridEnable");
86 public static final Command GRID_DISABLE = new Command("gridDisable");
88 public static final Command SNAP_TOGGLE = new Command("snapToggle");
89 public static final Command SNAP_ENABLE = new Command("snapEnable");
90 public static final Command SNAP_DISABLE = new Command("snapDisable");
92 public static final Command RULER_TOGGLE = new Command("rulerToggle");
93 public static final Command RULER_ENABLE = new Command("rulerEnable");
94 public static final Command RULER_DISABLE = new Command("rulerDisable");
96 public static final Command MAP_TOGGLE = new Command("mapToggle");
97 public static final Command MAP_ENABLE = new Command("mapEnable");
98 public static final Command MAP_DISABLE = new Command("mapDisable");
100 public static final Command ROTATE_CANVAS_CW_GRAB = new Command("grabRotateCW");
101 public static final Command ROTATE_CANVAS_CCW_GRAB = new Command("grabRotateCCW");
103 public static final Command ROTATE_CANVAS_CW_RELEASE = new Command("releaseRotateCW");
104 public static final Command ROTATE_CANVAS_CCW_RELEASE = new Command("releaseRotateCCW");
106 public static final Command SPLIT_CONNECTION = new Command("splitConnection");
108 public static final Command FOCUS_TOOLTIP = new Command("focusTooltip");
111 public static Command showPopup(Point2D atControlPosition) {
112 return new ShowPopup(atControlPosition);