-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.java
More file actions
42 lines (35 loc) · 1.07 KB
/
Window.java
File metadata and controls
42 lines (35 loc) · 1.07 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package structural.bridge;
public class Window {
private View contents;
private WindowImpl impl;
public Window(View contents) {
this.contents = contents;
}
protected View GetView() {
return contents;
}
protected WindowImpl GetWindowImpl () {
if (impl == null) {
// obtain impl from a factory (check Abstract Factory)
}
return impl;
}
// requests handled by window
public void DrawContents() {}
public void Open() {}
public void Close() {}
public void Iconify() {}
public void Deiconify() {}
// requests forwarded to implementation
public void SetOrigin(Object point) {}
public void SetExtent(Object extent) {}
public void Raise() {}
public void Lower() {}
public void DrawLine(Object from, Object to) {}
public void DrawPolygon(Object[] points, int n) {}
public void DrawText(String text, Object point) {}
public void DrawRect(Object from, Object to) {
WindowImpl impl = GetWindowImpl();
impl.DeviceRect(0, 0, 0, 0);
}
}