Update of /cvsroot/firebug/firebug/project/zaurus/vu/isis/nest/zaurus
In directory sc8-pr-cvs1:/tmp/cvs-serv30376/vu/isis/nest/zaurus
Modified Files:
ZFrame.java ZMain.java
Log Message:
Window event handling now implemented, much easier to close
down application on the zaurus now.
Index: ZFrame.java
===================================================================
RCS file: /cvsroot/firebug/firebug/project/zaurus/vu/isis/nest/zaurus/ZFrame.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ZFrame.java 8 Jul 2003 20:53:49 -0000 1.1
--- ZFrame.java 21 Jul 2003 17:45:09 -0000 1.2
***************
*** 2,14 ****
import java.awt. *;
import java.lang. *;
- import java.awt.event. *;
import java.io. *;
! public class ZFrame extends Frame { //implements WindowListener {
! //implements EarthquakeListener {
!
--- 2,13 ----
import java.awt. *;
+ import java.awt.event.*;
+
import java.lang. *;
import java.io. *;
! public class ZFrame extends Frame implements WindowListener {
***************
*** 19,22 ****
--- 18,22 ----
this.setMenuBar (mb);
ZMenu zm = new ZMenu(mb,this);
+ this.addWindowListener(this);
System.out.println("ZFrame constructor");
***************
*** 25,39 ****
! /** Custom event handler to listen for "earthquake events",
! * i.e., when the user changes parameters.
! */
! /*
! public void parameterChanged (EarthquakeEvent e) {
! spectrum.spectrum (EQ);
! graphit.drawspectrum ();
}
- */
}
--- 25,57 ----
+ public void windowClosed(WindowEvent e) {
+ System.out.println("Closed");
+ }
! public void windowActivated(WindowEvent e) {
! System.out.println("Activated");
! }
! public void windowClosing(WindowEvent e) {
! System.out.println("Closing");
! this.dispose();
! System.exit(0);
! }
!
! public void windowDeactivated(WindowEvent e) {
! System.out.println("Deactivated");
! }
!
! public void windowDeiconified(WindowEvent e) {
! System.out.println("Deinconified");
! }
!
! public void windowIconified(WindowEvent e) {
! System.out.println("Iconified");
! }
!
! public void windowOpened(WindowEvent e) {
! System.out.println("Opened");
}
}
Index: ZMain.java
===================================================================
RCS file: /cvsroot/firebug/firebug/project/zaurus/vu/isis/nest/zaurus/ZMain.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ZMain.java 21 Jul 2003 17:09:29 -0000 1.4
--- ZMain.java 21 Jul 2003 17:45:09 -0000 1.5
***************
*** 8,11 ****
--- 8,14 ----
public class ZMain extends Object {
+ private static final int width = 236;
+ private static final int height = 280;
+
public static void main (String[]args) {
***************
*** 19,28 ****
Panel panel = new Panel();
! panel.setSize(236,280);
! zf.setSize(236,280);
zf.add(panel);
- //zf.pack();
zf.show();
--- 22,30 ----
Panel panel = new Panel();
! panel.setSize(width,height);
! zf.setSize(width,height);
zf.add(panel);
zf.show();
***************
*** 30,39 ****
Insets insets = zf.getInsets();
-
- /* This will all have to be moved to a getDisplayable()
- * method.
- */
- int width = zf.getWidth();
- int height = zf.getHeight();
int cwidth = width - (insets.right + insets.left + 25);
--- 32,35 ----
|