edu.sdsc.mbt.viewables
Class StructureDocument

java.lang.Object
  extended byedu.sdsc.mbt.viewables.StructureDocument
All Implemented Interfaces:
java.io.Serializable

public class StructureDocument
extends java.lang.Object
implements java.io.Serializable

This class implements the top-level container document for one or more Structure objects.

Author:
John L. Moreland
See Also:

, Serialized Form


Field Summary
 Manager parent
           
 
Constructor Summary
StructureDocument(Manager c)
          Constructs a StructureDocument object with no initial Structure objects.
 
Method Summary
 void addEntry(Entry entry)
          Add an Entry to the list of managed/viewed structures, then send an event to inform all registered Viewer objects.
 void addEntryRecord(Entry e)
           
 void addViewer(Viewer viewer)
          Add a Viewer to the list of viewers.
 boolean containsId(java.lang.String id)
           
 boolean containsName(java.lang.String name)
           
 java.util.ArrayList getEntriesByType(int type)
           
 Entry getEntry(int index)
          Returns one of the loaded Entries by index
 Entry getEntryById(java.lang.String id)
          Returns a reference to an Entry by its id.
 Entry getEntryByName(java.lang.String name)
          Returns a reference to an Entry by its name.
 int getEntryCount()
          Returns count of Entries currently in the application
 java.util.Vector getEntryNames()
          This method returns a list of currently loaded entry names and is used by the entry loading mechanism to check ahead of time whether a particular entry has been loaded.
 java.util.ArrayList getViewers()
           
 void reloadContent()
           
 void removeEntry(Entry entry)
          Remove an Entry from this StructureDocument.
 void removeEntry(java.lang.String entryId)
          Remove an Entry from this StructureDocument.
 void removeEntryByName(java.lang.String name)
           
 void removeViewer(Viewer viewer)
          Remove a Viewer from the list of viewers.
 void renameEntry(Entry entry, java.lang.String name)
           
 void renameSequence(Sequence sequence, java.lang.String name)
          This method is called when individual sequences from composite entries are renamed in the sequence viewer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

public Manager parent
Constructor Detail

StructureDocument

public StructureDocument(Manager c)
Constructs a StructureDocument object with no initial Structure objects.

Method Detail

addEntry

public void addEntry(Entry entry)
              throws java.lang.IllegalArgumentException
Add an Entry to the list of managed/viewed structures, then send an event to inform all registered Viewer objects. Reference hash is created only for database-loaded entries that have both sequence and structure otherwise, it's left as null.

Throws:
java.lang.IllegalArgumentException

removeEntry

public void removeEntry(Entry entry)
                 throws java.lang.IllegalArgumentException
Remove an Entry from this StructureDocument.

Throws:
java.lang.IllegalArgumentException

removeEntry

public void removeEntry(java.lang.String entryId)
                 throws java.lang.IllegalArgumentException
Remove an Entry from this StructureDocument.

Throws:
java.lang.IllegalArgumentException

removeEntryByName

public void removeEntryByName(java.lang.String name)
                       throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getEntryCount

public int getEntryCount()
Returns count of Entries currently in the application

Returns:

getEntryNames

public java.util.Vector getEntryNames()
This method returns a list of currently loaded entry names and is used by the entry loading mechanism to check ahead of time whether a particular entry has been loaded.


getEntry

public Entry getEntry(int index)
Returns one of the loaded Entries by index

Parameters:
index - integer index of the Entry

getEntryByName

public Entry getEntryByName(java.lang.String name)
Returns a reference to an Entry by its name.

Parameters:
name - Entry name as a String
Returns:
Entry object reference

getEntryById

public Entry getEntryById(java.lang.String id)
Returns a reference to an Entry by its id.

Returns:
Entry object reference

addViewer

public void addViewer(Viewer viewer)
               throws java.lang.IllegalArgumentException
Add a Viewer to the list of viewers.

Throws:
java.lang.IllegalArgumentException

removeViewer

public void removeViewer(Viewer viewer)
                  throws java.lang.IllegalArgumentException
Remove a Viewer from the list of viewers.

Throws:
java.lang.IllegalArgumentException

containsId

public boolean containsId(java.lang.String id)

containsName

public boolean containsName(java.lang.String name)

getEntriesByType

public java.util.ArrayList getEntriesByType(int type)

addEntryRecord

public void addEntryRecord(Entry e)

reloadContent

public void reloadContent()

getViewers

public java.util.ArrayList getViewers()

renameSequence

public void renameSequence(Sequence sequence,
                           java.lang.String name)
This method is called when individual sequences from composite entries are renamed in the sequence viewer

Parameters:
sequence -
name -

renameEntry

public void renameEntry(Entry entry,
                        java.lang.String name)