General Modularity Example Module Projects & Files Commands & Scripting
Windows Menus Charts Tables Buttons & tools
Trees and Taxa Characters & Models Documentation General Utilities
Introduction to Projects & Files Reading and Writing NEXUS files Saving preferences
Also: Saving the current state (snapshots) User's introduction to projects and files
class MesquiteProject class MesquiteFile class FileElement

Preferences

(Updated August 2005)

Mesquite modules can save and load preferences using some methods of MesquiteModule.

Note: preferences are used by few modules at present (e.g., the Mesquite trunk module, ManagePAUP), and the system is not easy enough to use. For instance, it may be better to base the preferences on NEXUS formatted text commands, and have the preferences system use the doCommand method. Also, there is not a single easy way for a module to have a UI to set preferences. Because it would be too cluttering for each module participating in a calculation to request a menu item by which to set preferences, it will be useful to design a single preferences window with panels for the different modules involved in a window's calculations.

Writing

A module calls "storePreferences()" when it wants to store its preferences. Mesquite then prepares a file "prefs" in the module's directory. Mesquite calls the methods preparePreferencesForFile() method, which is to return a String array containing the module's preferences, and this String array is written into the file.

Reading

A module calls "loadPreferences" when it wants to read its preferences (e.g., in startJob). In response, Mesquite reads the module's pref file and passes the contents as a String to the modules "processPreferencesFromFile" method. For an example, see mesquite.minimal.BasicFileCoordinator.BasicFileCoordinator.java.


© W. Maddison & D. Maddison 1998-2005