Author: Ulf Dittmer (udittmer at yahoo.com) History: 2004/3/1: First version
Requires: ImageJ 1.32c or later Source: Preference_Demo.java Installation: Download Preference_Demo.java to the plugins folder, or subfolder, and compile and run it using Plugins/Compile and Run. Description: This plugin demonstrates how a plugin can store preference settings using ImageJs built-in preference mechanism (i.e., the IJ_Prefs.txt file). There are three overloaded methods for saving preferences values (strings, numbers and booleans) and three for retrieving values.
Note that the key should begin with a prefix that is unique to the calling plugin (e.g. "prefsdemo.").
- Prefs.set(key, value);
- Saves the value of a string, number or boolean in the preferences file using the keyword key.
- value = Prefs.get(key, defaultValue);
- Uses the keyword key to retrieve a string, number or boolean value from the preferences file. Returns defaultValue if the key is not found.