zerofile-svn Mailing List for ZeroFile (Page 3)
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-07 14:04:38
|
Revision: 36
http://zerofile.svn.sourceforge.net/zerofile/?rev=36&view=rev
Author: karl-bengtsson
Date: 2007-11-07 06:04:37 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Haxxored around with the properties/settings
Modified Paths:
--------------
trunk/src/ZeroFileSettings.java
Modified: trunk/src/ZeroFileSettings.java
===================================================================
--- trunk/src/ZeroFileSettings.java 2007-11-07 13:57:10 UTC (rev 35)
+++ trunk/src/ZeroFileSettings.java 2007-11-07 14:04:37 UTC (rev 36)
@@ -10,6 +10,7 @@
private static String _lastName;
private static String _email;
private static int _mainPort;
+ private static Properties _zeroFileProperties;
/*public static void saveSettings() throws IOException
{
@@ -33,12 +34,15 @@
public static String getNickName()
{
- return _nickName;
+ if (_zeroFileProperties.containsKey("NickName"))
+ return _zeroFileProperties.getProperty("NickName");
+ else
+ return "Anonymous";
}
public static void setNickName(String n)
{
- _nickName = n;
+ _zeroFileProperties.put("NickName", n);
}
public static String getFirstName()
@@ -83,11 +87,13 @@
public static void saveSettings() throws IOException {
- Properties applicationProps = new Properties();
+ //Properties applicationProps = new Properties();
FileOutputStream appStream = new FileOutputStream("appProperties");
- applicationProps.put("first", "balle");
- applicationProps.put("last", "ballesson");
- applicationProps.store(appStream, "settings");
+ _zeroFileProperties.put("first", "balle");
+ //applicationProps.put("first", "balle");
+ //applicationProps.put("last", "ballesson");
+ _zeroFileProperties.store(appStream, "sttings");
+ //applicationProps.store(appStream, "settings");
appStream.close();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-07 13:57:11
|
Revision: 35
http://zerofile.svn.sourceforge.net/zerofile/?rev=35&view=rev
Author: karl-bengtsson
Date: 2007-11-07 05:57:10 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Updated deprecated save() method to store() instead
Modified Paths:
--------------
trunk/src/ZeroFileSettings.java
Modified: trunk/src/ZeroFileSettings.java
===================================================================
--- trunk/src/ZeroFileSettings.java 2007-11-07 13:51:57 UTC (rev 34)
+++ trunk/src/ZeroFileSettings.java 2007-11-07 13:57:10 UTC (rev 35)
@@ -87,7 +87,7 @@
FileOutputStream appStream = new FileOutputStream("appProperties");
applicationProps.put("first", "balle");
applicationProps.put("last", "ballesson");
- applicationProps.save(appStream, "settings");
+ applicationProps.store(appStream, "settings");
appStream.close();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2007-11-07 13:52:04
|
Revision: 34
http://zerofile.svn.sourceforge.net/zerofile/?rev=34&view=rev
Author: elpedr0
Date: 2007-11-07 05:51:57 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Added at test save/load.
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroFileSettings.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-07 10:45:23 UTC (rev 33)
+++ trunk/src/ZeroFile.java 2007-11-07 13:51:57 UTC (rev 34)
@@ -1,3 +1,5 @@
+import java.io.IOException;
+
//import java.net.ServerSocket;
public class ZeroFile {
@@ -3,8 +5,11 @@
/**
* @param name - The service name used by the registration class. Deprecated. Don't use.
+ * @throws IOException
*/
- public static void main(String[] args) {
+ public static void main(String[] args) throws IOException {
ZeroFileMainWindow.startMainWindow();
ZeroFileChatWindow.startChatWindow();
+ ZeroFileSettings.saveSettings();
+ ZeroFileSettings.loadSettings();
try
{
Modified: trunk/src/ZeroFileSettings.java
===================================================================
--- trunk/src/ZeroFileSettings.java 2007-11-07 10:45:23 UTC (rev 33)
+++ trunk/src/ZeroFileSettings.java 2007-11-07 13:51:57 UTC (rev 34)
@@ -1,6 +1,9 @@
/* Settings for the program are stored in this class. Or something.
* At present, all it holds are a bunch of getters and setters.
*/
+import java.util.*;
+import java.io.*;
+
public class ZeroFileSettings {
private static String _nickName;
private static String _firstName;
@@ -8,6 +11,26 @@
private static String _email;
private static int _mainPort;
+ /*public static void saveSettings() throws IOException
+ {
+ // set up default properties
+ Properties defaultProps = new Properties();
+ FileInputStream defaultStream = new FileInputStream("defaultProperties");
+ defaultProps.load(defaultStream);
+ defaultStream.close();
+
+ // set up real properties
+ Properties applicationProps = new Properties(defaultProps);
+ FileOutputStream appStream = new FileOutputStream("appProperties");
+
+
+ applicationProps.put ( "HEIGHT","300" ) ;
+ applicationProps.put ( "WIDTH","300" ) ;
+
+
+ }*/
+
+
public static String getNickName()
{
return _nickName;
@@ -57,4 +80,27 @@
{
_mainPort = p;
}
+
+ public static void saveSettings() throws IOException {
+
+ Properties applicationProps = new Properties();
+ FileOutputStream appStream = new FileOutputStream("appProperties");
+ applicationProps.put("first", "balle");
+ applicationProps.put("last", "ballesson");
+ applicationProps.save(appStream, "settings");
+ appStream.close();
+ }
+
+ public static void loadSettings() throws IOException {
+ Properties applicationProps = new Properties();
+ FileInputStream appStream = new FileInputStream("appProperties");
+ applicationProps.load(appStream);
+ String key = "last";
+ String val = applicationProps.getProperty ( key ) ;
+ System.out.println ( val ) ;
+ appStream.close();
+
+ }
+
+
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <zo...@us...> - 2007-11-07 10:45:21
|
Revision: 33
http://zerofile.svn.sourceforge.net/zerofile/?rev=33&view=rev
Author: zondar
Date: 2007-11-07 02:45:23 -0800 (Wed, 07 Nov 2007)
Log Message:
-----------
Addad names to windows etc
Modified Paths:
--------------
trunk/src/ZeroFileChatWindow.java
trunk/src/ZeroFileMainWindow.java
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFileChatWindow.java
===================================================================
--- trunk/src/ZeroFileChatWindow.java 2007-11-06 19:35:39 UTC (rev 32)
+++ trunk/src/ZeroFileChatWindow.java 2007-11-07 10:45:23 UTC (rev 33)
@@ -1,4 +1,5 @@
import java.awt.*;
+
import javax.swing.*;
/**
@@ -9,6 +10,9 @@
{
JFrame chatWindowFrame = new JFrame();
chatWindowFrame.setLayout(new GridLayout(0,1,1,1));
+ chatWindowFrame.setLocation(0,400);
+ chatWindowFrame.setSize(new Dimension(300,200));
+ chatWindowFrame.setTitle("chatwindow");
JTextArea chatTextArea = new JTextArea();
chatWindowFrame.add(chatTextArea);
JPanel bottomPanel = new JPanel();
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-06 19:35:39 UTC (rev 32)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-07 10:45:23 UTC (rev 33)
@@ -31,6 +31,7 @@
_mainWindowFrame = new JFrame();
_mainWindowFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
_mainMenuBar = new JMenuBar();
+ _mainWindowFrame.setTitle("ZeroFile");
// File menu
_fileMenu = new JMenu("File");
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-06 19:35:39 UTC (rev 32)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-07 10:45:23 UTC (rev 33)
@@ -12,6 +12,8 @@
settingsWindowFrame.setSize(new Dimension(300,200));
settingsWindowFrame.setResizable(false);
settingsWindowFrame.setLayout(new GridLayout(0,2,1,1));
+ settingsWindowFrame.setLocation(200, 200);
+ settingsWindowFrame.setTitle("Settings");
// Label + field for Nickname parameter
JLabel nickNameLabel = new JLabel("Nickname:", JLabel.CENTER);
@@ -43,6 +45,7 @@
settingsWindowFrame.add(checkBoxLabel);
settingsWindowFrame.add(checkBoxTransfer);
+
// OK and Cancel buttons
JButton okButton = new JButton("OK");
JButton cancelButton = new JButton("Cancel");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 19:36:05
|
Revision: 32
http://zerofile.svn.sourceforge.net/zerofile/?rev=32&view=rev
Author: karl-bengtsson
Date: 2007-11-06 11:35:39 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
*) Added a static resolver class with a single method used to find out information about a given XMPP service on the network.
*) Further refined the ZeroconfBrowsing class
*) Modified the attributes of the XMPPLinkLocalHost class - this class should only hold information that is readily available when browsing for services, not detailed information for which a resolving operation is required. Such detailed information (IP address, port number, nick name, etc) should be fetched only when needed, to minimize network traffic.
Modified Paths:
--------------
trunk/src/XMPPLinkLocalHost.java
trunk/src/ZeroFile.java
trunk/src/ZeroFileMainWindow.java
trunk/src/ZeroconfBrowsing.java
Added Paths:
-----------
trunk/src/ZeroconfResolving.java
Modified: trunk/src/XMPPLinkLocalHost.java
===================================================================
--- trunk/src/XMPPLinkLocalHost.java 2007-11-06 18:22:06 UTC (rev 31)
+++ trunk/src/XMPPLinkLocalHost.java 2007-11-06 19:35:39 UTC (rev 32)
@@ -1,12 +1,43 @@
// Stub class, to represent a compatible XMPP-capable host on the ZeroConf network
public class XMPPLinkLocalHost {
- private String _ipAddress;
- public XMPPLinkLocalHost(String ipAddress)
+ private String _serviceName;
+ private String _nickName;
+ private String _firstName;
+ private String _lastName;
+
+ public XMPPLinkLocalHost(String serviceName)
{
- _ipAddress = ipAddress;
+ _serviceName = serviceName;
}
- public String getIPAddress()
+
+ /*public String getIPAddress()
{
return _ipAddress;
+ }*/
+
+ public String getServiceName()
+ {
+ return _serviceName;
}
+
+ public String getFirstName()
+ {
+ return _firstName;
+ }
+
+ public String getLastName()
+ {
+ return _lastName;
+ }
+
+ public String toString()
+ {
+ if (_nickName != null)
+ return _nickName;
+ else
+ if (_firstName != null && _lastName != null)
+ return _firstName + " " + _lastName;
+ else
+ return _serviceName;
+ }
}
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 18:22:06 UTC (rev 31)
+++ trunk/src/ZeroFile.java 2007-11-06 19:35:39 UTC (rev 32)
@@ -15,14 +15,18 @@
ZeroconfRegistration.registerService();
ZeroconfRegistration.set1st("Testar");
ZeroconfRegistration.setLast("Nisse");
+ ZeroconfBrowsing.startBrowsing();
+ /*
ZeroFileMainWindow.addContact("Test 1");
ZeroFileMainWindow.addContact("Test 2");
ZeroFileMainWindow.addContact("Test 3");
ZeroFileMainWindow.addContact("Test 4");
ZeroFileMainWindow.removeContact("Test 3");
+ */
Thread.sleep(5000);
ZeroconfRegistration.setStatus("away");
Thread.sleep(15000);
+ ZeroconfBrowsing.stopBrowsing();
ZeroconfRegistration.unregisterService();
}
catch(Exception e)
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-06 18:22:06 UTC (rev 31)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 19:35:39 UTC (rev 32)
@@ -17,11 +17,11 @@
private static JComboBox _statusLista;
private static DefaultListModel _contactListModel;
private static JList _contactList;
- static void addContact(String c)
+ static void addContact(Object c)
{
_contactListModel.addElement(c);
}
- static void removeContact(String c)
+ static void removeContact(Object c)
{
_contactListModel.removeElement(c);
}
Modified: trunk/src/ZeroconfBrowsing.java
===================================================================
--- trunk/src/ZeroconfBrowsing.java 2007-11-06 18:22:06 UTC (rev 31)
+++ trunk/src/ZeroconfBrowsing.java 2007-11-06 19:35:39 UTC (rev 32)
@@ -1,8 +1,39 @@
-// TODO
+import com.apple.dnssd.*;
+
public class ZeroconfBrowsing {
- static XMPPLinkLocalHost[] findXMPPHosts()
+ private static DNSSDService _s;
+ static void startBrowsing()
+ throws DNSSDException, InterruptedException
{
- XMPPLinkLocalHost[] testArr = {new XMPPLinkLocalHost("192.168.0.1"),new XMPPLinkLocalHost("192.168.0.2")};
- return testArr;
+ _s = DNSSD.browse("_presence._tcp",new BrowseListener() {
+ public void operationFailed(DNSSDService service, int errorCode)
+ {
+ System.out.println("Browse failed: " + errorCode);
+ System.exit(-1);
+ }
+ public void serviceFound(DNSSDService browser, int flags, int ifIndex,
+ String name, String regType, String domain)
+ {
+ System.out.println("Yay, found: " + name + " at interface: " + ifIndex);
+ try
+ {
+ ZeroconfResolving.getHost(name);
+ }
+ catch (Exception e)
+ {
+ System.out.println("Error: " + e.getStackTrace());
+ }
+ }
+ public void serviceLost(DNSSDService browser, int flags, int ifIndex,
+ String name, String regType, String domain)
+ {
+ System.out.println("Lost: " + name);
+ }
+ });
+ System.out.println("Starting browsing...");
}
+ static void stopBrowsing(){
+ _s.stop();
+ System.out.println("Stopped browsing");
+ }
}
Added: trunk/src/ZeroconfResolving.java
===================================================================
--- trunk/src/ZeroconfResolving.java (rev 0)
+++ trunk/src/ZeroconfResolving.java 2007-11-06 19:35:39 UTC (rev 32)
@@ -0,0 +1,35 @@
+import com.apple.dnssd.*;
+
+/*
+ * A static class with methods for resolving hosts once we've found them
+ */
+
+public class ZeroconfResolving {
+ private static DNSSDService _r;
+ static void getHost(String serviceName)
+ throws DNSSDException, InterruptedException
+ {
+ _r = DNSSD.resolve(0, DNSSD.ALL_INTERFACES, serviceName, "_presence._tcp", "local", new ResolveListener()
+ {
+ public void operationFailed(DNSSDService service,int errorCode)
+ {
+ System.out.println("Resolved failed " + errorCode);
+ System.exit(-1);
+ }
+ public void serviceResolved(DNSSDService resolver, int flags, int ifIndex,
+ String fullName, String hostName, int port, TXTRecord txtRecord)
+ {
+ System.out.println("Host resolved: " + hostName + ":" + port);
+ System.out.println("Flags: " + flags + ", ifIndex: " + ifIndex + ", FQDN: " + fullName);
+ for (int i = 0; i < txtRecord.size(); i++)
+ {
+ String key = txtRecord.getKey(i);
+ String value = txtRecord.getValueAsString(i);
+ if (key.length() > 0)
+ System.out.println("\t" + key + "=" + value);
+ }
+ _r.stop();
+ }
+ });
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 18:22:20
|
Revision: 31
http://zerofile.svn.sourceforge.net/zerofile/?rev=31&view=rev
Author: karl-bengtsson
Date: 2007-11-06 10:22:06 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
*) Made all GUI components in ZeroFileMainWindow private static attributes of that class, rather than local attributes in the startMainWindow()-method. This makes it possible to access and change them with public static methods of that class, which is useful when for instance updating the contact list.
*) Built methods for adding and removing contacts to said contact list. Also added a DefaultListModel tied to the list, through which changes are done (in accordance with the MVC pattern)
*) Added some (very ugly) stub code for testing to the XMPPLinkLocalHost and ZeroconfBrowsing classes, which will be replaced ASAP.
*) Bugfix in ZeroconfRegistration: the "last" TXT property was capitalized, and is now lowercase as it should be.
Modified Paths:
--------------
trunk/src/XMPPLinkLocalHost.java
trunk/src/ZeroFile.java
trunk/src/ZeroFileMainWindow.java
trunk/src/ZeroconfBrowsing.java
trunk/src/ZeroconfRegistration.java
Modified: trunk/src/XMPPLinkLocalHost.java
===================================================================
--- trunk/src/XMPPLinkLocalHost.java 2007-11-06 17:07:38 UTC (rev 30)
+++ trunk/src/XMPPLinkLocalHost.java 2007-11-06 18:22:06 UTC (rev 31)
@@ -1,4 +1,12 @@
// Stub class, to represent a compatible XMPP-capable host on the ZeroConf network
public class XMPPLinkLocalHost {
-
+ private String _ipAddress;
+ public XMPPLinkLocalHost(String ipAddress)
+ {
+ _ipAddress = ipAddress;
+ }
+ public String getIPAddress()
+ {
+ return _ipAddress;
+ }
}
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 17:07:38 UTC (rev 30)
+++ trunk/src/ZeroFile.java 2007-11-06 18:22:06 UTC (rev 31)
@@ -15,8 +15,13 @@
ZeroconfRegistration.registerService();
ZeroconfRegistration.set1st("Testar");
ZeroconfRegistration.setLast("Nisse");
+ ZeroFileMainWindow.addContact("Test 1");
+ ZeroFileMainWindow.addContact("Test 2");
+ ZeroFileMainWindow.addContact("Test 3");
+ ZeroFileMainWindow.addContact("Test 4");
+ ZeroFileMainWindow.removeContact("Test 3");
Thread.sleep(5000);
- ZeroconfRegistration.setStatus("dnd");
+ ZeroconfRegistration.setStatus("away");
Thread.sleep(15000);
ZeroconfRegistration.unregisterService();
}
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-06 17:07:38 UTC (rev 30)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 18:22:06 UTC (rev 31)
@@ -7,58 +7,76 @@
/**
* @author Karl Bengtsson
*/
+ private static JFrame _mainWindowFrame;
+ private static JMenuBar _mainMenuBar;
+ private static JMenu _fileMenu;
+ private static JMenuItem _settingsMenuItem;
+ private static JMenuItem _quitMenuItem;
+ private static JMenu _helpMenu;
+ private static JMenuItem _aboutMenuItem;
+ private static JComboBox _statusLista;
+ private static DefaultListModel _contactListModel;
+ private static JList _contactList;
+ static void addContact(String c)
+ {
+ _contactListModel.addElement(c);
+ }
+ static void removeContact(String c)
+ {
+ _contactListModel.removeElement(c);
+ }
static void startMainWindow()
{
// Grundkittet, JFrame + JMenuBar
- JFrame mainWindowFrame = new JFrame();
- mainWindowFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- JMenuBar mainMenuBar = new JMenuBar();
+ _mainWindowFrame = new JFrame();
+ _mainWindowFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+ _mainMenuBar = new JMenuBar();
// File menu
- JMenu fileMenu = new JMenu("File");
- mainMenuBar.add(fileMenu);
- JMenuItem settingsMenuItem = new JMenuItem("Settings...");
- settingsMenuItem.addActionListener(new ActionListener(){
+ _fileMenu = new JMenu("File");
+ _mainMenuBar.add(_fileMenu);
+ _settingsMenuItem = new JMenuItem("Settings...");
+ _settingsMenuItem.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
ZeroFileSettingsWindow.startSettingsWindow();
}
});
- fileMenu.add(settingsMenuItem);
- JMenuItem quitMenuItem = new JMenuItem("Quit");
- quitMenuItem.addActionListener(new ActionListener(){
+ _fileMenu.add(_settingsMenuItem);
+ _quitMenuItem = new JMenuItem("Quit");
+ _quitMenuItem.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
System.exit(1);
}
});
- fileMenu.add(quitMenuItem);
+ _fileMenu.add(_quitMenuItem);
// Help menu
- JMenu helpMenu = new JMenu("Help");
- mainMenuBar.add(helpMenu);
- JMenuItem aboutMenuItem = new JMenuItem("About..");
- helpMenu.add(aboutMenuItem);
+ _helpMenu = new JMenu("Help");
+ _mainMenuBar.add(_helpMenu);
+ _aboutMenuItem = new JMenuItem("About..");
+ _helpMenu.add(_aboutMenuItem);
// Layout, storlekar, samt koppling av JMenuBar
- mainWindowFrame.setLayout(new GridLayout(0,1,1,1));
- mainWindowFrame.setMinimumSize(new Dimension(120,300));
- mainWindowFrame.setSize(new Dimension(150,400));
- mainWindowFrame.setJMenuBar(mainMenuBar);
+ _mainWindowFrame.setLayout(new GridLayout(0,1,1,1));
+ _mainWindowFrame.setMinimumSize(new Dimension(120,300));
+ _mainWindowFrame.setSize(new Dimension(150,400));
+ _mainWindowFrame.setJMenuBar(_mainMenuBar);
// Statuslista
String[] statusModes = {"Available","Away","Do not disturb"};
- JComboBox statusLista = new JComboBox(statusModes);
- statusLista.setMaximumSize(new Dimension(20,100));
- mainWindowFrame.add(statusLista);
+ _statusLista = new JComboBox(statusModes);
+ _statusLista.setMaximumSize(new Dimension(20,100));
+ _mainWindowFrame.add(_statusLista);
// Kontaktlista
- String[] TestKontakter = {"Din mamma","Din pappa","Din syster","Din broder","Din chef"};
- JList contactList = new JList(TestKontakter);
- contactList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- contactList.setLayoutOrientation(JList.VERTICAL);
- contactList.setSize(500,700);
- mainWindowFrame.add(contactList);
+ _contactListModel = new DefaultListModel();
+ _contactList = new JList(_contactListModel);
+ _contactList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ _contactList.setLayoutOrientation(JList.VERTICAL);
+ _contactList.setSize(500,700);
+ _mainWindowFrame.add(_contactList);
// Sm\x8All upp f\x9Anstret
- mainWindowFrame.setVisible(true);
+ _mainWindowFrame.setVisible(true);
}
}
\ No newline at end of file
Modified: trunk/src/ZeroconfBrowsing.java
===================================================================
--- trunk/src/ZeroconfBrowsing.java 2007-11-06 17:07:38 UTC (rev 30)
+++ trunk/src/ZeroconfBrowsing.java 2007-11-06 18:22:06 UTC (rev 31)
@@ -1,4 +1,8 @@
// TODO
public class ZeroconfBrowsing {
-
+ static XMPPLinkLocalHost[] findXMPPHosts()
+ {
+ XMPPLinkLocalHost[] testArr = {new XMPPLinkLocalHost("192.168.0.1"),new XMPPLinkLocalHost("192.168.0.2")};
+ return testArr;
+ }
}
Modified: trunk/src/ZeroconfRegistration.java
===================================================================
--- trunk/src/ZeroconfRegistration.java 2007-11-06 17:07:38 UTC (rev 30)
+++ trunk/src/ZeroconfRegistration.java 2007-11-06 18:22:06 UTC (rev 31)
@@ -115,7 +115,7 @@
}
static String getLast()
{
- return _txtRecord.getValueAsString("Last");
+ return _txtRecord.getValueAsString("last");
}
static void setLast(String Last)
@@ -123,7 +123,7 @@
{
if (_r!=null)
{
- _txtRecord.set("Last",Last);
+ _txtRecord.set("last",Last);
_r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <zo...@us...> - 2007-11-06 17:07:35
|
Revision: 30
http://zerofile.svn.sourceforge.net/zerofile/?rev=30&view=rev
Author: zondar
Date: 2007-11-06 09:07:38 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Added a checkbox
Modified Paths:
--------------
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-06 16:17:15 UTC (rev 29)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-06 17:07:38 UTC (rev 30)
@@ -14,29 +14,35 @@
settingsWindowFrame.setLayout(new GridLayout(0,2,1,1));
// Label + field for Nickname parameter
- JLabel nickNameLabel = new JLabel("Nickname:");
+ JLabel nickNameLabel = new JLabel("Nickname:", JLabel.CENTER);
JTextField nickNameField = new JTextField();
settingsWindowFrame.add(nickNameLabel);
settingsWindowFrame.add(nickNameField);
// Label + field for First Name parameter
- JLabel firstNameLabel = new JLabel("First name:");
+ JLabel firstNameLabel = new JLabel("First name:", JLabel.CENTER);
JTextField firstNameField = new JTextField();
settingsWindowFrame.add(firstNameLabel);
settingsWindowFrame.add(firstNameField);
// Label + field for Last Name parameter
- JLabel lastNameLabel = new JLabel("Last name:");
+ JLabel lastNameLabel = new JLabel("Last name:", JLabel.CENTER);
JTextField lastNameField = new JTextField();
settingsWindowFrame.add(lastNameLabel);
settingsWindowFrame.add(lastNameField);
// Label + field for Last Name parameter
- JLabel emailLabel = new JLabel("Email:");
+ JLabel emailLabel = new JLabel("Email:", JLabel.CENTER);
JTextField emailField = new JTextField();
settingsWindowFrame.add(emailLabel);
settingsWindowFrame.add(emailField);
+ //Checkbox for auto accept file transfers
+ JLabel checkBoxLabel = new JLabel("Auto accept file transfers", JLabel.CENTER);
+ JCheckBox checkBoxTransfer = new JCheckBox();
+ settingsWindowFrame.add(checkBoxLabel);
+ settingsWindowFrame.add(checkBoxTransfer);
+
// OK and Cancel buttons
JButton okButton = new JButton("OK");
JButton cancelButton = new JButton("Cancel");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 16:47:38
|
Revision: 29
http://zerofile.svn.sourceforge.net/zerofile/?rev=29&view=rev
Author: karl-bengtsson
Date: 2007-11-06 08:17:15 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Further expanded methods in ZeroconfRegistration class
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroconfRegistration.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 15:49:52 UTC (rev 28)
+++ trunk/src/ZeroFile.java 2007-11-06 16:17:15 UTC (rev 29)
@@ -1,4 +1,4 @@
-import java.net.ServerSocket;
+//import java.net.ServerSocket;
public class ZeroFile {
/**
@@ -10,8 +10,11 @@
try
{
// Let system allocate us an available port to listen on
- ServerSocket s = new ServerSocket(0);
- ZeroconfRegistration.registerService(s.getLocalPort());
+ //ServerSocket s = new ServerSocket(0);
+ //ZeroconfRegistration.registerService(s.getLocalPort());
+ ZeroconfRegistration.registerService();
+ ZeroconfRegistration.set1st("Testar");
+ ZeroconfRegistration.setLast("Nisse");
Thread.sleep(5000);
ZeroconfRegistration.setStatus("dnd");
Thread.sleep(15000);
Modified: trunk/src/ZeroconfRegistration.java
===================================================================
--- trunk/src/ZeroconfRegistration.java 2007-11-06 15:49:52 UTC (rev 28)
+++ trunk/src/ZeroconfRegistration.java 2007-11-06 16:17:15 UTC (rev 29)
@@ -31,24 +31,27 @@
});
_txtRecord.set("txtvers", "1");
_txtRecord.set("status",status);
- //_txtRecord.set("email","tes...@te...");
- //_txtRecord.set("jid","te...@te...");
_txtRecord.set("vc","SDUR!XN");
_txtRecord.set("port.p2pj",Integer.toString(port));
- //_txtRecord.set("1st","Nisse");
- //_txtRecord.set("last","Nilsson");
_r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
}
static void registerService(int port)
- throws DNSSDException, InterruptedException
+ throws DNSSDException, InterruptedException
{
ZeroconfRegistration.registerService("avail",port);
}
+ static void registerService()
+ throws DNSSDException, InterruptedException
+ {
+ ZeroconfRegistration.registerService(5222);
+ }
+
static void unregisterService()
{
_r.stop();
+ System.out.println("Deregistered service");
}
static String getStatus()
@@ -57,7 +60,7 @@
}
static void setStatus(String s)
- throws DNSSDException, InterruptedException
+ throws DNSSDException, InterruptedException
{
if (_r != null)
{
@@ -65,4 +68,63 @@
_r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
}
}
+
+ static String getEmail()
+ {
+ return _txtRecord.getValueAsString("email");
+ }
+
+ static void setEmail(String e)
+ throws DNSSDException, InterruptedException
+ {
+ if (_r != null)
+ {
+ _txtRecord.set("email",e);
+ _r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
+ }
+ }
+
+ static String getJID()
+ {
+ return _txtRecord.getValueAsString("jid");
+ }
+
+ static void setJID(String jid)
+ throws DNSSDException, InterruptedException
+ {
+ if (_r != null)
+ {
+ _txtRecord.set("jid",jid);
+ _r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
+ }
+ }
+
+ static String get1st()
+ {
+ return _txtRecord.getValueAsString("1st");
+ }
+
+ static void set1st(String First)
+ throws DNSSDException, InterruptedException
+ {
+ if (_r!=null)
+ {
+ _txtRecord.set("1st",First);
+ _r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
+ }
+ }
+ static String getLast()
+ {
+ return _txtRecord.getValueAsString("Last");
+ }
+
+ static void setLast(String Last)
+ throws DNSSDException, InterruptedException
+ {
+ if (_r!=null)
+ {
+ _txtRecord.set("Last",Last);
+ _r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
+ }
+ }
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 15:49:52
|
Revision: 28
http://zerofile.svn.sourceforge.net/zerofile/?rev=28&view=rev
Author: karl-bengtsson
Date: 2007-11-06 07:49:52 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Maintenance
Modified Paths:
--------------
trunk/src/ZeroFile.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 14:28:26 UTC (rev 27)
+++ trunk/src/ZeroFile.java 2007-11-06 15:49:52 UTC (rev 28)
@@ -1,7 +1,6 @@
import java.net.ServerSocket;
public class ZeroFile {
-
/**
* @param name - The service name used by the registration class. Deprecated. Don't use.
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 14:28:28
|
Revision: 27
http://zerofile.svn.sourceforge.net/zerofile/?rev=27&view=rev
Author: karl-bengtsson
Date: 2007-11-06 06:28:26 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
*) Removed old ZeroConfRegistrationTest
*) Added overloading of serviceRegistered()-method, to make it possible to start registration with fewer arguments.
*) Cleaned up ZeroFile.java
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroconfRegistration.java
Removed Paths:
-------------
trunk/src/ZeroConfRegistrationTest.java
Deleted: trunk/src/ZeroConfRegistrationTest.java
===================================================================
--- trunk/src/ZeroConfRegistrationTest.java 2007-11-06 14:12:44 UTC (rev 26)
+++ trunk/src/ZeroConfRegistrationTest.java 2007-11-06 14:28:26 UTC (rev 27)
@@ -1,64 +0,0 @@
-import com.apple.dnssd.*;
-
-/*
- * This class tests XMPP ZeroConf registration, by registering as
- * providing a _presence._tcp service for about 30 seconds with
- * matching TXT records corresponding with the specification
- * at http://www.xmpp.org/registrar/linklocal.html
- *
- * The main method tests for parameters and handles exceptions.
- * It instantiates a ZeroConfRegistrationTest object, in which
- * the actual code for registering our presence is located.
- *
- * We implement the RegisterListener interface by implementing the
- * operationFailed() and serviceRegistered() methods, which are
- * called when a registration fails or succeeds. This makes it
- * possible to use a this-reference when declaring the listener in
- * the DNSSD.register() operation in the ZeroConfRegistrationTest.
- */
-public class ZeroConfRegistrationTest implements RegisterListener {
- public void serviceRegistered(DNSSDRegistration registration, int flags,
- String serviceName, String regType, String domain)
- {
- System.out.println("Registered Name : " + serviceName);
- System.out.println(" Type : " + regType);
- System.out.println(" Domain: " + domain);
- }
-
- public void operationFailed(DNSSDService service, int errorCode)
- {
- System.out.println("Registration failed: " + errorCode);
- }
-
- public ZeroConfRegistrationTest(String name, int port)
- throws DNSSDException, InterruptedException
- {
- System.out.println("Registration Starting");
- System.out.println("Requested Name: " + name);
- System.out.println(" Port: " + port);
-
- //Create and start a registration for the XMPP service
- DNSSDRegistration r = DNSSD.register(name, "_presence._tcp", port, this);
-
- // Create a TXT record to hold the flags
- TXTRecord txtRecord = new TXTRecord();
-
- // Set all the required TXT flags
- txtRecord.set("txtvers", "1");
- txtRecord.set("status","avail");
- txtRecord.set("email","tes...@te...");
- txtRecord.set("jid","te...@te...");
- txtRecord.set("vc","SDUR!XN");
- txtRecord.set("port.p2pj",""+port);
- txtRecord.set("1st","Nisse");
- txtRecord.set("last","Nilsson");
-
- // Attach the flags to the registration
- r.getTXTRecord().update(0, txtRecord.getRawBytes(), 0);
-
- // Wait thirty seconds, then exit
- Thread.sleep(30000);
- System.out.println("Registration Stopping");
- r.stop( );
- }
-}
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 14:12:44 UTC (rev 26)
+++ trunk/src/ZeroFile.java 2007-11-06 14:28:26 UTC (rev 27)
@@ -1,7 +1,5 @@
import java.net.ServerSocket;
-// Main loop of the program
-
public class ZeroFile {
/**
@@ -19,7 +17,6 @@
ZeroconfRegistration.setStatus("dnd");
Thread.sleep(15000);
ZeroconfRegistration.unregisterService();
- //new ZeroConfRegistrationTest(name, s.getLocalPort( ));
}
catch(Exception e)
{
Modified: trunk/src/ZeroconfRegistration.java
===================================================================
--- trunk/src/ZeroconfRegistration.java 2007-11-06 14:12:44 UTC (rev 26)
+++ trunk/src/ZeroconfRegistration.java 2007-11-06 14:28:26 UTC (rev 27)
@@ -10,7 +10,7 @@
private static TXTRecord _txtRecord = new TXTRecord();
private static DNSSDRegistration _r;
- static void registerService(int port)
+ static void registerService(String status,int port)
throws DNSSDException, InterruptedException
{
_r = DNSSD.register("servicename", "_presence._tcp", port, new RegisterListener()
@@ -30,16 +30,22 @@
}
});
_txtRecord.set("txtvers", "1");
- _txtRecord.set("status","avail");
- _txtRecord.set("email","tes...@te...");
- _txtRecord.set("jid","te...@te...");
+ _txtRecord.set("status",status);
+ //_txtRecord.set("email","tes...@te...");
+ //_txtRecord.set("jid","te...@te...");
_txtRecord.set("vc","SDUR!XN");
- _txtRecord.set("port.p2pj",""+port);
- _txtRecord.set("1st","Nisse");
- _txtRecord.set("last","Nilsson");
+ _txtRecord.set("port.p2pj",Integer.toString(port));
+ //_txtRecord.set("1st","Nisse");
+ //_txtRecord.set("last","Nilsson");
_r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
}
+ static void registerService(int port)
+ throws DNSSDException, InterruptedException
+ {
+ ZeroconfRegistration.registerService("avail",port);
+ }
+
static void unregisterService()
{
_r.stop();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 14:12:43
|
Revision: 26
http://zerofile.svn.sourceforge.net/zerofile/?rev=26&view=rev
Author: karl-bengtsson
Date: 2007-11-06 06:12:44 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Updated the ZeroFile.java to skip any launch arguments
Modified Paths:
--------------
trunk/src/ZeroFile.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 14:03:07 UTC (rev 25)
+++ trunk/src/ZeroFile.java 2007-11-06 14:12:44 UTC (rev 26)
@@ -10,31 +10,21 @@
public static void main(String[] args) {
ZeroFileMainWindow.startMainWindow();
ZeroFileChatWindow.startChatWindow();
- if (args.length > 1)
+ try
{
- System.out.println("Usage: java TestRegister name");
- System.exit(-1);
+ // Let system allocate us an available port to listen on
+ ServerSocket s = new ServerSocket(0);
+ ZeroconfRegistration.registerService(s.getLocalPort());
+ Thread.sleep(5000);
+ ZeroconfRegistration.setStatus("dnd");
+ Thread.sleep(15000);
+ ZeroconfRegistration.unregisterService();
+ //new ZeroConfRegistrationTest(name, s.getLocalPort( ));
}
- else
+ catch(Exception e)
{
- 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);
- ZeroconfRegistration.registerService(s.getLocalPort());
- Thread.sleep(5000);
- ZeroconfRegistration.setStatus("dnd");
- Thread.sleep(15000);
- ZeroconfRegistration.unregisterService();
- //new ZeroConfRegistrationTest(name, s.getLocalPort( ));
- }
- catch(Exception e)
- {
- e.printStackTrace( );
- System.exit(-1);
- }
+ 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-06 14:03:32
|
Revision: 25
http://zerofile.svn.sourceforge.net/zerofile/?rev=25&view=rev
Author: karl-bengtsson
Date: 2007-11-06 06:03:07 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Started moving the registration logic into it's own class using static class methods.
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroconfRegistration.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 12:02:00 UTC (rev 24)
+++ trunk/src/ZeroFile.java 2007-11-06 14:03:07 UTC (rev 25)
@@ -20,10 +20,15 @@
try
{
//If name specified, use it, else use default name
- String name = (args.length > 0) ? args[0] : null;
+ //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( ));
+ ZeroconfRegistration.registerService(s.getLocalPort());
+ Thread.sleep(5000);
+ ZeroconfRegistration.setStatus("dnd");
+ Thread.sleep(15000);
+ ZeroconfRegistration.unregisterService();
+ //new ZeroConfRegistrationTest(name, s.getLocalPort( ));
}
catch(Exception e)
{
Modified: trunk/src/ZeroconfRegistration.java
===================================================================
--- trunk/src/ZeroconfRegistration.java 2007-11-06 12:02:00 UTC (rev 24)
+++ trunk/src/ZeroconfRegistration.java 2007-11-06 14:03:07 UTC (rev 25)
@@ -1,3 +1,5 @@
+import com.apple.dnssd.DNSSD;
+import com.apple.dnssd.DNSSDException;
import com.apple.dnssd.DNSSDRegistration;
import com.apple.dnssd.DNSSDService;
import com.apple.dnssd.RegisterListener;
@@ -3,41 +5,57 @@
import com.apple.dnssd.TXTRecord;
-public class ZeroconfRegistration implements RegisterListener{
- private TXTRecord _TXTRecord = new TXTRecord();
-
- public void serviceRegistered(DNSSDRegistration registration, int flags,
- String serviceName, String regType, String domain)
+public class ZeroconfRegistration
+{
+ private static TXTRecord _txtRecord = new TXTRecord();
+ private static DNSSDRegistration _r;
+
+ static void registerService(int port)
+ throws DNSSDException, InterruptedException
{
- // TODO
- System.out.println("Registered Name : " + serviceName);
- System.out.println(" Type : " + regType);
- System.out.println(" Domain: " + domain);
+ _r = DNSSD.register("servicename", "_presence._tcp", port, new RegisterListener()
+ {
+ public void serviceRegistered(DNSSDRegistration registration, int flags,
+ String serviceName, String regType, String domain)
+ {
+ // TODO
+ System.out.println("Registered Name : " + serviceName);
+ System.out.println(" Type : " + regType);
+ System.out.println(" Domain: " + domain);
+ }
+ public void operationFailed(DNSSDService service, int errorCode)
+ {
+ // TODO
+ System.out.println("Registration failed: " + errorCode);
+ }
+ });
+ _txtRecord.set("txtvers", "1");
+ _txtRecord.set("status","avail");
+ _txtRecord.set("email","tes...@te...");
+ _txtRecord.set("jid","te...@te...");
+ _txtRecord.set("vc","SDUR!XN");
+ _txtRecord.set("port.p2pj",""+port);
+ _txtRecord.set("1st","Nisse");
+ _txtRecord.set("last","Nilsson");
+ _r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
}
- public void operationFailed(DNSSDService service, int errorCode)
+ static void unregisterService()
{
- // TODO
- System.out.println("Registration failed: " + errorCode);
+ _r.stop();
}
- public void registerService()
+ static String getStatus()
{
- // TODO
+ return _txtRecord.getValueAsString("status");
}
- public void unregisterService()
+ static void setStatus(String s)
+ throws DNSSDException, InterruptedException
{
- // TODO
+ if (_r != null)
+ {
+ _txtRecord.set("status", s);
+ _r.getTXTRecord().update(0, _txtRecord.getRawBytes(), 0);
+ }
}
-
- public String getStatus()
- {
- return _TXTRecord.getValueAsString("status");
-
- }
-
- public void setStatus(String s)
- {
- _TXTRecord.set("status", s);
- }
-}
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 12:01:57
|
Revision: 24
http://zerofile.svn.sourceforge.net/zerofile/?rev=24&view=rev
Author: karl-bengtsson
Date: 2007-11-06 04:02:00 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Implemented basic GUI components on the chat window.
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroFileChatWindow.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 11:32:18 UTC (rev 23)
+++ trunk/src/ZeroFile.java 2007-11-06 12:02:00 UTC (rev 24)
@@ -9,6 +9,7 @@
*/
public static void main(String[] args) {
ZeroFileMainWindow.startMainWindow();
+ ZeroFileChatWindow.startChatWindow();
if (args.length > 1)
{
System.out.println("Usage: java TestRegister name");
Modified: trunk/src/ZeroFileChatWindow.java
===================================================================
--- trunk/src/ZeroFileChatWindow.java 2007-11-06 11:32:18 UTC (rev 23)
+++ trunk/src/ZeroFileChatWindow.java 2007-11-06 12:02:00 UTC (rev 24)
@@ -1,15 +1,23 @@
-import java.io.Serializable;
+import java.awt.*;
+import javax.swing.*;
-import javax.swing.JFrame;
-
/**
- *
+ * @author Karl Bengtsson
*/
-
-/**
- * @author karl
- *
- */
-public class ZeroFileChatWindow extends JFrame implements Serializable {
- static final long serialVersionUID = -5208364155946320552L;
+public class ZeroFileChatWindow {
+ static void startChatWindow()
+ {
+ JFrame chatWindowFrame = new JFrame();
+ chatWindowFrame.setLayout(new GridLayout(0,1,1,1));
+ JTextArea chatTextArea = new JTextArea();
+ chatWindowFrame.add(chatTextArea);
+ JPanel bottomPanel = new JPanel();
+ chatWindowFrame.add(bottomPanel);
+ bottomPanel.setLayout(new GridLayout(1,0,1,1));
+ JTextField entryTextField = new JTextField();
+ JButton sendButton = new JButton("Send");
+ bottomPanel.add(entryTextField);
+ bottomPanel.add(sendButton);
+ chatWindowFrame.setVisible(true);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 11:32:14
|
Revision: 23
http://zerofile.svn.sourceforge.net/zerofile/?rev=23&view=rev
Author: karl-bengtsson
Date: 2007-11-06 03:32:18 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Cleaned up the settings window with labels and fields, and a better general design.
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroFileMainWindow.java
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-06 11:03:27 UTC (rev 22)
+++ trunk/src/ZeroFile.java 2007-11-06 11:32:18 UTC (rev 23)
@@ -9,7 +9,6 @@
*/
public static void main(String[] args) {
ZeroFileMainWindow.startMainWindow();
- ZeroFileSettingsWindow Settingsfonster = new ZeroFileSettingsWindow();
if (args.length > 1)
{
System.out.println("Usage: java TestRegister name");
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-06 11:03:27 UTC (rev 22)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 11:32:18 UTC (rev 23)
@@ -18,6 +18,11 @@
JMenu fileMenu = new JMenu("File");
mainMenuBar.add(fileMenu);
JMenuItem settingsMenuItem = new JMenuItem("Settings...");
+ settingsMenuItem.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent e) {
+ ZeroFileSettingsWindow.startSettingsWindow();
+ }
+ });
fileMenu.add(settingsMenuItem);
JMenuItem quitMenuItem = new JMenuItem("Quit");
quitMenuItem.addActionListener(new ActionListener(){
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-06 11:03:27 UTC (rev 22)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-06 11:32:18 UTC (rev 23)
@@ -1,23 +1,49 @@
-import java.io.Serializable;
import javax.swing.*;
import java.awt.*;
/**
* @author Peter
- *
*/
-public class ZeroFileSettingsWindow extends JFrame implements Serializable {
- static final long serialVersionUID = -5208364155946320552L;
-
- public ZeroFileSettingsWindow()
- {
- this.setSize(new Dimension(200,200));
- this.setLayout(new GridLayout(1,2));
- JButton Button1 = new JButton("OK");
- JButton Button2 = new JButton("Cancel");
- Button1.setSize(40, 20);
- this.add(Button1);
- this.add(Button2);
- this.setVisible(true);
+public class ZeroFileSettingsWindow
+{
+ static void startSettingsWindow()
+ {
+ JFrame settingsWindowFrame = new JFrame();
+ settingsWindowFrame.setSize(new Dimension(300,200));
+ settingsWindowFrame.setResizable(false);
+ settingsWindowFrame.setLayout(new GridLayout(0,2,1,1));
+
+ // Label + field for Nickname parameter
+ JLabel nickNameLabel = new JLabel("Nickname:");
+ JTextField nickNameField = new JTextField();
+ settingsWindowFrame.add(nickNameLabel);
+ settingsWindowFrame.add(nickNameField);
+
+ // Label + field for First Name parameter
+ JLabel firstNameLabel = new JLabel("First name:");
+ JTextField firstNameField = new JTextField();
+ settingsWindowFrame.add(firstNameLabel);
+ settingsWindowFrame.add(firstNameField);
+
+ // Label + field for Last Name parameter
+ JLabel lastNameLabel = new JLabel("Last name:");
+ JTextField lastNameField = new JTextField();
+ settingsWindowFrame.add(lastNameLabel);
+ settingsWindowFrame.add(lastNameField);
+
+ // Label + field for Last Name parameter
+ JLabel emailLabel = new JLabel("Email:");
+ JTextField emailField = new JTextField();
+ settingsWindowFrame.add(emailLabel);
+ settingsWindowFrame.add(emailField);
+
+ // OK and Cancel buttons
+ JButton okButton = new JButton("OK");
+ JButton cancelButton = new JButton("Cancel");
+ settingsWindowFrame.add(okButton);
+ settingsWindowFrame.add(cancelButton);
+
+ // Show the window
+ settingsWindowFrame.setVisible(true);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 11:03:23
|
Revision: 22
http://zerofile.svn.sourceforge.net/zerofile/?rev=22&view=rev
Author: karl-bengtsson
Date: 2007-11-06 03:03:27 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Bound the main window quit menu item and the main window close button to system.exit(), causing proper shutdown.
Modified Paths:
--------------
trunk/src/ZeroFileMainWindow.java
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-06 10:44:22 UTC (rev 21)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 11:03:27 UTC (rev 22)
@@ -1,15 +1,17 @@
import java.awt.*;
+import java.awt.event.*;
import javax.swing.*;
-public class ZeroFileMainWindow
+public class ZeroFileMainWindow
{
/**
* @author Karl Bengtsson
*/
- static void startMainWindow()
+ static void startMainWindow()
{
// Grundkittet, JFrame + JMenuBar
JFrame mainWindowFrame = new JFrame();
+ mainWindowFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JMenuBar mainMenuBar = new JMenuBar();
// File menu
@@ -18,6 +20,11 @@
JMenuItem settingsMenuItem = new JMenuItem("Settings...");
fileMenu.add(settingsMenuItem);
JMenuItem quitMenuItem = new JMenuItem("Quit");
+ quitMenuItem.addActionListener(new ActionListener(){
+ public void actionPerformed(ActionEvent e) {
+ System.exit(1);
+ }
+ });
fileMenu.add(quitMenuItem);
// Help menu
@@ -46,8 +53,7 @@
contactList.setSize(500,700);
mainWindowFrame.add(contactList);
- //for (int i = 0; i<12; i++)
- // mainWindowFrame.add(new JButton("Button #"+i));
+ // Sm\x8All upp f\x9Anstret
mainWindowFrame.setVisible(true);
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2007-11-06 10:44:31
|
Revision: 21
http://zerofile.svn.sourceforge.net/zerofile/?rev=21&view=rev
Author: elpedr0
Date: 2007-11-06 02:44:22 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
messed around with the window
Modified Paths:
--------------
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-06 10:42:14 UTC (rev 20)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-06 10:44:22 UTC (rev 21)
@@ -11,8 +11,13 @@
public ZeroFileSettingsWindow()
{
- JButton Button1 = new JButton();
+ this.setSize(new Dimension(200,200));
+ this.setLayout(new GridLayout(1,2));
+ JButton Button1 = new JButton("OK");
+ JButton Button2 = new JButton("Cancel");
+ Button1.setSize(40, 20);
this.add(Button1);
+ this.add(Button2);
this.setVisible(true);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 10:42:15
|
Revision: 20
http://zerofile.svn.sourceforge.net/zerofile/?rev=20&view=rev
Author: karl-bengtsson
Date: 2007-11-06 02:42:14 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
Added a help menu, status list, and contact list to the main window.
Modified Paths:
--------------
trunk/src/ZeroFileMainWindow.java
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-06 10:14:00 UTC (rev 19)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 10:42:14 UTC (rev 20)
@@ -8,20 +8,46 @@
*/
static void startMainWindow()
{
+ // Grundkittet, JFrame + JMenuBar
JFrame mainWindowFrame = new JFrame();
JMenuBar mainMenuBar = new JMenuBar();
+
+ // File menu
JMenu fileMenu = new JMenu("File");
mainMenuBar.add(fileMenu);
JMenuItem settingsMenuItem = new JMenuItem("Settings...");
fileMenu.add(settingsMenuItem);
JMenuItem quitMenuItem = new JMenuItem("Quit");
fileMenu.add(quitMenuItem);
+
+ // Help menu
+ JMenu helpMenu = new JMenu("Help");
+ mainMenuBar.add(helpMenu);
+ JMenuItem aboutMenuItem = new JMenuItem("About..");
+ helpMenu.add(aboutMenuItem);
+
+ // Layout, storlekar, samt koppling av JMenuBar
mainWindowFrame.setLayout(new GridLayout(0,1,1,1));
mainWindowFrame.setMinimumSize(new Dimension(120,300));
mainWindowFrame.setSize(new Dimension(150,400));
mainWindowFrame.setJMenuBar(mainMenuBar);
- for (int i = 0; i<12; i++)
- mainWindowFrame.add(new JButton("Button #"+i));
+
+ // Statuslista
+ String[] statusModes = {"Available","Away","Do not disturb"};
+ JComboBox statusLista = new JComboBox(statusModes);
+ statusLista.setMaximumSize(new Dimension(20,100));
+ mainWindowFrame.add(statusLista);
+
+ // Kontaktlista
+ String[] TestKontakter = {"Din mamma","Din pappa","Din syster","Din broder","Din chef"};
+ JList contactList = new JList(TestKontakter);
+ contactList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ contactList.setLayoutOrientation(JList.VERTICAL);
+ contactList.setSize(500,700);
+ mainWindowFrame.add(contactList);
+
+ //for (int i = 0; i<12; i++)
+ // mainWindowFrame.add(new JButton("Button #"+i));
mainWindowFrame.setVisible(true);
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-06 10:13:57
|
Revision: 19
http://zerofile.svn.sourceforge.net/zerofile/?rev=19&view=rev
Author: karl-bengtsson
Date: 2007-11-06 02:14:00 -0800 (Tue, 06 Nov 2007)
Log Message:
-----------
*) Changed the ZeroFileMainWindow class from inheriting from JFrame to being a static class with class methods instantiating all the required GUI components. This is cleaner.
*) Added some comments for Javadoc
*) Removed deprecated stuff from the main ZeroFile.java file
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroFileMainWindow.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-05 15:55:17 UTC (rev 18)
+++ trunk/src/ZeroFile.java 2007-11-06 10:14:00 UTC (rev 19)
@@ -5,11 +5,10 @@
public class ZeroFile {
/**
- * @param args
+ * @param name - The service name used by the registration class. Deprecated. Don't use.
*/
public static void main(String[] args) {
- ZeroFileMainWindow Huvudfonster = new ZeroFileMainWindow();
- Huvudfonster.setVisible(true);
+ ZeroFileMainWindow.startMainWindow();
ZeroFileSettingsWindow Settingsfonster = new ZeroFileSettingsWindow();
if (args.length > 1)
{
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-05 15:55:17 UTC (rev 18)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-06 10:14:00 UTC (rev 19)
@@ -1,13 +1,14 @@
-// The class defining the main GUI window
-
import java.awt.*;
import javax.swing.*;
-public class ZeroFileMainWindow extends JFrame implements java.io.Serializable
+public class ZeroFileMainWindow
{
- static final long serialVersionUID = -5208364155946320552L;
- public ZeroFileMainWindow ()
+ /**
+ * @author Karl Bengtsson
+ */
+ static void startMainWindow()
{
+ JFrame mainWindowFrame = new JFrame();
JMenuBar mainMenuBar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
mainMenuBar.add(fileMenu);
@@ -15,11 +16,12 @@
fileMenu.add(settingsMenuItem);
JMenuItem quitMenuItem = new JMenuItem("Quit");
fileMenu.add(quitMenuItem);
- this.setLayout(new GridLayout(0,1,1,1));
- this.setMinimumSize(new Dimension(120,300));
- this.setSize(new Dimension(150,400));
- this.setJMenuBar(mainMenuBar);
+ mainWindowFrame.setLayout(new GridLayout(0,1,1,1));
+ mainWindowFrame.setMinimumSize(new Dimension(120,300));
+ mainWindowFrame.setSize(new Dimension(150,400));
+ mainWindowFrame.setJMenuBar(mainMenuBar);
for (int i = 0; i<12; i++)
- this.add(new JButton("Button #"+i));
+ mainWindowFrame.add(new JButton("Button #"+i));
+ mainWindowFrame.setVisible(true);
}
}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2007-11-05 15:55:25
|
Revision: 18
http://zerofile.svn.sourceforge.net/zerofile/?rev=18&view=rev
Author: elpedr0
Date: 2007-11-05 07:55:17 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
Added a settingwindow with a button that popsup when you start the application.
Modified Paths:
--------------
trunk/src/ZeroFile.java
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFile.java
===================================================================
--- trunk/src/ZeroFile.java 2007-11-05 15:25:41 UTC (rev 17)
+++ trunk/src/ZeroFile.java 2007-11-05 15:55:17 UTC (rev 18)
@@ -10,6 +10,7 @@
public static void main(String[] args) {
ZeroFileMainWindow Huvudfonster = new ZeroFileMainWindow();
Huvudfonster.setVisible(true);
+ ZeroFileSettingsWindow Settingsfonster = new ZeroFileSettingsWindow();
if (args.length > 1)
{
System.out.println("Usage: java TestRegister name");
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:25:41 UTC (rev 17)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:55:17 UTC (rev 18)
@@ -1,5 +1,6 @@
import java.io.Serializable;
-import javax.swing.JFrame;
+import javax.swing.*;
+import java.awt.*;
/**
* @author Peter
@@ -7,4 +8,11 @@
*/
public class ZeroFileSettingsWindow extends JFrame implements Serializable {
static final long serialVersionUID = -5208364155946320552L;
+
+ public ZeroFileSettingsWindow()
+ {
+ JButton Button1 = new JButton();
+ this.add(Button1);
+ this.setVisible(true);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-05 15:25:41
|
Revision: 17
http://zerofile.svn.sourceforge.net/zerofile/?rev=17&view=rev
Author: karl-bengtsson
Date: 2007-11-05 07:25:41 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
*) Made all attributes and methods in ZeroFileSettings static, class attributes/methods (this class does not need to be instantiated)
*) Added chat window class stub
*) Removed inappropriate comments from the source code
Modified Paths:
--------------
trunk/src/ZeroFileSettings.java
trunk/src/ZeroFileSettingsWindow.java
Added Paths:
-----------
trunk/src/ZeroFileChatWindow.java
Added: trunk/src/ZeroFileChatWindow.java
===================================================================
--- trunk/src/ZeroFileChatWindow.java (rev 0)
+++ trunk/src/ZeroFileChatWindow.java 2007-11-05 15:25:41 UTC (rev 17)
@@ -0,0 +1,15 @@
+import java.io.Serializable;
+
+import javax.swing.JFrame;
+
+/**
+ *
+ */
+
+/**
+ * @author karl
+ *
+ */
+public class ZeroFileChatWindow extends JFrame implements Serializable {
+ static final long serialVersionUID = -5208364155946320552L;
+}
Modified: trunk/src/ZeroFileSettings.java
===================================================================
--- trunk/src/ZeroFileSettings.java 2007-11-05 15:16:26 UTC (rev 16)
+++ trunk/src/ZeroFileSettings.java 2007-11-05 15:25:41 UTC (rev 17)
@@ -2,58 +2,58 @@
* At present, all it holds are a bunch of getters and setters.
*/
public class ZeroFileSettings {
- private String _nickName;
- private String _firstName;
- private String _lastName;
- private String _email;
- private int _mainPort;
+ private static String _nickName;
+ private static String _firstName;
+ private static String _lastName;
+ private static String _email;
+ private static int _mainPort;
- public String getNickName()
+ public static String getNickName()
{
return _nickName;
}
- public void setNickName(String n)
+ public static void setNickName(String n)
{
_nickName = n;
}
- public String getFirstName()
+ public static String getFirstName()
{
return _firstName;
}
- public void setFirstName(String f)
+ public static void setFirstName(String f)
{
_firstName = f;
}
- public String getLastName()
+ public static String getLastName()
{
return _lastName;
}
- public void setLastName(String l)
+ public static void setLastName(String l)
{
_nickName = l;
}
- public String getEmail()
+ public static String getEmail()
{
return _email;
}
- public void setEmail(String e)
+ public static void setEmail(String e)
{
_email = e;
}
- public int getMainPort()
+ public static int getMainPort()
{
return _mainPort;
}
- public void setMainPort(int p)
+ public static void setMainPort(int p)
{
_mainPort = p;
}
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:16:26 UTC (rev 16)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:25:41 UTC (rev 17)
@@ -1,16 +1,7 @@
-
-/*
- * Din mamma!
- */
-
import java.io.Serializable;
import javax.swing.JFrame;
/**
- *
- */
-//hej
-/**
* @author Peter
*
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2007-11-05 15:16:29
|
Revision: 16
http://zerofile.svn.sourceforge.net/zerofile/?rev=16&view=rev
Author: elpedr0
Date: 2007-11-05 07:16:26 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
update
Modified Paths:
--------------
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:13:34 UTC (rev 15)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:16:26 UTC (rev 16)
@@ -9,7 +9,7 @@
/**
*
*/
-
+//hej
/**
* @author Peter
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-05 15:13:30
|
Revision: 15
http://zerofile.svn.sourceforge.net/zerofile/?rev=15&view=rev
Author: karl-bengtsson
Date: 2007-11-05 07:13:34 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
Testing SVN collision detection
Modified Paths:
--------------
trunk/src/ZeroFileSettingsWindow.java
Modified: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:11:23 UTC (rev 14)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:13:34 UTC (rev 15)
@@ -1,5 +1,9 @@
+
+/*
+ * Din mamma!
+ */
+
import java.io.Serializable;
-
import javax.swing.JFrame;
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <el...@us...> - 2007-11-05 15:11:23
|
Revision: 14
http://zerofile.svn.sourceforge.net/zerofile/?rev=14&view=rev
Author: elpedr0
Date: 2007-11-05 07:11:23 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
Made a new settingswindow
Added Paths:
-----------
trunk/src/ZeroFileSettingsWindow.java
Added: trunk/src/ZeroFileSettingsWindow.java
===================================================================
--- trunk/src/ZeroFileSettingsWindow.java (rev 0)
+++ trunk/src/ZeroFileSettingsWindow.java 2007-11-05 15:11:23 UTC (rev 14)
@@ -0,0 +1,15 @@
+import java.io.Serializable;
+
+import javax.swing.JFrame;
+
+/**
+ *
+ */
+
+/**
+ * @author Peter
+ *
+ */
+public class ZeroFileSettingsWindow extends JFrame implements Serializable {
+ static final long serialVersionUID = -5208364155946320552L;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-05 13:43:04
|
Revision: 13
http://zerofile.svn.sourceforge.net/zerofile/?rev=13&view=rev
Author: karl-bengtsson
Date: 2007-11-05 05:43:05 -0800 (Mon, 05 Nov 2007)
Log Message:
-----------
Added "Quit" menu item to the GUI.
Modified Paths:
--------------
trunk/src/ZeroFileMainWindow.java
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-03 20:03:06 UTC (rev 12)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-05 13:43:05 UTC (rev 13)
@@ -13,6 +13,8 @@
mainMenuBar.add(fileMenu);
JMenuItem settingsMenuItem = new JMenuItem("Settings...");
fileMenu.add(settingsMenuItem);
+ JMenuItem quitMenuItem = new JMenuItem("Quit");
+ fileMenu.add(quitMenuItem);
this.setLayout(new GridLayout(0,1,1,1));
this.setMinimumSize(new Dimension(120,300));
this.setSize(new Dimension(150,400));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <kar...@us...> - 2007-11-03 20:03:06
|
Revision: 12
http://zerofile.svn.sourceforge.net/zerofile/?rev=12&view=rev
Author: karl-bengtsson
Date: 2007-11-03 13:03:06 -0700 (Sat, 03 Nov 2007)
Log Message:
-----------
A bunch of changes to structure up the classes and prepare for actual codng to begin. Added class definitions (but not much implementation) to handle zeroconf registration and browsing, and application settings.
Modified Paths:
--------------
trunk/src/XMPPLinkLocalSession.java
trunk/src/ZeroFileMainWindow.java
Added Paths:
-----------
trunk/src/ZeroFileSettings.java
trunk/src/ZeroconfBrowsing.java
trunk/src/ZeroconfRegistration.java
Modified: trunk/src/XMPPLinkLocalSession.java
===================================================================
--- trunk/src/XMPPLinkLocalSession.java 2007-11-03 18:59:30 UTC (rev 11)
+++ trunk/src/XMPPLinkLocalSession.java 2007-11-03 20:03:06 UTC (rev 12)
@@ -1,4 +1,8 @@
-// Stub class, to be the base for our actual chat sessions
+/* Stub class, to be the base for our actual chat sessions
+* Should perhaps be renamed to indicate that this is actually a
+* chat session?
+*/
+
public class XMPPLinkLocalSession {
}
Modified: trunk/src/ZeroFileMainWindow.java
===================================================================
--- trunk/src/ZeroFileMainWindow.java 2007-11-03 18:59:30 UTC (rev 11)
+++ trunk/src/ZeroFileMainWindow.java 2007-11-03 20:03:06 UTC (rev 12)
@@ -1,4 +1,5 @@
// The class defining the main GUI window
+
import java.awt.*;
import javax.swing.*;
Added: trunk/src/ZeroFileSettings.java
===================================================================
--- trunk/src/ZeroFileSettings.java (rev 0)
+++ trunk/src/ZeroFileSettings.java 2007-11-03 20:03:06 UTC (rev 12)
@@ -0,0 +1,60 @@
+/* Settings for the program are stored in this class. Or something.
+ * At present, all it holds are a bunch of getters and setters.
+ */
+public class ZeroFileSettings {
+ private String _nickName;
+ private String _firstName;
+ private String _lastName;
+ private String _email;
+ private int _mainPort;
+
+ public String getNickName()
+ {
+ return _nickName;
+ }
+
+ public void setNickName(String n)
+ {
+ _nickName = n;
+ }
+
+ public String getFirstName()
+ {
+ return _firstName;
+ }
+
+ public void setFirstName(String f)
+ {
+ _firstName = f;
+ }
+
+ public String getLastName()
+ {
+ return _lastName;
+ }
+
+ public void setLastName(String l)
+ {
+ _nickName = l;
+ }
+
+ public String getEmail()
+ {
+ return _email;
+ }
+
+ public void setEmail(String e)
+ {
+ _email = e;
+ }
+
+ public int getMainPort()
+ {
+ return _mainPort;
+ }
+
+ public void setMainPort(int p)
+ {
+ _mainPort = p;
+ }
+}
Added: trunk/src/ZeroconfBrowsing.java
===================================================================
--- trunk/src/ZeroconfBrowsing.java (rev 0)
+++ trunk/src/ZeroconfBrowsing.java 2007-11-03 20:03:06 UTC (rev 12)
@@ -0,0 +1,4 @@
+// TODO
+public class ZeroconfBrowsing {
+
+}
Added: trunk/src/ZeroconfRegistration.java
===================================================================
--- trunk/src/ZeroconfRegistration.java (rev 0)
+++ trunk/src/ZeroconfRegistration.java 2007-11-03 20:03:06 UTC (rev 12)
@@ -0,0 +1,44 @@
+import com.apple.dnssd.DNSSDRegistration;
+import com.apple.dnssd.DNSSDService;
+import com.apple.dnssd.RegisterListener;
+import com.apple.dnssd.TXTRecord;
+
+public class ZeroconfRegistration implements RegisterListener{
+ private TXTRecord _TXTRecord = new TXTRecord();
+
+ public void serviceRegistered(DNSSDRegistration registration, int flags,
+ String serviceName, String regType, String domain)
+ {
+ // TODO
+ System.out.println("Registered Name : " + serviceName);
+ System.out.println(" Type : " + regType);
+ System.out.println(" Domain: " + domain);
+ }
+
+ public void operationFailed(DNSSDService service, int errorCode)
+ {
+ // TODO
+ System.out.println("Registration failed: " + errorCode);
+ }
+
+ public void registerService()
+ {
+ // TODO
+ }
+
+ public void unregisterService()
+ {
+ // TODO
+ }
+
+ public String getStatus()
+ {
+ return _TXTRecord.getValueAsString("status");
+
+ }
+
+ public void setStatus(String s)
+ {
+ _TXTRecord.set("status", s);
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|