return null;
}
+ /**
+ * Sets the given node to the “online” state.
+ *
+ * @param node
+ * The node to set online
+ */
+ public void setOnline(Node node) {
+ nodeLabels.get(node).setOnline();
+ }
+
+ /**
+ * Sets the given node to the “offline” state in the status bar.
+ *
+ * @param node
+ * The node to set offline
+ */
+ public void setOffline(Node node) {
+ nodeLabels.get(node).setOffline();
+ }
+
+ /**
+ * Sets the given node to the “error” state in the status bar.
+ *
+ * @param node
+ * The node to set the error state for
+ */
+ public void setError(Node node) {
+ nodeLabels.get(node).setError();
+ }
+
//
// ACTIONS
//
public void nodeConnected(Node node) {
nodeDisconnectActions.get(node).setEnabled(true);
mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.connectedToNode", node.getName(), node.getHostname(), node.getPort()));
+ mainWindow.setOnline(node);
}
/**
nodeEditActions.get(node).setEnabled(true);
nodeDeleteActions.get(node).setEnabled(true);
mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.connectionToNodeFailed", node.getName(), node.getHostname(), node.getPort(), (cause != null) ? cause.getMessage() : "no reason given"));
+ mainWindow.setError(node);
JOptionPane.showMessageDialog(mainWindow, I18n.get("mainWindow.error.nodeConnectionFailed.message", node.getName(), node.getHostname(), node.getPort(), (cause != null) ? cause.getMessage() : "no reason given"), I18n.get("mainWindow.error.nodeConnectionFailed.title"), JOptionPane.ERROR_MESSAGE);
}
nodeEditActions.get(node).setEnabled(true);
nodeDeleteActions.get(node).setEnabled(true);
mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.disconnectedFromNode", node.getName(), node.getHostname(), node.getPort()));
+ mainWindow.setOffline(node);
}
/**