01: // FrameTreeListener.java
02: // $Id: FrameTreeListener.java,v 1.4 2000/08/16 21:37:27 ylafon Exp $
03: // (c) COPYRIGHT MIT and INRIA, 1997.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05:
06: package org.w3c.jigadm.editors;
07:
08: import java.util.EventListener;
09:
10: import org.w3c.jigsaw.admin.RemoteAccessException;
11:
12: import org.w3c.jigadm.RemoteResourceWrapper;
13:
14: public class FrameTreeListener implements EventListener {
15: FramesHelper helper = null;
16: RemoteResourceWrapper lastr = null;
17: FramesHelperListener fl = null;
18:
19: class Initializer extends Thread {
20: FramesHelper fh;
21:
22: public void run() {
23: try {
24: fh.initialize(lastr, null);
25: } catch (RemoteAccessException ex) {
26: // FIXME
27: }
28: }
29:
30: Initializer(FramesHelper fh) {
31: this .fh = fh;
32: }
33: }
34:
35: public void editedChanged(FrameBrowser fb,
36: RemoteResourceWrapper framew) {
37: lastr = framew;
38: if (fl != null)
39: helper.removeResourceListener(fl);
40: fl = new FramesHelperListener(fb);
41: helper.addResourceListener(fl);
42: helper.editFrame(framew);
43: // (new Initializer(helper)).start();
44: }
45:
46: public void focusChanged(RemoteResourceWrapper rw) { //FIXME
47: if (rw == null) {
48: if (lastr != null) {
49: helper.removeCenterComp();
50: }
51: } else {
52: if (!rw.equals(lastr)) {
53: helper.removeCenterComp();
54: }
55: }
56: lastr = rw;
57: }
58:
59: public void nodeRemoved(RemoteResourceWrapper rw) { //FIXME
60: if (rw.equals(lastr)) {
61: lastr = null;
62: helper.removeCenterComp();
63: }
64: }
65:
66: public FrameTreeListener(FramesHelper helper) {
67: this.helper = helper;
68: }
69: }
|