-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImageProxy.java
More file actions
46 lines (36 loc) · 870 Bytes
/
ImageProxy.java
File metadata and controls
46 lines (36 loc) · 870 Bytes
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
43
44
45
46
package structural.proxy;
public class ImageProxy implements Graphic {
private Image image;
private Object extent;
private String filename;
public ImageProxy(String filename) {
this.filename = filename;
this.extent = null; // still unknown
this.image = null;
}
protected Image GetImage(){
if (image == null){
image = new Image(filename);
}
return image;
}
@Override
public void Draw() {
GetImage().Draw();
}
@Override
public void HandleMouse() {
GetImage().HandleMouse();
}
@Override
public Object GetExtent() {
if (extent == null) {
extent = GetImage().GetExtent();
}
return extent;
}
@Override
public void Load() {}
@Override
public void Save() {}
}