01: /*
02: * @(#)VisualDebugger.java 1.2 04/12/06
03: *
04: * Copyright (c) 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution of
07: * this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package pnuts.tools;
10:
11: import pnuts.lang.Context;
12:
13: public class VisualDebugger extends VisualDebuggerView implements
14: Debugger, ContextFactory {
15: public VisualDebugger() {
16: VisualDebuggerModel model = new VisualDebuggerModel();
17: model.setView(this );
18: this .model = model;
19: }
20:
21: public Context createContext(Context context) {
22: DebugContext dc = new DebugContext(context);
23: dc.addCommandListener(this );
24: return dc;
25: }
26:
27: public Context createContext() {
28: DebugContext dc = new DebugContext();
29: dc.addCommandListener(this );
30: return dc;
31: }
32:
33: public void setBreakPoint(Object source, int lineno) {
34: model.setBreakPoint(source, lineno);
35: }
36:
37: public void removeBreakPoint(Object source, int lineno) {
38: model.removeBreakPoint(source, lineno);
39: }
40:
41: public void clearBreakPoints() {
42: model.clearBreakPoints();
43: }
44:
45: public void signal(CommandEvent event) {
46: model.signal(event);
47: }
48:
49: }
|