]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scenegraph.swing/src/org/simantics/scenegraph/swing/JListSG.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.scenegraph.swing / src / org / simantics / scenegraph / swing / JListSG.java
1 package org.simantics.scenegraph.swing;
2
3 import java.awt.AWTEvent;
4 import java.awt.Point;
5
6 import javax.swing.JComponent;
7 import javax.swing.JList;
8
9 import org.simantics.scenegraph.INode;
10
11 public class JListSG extends JList implements JComponentSG {
12
13         private static final long serialVersionUID = 3883052650752301256L;
14         
15         final private INode node;
16
17         JListSG(INode node) {
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         @Override
37         protected void processEvent(AWTEvent e) {
38                 super.processEvent(JComponentUtils.relocate(e, this, node));
39         }
40         
41 }