[Mongobrowser-commit] SF.net SVN: mongobrowser:[121] trunk/mongobrowser/src/com/mebigfatguy/ mongo
Status: Pre-Alpha
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2010-01-03 05:03:49
|
Revision: 121
http://mongobrowser.svn.sourceforge.net/mongobrowser/?rev=121&view=rev
Author: dbrosius
Date: 2010-01-03 05:03:29 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/mongobrowser/src/com/mebigfatguy/mongobrowser/dialogs/ConnectionDialog.java
Modified: trunk/mongobrowser/src/com/mebigfatguy/mongobrowser/dialogs/ConnectionDialog.java
===================================================================
--- trunk/mongobrowser/src/com/mebigfatguy/mongobrowser/dialogs/ConnectionDialog.java 2010-01-03 05:00:20 UTC (rev 120)
+++ trunk/mongobrowser/src/com/mebigfatguy/mongobrowser/dialogs/ConnectionDialog.java 2010-01-03 05:03:29 UTC (rev 121)
@@ -36,6 +36,9 @@
import com.jgoodies.forms.layout.FormLayout;
import com.mebigfatguy.mongobrowser.MongoBundle;
+/**
+ * a dialog for requesting server and port information for a mongo server
+ */
public class ConnectionDialog extends JDialog {
private static final long serialVersionUID = -3210253285939498235L;
@@ -45,6 +48,9 @@
private JButton cancelButton;
private boolean ok = false;
+ /**
+ * constructs the dialog
+ */
public ConnectionDialog() {
setTitle(MongoBundle.getString(MongoBundle.Key.ConnectToServer));
initComponents();
@@ -52,14 +58,21 @@
pack();
}
+ /**
+ * creates and lays out the components
+ */
private void initComponents() {
Container cp = getContentPane();
cp.setLayout(new BorderLayout(4, 4));
cp.add(createFormPanel(), BorderLayout.CENTER);
cp.add(createCtrlPanel(), BorderLayout.SOUTH);
-
}
+ /**
+ * create the panel that houses the input form
+ *
+ * @return the form panel
+ */
private JPanel createFormPanel() {
JPanel p = new JPanel();
p.setLayout(new FormLayout("6dlu, pref, 5dlu, 200px, 6dlu", "6dlu, pref, 2dlu, pref, 6dlu"));
@@ -87,6 +100,11 @@
return p;
}
+ /**
+ * creates the panel that houses the ok and cancel buttons
+ *
+ * @return the control panel
+ */
private JPanel createCtrlPanel() {
JPanel p = new JPanel();
p.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
@@ -104,6 +122,9 @@
return p;
}
+ /**
+ * initializes the event listeners
+ */
private void initListeners() {
okButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
@@ -119,14 +140,29 @@
});
}
+ /**
+ * retrieves whether or not the user clicked the ok button
+ *
+ * @return if the user clicked the ok button
+ */
public boolean isOK() {
return ok;
}
+ /**
+ * get the user supplied host name of the server
+ *
+ * @return the host name or ip address of the server
+ */
public String getHost() {
return serverField.getText();
}
+ /**
+ * get the user supplied port of the server
+ *
+ * @return the port of the server
+ */
public int getPort() {
return Integer.parseInt(portField.getText());
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|