[archstudio-commits] svn commit: r7107 - /calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/Menu.java

archstudio-commits-owner at uci.edu archstudio-commits-owner at uci.edu
Thu May 8 06:22:04 PDT 2008


Author: nmangano
Date: Thu May  8 06:22:04 2008
New Revision: 7107

Log:
Set default file name for saving a grid.

Modified:
    calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/Menu.java

Modified: calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/Menu.=
java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/Menu.java (=
original)
+++ calico/branches/mitchnick2/ics/uci/edu/Calico/UI/components/Menu.java T=
hu May  8 06:22:04 2008
@@ -21,6 +21,8 @@
 import java.io.ObjectOutput;
 import java.io.ObjectOutputStream;
 import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
 =

 import javax.imageio.ImageIO;
 import javax.swing.JFileChooser;
@@ -336,6 +338,11 @@
 	        // Serialize to a file
 			String filename =3D File.separator+"vbg";
 		    JFileChooser fc =3D new JFileChooser(new File(filename));
+		    Calendar cal =3D new GregorianCalendar();
+		    String defaultName =3D cal.get(Calendar.HOUR_OF_DAY) + "" + cal.get(=
Calendar.MINUTE) + "_" + =

+		    	cal.get(Calendar.MONTH) + "-" + cal.get(Calendar.DAY_OF_MONTH) + "-=
" + =

+		    	cal.get(Calendar.YEAR) + ".vbg";
+		    fc.setSelectedFile(new File(defaultName));
 		    fc.setCurrentDirectory(null);
 		    fc.addChoosableFileFilter(new MyFilter());
 		    =





More information about the archstudio-commits mailing list