+ nodeConnectActions.get(node).setEnabled(false);
+ nodeEditActions.get(node).setEnabled(false);
+ nodeDeleteActions.get(node).setEnabled(false);
+ mainWindow.setStatusBarText(I18n.get("mainWindow.statusBar.connectingToNode", node.getName(), node.getHostname(), node.getPort()));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ 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);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void nodeConnectionFailed(Node node, Throwable cause) {
+ nodeConnectActions.get(node).setEnabled(true);
+ 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);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void nodeDisconnected(Node node, Throwable throwable) {
+ nodeDisconnectActions.get(node).setEnabled(false);
+ nodeConnectActions.get(node).setEnabled(true);
+ 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);
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.core.CoreListener#projectInsertStarted(net.pterodactylus.jsite.core.Project)
+ */
+ public void projectInsertStarted(Project project) {
+ mainWindow.projectInsertStarted(project);
+ }
+
+ /**
+ * @see net.pterodactylus.jsite.core.CoreListener#projectInsertProgressed(net.pterodactylus.jsite.core.Project,
+ * int, int, int, int, int, boolean)
+ */
+ public void projectInsertProgressed(Project project, int totalBlocks, int requiredBlocks, int successfulBlocks, int failedBlocks, int fatallyFailedBlocks, boolean finalizedTotal) {
+ mainWindow.projectInsertProgressed(project, totalBlocks, requiredBlocks, successfulBlocks, failedBlocks, fatallyFailedBlocks, finalizedTotal);