zerofile-svn Mailing List for ZeroFile (Page 4)
Status: Pre-Alpha
Brought to you by:
karl-bengtsson
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(51) |
Dec
(26) |
|---|
|
From: <kar...@us...> - 2007-11-03 18:59:25
|
Revision: 11
http://zerofile.svn.sourceforge.net/zerofile/?rev=11&view=rev
Author: karl-bengtsson
Date: 2007-11-03 11:59:30 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
Moved test registration into the main ZeroFile.java file so that we only have one main() in all of our classes. The registration with Zeroconf should eventually be handled by some sort of special registration class.
Modified Paths:
--------------
trunk/src/ZeroConfRegistrationTest.java
trunk/src/ZeroFile.java
Modified: trunk/src/ZeroConfRegistrationTest.java
===================================================================
--- trunk/src/ZeroConfRegistrationTest.java 2007-11-03 13:21:05 UTC (rev 10)
+++ trunk/src/ZeroConfRegistrationTest.java 2007-11-03 18:59:30 UTC (rev 11)
@@ -1,5 +1,4 @@
import com.apple.dnssd.*;
-import java.net.*;
/*
* This class tests XMPP ZeroConf registration, by registering as
@@ -62,28 +61,4 @@
System.out.println("Registration Stopping");
r.stop( );
}
-
- public static void main(String[] args) {
- if (args.length > 1)
- {
- System.out.println("Usage: java TestRegister name");
- System.exit(-1);
- }
- else
- {
- try
- {
- //If name specified, use it, else use default name
- String name = (args.length > 0) ? args[0] : null;
- // Let system allocate us an available port to listen on
- ServerSocket s = new ServerSocket(0);
- new ZeroConfRegistrationTest(name, s.getLocalPort( ));
- }
- catch(Exception e)
- {
- e.printStackTrace( );
- System.exit(-1);
- }
- }
- }
}
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-03 13:21:05 UTC (rev 10)
+++ trunk/src/ZeroFile.java 2007-11-03 18:59:30 UTC (rev 11)
@@ -1,3 +1,5 @@
+import java.net.ServerSocket;
+
// Main loop of the program
public class ZeroFile {
@@ -8,5 +10,26 @@
public static void main(String[] args) {
ZeroFileMainWindow Huvudfonster = new ZeroFileMainWindow();
Huvudfonster.setVisible(true);
+ if (args.length > 1)
+ {
+ System.out.println("Usage: java TestRegister name");
+ System.exit(-1);
+ }
+ else
+ {
+ try
+ {
+ //If name specified, use it, else use default name
+ String name = (args.length > 0) ? args[0] : null;
+ // Let system allocate us an available port to listen on
+ ServerSocket s = new ServerSocket(0);
+ new ZeroConfRegistrationTest(name, s.getLocalPort( ));
+ }
+ catch(Exception e)
+ {
+ e.printStackTrace( );
+ System.exit(-1);
+ }
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-03 13:21:09
|
Revision: 10
http://zerofile.svn.sourceforge.net/zerofile/?rev=10&view=rev
Author: karl-bengtsson
Date: 2007-11-03 06:21:05 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
Added a very basic menu bar to the program, to display how to implement such functionality.
Modified Paths:
--------------
trunk/src/ZeroFileMainWindow.java
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-02 11:32:20 UTC (rev 9)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-03 13:21:05 UTC (rev 10)
@@ -7,7 +7,15 @@
static final long serialVersionUID = -5208364155946320552L;
public ZeroFileMainWindow ()
{
- this.setLayout(new GridLayout(0,3,10,10));
+ JMenuBar mainMenuBar = new JMenuBar();
+ JMenu fileMenu = new JMenu("File");
+ mainMenuBar.add(fileMenu);
+ JMenuItem settingsMenuItem = new JMenuItem("Settings...");
+ fileMenu.add(settingsMenuItem);
+ this.setLayout(new GridLayout(0,1,1,1));
+ this.setMinimumSize(new Dimension(120,300));
+ this.setSize(new Dimension(150,400));
+ this.setJMenuBar(mainMenuBar);
for (int i = 0; i<12; i++)
this.add(new JButton("Button #"+i));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|