apollo.editor
Class AnnotationChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by apollo.editor.FeatureChangeEvent
          extended by apollo.editor.AnnotationChangeEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AnnotationAddEvent, AnnotationCompoundEvent, AnnotationDeleteEvent, AnnotationReplaceEvent, AnnotationUpdateEvent, AnnotSessionDoneEvent

public class AnnotationChangeEvent
extends FeatureChangeEvent

A controller managed event class which signals when a change is made to a set of annotations and what type of change occurred. Objects interested in listening for these event should implement the FeatureChangeListener interface and register with the controller. Eventually I would like this to just be a carrier/wrapper for a transaction, so it could/should just query transaction for everything. All of its fields are really redundant of transactions.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class apollo.editor.FeatureChangeEvent
ADD, DELETE, logger, MERGE, parentFeature, REDRAW, REPLACE, SPLIT, SYNC
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected AnnotationChangeEvent(java.lang.Object source)
          Solely for edit session done event
protected AnnotationChangeEvent(java.lang.Object source, AnnotatedFeatureI feature)
          No subpart
protected AnnotationChangeEvent(java.lang.Object source, AnnotatedFeatureI changedFeat, TransactionSubpart subpart)
          With subpart
 
Method Summary
 void addTransaction(Transaction trans)
          If compound change event, add trans to compound transaction AnnotationCompoundEvent overrides no-op
 AnnotatedFeatureI getAnnotTop()
          rename get change top? annot top? should this return an AnnotatedFeatureI? rename getAnnotRoot?
 AnnotatedFeatureI getChangedAnnot()
           
 SeqFeatureI getChangeTop()
           
 AnnotationChangeEvent getChildChangeEvent(int i)
          Default is null.
 AnnotatedFeatureI getDeletedFeature()
           
 int getNumberOfChildren()
          If compound event return # of child events, default 0
 Comment getOldComment()
           
 java.lang.String getOldId()
          A parent update for transcripts will change the transcript id and make it impossible to update the db.
 java.lang.String getOldString()
           
 SeqFeatureI getParentFeature()
           
 int getSubpartRank()
           
 boolean isCommentChange()
           
 boolean isStringChange()
           
 boolean isUndo()
           
 void setDeletedFeature(AnnotatedFeatureI delFeat)
           
 void setOldComment(Comment comment)
          For comment deletes
 void setOldId(java.lang.String oldId)
          Set original id before update of parent changed it.
 void setOldString(java.lang.String oldString)
          for updates(name...) and deletes(syn) to strings
 void setSubpartRank(int rank)
          For subparts that are lists, like comments and synoyms we need to know which item in the list is being operated on
 java.lang.String toString()
           
 
Methods inherited from class apollo.editor.FeatureChangeEvent
getAddedFeature, getChangedFeature, getOperation, getOperationAsString, getReplacedFeature, getSource, getSubpart, getUpdateDetails, hasSubpart, isAdd, isCompound, isDelete, isEndOfEditSession, isExonChange, isMerge, isMove, isRootAnnotChange, isSplit, isSync, isTranscriptChange, isUpdate, setChangeTop, setParentFeature, setReplacedFeature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotationChangeEvent

protected AnnotationChangeEvent(java.lang.Object source)
Solely for edit session done event


AnnotationChangeEvent

protected AnnotationChangeEvent(java.lang.Object source,
                                AnnotatedFeatureI feature)
No subpart


AnnotationChangeEvent

protected AnnotationChangeEvent(java.lang.Object source,
                                AnnotatedFeatureI changedFeat,
                                TransactionSubpart subpart)
With subpart

Method Detail

isUndo

public boolean isUndo()

getParentFeature

public SeqFeatureI getParentFeature()
Overrides:
getParentFeature in class FeatureChangeEvent

getNumberOfChildren

public int getNumberOfChildren()
If compound event return # of child events, default 0


getChildChangeEvent

public AnnotationChangeEvent getChildChangeEvent(int i)
Default is null. If compound event return ith chil event


addTransaction

public void addTransaction(Transaction trans)
If compound change event, add trans to compound transaction AnnotationCompoundEvent overrides no-op


getChangedAnnot

public AnnotatedFeatureI getChangedAnnot()

getDeletedFeature

public AnnotatedFeatureI getDeletedFeature()

setDeletedFeature

public void setDeletedFeature(AnnotatedFeatureI delFeat)

getAnnotTop

public AnnotatedFeatureI getAnnotTop()
rename get change top? annot top? should this return an AnnotatedFeatureI? rename getAnnotRoot?


getChangeTop

public SeqFeatureI getChangeTop()
Overrides:
getChangeTop in class FeatureChangeEvent

setSubpartRank

public void setSubpartRank(int rank)
For subparts that are lists, like comments and synoyms we need to know which item in the list is being operated on


getSubpartRank

public int getSubpartRank()

setOldString

public void setOldString(java.lang.String oldString)
for updates(name...) and deletes(syn) to strings


isStringChange

public boolean isStringChange()

getOldString

public java.lang.String getOldString()

setOldComment

public void setOldComment(Comment comment)
For comment deletes


getOldComment

public Comment getOldComment()

isCommentChange

public boolean isCommentChange()

setOldId

public void setOldId(java.lang.String oldId)
Set original id before update of parent changed it.


getOldId

public java.lang.String getOldId()
A parent update for transcripts will change the transcript id and make it impossible to update the db. getOldId returns the original ID of the transcript before changes.


toString

public java.lang.String toString()
Overrides:
toString in class FeatureChangeEvent