]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph.swing/src/org/simantics/scenegraph/swing/JViewportSG.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scenegraph.swing / src / org / simantics / scenegraph / swing / JViewportSG.java
1 package org.simantics.scenegraph.swing;
2
3 import java.awt.Point;
4
5 import javax.swing.JComponent;
6 import javax.swing.JViewport;
7
8 import org.simantics.scenegraph.INode;
9
10 public class JViewportSG extends JViewport implements JComponentSG {
11
12         private static final long serialVersionUID = 1941565557888406721L;
13
14         final private INode node;
15         
16         public JViewportSG(INode node) {
17                 super();
18                 this.node = node;
19         }
20
21         @Override
22         public boolean contains(int eventX, int eventY) {
23                 return JComponentUtils.contains(eventX, eventY, this, node);
24         }
25         
26         @Override
27         public boolean containsTransformed(Point p) {
28                 return super.contains(p.x, p.y);
29         }
30         
31         @Override
32         public JComponent getComponent() {
33                 return this;
34         }
35         
36 }