Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

apollo.gui
Class AnnotationChangeCoalescer  view AnnotationChangeCoalescer download AnnotationChangeCoalescer.java

java.lang.Object
  extended byapollo.gui.AnnotationChangeCoalescer
All Implemented Interfaces:
ControlledObjectI, java.io.Serializable

public class AnnotationChangeCoalescer
extends java.lang.Object
implements ControlledObjectI

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.
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


Field Summary
(package private)  java.util.Vector changes
           
(package private)  Controller controller
           
 
Constructor Summary
AnnotationChangeCoalescer(Controller c)
           
 
Method Summary
 void addChange(apollo.gui.event.AnnotationChangeEvent evt)
           
private  void coalesceChanges(apollo.datamodel.SeqFeatureI root)
          If both parent and child are set for a delete, removes child delete
 void executeChanges()
           
 void executeChangesOLD()
          This goes through the change events in the OPPOSITE order of how they were entered.
 void fireAnnotationChangeEvent(apollo.gui.event.AnnotationChangeEvent evt)
           
 Controller getController()
          Gets the Controller for the object
 java.lang.Object getControllerWindow()
           
 boolean needsAutoRemoval()
           
 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
 

Field Detail

changes

java.util.Vector changes

controller

Controller controller
Constructor Detail

AnnotationChangeCoalescer

public AnnotationChangeCoalescer(Controller c)
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()
Specified by:
getControllerWindow in interface ControlledObjectI

needsAutoRemoval

public boolean needsAutoRemoval()
Specified by:
needsAutoRemoval in interface ControlledObjectI

addChange

public void addChange(apollo.gui.event.AnnotationChangeEvent evt)

coalesceChanges

private void coalesceChanges(apollo.datamodel.SeqFeatureI root)
If both parent and child are set for a delete, removes child delete


executeChangesOLD

public void executeChangesOLD()
This goes through the change events in the OPPOSITE order of how they were entered. Why is that? It seems counter intuitive so im gonna change it to do it in the order entered. Can the changer have events added to it in the middle of executeChanges? Why is the redraw event not removed?


executeChanges

public void executeChanges()

fireAnnotationChangeEvent

public void fireAnnotationChangeEvent(apollo.gui.event.AnnotationChangeEvent evt)