mesquite.lib
Class MesquiteModule

java.lang.Object
  extended bymesquite.lib.MenuOwner
      extended bymesquite.lib.EmployerEmployee
          extended bymesquite.lib.MesquiteModule
All Implemented Interfaces:
Commandable, Doomable, Explainable, FileDirtier, HNode, Identifiable, Listable, Logger, MesquiteListener, Showable
Direct Known Subclasses:
AAProperty, AssociationSource, BooleanForTree, BrowseHierarchy, CharacterModelSource, CharacterObedSource, CharacterSelector, CharacterSimulator, CharHistorySource, CharListAssistantI, CharMapper, CharMatrixFiller, CharMatrixManager, CharModelCurator, CharSelectCoordinator, CharSourceCoord, CharSourceCoordObed, CharsStatesForNodes, CharTableAssistantI, ChartAssistant, Coalescer, Consenser, ContainedTreeSim, DataAlterer, DataColumnNamesAssistant, DataMatcher, DataSearcher, DatasetsListUtility, DataUtility, DataWindowAssistant, DataWindowMaker, DefaultsAssistant, DetTreeModifier, DisplayCharsStsAtNodes, DisplayNumbersAtNodes, DisplayStatesAtNodes, DrawChart, DrawNamesTaxaDisplay, DrawNamesTreeDisplay, DrawTaxa, DrawTaxaCoordinator, DrawTree, DrawTreeCoordinator, EditRawNexusBlock, EmployeeTree, FileAssistant, FileCoordinator, FileElementManager, FileInit, FileInterpreter, FindSequenceCriterion, GeneralFileMaker, ItemsBiplotter, ItemsCharter, JointLikeAncStForModel, ListAssistant, ManagerAssistant, MargLikelihoodForModel, MatrixCharter, MatrixSourceCoord, MatrixSourceCoordObed, MesquiteInit, MesquiteTrunk, MultipleSequenceAligner, NodeChooser, NodeLocs, NumberFor2Characters, NumberFor2CharAndTree, NumberFor2Taxa, NumberFor2Trees, NumberForCharacter, NumberForCharAndTaxon, NumberForCharAndTree, NumberForMatrix, NumberForMatrixAndTree, NumberForNode, NumberForTaxon, NumberForTreeBlock, NumberForTreeWContext, NumbersForNodes, NumbersForNodesAndHistory, NumbersForNodesAndMatrix, NumbersForNodesWithChar, NumForCharHistAndTree, OneTreeSource, OrdinationAssistant, Ordinator, PackageIntro, PairMaker, ParsAncStatesForModel, RandomMatrixModifier, ReconstructAssociation, RndTreeModifier, TaxaBlocksListUtility, TaxaDisplayAssistant, TaxaDistanceSource, TaxaDistFromMatrix, TaxaListAssistantI, TaxaPartitionSource, TaxaSelectCoordinator, TaxaSource, TaxaTableAssistantI, TaxaWindowAssistant, TaxaWindowMaker, TaxonNameAlterer, TaxonPairSource, TaxonSelector, TaxonSource, TaxonUtility, TextDisplayer, TraceCharacterInit, TreeBlockFiller, TreeBlockListUtility, TreeBlockSource, TreeClusterer, TreeDisplayAssistant, TreeListUtility, TreeSearcher, TreeSimulate, TreeSourceDefinite, TreeSwapper, TreeTransformer, TreeUtility, TreeWindowAssistant, TreeWindowMaker, TWindowMaker, TwoSequenceAligner, UtilitiesAssistant, WindowHolder

public abstract class MesquiteModule
extends EmployerEmployee
implements Commandable, Showable, Logger, Explainable, Identifiable, FileDirtier, MesquiteListener

The Mesquite system operates around a tree of modules (subclasses of MesquiteModule), with the class containing the "main" method being the trunk module, and the other modules like branches that are attached to the trunk.

When Mesquite starts up, the trunk starts up and surveys the mesquite folder to acquire information about all of the available modules (i.e., all of the available subclasses of MesquiteModule). To be found, a module must be in a folder (directory) of the same name as itself; that is, a module whose class file is "MyModule.class" must be in a directory named "MyModule". Mesquite remembers the modules in a vector of MesquiteModuleInfo objects. Later, when modules need to be "hired" to perform certain tasks, this vector of information can be used to help choose which module to hire. To be hired, a module is instantiated and linked to its employer module. Thus, a new branch sprouts in the Mesquite bureacratic hierarchy.

Modules are chosen for hire by other modules according to their talents. What talents a module has is implicit in its superclass. For instance, a module that subclasses the NumberForTree class (itself a subclass of MesquiteModule) calculates a number for a tree. Any module that wants numbers calculated for trees can therefore hire a module that is an instance of the NumberForTree class. The basic talent-defining classes are part of the Mesquite Class LIbrary, in the subpackage duties. There is in addition a system to determine whether a module is compatible with a particular condition (e.g. operating on continuous-valued data.)

The only types of module that the trunk knows of directly are the FileCoordinator and FileInterpreter classes. Each instance of the File Coordinator is associated with one file, and it is responsible for using employee modules to read and write the file, and to hire tree windows and data windows. The trunk is a specific subclass of MesquiteModule, a MesquiteTrunk

Because menus are composed hierarchically along the employee tree, menu composition is most easily done where there is easy access to employee-employer relations. For this reason, it is most convenient to have the menu composition embedded within the module code. In order not to burden the MesquiteModule class with numerous methods to handle employee-employer relations, the MesquiteModule class was split into three: its superclass, EmployeeEmployer (which handles employee-employer relations), MenuOwner (which handles all menu issues) and MesquiteModule itself, which handles its basic functions. EmployeeEmployer and MenuOwner are intended to be used ONLY as superclasses to MesquiteModule

The MesquiteModule class is more or less equivalent to the MacClade proto4 ModuleRecord, while its instantiated objects are more or less equivalent to the MacClade proto4 Tasks. Hence, "task" is sometimes used in names for MesquiteModule objects.


Field Summary
static Author author
          The default author for this machine and user account
protected static java.lang.String browserString
          the file path to the web browser for showing web pages
static boolean checkMethodsAtStartup
          true if does extra check for module compatibility at startup.
 boolean hiredAsDefaultInScripting
          This module was hired as a default choice in scripting
static LogWindow logWindow
          The window, created by mesquiteTrunk, that displays the log.
static java.io.File mesquiteDirectory
          The root of the mesquite classpath.
static java.lang.String mesquiteDirectoryPath
          The root of the mesquite classpath.
static MesquiteTrunk mesquiteTrunk
          Static storage so that everyone can find the trunk MesquiteModule object
protected  MesquiteModuleInfo moduleInfo
          the MesquiteModuleInfo that refers to the module
static java.io.File prefsDirectory
          The directory that includes all the preference files.
protected  MesquiteProject proj
          The project that the module was hired under.
static int textEdgeCompensationHeight
           
static int textEdgeCompensationWidth
           
static int totalFinalized
           
static java.io.File userDirectory
          The user's directory.
 
Fields inherited from class mesquite.lib.EmployerEmployee
employees, employer, startupBailOut, stringPos, suppressHireQueries, totalCreated, totalDisposed, useOtherChoices
 
Fields inherited from class mesquite.lib.MenuOwner
considerPriorities, doomed, MAXPRIORITY, menuCompositionTime, menuCompositionTime1, menuCompositionTime2, menuCompositionTime2a, menuCompositionTime2b, menuCompositionTime2c, menuCompositionTime3, menuCompositionTime4, menuCompositionTime5, menuCompositionTime6, menuCompositionTime7, menuCompositionTime8, menuCompositionTime9, menuTracing, module, parser
 
Fields inherited from interface mesquite.lib.MesquiteListener
ANNOTATION_ADDED, ANNOTATION_CHANGED, ANNOTATION_DELETED, ASSOCIATED_CHANGED, BRANCHES_REARRANGED, BRANCHLENGTHS_CHANGED, COMMAND_CANCELLED, DATA_CHANGED, ELEMENT_CHANGED, ITEMS_ADDED, NAMES_CHANGED, OBJECT_DESTROYED, PARTS_ADDED, PARTS_CHANGED, PARTS_DELETED, PARTS_MOVED, SELECTION_CHANGED, TAXA_SUBSTITUTED, UNKNOWN, VALUE_CHANGED
 
Fields inherited from interface mesquite.lib.HNode
MOUSEDOWN, MOUSEEXIT, MOUSEMOVE
 
Constructor Summary
MesquiteModule()
          The constructor in general is to be avoided, because modules are instantiated momentarily on startup to gather information.
 
Method Summary
 java.lang.String accumulateParameters(java.lang.String spacer)
           
 void addNEXUSBlock(NexusBlock nb)
          Adds NEXUS block to the file.
 void alert(java.lang.String s)
          Displays an alert in log; also in dialog if flag is set.
 void alert(java.lang.String s, java.lang.String windowTitle, java.lang.String logTitle)
          Displays an alert in log; also in dialog if flag is set.
 boolean anySubstantivePrereleases()
          returns whether this or employee modules are substantive and prerelease
 void broadCastAssignedID(MesquiteModule module, java.lang.String assignedID, CommandRecord commandRec)
          Broadcasts that an id has been assigned to a module.
 void changed(java.lang.Object caller, java.lang.Object obj, Notification notification, CommandRecord commandRec)
          passes which object changed, along with optional integer (e.g.
 void classFieldChanged(java.lang.Class c, java.lang.String fieldName, CommandRecord commandRec)
          Notifies all employees that a class field has changed.
 boolean compatibleWithSystem()
          returns whether the module is compatible with the current OS, Mesquite system, Java VM, and so on.
 java.awt.Frame containerOfModule()
          Returns the window of the MesquiteModule, or if none, the window of the nearest employer with a window.
 java.lang.String createSupportDirectory()
           
 void deleteSupportDirectory()
           
 void discreetAlert(boolean beDiscreet, java.lang.String s)
          If scripting, puts alert in log; otherwise puts up alert dialog.
 void discreetAlert(CommandRecord commandRec, java.lang.String s)
          If scripting, puts alert in log; otherwise puts up alert dialog.
protected  void dispose()
          dispose is called automatically when an employee is fired.
 void disposing(java.lang.Object obj)
          passes which object is being disposed (from MesquiteListener interface)
 java.lang.Object doCommand(java.lang.String commandName, java.lang.String arguments, CommandRecord commandRec, CommandChecker checker)
          A request for the MesquiteModule to perform a command.
 void echoStringToFile(java.lang.String s, java.lang.StringBuffer sb)
           
 void employeeOutputInvalid(MesquiteModule employee, MesquiteModule source, CommandRecord commandRec)
          Generated by an employee calling its outputInvalide method.
 void employeeParametersChanged(MesquiteModule employee, MesquiteModule source, Notification notification, CommandRecord commandRec)
          Generated by an employee calling its parametersChanged method.
 void employeeQuit(MesquiteModule employee)
          Generated by an employee who quit.
 MesquiteModule employerWithWindow()
          Returns the employer with a window
 void endJob()
          endJob is called as a module is quitting; modules should put their clean up code here.
 void fileAboutToBeWritten(MesquiteFile f)
          A method called immediately before a file is to be saved.
 void fileDirtiedByCommand(MesquiteCommand command)
          for FileDirtier interface
 void fileElementAdded(FileElement element)
          A method called when a FileElement added to the project; module can respond as needed (e.g., InitializeParsimony can add default model set to a CharacterData.
 void fileReadIn(MesquiteFile f)
          A method called immediately after the file has been read in or completely set up (if a new file).
 void finalize()
           
 NexusBlock findNEXUSBlock(FileElement e)
          Finds the NEXUS block containing the given FileElement.
 java.lang.String getAppletInfo()
           
 java.lang.String getAuthors()
          Returns the authors of the module.
 boolean getAutoSaveMacros()
          Returns whether module has requested to enable auto-save of macros.
 java.lang.String getBrowserManualPath()
          returns path to manual.
 HPanel getBrowserPanel()
          Asks for hierarchy browser panel (File coordinator or trunk should override to return.
static java.lang.String getBuildDate()
          returns build date of the Mesquite system (e.g., "22 September 2003")
static java.lang.String getBuildVersion()
          returns build number of the Mesquite system (e.g., "e58")
 java.lang.String getCitation()
          Returns the citation of the module.
 java.lang.String getCommandPagePath()
          returns path to page showing the commands.
 CompatibilityTest getCompatibilityTest()
          Returns CompatibilityTest so other modules know if this is compatible with some object.
 java.lang.String getDateReleased()
          returns the year released, as a string.
 java.lang.String[] getDefaultModule()
          Returns name of default module for superclass.
static java.lang.String getDocsPath()
          returns path to the root directory of the documentation of Mesquite
abstract  java.lang.Class getDutyClass()
          Returns duty Class the module belongs to; should be defined not by module itself but by abstract class representing duty
 java.lang.String getDutyName()
          Returns the name of the duty; set by the duty-defining library classes.
 java.lang.String getExpectedPath()
          returns a local file path expected by the module.
 java.lang.String getExplanation()
          returns an explanation of what the module does.
 java.lang.Class getHireSubchoice()
          Returns duty Class that module would like to hire immediately upon hiring.
 long getID()
          instantiations of modules are numbered sequentially so they can be referred to by number
 boolean getIfLastEmployee()
          Returns whether this module is to remain one of the last employees of its employers.
 java.lang.String getManualPath()
          returns path to manual.
static java.lang.String getMesquiteVersion()
          returns version of the Mesquite system
 MesquiteModuleInfo getModuleInfo()
          Returns module info for module
abstract  java.lang.String getName()
          Returns the name of the module
 java.lang.String getNameAndParameters()
          returns name plus current parameters, for logging etc..
 java.lang.String getNameForMenuItem()
          Returns the name of the module for menu items.
 NexusBlockTest getNexusBlockTest()
          Returns NexusBlockTest so interpreter knows if this module can interpret a block.
 java.lang.String getNexusCommands(MesquiteFile file, java.lang.String blockName)
          Return any nexus commands belonging to block in file.
 NexusCommandTest getNexusCommandTest()
          Returns NexusCommandTest so interpreter knows if this module can interpret a command.
 java.lang.String getPackageImagesPath()
          returns path to the image directory for this module's images
 MesquiteModuleInfo getPackageIntroModule()
          Returns the name of the module introducing package of modules (e.g., "#aParsimonyIntro")
 java.lang.String getPackagePath()
          returns path to this module's package directory
 java.lang.String getParameters()
          returns current parameters, for logging etc..
 java.lang.String getPath()
          returns path to this module's directory
 java.lang.String getPermanentIDString()
          A string that uniquely refers to this module (unique even across runs of Mesquite)
 MesquiteProject getProject()
          Returns the project of the MesquiteModule
static java.lang.String getRootImageDirectoryPath()
          returns path to the root directory of Mesquite images
static java.lang.String getRootPath()
          returns path to the root directory of Mesquite (i.e., above mesquite, images, etc.)
 java.lang.String getShortClassName()
          returns short (not full package) name of class
static java.lang.String getShortClassName(java.lang.Class classToShow)
          returns short (not full package) name of class
static java.lang.String getSizedRootImageFilePath(int s, java.lang.String imageFileName)
           
 Snapshot getSnapshot(MesquiteFile file)
          Return Mesquite commands that will put the module (approximately) back into its current state.
 java.lang.String getURLString()
          Returns a String containing the URL for this module
 boolean getUserChooseable()
          Returns true if the module is to appear in menus and other places in which users can choose, and if can be selected in any way other than by direct request
 java.lang.String getVersion()
          returns the version number string of the module.
 int getVersionInt()
          returns the version number string of the module as an integer.
 int getVersionOfFirstRelease()
          returns the version number at which this module was first released.
 java.lang.String getVeryShortName()
          Returns the name of the module in very short form.
 int getXMLPrefsVersion()
           
 void iQuit()
          To be called by a module to close down on its own (as opposed to being fired).
 void iQuit(boolean giveMessage)
           
 boolean isPrerelease()
          returns whether this module is a prerelease version.
 boolean isSubstantive()
          returns whether this module does substantive calculations affecting analysis results, or only a graphical/UI/input-output module
 java.lang.String listEmployeeParameters(java.lang.String spacer)
          Lists the parameters of all employees of this MesquiteModule.
 void loadPreferences()
          This causes the file "prefs" in the module's directory to be read, and the contents are then sent to "processPreferencesFromFile".
 void log(java.lang.String s)
          Places string in log AND in System.out.println.
 void log(java.lang.String s, CommandRecord commandRec, boolean echoToDetails)
          Places string in log AND in System.out.println.
 void logln(java.lang.String s)
          Places string and newline character in log AND in System.out.println.
 void logln(java.lang.String s, CommandRecord commandRec)
          Places string and newline character in log AND in System.out.println.
 void logln(java.lang.String s, CommandRecord commandRec, boolean echoToDetails)
          Places string and newline character in log AND in System.out.println.
 void loglnNoEcho(java.lang.String s)
          Places string and newline character in log.
 void logNoEcho(java.lang.String s)
          Places string in log.
static MesquiteCommand makeCommand(java.lang.String commandName, Commandable ownerObject)
          Commands are created here.
 void mesquiteStartup()
          Called during Mesquite startup when the list of available modules is being constructed.
static boolean nameIsInstanceOf(java.lang.String n, java.lang.Class c)
          returns whether the passed class, or a superclass or interface of it, has the passed name
 boolean nameMatches(java.lang.String s)
          returns whether name of Module matches passed String.
 void offHold()
          Called typically by employer to turn off hold, therefore don't update graphics.
 boolean okToDispose(java.lang.Object obj, int queryUser)
          passes which object is being disposed (from MesquiteListener interface)
 void onHold()
          Called typically by employer to indicate that will be called soon, therefore don't update graphics.
 void outputInvalid(CommandRecord commandRec)
          This passes an employeeOutputInvalid call to the employer, and so on, until some employer overrides it to do something about it.
 void pageModule(MesquiteModule fromModule, boolean persistent)
          for the paging system (may be defunct)
 void parametersChanged(CommandRecord commandRec)
           
 void parametersChanged(Notification notification, CommandRecord commandRec)
          A generic call to tell employer that the module's parameters have changed sufficiently that its basic calculations are no longer valid, and a recalculation should be requested.
 boolean permanentIDExists(java.lang.String id)
           
 java.lang.String[] preparePreferencesForFile()
          This is called following a "storePreferences" call by a module.
 java.lang.String preparePreferencesForXML()
          This is called following a "storePreferences" call by a module.
 void processPreferencesFromFile(java.lang.String[] prefs)
          This is called following a "loadPreferences" call by a module.
 void processPreferencesFromXML(java.lang.String prefsXML)
          This is called following a "loadPreferences" call by a module.
 void processSingleXMLPreference(java.lang.String tag, java.lang.String content)
          This is called following a "processPreferencesFromXML" call by a module.
 void projectEstablished()
          A method called immediately after the file has been established but not yet read in.
 boolean quittingConditions()
          Query module as to whether conditions are such that it will have to quit soon -- e.g.
 NexusBlock readNexusBlock(MesquiteFile file, java.lang.String name, FileBlock block, java.lang.StringBuffer blockComments, java.lang.String fileReadingArguments, CommandRecord commandRec)
          Read the nexus block passed (passed only to modules claiming they can read it).
 boolean readNexusCommand(MesquiteFile file, NexusBlock nBlock, java.lang.String blockName, java.lang.String command, MesquiteString comment)
          Read the nexus command in the given block (passed only to modules claiming they can read it).
 void readUnrecognizedCommand(MesquiteFile file, NexusBlock nBlock, java.lang.String blockName, FileBlock block, java.lang.String commandName, java.lang.String command, java.lang.StringBuffer blockComments, MesquiteString comment)
          Read the unrecognized command, first by looking for a module reading it, second by storing it as unrecognized within the nexus block.
 void removeNEXUSBlock(NexusBlock nb)
          Remove NEXUS block from the file.
 void removePaging(MesquiteModule fromModule)
          for the paging system (may be defunct)
 void reportProfiling()
          Requests modules to report profiling.
 boolean requestPrimaryChoice()
          returns whether this module is requesting to appear as a primary choice
protected  void respondToPaging()
          for the paging system (may be defunct)
protected  void returningPage(MesquiteModule pagedModule)
          for the paging system (may be defunct)
 void setAutoSaveMacros(boolean aut)
          Sets whether module has requested to enable auto-save of macros.
 void setProject(MesquiteProject proj)
          sets the file of the MesquiteModule
 void setToLastEmployee(boolean last)
          Sets this module to remain one of the last employees of its employers.
 boolean showCitation()
          Returns whether or not the module does substantive calculations and thus should be cited.
static void showLogWindow()
          Shows the log window.
static void showLogWindow(boolean bringToFront)
          Shows the log window.
 void showManual()
          shows manual for module
 void showMe()
          In some way shows the module, either by showing its window or its place in hierarchy
static void showWebPage(java.lang.String path, boolean autoCompose)
           
static void showWebPage(java.lang.String path, boolean autoCompose, boolean removePastNumberSign)
           
 boolean sorry(CommandRecord commandRec, java.lang.String s)
          Displays a message and returns false.
abstract  boolean startJob(java.lang.String arguments, java.lang.Object condition, CommandRecord commandRec, boolean hiredByName)
          startJob is called automatically when an employee is hired.
 void startProfiling()
          Requests modules to start profiling.
 void storePreferences()
          This causes the file "prefs" in the module's directory to be written, using contents returned by the module via "preparePreferencesForFile"
 boolean superStartJob(java.lang.String arguments, java.lang.Object condition, CommandRecord commandRec, boolean hiredByName)
          superStartJob is called automatically when an employee is hired.
 java.lang.String supportDirectoryPath()
           
 java.lang.String toString()
           
 void windowGoAway(MesquiteWindow whichWindow)
          Requests a window to close.
 boolean writeNexusCommands(MesquiteFile file, java.lang.String blockName, MesquiteString pending)
          Writes any nexus commands to file.
 boolean xmlPrefsVersionMustMatch()
           
 
Methods inherited from class mesquite.lib.EmployerEmployee
canHireMoreThanOnce, closeDownAllEmployees, decrementEmployeeBrowserRefreshSuppression, deferBranchPriority, employeeOfWhichEmployee, findCharacterDataEditor, findCharacterDataEditorRec, findElementManager, findEmployee, findEmployee, findEmployeeWithDuty, findEmployeeWithDuty, findEmployeeWithIDNumber, findEmployeeWithName, findEmployeeWithName, findEmployeeWithName, findEmployeeWithPermanentID, findEmployerWithDuty, findImmediateEmployeeWithDuty, findModelCurator, findModelCuratorRec, findModules, findModulesWithDuty, findNearestColleagueWithDuty, findNearestColleagueWithName, findNearestModuleWithDuty, findNextEmployeeWithDuty, fireEmployee, getClonableEmployeeCommand, getEmployeeReference, getEmployeeVector, getEmployer, getEmployerPath, getExplanationByWhichHired, getFileCoordinator, getHColor, getHDaughters, getHImage, getHiredAs, getHiringCommand, getHiringCondition, getHMother, getHShow, getImmediateEmployeesWithDuty, getNextEmployeeWithDuty, getNumberOfEmployees, getNumSupplements, getSupplementName, getTypeName, hireAllCompatibleEmployees, hireAllEmployees, hireAllOtherCompatibleEmployees, hireAllOtherEmployees, hireCompatibleEmployee, hireEmployee, hireEmployeeFromModuleInfo, hireNamedEmployee, hireNamedEmployee, hireNamedEmployee, hNodeAction, hSupplementTouched, incrementEmployeeBrowserRefreshSuppression, instantiateEmployee, instantiateModule, internalStartUp, isEmployerOf, isMacroAnchor, isPriorityFixed, listEmployees, makeEmployeeVector, moduleActiveWord, moveEmployeeToFront, numCompatibleModulesAvailable, numModulesAvailable, purposeOfEmployee, queryChooseModule, refreshBrowser, replaceCompatibleEmployee, replaceEmployee, replaceEmployeeWithNext, setHiringCommand, setPriorityFixed, setShowHiringPath, whatIsMyPurpose
 
Methods inherited from class mesquite.lib.MenuOwner
addAuxiliaryMenu, addCheckMenuItem, addCheckMenuItemToSubmenu, addItemToSubmenu, addItemToSubmenu, addLineToSubmenu, addMenuItem, addMenuItem, addMenuItem, addMenuLine, addModuleMenuItems, addSubmenu, addSubmenu, addSubmenu, addSubmenu, addSubmenu, checkMISVector, composeMenuBar, decrementMenuResetSuppression, defineMenus, deleteMenuItem, destroyMenu, disposeMenuSpecifications, doom, findMenuAmongEmployers, getContainingMenuSpec, getMenuItemSpecs, getMenuResetSuppression, getModuleWindow, getUseMenubar, incrementMenuResetSuppression, isDoomed, makeMenu, needsMenu, recomposeWindowsMenu, resetAllMenuBars, resetAllWindowsMenus, resetContainingMenuBar, setMenuToUse, setModule, setModuleWindow, setUseMenubar, showPopUp, zeroMenuResetSuppression
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mesquiteTrunk

public static MesquiteTrunk mesquiteTrunk
Static storage so that everyone can find the trunk MesquiteModule object


mesquiteDirectory

public static java.io.File mesquiteDirectory
The root of the mesquite classpath.


mesquiteDirectoryPath

public static java.lang.String mesquiteDirectoryPath
The root of the mesquite classpath.


prefsDirectory

public static java.io.File prefsDirectory
The directory that includes all the preference files.


userDirectory

public static java.io.File userDirectory
The user's directory.


logWindow

public static LogWindow logWindow
The window, created by mesquiteTrunk, that displays the log.


browserString

protected static java.lang.String browserString
the file path to the web browser for showing web pages


checkMethodsAtStartup

public static boolean checkMethodsAtStartup
true if does extra check for module compatibility at startup.


author

public static Author author
The default author for this machine and user account


hiredAsDefaultInScripting

public boolean hiredAsDefaultInScripting
This module was hired as a default choice in scripting


totalFinalized

public static int totalFinalized

moduleInfo

protected MesquiteModuleInfo moduleInfo
the MesquiteModuleInfo that refers to the module


proj

protected MesquiteProject proj
The project that the module was hired under. Almost all modules are descendant from a file coordinating module that belongs to a specific project


textEdgeCompensationHeight

public static int textEdgeCompensationHeight

textEdgeCompensationWidth

public static int textEdgeCompensationWidth
Constructor Detail

MesquiteModule

public MesquiteModule()
The constructor in general is to be avoided, because modules are instantiated momentarily on startup to gather information. The usual functions of a constructor are performed by startJob

Method Detail

getID

public long getID()
instantiations of modules are numbered sequentially so they can be referred to by number

Specified by:
getID in interface Identifiable

getPermanentIDString

public java.lang.String getPermanentIDString()
A string that uniquely refers to this module (unique even across runs of Mesquite)


broadCastAssignedID

public void broadCastAssignedID(MesquiteModule module,
                                java.lang.String assignedID,
                                CommandRecord commandRec)
Broadcasts that an id has been assigned to a module. This is used for scripting, in which a module assigns itself an id string in a snapshot (e.g., a TreeContext) that an interested module can clue in to (e.g., TreeOfContext). This allows the interested module to hook up to the assigning module even if the former was script-created before the latter (see interaction between BasicTreeWindow and TreeOfContext)


superStartJob

public boolean superStartJob(java.lang.String arguments,
                             java.lang.Object condition,
                             CommandRecord commandRec,
                             boolean hiredByName)
superStartJob is called automatically when an employee is hired. This is intended for use by superclasses of modules that need their own constructor-like call, without relying on the subclass to be polite enough to call super.startJob().


startJob

public abstract boolean startJob(java.lang.String arguments,
                                 java.lang.Object condition,
                                 CommandRecord commandRec,
                                 boolean hiredByName)
startJob is called automatically when an employee is hired. The parameter scripting indicates if the hiring occurs in the context of automated scripting (e.g., on reading a Mesquite block of a NEXUS file). The module can limit user interface calls (e.g. dialog boxes) when scripting occurs.

The MesquiteModule should override this method, to add code to initialize things it needs, and to hire relevant necessary employees. startJob must return true if the module was successfully started; false otherwise. Thus, if the module needs a data matrix but the file has none, it returns false and the hiring process is undone.

Most modules will ignore the arguments and condition.


endJob

public void endJob()
endJob is called as a module is quitting; modules should put their clean up code here.


finalize

public void finalize()
              throws java.lang.Throwable
Throws:
java.lang.Throwable

dispose

protected void dispose()
dispose is called automatically when an employee is fired. It fires all employees and their subemployees etc. The MesquiteModule should call endJob to finalize things it needs.. NOTE: if a module wants to quit on its own accord, it should call "iQuit" so that the replacement hiring system can take effect.


iQuit

public final void iQuit()
To be called by a module to close down on its own (as opposed to being fired). This might happen, for example, if conditions change so that the module can no longer function (e.g. all stored matrices are deleted from a file, and so StoredMatrices can no longer supply matrices). A module could also call its own endJob() method, but iQuit is to be preferred because it