/** * Pops up a dialog for viewing/editing complex parameter settings. * * <p>This method automatically updates the visual settings for the complex parameter if the user * presses the "OK" or "Save as Default" button. It also attempts to save the * settings if the user presses the "Save as Default" button and displays an error * message in case the attempt was not successful. * * <p><b>Note:</b> It is the responsibility of the caller to update all the controls created by * the visualizer by calling the {@link #updateControl(JFreeChart)} method for each of them. * * @param aOwner The <code>Dialog</code> from which the settings dialog is displayed. * @return The status as returned by the settings dialog. * @see SettingsDialog#STATUS_CANCEL * @see SettingsDialog#STATUS_DEFAULT * @see SettingsDialog#STATUS_OK */ public int showSettingsDialog(Dialog aOwner) { SettingsDialog d = new SettingsDialog(aOwner, Messages.DI_CHARTSETTINGS); JComponent dataComp = addSettingsPanels(d.getSettingsPane()); d.pack(); d.setLocationRelativeTo(aOwner); d.setVisible(true); int status = d.getStatus(); if (status != SettingsDialog.STATUS_CANCEL) { try { d.update(); updateSettings(dataComp); if (status == SettingsDialog.STATUS_DEFAULT) { try { saveDefault(); } catch (SecurityException ex) { Utils.showErrorBox(aOwner, Messages.DT_SECERROR, Messages.SM_SECERROR2); } catch (Exception ex) { // FileNotFoundException // IOException Utils.showErrorBox(aOwner, Messages.DT_IOERROR, Messages.SM_DEFFAILED); } } } catch (InvocationTargetException ex) { throw new InnerException(ex); } } return status; }