Lines 55-60
Link Here
|
55 |
private boolean updateQueued = false; |
55 |
private boolean updateQueued = false; |
56 |
|
56 |
|
57 |
private boolean updating; |
57 |
private boolean updating; |
|
|
58 |
private boolean validating = false; |
58 |
private RunnableChain afterUpdate; |
59 |
private RunnableChain afterUpdate; |
59 |
|
60 |
|
60 |
private static class RunnableChain { |
61 |
private static class RunnableChain { |
Lines 137-154
Link Here
|
137 |
|
138 |
|
138 |
void paint(GC gc) { |
139 |
void paint(GC gc) { |
139 |
SWTGraphics graphics = new SWTGraphics(gc); |
140 |
SWTGraphics graphics = new SWTGraphics(gc); |
|
|
141 |
Rectangle rect = graphics.getClip(new Rectangle()); |
140 |
if (!updating) { |
142 |
if (!updating) { |
141 |
/** |
143 |
/** |
142 |
* If a paint occurs not as part of an update, we should notify that the region |
144 |
* If a paint occurs not as part of an update, we should notify that the region |
143 |
* is being painted. Otherwise, notification already occurs in repairDamage(). |
145 |
* is being painted. Otherwise, notification already occurs in repairDamage(). |
144 |
*/ |
146 |
*/ |
145 |
HashMap map = new HashMap(); |
147 |
HashMap map = new HashMap(); |
146 |
Rectangle rect = graphics.getClip(new Rectangle()); |
|
|
147 |
map.put(root, rect); |
148 |
map.put(root, rect); |
148 |
firePainting(rect, map); |
149 |
firePainting(rect, map); |
149 |
} |
150 |
} |
150 |
root.paint(graphics); |
151 |
if (!validating) { |
151 |
graphics.dispose(); |
152 |
performValidation(); |
|
|
153 |
root.paint(graphics); |
154 |
graphics.dispose(); |
155 |
} else { |
156 |
/* |
157 |
* If figures are being validated then we can simply |
158 |
* add a dirty region here and update will repaint this region with other |
159 |
* dirty regions when it gets to painting. We can't paint if we're not sure |
160 |
* that all figures are valid. |
161 |
*/ |
162 |
addDirtyRegion(root, rect); |
163 |
} |
152 |
} |
164 |
} |
153 |
|
165 |
|
154 |
/** |
166 |
/** |
Lines 185-198
Link Here
|
185 |
return; |
197 |
return; |
186 |
try { |
198 |
try { |
187 |
IFigure fig; |
199 |
IFigure fig; |
|
|
200 |
validating = true; |
188 |
fireValidating(); |
201 |
fireValidating(); |
189 |
for (int i = 0; i < invalidFigures.size(); i++) { |
202 |
for (int i = 0; i < invalidFigures.size(); i++) { |
|
|
203 |
System.out.println("FOR: " + i + " out of " + invalidFigures.size()); |
190 |
fig = (IFigure) invalidFigures.get(i); |
204 |
fig = (IFigure) invalidFigures.get(i); |
191 |
invalidFigures.set(i, null); |
205 |
invalidFigures.set(i, null); |
192 |
fig.validate(); |
206 |
fig.validate(); |
193 |
} |
207 |
} |
194 |
} finally { |
208 |
} finally { |
195 |
invalidFigures.clear(); |
209 |
invalidFigures.clear(); |
|
|
210 |
validating = false; |
196 |
} |
211 |
} |
197 |
} |
212 |
} |
198 |
|
213 |
|