X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fgui%2FEditNodeDialog.java;h=260466ebc0bace48f80adfe9eda8940238102eca;hb=010e39aacf7769db05545c166edb222d212a3dae;hp=12c91cba5069d50c5518deaf5f240a4c78fa47e8;hpb=86e89a98ea5bd97c007db7061cd65491320587cc;p=jSite2.git
diff --git a/src/net/pterodactylus/jsite/gui/EditNodeDialog.java b/src/net/pterodactylus/jsite/gui/EditNodeDialog.java
index 12c91cb..260466e 100644
--- a/src/net/pterodactylus/jsite/gui/EditNodeDialog.java
+++ b/src/net/pterodactylus/jsite/gui/EditNodeDialog.java
@@ -30,7 +30,6 @@ import java.net.UnknownHostException;
import javax.swing.BorderFactory;
import javax.swing.JButton;
-import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
@@ -46,7 +45,7 @@ import net.pterodactylus.util.swing.SwingUtils;
/**
* Dialog that lets the user edit the properties of a node.
- *
+ *
* @author David âBombeâ Roden <bombe@freenetproject.org>
* @version $Id$
*/
@@ -61,9 +60,6 @@ public class EditNodeDialog extends JDialog implements I18nable {
/** The FNP port number of the node. */
private int port;
- /** Whether the node is on the same machine. */
- private boolean sameMachine;
-
/** Action of the okay button. */
private I18nAction okayAction;
@@ -88,18 +84,12 @@ public class EditNodeDialog extends JDialog implements I18nable {
/** The port textfield. */
private JTextField portTextField;
- /** The same machine checkbox. */
- private JCheckBox sameMachineCheckBox;
-
- /** The same machine action. */
- private I18nAction sameMachineAction;
-
/** Whether the dialog was cancelled. */
private boolean cancelled;
/**
* Creates a new node edit dialog with the given parent.
- *
+ *
* @param parentDialog
* The parent dialog of this dialog
*/
@@ -118,7 +108,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Returns the user-given name of the node.
- *
+ *
* @return The user-given name of the node
*/
public String getNodeName() {
@@ -127,7 +117,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Sets the user-given name of the node.
- *
+ *
* @param name
* The name of the node
*/
@@ -138,7 +128,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Returns the hostname of the node.
- *
+ *
* @return The hostname of the node
*/
public String getNodeHostname() {
@@ -147,7 +137,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Sets the hostname of the node.
- *
+ *
* @param hostname
* The hostname of the node
*/
@@ -158,7 +148,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Returns the FCP port number of the node.
- *
+ *
* @return The FCP port number of the node
*/
public int getNodePort() {
@@ -167,7 +157,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Sets the FCP port number of the node.
- *
+ *
* @param port
* The FCP port number of the node
*/
@@ -177,30 +167,8 @@ public class EditNodeDialog extends JDialog implements I18nable {
}
/**
- * Returns whether the node is on the same machine as jSite.
- *
- * @return true
if the node is on the same machine as jSite,
- * false
otherwise
- */
- public boolean isNodeOnSameMachine() {
- return sameMachine;
- }
-
- /**
- * Sets whether the node is on the same machine as jSite.
- *
- * @param sameMachine
- * true
if the node is on the same machine as
- * jSite, false
otherwise
- */
- public void setNodeOnSameMachine(boolean sameMachine) {
- this.sameMachine = sameMachine;
- sameMachineCheckBox.setSelected(sameMachine);
- }
-
- /**
* Returns whether the dialog was cancelled.
- *
+ *
* @return true
if the dialog was cancelled,
* false
if the user clicked âokayâ
*/
@@ -236,12 +204,6 @@ public class EditNodeDialog extends JDialog implements I18nable {
cancel();
}
};
- sameMachineAction = new I18nAction("editNodeDialog.checkbox.sameMachine") {
-
- public void actionPerformed(ActionEvent e) {
- /* don't do anything. */
- }
- };
}
/**
@@ -266,18 +228,17 @@ public class EditNodeDialog extends JDialog implements I18nable {
nameTextField = new JTextField();
contentPanel.add(nameLabel = new I18nLabel("editNodeDialog.label.name", nameTextField), new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
- contentPanel.add(nameTextField, new GridBagConstraints(1, 0, 1, 1, 1, 0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 12, 0, 0), 0, 0));
+ contentPanel.add(nameTextField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(0, 12, 0, 0), 0, 0));
hostnameTextField = new JTextField();
contentPanel.add(hostnameLabel = new I18nLabel("editNodeDialog.label.hostname", hostnameTextField), new GridBagConstraints(0, 1, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0));
- contentPanel.add(hostnameTextField, new GridBagConstraints(1, 1, 1, 1, 1, 0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(12, 12, 0, 0), 0, 0));
+ contentPanel.add(hostnameTextField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(12, 12, 0, 0), 0, 0));
portTextField = new JTextField();
contentPanel.add(portLabel = new I18nLabel("editNodeDialog.label.port", portTextField), new GridBagConstraints(0, 2, 1, 1, 0, 0, GridBagConstraints.LINE_END, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0));
- contentPanel.add(portTextField, new GridBagConstraints(1, 2, 1, 1, 1, 0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(12, 12, 0, 0), 0, 0));
+ contentPanel.add(portTextField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL, new Insets(12, 12, 0, 0), 0, 0));
- sameMachineCheckBox = new JCheckBox(sameMachineAction);
- contentPanel.add(sameMachineCheckBox, new GridBagConstraints(0, 3, 2, 1, 1, 1, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0));
+ contentPanel.add(new JPanel(), new GridBagConstraints(0, 3, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
}
//
@@ -286,7 +247,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Checks the name textfield for valid input.
- *
+ *
* @return true
if the name textfield seem okay,
* false
if there is an error
*/
@@ -296,7 +257,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Verifies the hostname textfield by resolving the given name.
- *
+ *
* @return true
if the hostname is not empty and can be
* resolved, false
otherwise
*/
@@ -315,7 +276,7 @@ public class EditNodeDialog extends JDialog implements I18nable {
/**
* Verifies that the port number is numeric and in the range from
* 0
to 65535
.
- *
+ *
* @return true
if the port number is okay,
* false
otherwise
*/
@@ -355,7 +316,6 @@ public class EditNodeDialog extends JDialog implements I18nable {
/* should not occur, the value was checked! */
assert false: "port number is invalid though it was checked!";
}
- sameMachine = sameMachineCheckBox.isSelected();
cancelled = false;
setVisible(false);
}
@@ -381,7 +341,6 @@ public class EditNodeDialog extends JDialog implements I18nable {
nameLabel.updateI18n();
hostnameLabel.updateI18n();
portLabel.updateI18n();
- sameMachineAction.updateI18n();
setTitle(I18n.get("editNodeDialog.title") + " â jSite " + Version.getVersion());
SwingUtils.repackCentered(this);
}