1 package org.catacomb.graph.gui;
2
3
4
5 import java.awt.Graphics2D;
6
7
8
9 abstract class MouseHandler {
10
11 final static int NONE = 0;
12 final static int BUFFERED = 1;
13 final static int FULL = 2;
14 private int repaintStatus = NONE;
15
16 private boolean active;
17
18
19 private final static int OUT = -1;
20 private final static int UNDECIDED = 0;
21 private final static int IN = 1;
22 private int claimStatus = UNDECIDED;
23
24
25
26
27 MouseHandler() {
28 active = true;
29 setClaimUndecided();
30 }
31
32
33 public void activate() {
34 active = true;
35 }
36
37 public void deactivate() {
38 active = false;
39 }
40
41
42 public boolean isActive() {
43 return active;
44 }
45
46
47
48 boolean motionAware() {
49 return false;
50 }
51 boolean motionChange(Mouse m) {
52 return false;
53 }
54
55
56
57
58 int getRepaintStatus() {
59 return repaintStatus;
60 }
61
62
63 void setRepaintStatus(int i) {
64 repaintStatus = i;
65 }
66
67 void setFullRepaint() {
68 repaintStatus = FULL;
69 }
70
71
72
73
74 void setClaimUndecided() {
75 claimStatus = UNDECIDED;
76 }
77
78 void setClaimIn() {
79 claimStatus = IN;
80 }
81
82 void setClaimOut() {
83 claimStatus = OUT;
84 }
85
86
87
88 boolean isIn() {
89 return (claimStatus == IN);
90 }
91
92 boolean isUndecided() {
93 return (claimStatus == UNDECIDED);
94 }
95
96 boolean isOut() {
97 return (claimStatus == OUT);
98 }
99
100
101
102
103
104
105
106 void clear() {
107 }
108
109 void init(Mouse m) {
110 }
111
112 void advance(Mouse m) {
113 }
114
115 void release(Mouse m) {
116 }
117
118
119
120
121
122 void echoPaint(Graphics2D g) {
123 }
124
125
126
127
128
129 void missedPress(Mouse m) {
130
131 }
132 void applyOnDown(Mouse m) {
133 }
134
135 void applyOnDrag(Mouse m) {
136 }
137 void applyOnRelease(Mouse m) {
138 }
139
140 }