public static void main(String[] args) throws Exception { GeneralPreferencesPanel pp = new GeneralPreferencesPanel(); pp.initialise(); JDialog dlg = new JDialog(); dlg.getContentPane().add(pp); dlg.pack(); dlg.setVisible(true); } }
public void initialise() throws Exception { createUI(); }
private void createUI() { setLayout(new BorderLayout()); PreferencesLayoutPanel panel = new PreferencesLayoutPanel(); add(panel, BorderLayout.NORTH); panel.addGroup("Editor delay"); final int checkDelay = ExpressionEditorPreferences.getInstance().getCheckDelay(); panel.addGroup("Search type"); panel.addGroupComponent(searchManagerPluginComboBox); SearchManagerSelector selector = getOWLEditorKit().getSearchManagerSelector(); Collection<SearchManagerPlugin> plugins = selector.getPlugins(); if (!plugins.isEmpty()) { for(SearchManagerPlugin plugin : plugins) { searchManagerPluginComboBox.addItem(plugin); if(plugin.getId().equals(getOWLEditorKit().getSearchManagerSelector().getCurrentPluginId())) { searchManagerPluginComboBox.setSelectedItem(plugin);
public void applyChanges() { ExpressionEditorPreferences.getInstance().setCheckDelay((Integer) checkDelaySpinner.getModel().getValue()); Preferences appPrefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeApplication.ID); appPrefs.putBoolean(DIALOGS_ALWAYS_CENTRED, alwaysCentreDialogsCheckbox.isSelected()); appPrefs.putBoolean(View.DETACHED_WINDOWS_FLOAT, detachedWindowsFloat.isSelected()); FreshAxiomLocationPreferences axiomPrefs = FreshAxiomLocationPreferences.getPreferences(); if(addFreshAxiomsToActiveOntologyRadioButton.isSelected()) { axiomPrefs.setFreshAxiomLocation(FreshAxiomLocation.ACTIVE_ONTOLOGY); } else if (addFreshAxiomsToSubjectDefiningOntology.isSelected()) { axiomPrefs.setFreshAxiomLocation(FreshAxiomLocation.SUBJECT_DEFINING_ONTOLOGY); } OWLTreePreferences prefs = OWLTreePreferences.getInstance(); prefs.setAutoExpansionEnabled(autoExpandEnabledCheckBox.isSelected()); prefs.setPaintLines(paintLinesCheckBox.isSelected()); prefs.setAutoExpansionDepthLimit((Integer)autoExpandMaxDepthSpinner.getValue()); prefs.setAutoExpansionChildLimit((Integer) autoExpandMaxChildSizeSpinner.getValue()); prefs.setTreeDragAndDropEnabled(dragAndDropEnabled.isSelected()); SearchManagerPlugin plugin = (SearchManagerPlugin) searchManagerPluginComboBox.getSelectedItem(); if(plugin != null) { getOWLEditorKit().getSearchManagerSelector().setCurrentPluginId(plugin.getId()); } }
private void createUI() { setLayout(new BorderLayout()); PreferencesLayoutPanel panel = new PreferencesLayoutPanel(); add(panel, BorderLayout.NORTH); panel.addGroup("Editor delay"); final int checkDelay = ExpressionEditorPreferences.getInstance().getCheckDelay(); panel.addGroup("Search type"); panel.addGroupComponent(searchManagerPluginComboBox); SearchManagerSelector selector = getOWLEditorKit().getSearchManagerSelector(); Collection<SearchManagerPlugin> plugins = selector.getPlugins(); if (!plugins.isEmpty()) { for(SearchManagerPlugin plugin : plugins) { searchManagerPluginComboBox.addItem(plugin); if(plugin.getId().equals(getOWLEditorKit().getSearchManagerSelector().getCurrentPluginId())) { searchManagerPluginComboBox.setSelectedItem(plugin);
public void applyChanges() { ExpressionEditorPreferences.getInstance().setCheckDelay((Integer) checkDelaySpinner.getModel().getValue()); Preferences appPrefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeApplication.ID); appPrefs.putBoolean(DIALOGS_ALWAYS_CENTRED, alwaysCentreDialogsCheckbox.isSelected()); appPrefs.putBoolean(View.DETACHED_WINDOWS_FLOAT, detachedWindowsFloat.isSelected()); FreshAxiomLocationPreferences axiomPrefs = FreshAxiomLocationPreferences.getPreferences(); if(addFreshAxiomsToActiveOntologyRadioButton.isSelected()) { axiomPrefs.setFreshAxiomLocation(FreshAxiomLocation.ACTIVE_ONTOLOGY); } else if (addFreshAxiomsToSubjectDefiningOntology.isSelected()) { axiomPrefs.setFreshAxiomLocation(FreshAxiomLocation.SUBJECT_DEFINING_ONTOLOGY); } OWLTreePreferences prefs = OWLTreePreferences.getInstance(); prefs.setAutoExpansionEnabled(autoExpandEnabledCheckBox.isSelected()); prefs.setPaintLines(paintLinesCheckBox.isSelected()); prefs.setAutoExpansionDepthLimit((Integer)autoExpandMaxDepthSpinner.getValue()); prefs.setAutoExpansionChildLimit((Integer) autoExpandMaxChildSizeSpinner.getValue()); prefs.setTreeDragAndDropEnabled(dragAndDropEnabled.isSelected()); SearchManagerPlugin plugin = (SearchManagerPlugin) searchManagerPluginComboBox.getSelectedItem(); if(plugin != null) { getOWLEditorKit().getSearchManagerSelector().setCurrentPluginId(plugin.getId()); } }
public static void main(String[] args) throws Exception { GeneralPreferencesPanel pp = new GeneralPreferencesPanel(); pp.initialise(); JDialog dlg = new JDialog(); dlg.getContentPane().add(pp); dlg.pack(); dlg.setVisible(true); } }
public void initialise() throws Exception { createUI(); }