working on group leader -> group leader connectivity
git-svn-id: svn://anubis/gvsu@56 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
d7ebcf68d9
commit
dd4be30846
@ -35,6 +35,8 @@ public class KaZaGUI extends JFrame
|
|||||||
private JLabel m_serverClientsLabel;
|
private JLabel m_serverClientsLabel;
|
||||||
private JLabel m_serverStatusLabel;
|
private JLabel m_serverStatusLabel;
|
||||||
private JButton m_serverStartButton;
|
private JButton m_serverStartButton;
|
||||||
|
private JTextField m_serverPeerAddressField;
|
||||||
|
private JButton m_serverPeerConnectButton;
|
||||||
|
|
||||||
public KaZaGUI()
|
public KaZaGUI()
|
||||||
{
|
{
|
||||||
@ -160,6 +162,14 @@ public class KaZaGUI extends JFrame
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (e.getSource() == m_serverPeerConnectButton)
|
||||||
|
{
|
||||||
|
if (m_server != null)
|
||||||
|
{
|
||||||
|
m_server.connectToPeerGroupLeader(
|
||||||
|
m_serverPeerAddressField.getText());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,27 +274,32 @@ public class KaZaGUI extends JFrame
|
|||||||
|
|
||||||
JPanel clientPanel = new JPanel();
|
JPanel clientPanel = new JPanel();
|
||||||
clientPanel.setLayout(new BoxLayout(clientPanel, BoxLayout.Y_AXIS));
|
clientPanel.setLayout(new BoxLayout(clientPanel, BoxLayout.Y_AXIS));
|
||||||
|
|
||||||
JPanel p = new JPanel();
|
JPanel p = new JPanel();
|
||||||
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
p.add(new JLabel("User name: "));
|
p.add(new JLabel("User name: "));
|
||||||
p.add(m_userNameField);
|
p.add(m_userNameField);
|
||||||
clientPanel.add(p);
|
clientPanel.add(p);
|
||||||
|
|
||||||
p = new JPanel();
|
p = new JPanel();
|
||||||
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
p.add(new JLabel("Connection speed: "));
|
p.add(new JLabel("Connection speed: "));
|
||||||
p.add(m_speedCombo);
|
p.add(m_speedCombo);
|
||||||
clientPanel.add(p);
|
clientPanel.add(p);
|
||||||
|
|
||||||
p = new JPanel();
|
p = new JPanel();
|
||||||
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
p.add(new JLabel("Shared folder: "));
|
p.add(new JLabel("Shared folder: "));
|
||||||
p.add(m_shareFolderField);
|
p.add(m_shareFolderField);
|
||||||
p.add(m_browseButton);
|
p.add(m_browseButton);
|
||||||
clientPanel.add(p);
|
clientPanel.add(p);
|
||||||
|
|
||||||
p = new JPanel();
|
p = new JPanel();
|
||||||
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
p.add(new JLabel("Server: "));
|
p.add(new JLabel("Server: "));
|
||||||
p.add(m_serverNameField);
|
p.add(m_serverNameField);
|
||||||
clientPanel.add(p);
|
clientPanel.add(p);
|
||||||
|
|
||||||
p = new JPanel();
|
p = new JPanel();
|
||||||
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
p.add(new JLabel("Search query: "));
|
p.add(new JLabel("Search query: "));
|
||||||
@ -292,6 +307,7 @@ public class KaZaGUI extends JFrame
|
|||||||
p.add(m_searchButton);
|
p.add(m_searchButton);
|
||||||
clientPanel.add(p);
|
clientPanel.add(p);
|
||||||
clientPanel.add(m_searchResultsPanel);
|
clientPanel.add(m_searchResultsPanel);
|
||||||
|
|
||||||
p = new JPanel();
|
p = new JPanel();
|
||||||
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
p.add(m_statusLabel);
|
p.add(m_statusLabel);
|
||||||
@ -334,6 +350,9 @@ public class KaZaGUI extends JFrame
|
|||||||
m_serverStartButton = new JButton("Start MNH Server");
|
m_serverStartButton = new JButton("Start MNH Server");
|
||||||
m_serverStartButton.addActionListener(m_handler);
|
m_serverStartButton.addActionListener(m_handler);
|
||||||
m_serverClientsLabel = new JLabel("Server Not Running");
|
m_serverClientsLabel = new JLabel("Server Not Running");
|
||||||
|
m_serverPeerAddressField = new JTextField();
|
||||||
|
m_serverPeerConnectButton = new JButton("Connect");
|
||||||
|
m_serverPeerConnectButton.addActionListener(m_handler);
|
||||||
|
|
||||||
JPanel serverPanel = new JPanel();
|
JPanel serverPanel = new JPanel();
|
||||||
serverPanel.setLayout(new BoxLayout(serverPanel, BoxLayout.Y_AXIS));
|
serverPanel.setLayout(new BoxLayout(serverPanel, BoxLayout.Y_AXIS));
|
||||||
@ -343,6 +362,14 @@ public class KaZaGUI extends JFrame
|
|||||||
p.add(new Box.Filler(new Dimension(0, 0), new Dimension(Short.MAX_VALUE, 0),
|
p.add(new Box.Filler(new Dimension(0, 0), new Dimension(Short.MAX_VALUE, 0),
|
||||||
new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)));
|
new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)));
|
||||||
serverPanel.add(p);
|
serverPanel.add(p);
|
||||||
|
|
||||||
|
p = new JPanel();
|
||||||
|
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
|
||||||
|
p.add(new JLabel("Peer Group Leader to link to: "));
|
||||||
|
p.add(m_serverPeerAddressField);
|
||||||
|
p.add(m_serverPeerConnectButton);
|
||||||
|
serverPanel.add(p);
|
||||||
|
|
||||||
serverPanel.add(new Box.Filler(new Dimension(0, 0),
|
serverPanel.add(new Box.Filler(new Dimension(0, 0),
|
||||||
new Dimension(0, Short.MAX_VALUE),
|
new Dimension(0, Short.MAX_VALUE),
|
||||||
new Dimension(Short.MAX_VALUE,
|
new Dimension(Short.MAX_VALUE,
|
||||||
@ -355,6 +382,7 @@ public class KaZaGUI extends JFrame
|
|||||||
new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)));
|
new Dimension(Short.MAX_VALUE, Short.MAX_VALUE)));
|
||||||
p.add(m_serverStartButton);
|
p.add(m_serverStartButton);
|
||||||
serverPanel.add(p);
|
serverPanel.add(p);
|
||||||
|
|
||||||
return serverPanel;
|
return serverPanel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,9 @@ public class KaZaServer implements Runnable
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
String peerResults =
|
String peerResults =
|
||||||
getSearchResultsFromPeerGroupLeader(s, depth-1, query);
|
getSearchResultsFromPeerGroupLeader(
|
||||||
|
m_peerGroupLeaders.elementAt(i),
|
||||||
|
depth-1, query);
|
||||||
results += peerResults;
|
results += peerResults;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user