/** * Gets the layout preferences set. This is common amongst all views * @return The preferences. */ public static Preferences getViewLayoutPreferences() { PreferencesManager prefsMan = PreferencesManager.getInstance(); return prefsMan.getApplicationPreferences(VIEW_LAYOUT_PREFERENCES_ID); }
/** * Gets the layout preferences set. This is common amongst all views * @return The preferences. */ public static Preferences getViewLayoutPreferences() { PreferencesManager prefsMan = PreferencesManager.getInstance(); return prefsMan.getApplicationPreferences(VIEW_LAYOUT_PREFERENCES_ID); }
public PhysicalLocationPanel(EditorKit editorKit) { super(ID, "Physical Location", editorKit); Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeOWL.ID); String path = prefs.getString(DEFAULT_LOCAL_BASE_KEY, new File(new File(System.getProperty("user.home")), "ontologies").toString()); locationBase = new File(path); }
public static String getCurrentFileDirectory() { String dir = "~"; Preferences p = PreferencesManager.getInstance().getApplicationPreferences(FILE_PREFERENCES_KEY); dir = p.getString(CURRENT_FILE_DIRECTORY_KEY, dir); return dir; }
public static String getCurrentFileDirectory() { String dir = "~"; Preferences p = PreferencesManager.getInstance().getApplicationPreferences(FILE_PREFERENCES_KEY); dir = p.getString(CURRENT_FILE_DIRECTORY_KEY, dir); return dir; }
public void updatePanelSelection(String selectedPanel) { if (selectedPanel == null){ final Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ExplanationPreferencesPanel.class); selectedPanel = prefs.getString(EXPL_PREFS_HISTORY_PANEL_KEY, null); } Component c = componentMap.get(selectedPanel); if (c != null) { tabbedPane.setSelectedComponent(c); } }
public void add(URI bookMarkedURI) { PreferencesManager man = PreferencesManager.getInstance(); Preferences prefs = man.getApplicationPreferences(PREFERENCES_KEY); List<String> bookmarks = prefs.getStringList(PREFERENCES_KEY, getDefaults()); bookmarks.add(bookMarkedURI.toString()); prefs.putStringList(PREFERENCES_KEY, bookmarks); }
public void remove(URI bookMarkedURI) { PreferencesManager man = PreferencesManager.getInstance(); Preferences prefs = man.getApplicationPreferences(PREFERENCES_KEY); List<String> bookmarks = prefs.getStringList(PREFERENCES_KEY, getDefaults()); bookmarks.remove(bookMarkedURI.toString()); prefs.putStringList(PREFERENCES_KEY, bookmarks); }
public void setFreshAxiomLocation(FreshAxiomLocation freshAxiomLocation) { PreferencesManager.getInstance().getApplicationPreferences(PREFERENCES_KEY).putString( FRESH_AXIOM_LOCATION_KEY, freshAxiomLocation.getLocationName()); }
protected void setDefaultLocalBase() { File folder = UIUtil.chooseFolder(this, "Please select a folder"); if (folder != null) { locationBase = folder; Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeOWL.ID); prefs.putString(DEFAULT_LOCAL_BASE_KEY, locationBase.toString()); updateLocationField(); } }
protected void setDefaultLocalBase() { File folder = UIUtil.chooseFolder(this, "Please select a folder"); if (folder != null) { locationBase = folder; Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeOWL.ID); prefs.putString(DEFAULT_LOCAL_BASE_KEY, locationBase.toString()); updateLocationField(); } }
protected void setDefaultLocalBase() { File folder = UIUtil.chooseFolder(this, "Please select a folder"); if (folder != null) { locationBase = folder; Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeOWL.ID); prefs.putString(DEFAULT_LOCAL_BASE_KEY, locationBase.toString()); updateLocationField(); } }
public FreshAxiomLocation getFreshAxiomLocation() { String locationName = PreferencesManager.getInstance().getApplicationPreferences(PREFERENCES_KEY) .getString(FRESH_AXIOM_LOCATION_KEY, null); if(locationName == null) { return FreshAxiomLocation.getDefaultValue(); } return FreshAxiomLocation.getLocationFromName(locationName).or(FreshAxiomLocation.getDefaultValue()); }
public void setUseEntities(boolean b) { PreferencesManager.getInstance().getApplicationPreferences(KEY).putBoolean(USE_ENTITIES, b); XMLWriterPreferences.getInstance().setUseNamespaceEntities(b); } }
protected void saveMetrics() { Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(getClass().getName()); Point location = getLocation(); prefs.putInt(LOC_X, location.x); prefs.putInt(LOC_Y, location.y); prefs.putInt(SIZE_X, getSize().width); prefs.putInt(SIZE_Y, getSize().height); }
private Component getDialogParent() { // @@TODO move prefs somewhere more central Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeApplication.ID); return prefs.getBoolean(GeneralPreferencesPanel.DIALOGS_ALWAYS_CENTRED, false) ? SwingUtilities.getAncestorOfClass(Frame.class, getParent()) : getParent(); }
private Component getDialogParent() { // @@TODO move prefs somewhere more central Preferences prefs = PreferencesManager.getInstance().getApplicationPreferences(ProtegeApplication.ID); return prefs.getBoolean(GeneralPreferencesPanel.DIALOGS_ALWAYS_CENTRED, false) ? SwingUtilities.getAncestorOfClass(Frame.class, getParent()) : getParent(); }
protected void saveMetrics() { Preferences p = PreferencesManager.getInstance().getApplicationPreferences(getClass().getName()); p.putInt(LOC_X, getLocation().x); p.putInt(LOC_Y, getLocation().y); p.putInt(SIZE_X, getSize().width); p.putInt(SIZE_Y, getSize().height); }
protected void restoreMetrics() { Preferences p = PreferencesManager.getInstance().getApplicationPreferences(getClass().getName()); int w = p.getInt(SIZE_X, 800); int h = p.getInt(SIZE_Y, 600); setSize(w, h); Point defLoc = getDefaultLocation(); int x = p.getInt(LOC_X, defLoc.x); int y = p.getInt(LOC_Y, defLoc.y); setLocation(x, y); setSize(w, h); }
protected void saveMetrics() { Preferences p = PreferencesManager.getInstance().getApplicationPreferences(getClass().getName()); p.putInt(LOC_X, getLocation().x); p.putInt(LOC_Y, getLocation().y); p.putInt(SIZE_X, getSize().width); p.putInt(SIZE_Y, getSize().height); }