package jde.debugger.gui; import java.awt.GridLayout; import javax.swing.JFrame; import javax.swing.JPanel; import jde.debugger.Debugger; import jde.debugger.JDE; import jde.debugger.Protocol; /** * This is a first shot at trying to produce a GUI that displays debugging info from * JDEbug. I recommend a redesign, either after studying this a bit more, or straight * away, depending on the experience of the developer. The main things I am unhappy with * are: *
* Created: Thu Jan 31 13:13:39 2002 * * @author Petter Måhlén * @author Troy Daniels * @version */ public class GUI implements Protocol { private JFrame m_frame; public GUI(final Debugger debugger) { m_frame = new JFrame("JDEbug " + debugger.getProcID()); m_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // Set up the GUI stuff JPanel basePanel = new JPanel(); basePanel.setLayout(new GridLayout(0, 1)); basePanel.add(new LocalVariableDisplay(debugger)); // Finally, add the base panel to the content pane of the frame. m_frame.getContentPane().add(basePanel); m_frame.pack(); m_frame.show(); JDE.debug(FRAMEWORK, "GUI constructor done"); } /** Shutdown the GUI */ public synchronized void shutdown() { if (null != m_frame) m_frame.dispose(); } protected void finalize() throws Throwable { super.finalize(); shutdown(); } }// GUI