From: David ‘Bombe’ Roden Date: Sat, 26 Apr 2008 11:14:13 +0000 (+0000) Subject: remove same machine setting (can be detected automatically) X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=010e39aacf7769db05545c166edb222d212a3dae;p=jSite2.git remove same machine setting (can be detected automatically) git-svn-id: http://trooper/svn/projects/jSite/trunk@774 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/jsite/gui/EditNodeDialog.java b/src/net/pterodactylus/jsite/gui/EditNodeDialog.java index 3f0694d..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; @@ -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,12 +84,6 @@ 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; @@ -177,28 +167,6 @@ 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, @@ -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. */ - } - }; } /** @@ -276,10 +238,7 @@ public class EditNodeDialog extends JDialog implements I18nable { 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, 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.0, 0.0, GridBagConstraints.LINE_START, GridBagConstraints.NONE, new Insets(12, 0, 0, 0), 0, 0)); - - contentPanel.add(new JPanel(), new GridBagConstraints(0, 4, 2, 1, 1.0, 1.0, GridBagConstraints.LINE_START, GridBagConstraints.BOTH, new Insets(0, 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)); } // @@ -357,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); } @@ -383,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); } diff --git a/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java b/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java index e47a9b9..f4c4822 100644 --- a/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java +++ b/src/net/pterodactylus/jsite/gui/ManageNodesDialog.java @@ -49,7 +49,7 @@ import net.pterodactylus.util.swing.SwingUtils; /** * Dialog that lets the user manage her nodes. - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ */ @@ -87,7 +87,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Creates a new node manager dialog. - * + * * @param swingInterface * The Swing interface */ @@ -108,7 +108,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Returns the list of nodes. - * + * * @return The list of nodes */ public List getNodeList() { @@ -117,7 +117,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Sets the list of nodes. - * + * * @param nodeList * The list of nodes */ @@ -241,7 +241,6 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, editNodeDialog.setNodeName("New Node"); editNodeDialog.setNodeHostname("localhost"); editNodeDialog.setNodePort(9481); - editNodeDialog.setNodeOnSameMachine(true); editNodeDialog.setVisible(true); if (!editNodeDialog.wasCancelled()) { Node newNode = new Node(); @@ -260,13 +259,11 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, editNodeDialog.setNodeName(selectedNode.getName()); editNodeDialog.setNodeHostname(selectedNode.getHostname()); editNodeDialog.setNodePort(selectedNode.getPort()); - editNodeDialog.setNodeOnSameMachine(selectedNode.isSameMachine()); editNodeDialog.setVisible(true); if (!editNodeDialog.wasCancelled()) { selectedNode.setName(editNodeDialog.getNodeName()); selectedNode.setHostname(editNodeDialog.getNodeHostname()); selectedNode.setPort(editNodeDialog.getNodePort()); - selectedNode.setSameMachine(editNodeDialog.isNodeOnSameMachine()); nodeList.repaint(); } } @@ -293,7 +290,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Checks whether the list of nodes is not empty. - * + * * @return true if there is at least one node defined, * false otherwise */ @@ -359,7 +356,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * List model for the {@link ManageNodesDialog#nodeList}. TODO - * + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ */ @@ -373,11 +370,12 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, * Creates a new node list model. */ public NodeListModel() { + /* do nothing. */ } /** * Adds the given node to the list model. - * + * * @see Collection#add(Object) * @param node * The node to add @@ -389,7 +387,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Removes the given node from the list model. - * + * * @see Collection#remove(Object) * @param node * The node to remove @@ -402,7 +400,7 @@ public class ManageNodesDialog extends JDialog implements ListSelectionListener, /** * Removes all nodes from the list model. - * + * * @see Collection#clear() */ public void clear() {