1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.utgenome.gwt.utgb.client.ui;
26
27 import org.utgenome.gwt.utgb.client.track.Design;
28
29 import com.google.gwt.event.dom.client.HasMouseDownHandlers;
30 import com.google.gwt.event.dom.client.HasMouseMoveHandlers;
31 import com.google.gwt.event.dom.client.MouseDownHandler;
32 import com.google.gwt.event.dom.client.MouseMoveHandler;
33 import com.google.gwt.event.shared.HandlerRegistration;
34 import com.google.gwt.user.client.DOM;
35 import com.google.gwt.user.client.ui.AbsolutePanel;
36 import com.google.gwt.user.client.ui.Image;
37
38
39
40
41
42
43
44 public class AbsoluteFocusPanel extends AbsolutePanel implements HasMouseDownHandlers, HasMouseMoveHandlers {
45 private Image _focusPanel = new Image(Design.IMAGE_TRANSPARENT);
46
47 public AbsoluteFocusPanel() {
48 add(_focusPanel, 0, 0);
49 DOM.setStyleAttribute(_focusPanel.getElement(), "zIndex", "1000");
50 }
51
52 public void setSize(String width, String height) {
53 super.setSize(width, height);
54 _focusPanel.setSize(width, height);
55 }
56
57 public Image getFocusPanel() {
58 return _focusPanel;
59 }
60
61 public void clear() {
62 super.clear();
63 add(_focusPanel, 0, 0);
64 }
65
66 public HandlerRegistration addMouseDownHandler(MouseDownHandler m) {
67 return _focusPanel.addMouseDownHandler(m);
68 }
69
70 public HandlerRegistration addMouseMoveHandler(MouseMoveHandler m) {
71 return _focusPanel.addMouseMoveHandler(m);
72 }
73
74 }