/** * Show the perspectives toolbar */ @Override public void showPerspectivesToolBar() { if (!isPerspectivesToolBarVisible()) { m_perspectiveManager.setPerspectiveToolBarIsVisible(true); add(m_perspectiveManager.getPerspectiveToolBar(), BorderLayout.NORTH); } }
/** * Get the current settings for this application * * @return the current settings for this application */ @Override public Settings getApplicationSettings() { if (m_applicationSettings == null) { m_applicationSettings = new Settings("weka", getApplicationID()); m_applicationSettings.applyDefaults(getApplicationDefaults()); } return m_applicationSettings; }
/** * Force a re-validation and repaint() of the application */ @Override public void revalidate() { if (getTopLevelAncestor() != null) { getTopLevelAncestor().revalidate(); getTopLevelAncestor().repaint(); } else { super.revalidate(); } repaint(); } }
/** * Hide the perspectives toolbar */ @Override public void hidePerspectivesToolBar() { if (isPerspectivesToolBarVisible()) { m_perspectiveManager.setPerspectiveToolBarIsVisible(false); remove(m_perspectiveManager.getPerspectiveToolBar()); } }
/** * Popup a dialog displaying the supplied Exception * * @param cause the exception to show */ @Override public void showErrorDialog(Exception cause) { String stackTrace = LogManager.stackTraceToString(cause); Object[] options = null; if (stackTrace != null && stackTrace.length() > 0) { options = new Object[2]; options[0] = "OK"; options[1] = "Show error"; } else { options = new Object[1]; options[0] = "OK"; } int result = JOptionPane.showOptionDialog(this, "An error has occurred: " + cause.getMessage(), getApplicationName(), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]); if (result == 1) { JTextArea jt = new JTextArea(stackTrace, 10, 40); JOptionPane.showMessageDialog(this, new JScrollPane(jt), getApplicationName(), JOptionPane.ERROR_MESSAGE); } }
/** * Hide the perspectives toolbar */ @Override public void hidePerspectivesToolBar() { if (isPerspectivesToolBarVisible()) { m_perspectiveManager.setPerspectiveToolBarIsVisible(false); remove(m_perspectiveManager.getPerspectiveToolBar()); } }
/** * Popup a dialog displaying the supplied Exception * * @param cause the exception to show */ @Override public void showErrorDialog(Exception cause) { String stackTrace = LogManager.stackTraceToString(cause); Object[] options = null; if (stackTrace != null && stackTrace.length() > 0) { options = new Object[2]; options[0] = "OK"; options[1] = "Show error"; } else { options = new Object[1]; options[0] = "OK"; } int result = JOptionPane.showOptionDialog(this, "An error has occurred: " + cause.getMessage(), getApplicationName(), JOptionPane.YES_NO_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]); if (result == 1) { JTextArea jt = new JTextArea(stackTrace, 10, 40); JOptionPane.showMessageDialog(this, new JScrollPane(jt), getApplicationName(), JOptionPane.ERROR_MESSAGE); } }
/** * Show the perspectives toolbar */ @Override public void showPerspectivesToolBar() { if (!isPerspectivesToolBarVisible()) { m_perspectiveManager.setPerspectiveToolBarIsVisible(true); add(m_perspectiveManager.getPerspectiveToolBar(), BorderLayout.NORTH); } }
/** * Get the current settings for this application * * @return the current settings for this application */ @Override public Settings getApplicationSettings() { if (m_applicationSettings == null) { m_applicationSettings = new Settings("weka", getApplicationID()); m_applicationSettings.applyDefaults(getApplicationDefaults()); } return m_applicationSettings; }
/** * Force a re-validation and repaint() of the application */ @Override public void revalidate() { if (getTopLevelAncestor() != null) { getTopLevelAncestor().revalidate(); getTopLevelAncestor().repaint(); } else { super.revalidate(); } repaint(); } }