Although the MX architecture provides the ability to define modules, and their interaction with each other, they do not provide any specific Cinema functionality. It would be possible to provide all of this functionality through the MX system, by accessing specific modules. However for convenience the XMLModule class has been extended, to give access to a number of different method, through the CinemaModule class. 1Additionally there is a more specific CinemaCoreGui class, which gives access to more methods, which gives direct access to the widgets used to build the basic Cinema-MX frame. Essentially the rule is extend the CinemaModule unless you really need the CinemaGuiModule as the latter is less likely to remain stable.
[caption=The Cinema Module, label=lst:cin-mod] public abstract class CinemaModule extends XMLModule implements AlignmentEventProvider public SequenceAlignment getSequenceAlignment() public void setSequenceAlignment( SequenceAlignment seq ) public ColorMap getColorMap() public void setColorMap( ColorMap map ) public AlignmentSelectionModel getAlignmentSelectionModel() public void setAlignmentSelectionModel( AlignmentSelectionModel model ) public void setSequenceTitleColor( GappedSequence seq, Color colour ) public void clearSequenceTitleColor( GappedSequence seq ) public void sendStatusMessage( String message ) // CinemaModule
The interface of the CinemaModule is shown in Listing 11. Direct access is provided to the alignment being shown, to the ColorMap. 2The other methods give access to other information associated with the view, including the Selection Model, the colour associated with the sequence, and a status message which appears at the bottom of the Cinema-MX frame.