]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.trend/src/org/simantics/trend/configuration/TrendKeyBindings.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.trend / src / org / simantics / trend / configuration / TrendKeyBindings.java
diff --git a/bundles/org.simantics.trend/src/org/simantics/trend/configuration/TrendKeyBindings.java b/bundles/org.simantics.trend/src/org/simantics/trend/configuration/TrendKeyBindings.java
new file mode 100644 (file)
index 0000000..64b5b8d
--- /dev/null
@@ -0,0 +1,57 @@
+/*******************************************************************************\r
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     VTT Technical Research Centre of Finland - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.trend.configuration;\r
+\r
+import java.awt.event.KeyEvent;\r
+\r
+import org.simantics.scenegraph.g2d.events.command.Command;\r
+import org.simantics.scenegraph.g2d.events.command.CommandKeyBinding;\r
+import org.simantics.scenegraph.g2d.events.command.Commands;\r
+\r
+/**\r
+ * Describes a key binding of a command\r
+ * \r
+ * @See {@link Command} Command class\r
+ * @See {@link Commands} Default commands\r
+ * @See KeyToCommand Participant that forwards key presses to commands\r
+ * \r
+ * @author Toni Kalajainen\r
+ */\r
+public class TrendKeyBindings {\r
+\r
+       public static final CommandKeyBinding[] DEFAULT_BINDINGS = {\r
+//             new ChartKeyBindings(TrendParticipant.TIME_WINDOW_MATCH_OTHERS, null, KeyEvent.VK_5),\r
+               new CommandKeyBinding(Commands.PAN_LEFT, null, KeyEvent.VK_LEFT),\r
+               new CommandKeyBinding(Commands.PAN_RIGHT, null, KeyEvent.VK_RIGHT),\r
+               new CommandKeyBinding(Commands.PAN_UP, null, KeyEvent.VK_UP),\r
+               new CommandKeyBinding(Commands.PAN_DOWN, null, KeyEvent.VK_DOWN),\r
+               new CommandKeyBinding(Commands.ZOOM_TO_FIT, null, KeyEvent.VK_1),\r
+        new CommandKeyBinding(Commands.ZOOM_TO_FIT_HORIZ, null, KeyEvent.VK_2),\r
+        new CommandKeyBinding(Commands.ZOOM_TO_FIT_VERT, null, KeyEvent.VK_3),\r
+        new CommandKeyBinding(Commands.AUTOSCALE, null, KeyEvent.VK_4),\r
+        new CommandKeyBinding(Commands.AUTOSCALE, null, KeyEvent.VK_ESCAPE),\r
+               new CommandKeyBinding(Commands.ZOOM_IN, null, KeyEvent.VK_PLUS),\r
+               new CommandKeyBinding(Commands.ZOOM_IN, null, KeyEvent.VK_ADD),\r
+               new CommandKeyBinding(Commands.ZOOM_OUT, null, KeyEvent.VK_MINUS),\r
+               new CommandKeyBinding(Commands.ZOOM_OUT, null, KeyEvent.VK_SUBTRACT),\r
+\r
+               new CommandKeyBinding(Commands.CUT, null, KeyEvent.VK_X, KeyEvent.VK_CONTROL),\r
+               new CommandKeyBinding(Commands.COPY, null, KeyEvent.VK_C, KeyEvent.VK_CONTROL),\r
+               new CommandKeyBinding(Commands.PASTE, null, KeyEvent.VK_V, KeyEvent.VK_CONTROL),\r
+               new CommandKeyBinding(Commands.PRINT, null, KeyEvent.VK_P, KeyEvent.VK_CONTROL),\r
+               new CommandKeyBinding(Commands.PDFPRINT, null, KeyEvent.VK_P, KeyEvent.VK_ALT),\r
+               new CommandKeyBinding(Commands.GRID_TOGGLE, null, KeyEvent.VK_G),\r
+               new CommandKeyBinding(Commands.RULER_TOGGLE, null, KeyEvent.VK_R),\r
+               new CommandKeyBinding(Commands.FOCUS_TOOLTIP, null, KeyEvent.VK_F9)\r
+       };\r
+       \r
+}\r