- Requirements
- Users survey
- Vision
- Configuration
- Jython Dependencies
- Interface Specification for Helpers and Tools
- Preferences
- Using a JDOM document as a Swing Document
- Using Jython and Java




Interface Specification for Helpers and Tools

1. Helper

A synonym for helper is controller. It reacts to change, deletion and insertion of elements and attributes. Helpers are mostly used to keep certain semantic restrictions valid, for example that the sequence length displays the actual length of the sequence.

1.1. Helper interface

interface Helper { //Variables DocumentFrame docFrame String name String description Hashtable documentTypes

//Methods elementChanged(...) elementDeleted(...) elementInserted(...) setters/getters }

The variable docFrame gives access to the view factory, the XML document and the document panel. The description should give a brief overview about the function of this helper.

The hash table documentTypes contains all supported document types as keys. The values are vectors of XPath expressions which define the elements the helper wants to observe.

1.2. Helper use example

An evidence tag is inserted, the evidence helper is called. It checks if the referred evidence description is already there. If it is not found, the helper creates a new evidence in the evidence set (If the evidence set is not found, also an evidence set is created). Afterwards the helper sets the caret to the newly created evidence description. Now the editor awaits input for the description. An alternative behaviour might be that the helper creates a warning, that the referred evidence is not found.

2. Tool

A tool is an editor extension which provides a utility for a certain document type(s). An example for the SP-ML document type would be a tool facilitating FastA, Smith-Waterman, Blast and Decypher similarity searches on the sequence of the entry.

2.1. Tool interface

A tool is, in contrast to a helper, called manually. Therefore the interface of a tool is slightly different to the one of a helper. There is no need for the methods elementChanged, elementDeleted and elementInserted , as a tool is not interested in the current changes. It is instead called via the method activateTool . A tool also has two additional properties: the preferred keyboard shortcut and a flag whether it needs interaction with the user or not.

interface Tool { //Variables DocumentFrame docFrame String name String description Hashtable documentTypes String prefShortcut Boolean isInteractive

//Methods setters/getters activateTool() }