use of java.util.prefs.BackingStoreException in project blue by kunstmusik.
the class OSCPanel method store.
void store() {
final Preferences prefs = NbPreferences.forModule(OSCManager.class);
prefs.putInt("serverPort", ((SpinnerNumberModel) serverPortSpinner.getModel()).getNumber().intValue());
try {
prefs.sync();
} catch (BackingStoreException ex) {
Exceptions.printStackTrace(ex);
}
}
use of java.util.prefs.BackingStoreException in project blue by kunstmusik.
the class GeneralSettings method save.
public void save() {
final Preferences prefs = NbPreferences.forModule(GeneralSettings.class);
prefs.put(PREFIX + DEFAULT_WORK_DIRECTORY, defaultDirectory.getAbsolutePath());
prefs.putBoolean(PREFIX + NEW_USER_DEFAULTS_ENABLED, newUserDefaultsEnabled);
prefs.putBoolean(PREFIX + DRAW_ALPHA_BACKGROUND_ON_MARQUEE, alphaEnabled);
prefs.putBoolean(PREFIX + MESSAGE_COLORS_ENABLED, messageColorsEnabled);
prefs.putBoolean(PREFIX + CSOUND_ERROR_WARNING_ENABLED, csoundErrorWarningEnabled);
try {
prefs.sync();
} catch (BackingStoreException ex) {
Exceptions.printStackTrace(ex);
}
}
use of java.util.prefs.BackingStoreException in project blue by kunstmusik.
the class UtilitySettings method save.
public void save() {
final Preferences prefs = NbPreferences.forModule(UtilitySettings.class);
prefs.put(PREFIX + CSOUND_EXECUTABLE, csoundExecutable);
prefs.put(PREFIX + FREEZE_FLAGS, freezeFlags);
try {
prefs.sync();
} catch (BackingStoreException ex) {
Exceptions.printStackTrace(ex);
}
}
use of java.util.prefs.BackingStoreException in project blue by kunstmusik.
the class InfoDialog method showInformationDialogTabs.
public static final void showInformationDialogTabs(String information, String title) {
if (dialog == null) {
dialog = new JDialog(WindowManager.getDefault().getMainWindow(), false);
dialog.setTitle("Information");
tabs = new JTabbedPane();
dialog.getContentPane().add(tabs);
final Preferences prefs = NbPreferences.forModule(InfoDialog.class);
int w = prefs.getInt("infoDialogTabsWidth", 640);
int h = prefs.getInt("infoDialogTabsHeight", 480);
dialog.setSize(new Dimension(w, h));
dialog.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
final Preferences prefs = NbPreferences.forModule(InfoDialog.class);
prefs.putInt("infoDialogTabsWidth", dialog.getWidth());
prefs.putInt("infoDialogTabsHeight", dialog.getHeight());
prefs.putInt("infoDialogTabsX", dialog.getX());
prefs.putInt("infoDialogTabsY", dialog.getY());
try {
prefs.sync();
} catch (BackingStoreException ex) {
Exceptions.printStackTrace(ex);
}
}
});
int x = prefs.getInt("infoDialogTabsX", -1);
int y = prefs.getInt("infoDialogTabsY", -1);
if (x > 0 && y > 0) {
dialog.setLocation(x, y);
} else {
GUI.centerOnScreen(dialog);
}
popup = new JPopupMenu();
popup.add(new AbstractAction("Remove") {
@Override
public void actionPerformed(ActionEvent e) {
int index = tabs.getSelectedIndex();
if (index >= 0) {
tabs.remove(index);
if (tabs.getTabCount() == 0) {
dialog.setVisible(false);
}
}
}
});
tabs.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (UiUtilities.isRightMouseButton(e)) {
popup.show(tabs, e.getX(), e.getY());
}
}
});
dialog.getRootPane().putClientProperty("SeparateWindow", Boolean.TRUE);
}
tabs.add(title, new JScrollPane(new JTextArea(information)));
tabs.setSelectedIndex(tabs.getTabCount() - 1);
dialog.setVisible(true);
}
use of java.util.prefs.BackingStoreException in project blue by kunstmusik.
the class RecentProjectsList method store.
protected void store() {
Preferences prefs = getPreferences();
// clear the backing store
try {
prefs.clear();
} catch (BackingStoreException ex) {
}
for (int i = 0; i < mruFileList.size(); i++) {
String str = mruFileList.get(i);
prefs.put(MRU_FILE_LIST_PROPERTY + i, str);
}
}
Aggregations