]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/action/vtkAction.java
Copyrights
[simantics/3d.git] / org.simantics.g3d.vtk / src / org / simantics / g3d / vtk / action / vtkAction.java
1 /*******************************************************************************\r
2  * Copyright (c) 2012, 2013 Association for Decentralized Information Management in\r
3  * Industry THTH ry.\r
4  * All rights reserved. This program and the accompanying materials\r
5  * are made available under the terms of the Eclipse Public License v1.0\r
6  * which accompanies this distribution, and is available at\r
7  * http://www.eclipse.org/legal/epl-v10.html\r
8  *\r
9  * Contributors:\r
10  *     VTT Technical Research Centre of Finland - initial API and implementation\r
11  *******************************************************************************/\r
12 package org.simantics.g3d.vtk.action;\r
13 \r
14 import java.awt.event.KeyEvent;\r
15 import java.awt.event.KeyListener;\r
16 import java.awt.event.MouseEvent;\r
17 import java.awt.event.MouseListener;\r
18 import java.awt.event.MouseMotionListener;\r
19 \r
20 import org.eclipse.jface.action.Action;\r
21 import org.simantics.g3d.vtk.common.InteractiveVtkPanel;\r
22 \r
23 public abstract class vtkAction extends Action implements KeyListener, MouseListener, MouseMotionListener {\r
24 \r
25         protected InteractiveVtkPanel panel;\r
26         \r
27         public vtkAction(InteractiveVtkPanel panel) {\r
28                 this.panel = panel;\r
29         }\r
30         \r
31         @Override\r
32         public void run() {\r
33                 panel.setActiveAction(this);\r
34         }\r
35         \r
36         \r
37         public void attach() {\r
38 \r
39                 panel.addKeyListener(this);\r
40                 panel.addMouseListener(this);\r
41                 panel.addMouseMotionListener(this);\r
42 \r
43         }\r
44         \r
45         public void deattach() {\r
46                 panel.removeKeyListener(this);\r
47                 panel.removeMouseListener(this);\r
48                 panel.removeMouseMotionListener(this);\r
49         }\r
50         \r
51         @Override\r
52         public void keyPressed(KeyEvent e) {\r
53                 \r
54         }\r
55         \r
56         @Override\r
57         public void keyReleased(KeyEvent e) {\r
58                 \r
59         }\r
60         \r
61         @Override\r
62         public void keyTyped(KeyEvent e) {\r
63                 \r
64         }\r
65         \r
66         public void mouseClicked(java.awt.event.MouseEvent e) {\r
67                 \r
68         };\r
69         \r
70         @Override\r
71         public void mouseDragged(MouseEvent e) {\r
72                 \r
73         }\r
74         \r
75         @Override\r
76         public void mouseEntered(MouseEvent e) {\r
77                 \r
78         }\r
79         \r
80         @Override\r
81         public void mouseExited(MouseEvent e) {\r
82                 \r
83         }\r
84         \r
85         @Override\r
86         public void mouseMoved(MouseEvent e) {\r
87                 \r
88         }\r
89         \r
90         @Override\r
91         public void mousePressed(MouseEvent e) {\r
92                 \r
93         }\r
94         \r
95         @Override\r
96         public void mouseReleased(MouseEvent e) {\r
97         \r
98         }\r
99 }\r