View | Details | Raw Unified | Return to bug 146894 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/draw2d/DeferredUpdateManager.java (-9 / +23 lines)
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-153 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);
140
	if (!updating) {
141
	Rectangle rect = graphics.getClip(new Rectangle());
141
		/**
142
	if (!validating) {
142
		 * If a paint occurs not as part of an update, we should notify that the region
143
		if (!updating) {
143
		 * is being painted. Otherwise, notification already occurs in repairDamage().
144
			/**
145
			 * If a paint occurs not as part of an update, we should notify that the region
146
			 * is being painted. Otherwise, notification already occurs in repairDamage().
147
			 */
148
			HashMap map = new HashMap();
149
			map.put(root, rect);
150
			firePainting(rect, map);
151
		}
152
		performValidation();
153
		root.paint(graphics);
154
	} else {
155
		/*
156
		 * If figures are being validated then we can simply
157
		 * add a dirty region here and update will repaint this region with other 
158
		 * dirty regions when it gets to painting. We can't paint if we're not sure
159
		 * that all figures are valid. 
144
		 */
160
		 */
145
		HashMap map = new HashMap();
161
		addDirtyRegion(root, rect);
146
		Rectangle rect = graphics.getClip(new Rectangle());
147
		map.put(root, rect);
148
		firePainting(rect, map);
149
	}
162
	}
150
	root.paint(graphics);
151
	graphics.dispose();
163
	graphics.dispose();
152
}
164
}
153
165
Lines 185-190 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++) {
190
			fig = (IFigure) invalidFigures.get(i);
203
			fig = (IFigure) invalidFigures.get(i);
Lines 193-198 Link Here
193
		}
206
		}
194
	} finally {
207
	} finally {
195
		invalidFigures.clear();
208
		invalidFigures.clear();
209
		validating = false;
196
	}
210
	}
197
}
211
}
198
212

Return to bug 146894