]> gerrit.simantics Code Review - simantics/3d.git/blob - org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/awt/vtkAwtAction.java
Scale tooltip font by display DPI.
[simantics/3d.git] / org.simantics.g3d.vtk / src / org / simantics / g3d / vtk / awt / vtkAwtAction.java
1 /*******************************************************************************
2  * Copyright (c) 2012, 2013 Association for Decentralized Information Management in
3  * Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.g3d.vtk.awt;
13
14 import java.awt.event.KeyEvent;
15 import java.awt.event.KeyListener;
16 import java.awt.event.MouseEvent;
17 import java.awt.event.MouseListener;
18 import java.awt.event.MouseMotionListener;
19
20 import org.simantics.g3d.vtk.action.vtkAction;
21
22 public abstract class vtkAwtAction extends vtkAction implements KeyListener, MouseListener, MouseMotionListener {
23
24         protected InteractiveVtkPanel panel;
25         
26         public vtkAwtAction(InteractiveVtkPanel panel) {
27                 this.panel = panel;
28         }
29         
30         @Override
31         public void run() {
32                 panel.setActiveAction(this);
33         }
34         
35         
36         public void attach() {
37
38                 panel.addKeyListener(this);
39                 panel.addMouseListener(this);
40                 panel.addMouseMotionListener(this);
41
42         }
43         
44         public void deattach() {
45                 panel.removeKeyListener(this);
46                 panel.removeMouseListener(this);
47                 panel.removeMouseMotionListener(this);
48         }
49         
50         protected vtkAwtAction getDefaultAction() {
51                 return (vtkAwtAction)panel.getDefaultAction();
52         }
53         
54         @Override
55         public void keyPressed(KeyEvent e) {
56                 
57         }
58         
59         @Override
60         public void keyReleased(KeyEvent e) {
61                 
62         }
63         
64         @Override
65         public void keyTyped(KeyEvent e) {
66                 
67         }
68         
69         public void mouseClicked(java.awt.event.MouseEvent e) {
70                 
71         };
72         
73         @Override
74         public void mouseDragged(MouseEvent e) {
75                 
76         }
77         
78         @Override
79         public void mouseEntered(MouseEvent e) {
80                 
81         }
82         
83         @Override
84         public void mouseExited(MouseEvent e) {
85                 
86         }
87         
88         @Override
89         public void mouseMoved(MouseEvent e) {
90                 
91         }
92         
93         @Override
94         public void mousePressed(MouseEvent e) {
95                 
96         }
97         
98         @Override
99         public void mouseReleased(MouseEvent e) {
100         
101         }
102 }