apollo.editor
Class ChangeList

java.lang.Object
  extended by apollo.editor.ChangeList
All Implemented Interfaces:
ControlledObjectI, java.io.Serializable

public class ChangeList
extends java.lang.Object
implements ControlledObjectI

TransactionManager does the real coalescing for saving transactions. This is more like the place where events are stored before firing now. Renamed ChangeList (used to be AnnotationChangeCoalescer) The AnnotationChangeCoalescer holds all the AnnotationChangeEvents for the current edit along with a representation of the feature tree before the edit began.

NOTE: THIS CLASS IS NOT FULLY IMPLEMENTED.

As edits are added to the AnnotationChangeCoalescer it checks to see if they can be coalesced - for example if you delete all the exons in a transcript and then delete the transcript the edit can be coalesced into a delete transcript - all the delete exon AnnotationChangeEvents can be removed from the changes vector.

A new AnnotationChangeCoalescer should be created at the start of each edit in the AnnotationEditor because it is important that the tree representing the underlying features (the origTree) is current. After that it is simply a matter of adding changes using addChanges. At the end of the edit executeChanges is called to send the AnnotationChangeEvents to all the listeners.

Remember that the Drawable tree will be in tht origTree state until executeChanges is called. This is VERY important for deciding which edits are necessary.

delete exon
Check if its in the add list
Look to see if any of the current parents of the exon have
been deleted.
delete transcript
Check if its in the add list
Look to see if any of the current parents of the transcript
have been deleted.
Look to see if any of the previous children of the
transcript have been deleted - remove those.
delete gene
Check if its in the add list
Look to see if any of the previous children of the
gene have been deleted - remove those.
I dont think any of the add checks are currently happening, just the delete checks.
add exon
Add to add list
Look to see if any of the current parents of the exon have
already been added.
Could do error check if add to parents which have already
been deleted.
add transcript
Add to add list
add gene
Add to add list
other exon
other transcript
other gene
The only reason i can see that this implements ControlledObjectI is so SyntenyLinkPanel can avoid firing at its controller - but ACC is not even the event source - so actually I dont think being a ControlledObjectI serves any purpose as getControllerWindow is null. Not sure about this but this could eventually just be a list of transactions(?) and convert to change events at firing time.

See Also:
Serialized Form

Constructor Summary
ChangeList(Controller c)
          for gene edit panel
 
Method Summary
 void addChange(AnnotationChangeEvent evt)
          Add change to end of changes list
 void addChangeList(ChangeList changeList)
           
 void executeChanges()
          calls coalesceChanges which seems to be broken.
 Controller getController()
          Gets the Controller for the object
 java.lang.Object getControllerWindow()
          Shouldnt this return Window - would we ever want a non-window?
 boolean needsAutoRemoval()
          Since getControllerWindow is null, needsAutoRemoval is meaningless
 void setController(Controller c)
          Sets the Controller for the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeList

public ChangeList(Controller c)
for gene edit panel

Method Detail

getController

public Controller getController()
Description copied from interface: ControlledObjectI
Gets the Controller for the object

Specified by:
getController in interface ControlledObjectI

setController

public void setController(Controller c)
Description copied from interface: ControlledObjectI
Sets the Controller for the object

Specified by:
setController in interface ControlledObjectI

getControllerWindow

public java.lang.Object getControllerWindow()
Description copied from interface: ControlledObjectI
Shouldnt this return Window - would we ever want a non-window?

Specified by:
getControllerWindow in interface ControlledObjectI

needsAutoRemoval

public boolean needsAutoRemoval()
Since getControllerWindow is null, needsAutoRemoval is meaningless

Specified by:
needsAutoRemoval in interface ControlledObjectI

addChange

public void addChange(AnnotationChangeEvent evt)
Add change to end of changes list


addChangeList

public void addChangeList(ChangeList changeList)

executeChanges

public void executeChanges()
calls coalesceChanges which seems to be broken. puts redraw event at end fires all events - only one redraw event fired.