Project

General

Profile

Download (2.2 KB) Statistics
| Branch: | Tag: | Revision:
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.draw2d;
12

    
13
import org.eclipse.draw2d.geometry.Rectangle;
14

    
15
/**
16
 * @deprecated this class is not used
17
 */
18
public abstract class SubordinateUpdateManager extends UpdateManager {
19

    
20
	/**
21
	 * A root figure.
22
	 */
23
	protected IFigure root;
24

    
25
	/**
26
	 * A graphics source
27
	 */
28
	protected GraphicsSource graphicsSource;
29

    
30
	/**
31
	 * @see UpdateManager#addDirtyRegion(IFigure, int, int, int, int)
32
	 */
33
	public void addDirtyRegion(IFigure f, int x, int y, int w, int h) {
34
		if (getSuperior() == null)
35
			return;
36
		getSuperior().addDirtyRegion(f, x, y, w, h);
37
	}
38

    
39
	/**
40
	 * @see UpdateManager#addInvalidFigure(IFigure)
41
	 */
42
	public void addInvalidFigure(IFigure f) {
43
		UpdateManager um = getSuperior();
44
		if (um == null)
45
			return;
46
		um.addInvalidFigure(f);
47
	}
48

    
49
	/**
50
	 * Returns the host figure.
51
	 * 
52
	 * @return the host figure
53
	 */
54
	protected abstract IFigure getHost();
55

    
56
	/**
57
	 * Returns the superior update manager.
58
	 * 
59
	 * @return the superior
60
	 */
61
	protected UpdateManager getSuperior() {
62
		if (getHost().getParent() == null)
63
			return null;
64
		return getHost().getParent().getUpdateManager();
65
	}
66

    
67
	/**
68
	 * @see UpdateManager#performUpdate()
69
	 */
70
	public void performUpdate() {
71
		UpdateManager um = getSuperior();
72
		if (um == null)
73
			return;
74
		um.performUpdate();
75
	}
76

    
77
	/**
78
	 * @see UpdateManager#performUpdate(Rectangle)
79
	 */
80
	public void performUpdate(Rectangle rect) {
81
		UpdateManager um = getSuperior();
82
		if (um == null)
83
			return;
84
		um.performUpdate(rect);
85
	}
86

    
87
	/**
88
	 * @see UpdateManager#setRoot(IFigure)
89
	 */
90
	public void setRoot(IFigure f) {
91
		root = f;
92
	}
93

    
94
	/**
95
	 * @see UpdateManager#setGraphicsSource(GraphicsSource)
96
	 */
97
	public void setGraphicsSource(GraphicsSource gs) {
98
		graphicsSource = gs;
99
	}
100
}
(153-153/171)