+ * Shows the configuration dialog.
+ */
+ private void configure() {
+ configurationDialog.setAdvancedMode(advancedMode);
+ configurationDialog.setAntialias(antialias);
+ configurationDialog.setControlFont(controlFont);
+ configurationDialog.setUserFont(userFont);
+ configurationDialog.setLookAndFeel(lookAndFeel);
+ configurationDialog.setVisible(true);
+ if (!configurationDialog.wasCancelled()) {
+ advancedMode = configurationDialog.isAdvancedMode();
+ if (!advancedMode && (nodeList.size() > 1)) {
+ JOptionPane.showMessageDialog(mainWindow, I18n.get("mainWindow.warning.multipleNodesNotAdvancedMode.message"), I18n.get("mainWindow.warning.multipleNodesNotAdvancedMode.title"), JOptionPane.WARNING_MESSAGE);
+ }
+ mainWindow.setAdvancedMode(advancedMode);
+ antialias = configurationDialog.isAntialias();
+ controlFont = configurationDialog.getControlFont();
+ userFont = configurationDialog.getUserFont();
+ lookAndFeel = configurationDialog.getLookAndFeel();
+ saveConfig();
+ }
+ }
+
+ /**
+ * Imports old jSite configuration.
+ */
+ private void importConfig() {
+ /* TODO */
+ }
+
+ /**
+ * Quits jSite.
+ */
+ private void quit() {
+ /* TODO - ask */
+ core.stop();
+ mainWindowX = mainWindow.getX();
+ mainWindowY = mainWindow.getY();
+ mainWindowWidth = mainWindow.getWidth();
+ mainWindowHeight = mainWindow.getHeight();
+ saveConfig();
+ System.exit(0);
+ }
+
+ /**
+ * Rebuilds all node connect and disconnect actions.
+ *
+ * @param nodes
+ * The list of nodes
+ */
+ private void rebuildNodeActions(List<Node> nodes) {
+ logger.fine("rebuilding node actions…");
+ nodeConnectActions.clear();
+ nodeNodeConnectActions.clear();
+ nodeConnectActionNodes.clear();
+ nodeDisconnectActions.clear();
+ nodeNodeDisconnectActions.clear();
+ nodeDisconnectActionNodes.clear();
+ for (Node node: nodes) {
+ logger.finer("adding node “" + node + "” to menus");
+ Action nodeConnectAction = new AbstractAction(node.getName()) {
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("synthetic-access")
+ public void actionPerformed(ActionEvent e) {
+ Node node = nodeConnectActionNodes.get(this);
+ nodeConnect(node);
+ }
+ };
+ nodeConnectActions.add(nodeConnectAction);
+ nodeConnectActionNodes.put(nodeConnectAction, node);
+ nodeNodeConnectActions.put(node, nodeConnectAction);
+ Action nodeDisconnectAction = new AbstractAction(node.getName()) {
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("synthetic-access")
+ public void actionPerformed(ActionEvent e) {
+ Node node = nodeDisconnectActionNodes.get(this);
+ nodeDisconnect(node);
+ }
+ };
+ // nodeDisconnectActions.add(nodeDisconnectAction);
+ nodeDisconnectActionNodes.put(nodeDisconnectAction, node);
+ nodeNodeDisconnectActions.put(node, nodeDisconnectAction);
+ }
+ }
+
+ /**