blob: 29696c2f61b249cee314c3884fc1ac1232fadf39 (
plain) (
blame)
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
47
48
49
|
package NET.worlds.scape;
import NET.worlds.core.IniFile;
import java.util.Vector;
public class ProgressiveAdder implements FrameHandler {
Vector addList = new Vector();
static ProgressiveAdder theProgressiveAdder = null;
public static ProgressiveAdder get() {
if (theProgressiveAdder == null) {
theProgressiveAdder = new ProgressiveAdder();
}
return theProgressiveAdder;
}
ProgressiveAdder() {
}
public boolean enabled() {
return IniFile.gamma().getIniInt("ProgressiveAvLoading", 0) == 1;
}
void scheduleForAdd(WObject parent, WObject child) {
synchronized (this.addList) {
WObject[] objs = new WObject[]{parent, child};
this.addList.addElement(objs);
}
}
@Override
public boolean handle(FrameEvent fe) {
synchronized (this.addList) {
if (this.addList.size() > 0) {
WObject[] objs = (WObject[])this.addList.elementAt(0);
WObject parent = objs[0];
WObject child = objs[1];
if (!parent.discarded && !child.discarded) {
parent.add(child);
}
this.addList.removeElementAt(0);
}
return true;
}
}
}
|