apollo.editor
Class FeatureChangeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by apollo.editor.FeatureChangeEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AnnotationChangeEvent, ResultChangeEvent

public abstract class FeatureChangeEvent
extends java.util.EventObject

A controller managed event class which signals when a change is made to a set of features and what type of change occurred. Objects interested in listening for these event should implement the FeatureChangeListener interface and register with the controller.

See Also:
Serialized Form

Field Summary
static int ADD
          Replace these with TransactionOperation!
static int DELETE
           
protected static org.apache.log4j.Logger logger
           
static int MERGE
           
protected  SeqFeatureI parentFeature
          parent only explictly set for deletes
static int REDRAW
           
static int REPLACE
          Replace means rip out the old, put in new feat
static int SPLIT
           
static int SYNC
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
protected FeatureChangeEvent(java.lang.Object source)
          For edit session done event.
protected FeatureChangeEvent(java.lang.Object source, SeqFeatureI changedFeature)
          No subpart
  FeatureChangeEvent(java.lang.Object source, SeqFeatureI changeTop, int operation, SeqFeatureI feature1, SeqFeatureI feature2)
          This constructor needs to be vanquished i think.
protected FeatureChangeEvent(java.lang.Object source, SeqFeatureI changedFeature, TransactionSubpart subpart)
          With subpart
 
Method Summary
 SeqFeatureI getAddedFeature()
          Convenience.
 SeqFeatureI getChangedFeature()
          This is the feature that has been added,deleted,updated,...
 SeqFeatureI getChangeTop()
           
 int getOperation()
           
protected  java.lang.String getOperationAsString()
           
 SeqFeatureI getParentFeature()
           
 AnnotatedFeatureI getReplacedFeature()
          Returns feature replaced for replace event.
 java.lang.Object getSource()
           
 TransactionSubpart getSubpart()
          Returns null if no subpart
 UpdateDetailsI getUpdateDetails()
          Update event has a bunch of stuff - need to be able to acces this from superclass - separate UpdateDetail class with update stuff? EventDetail? for now just get the update event
 boolean hasSubpart()
           
 boolean isAdd()
           
 boolean isCompound()
          whether event is a compound event - ie contains child transactions/events.
 boolean isDelete()
           
 boolean isEndOfEditSession()
          once compound transactions are fully in place i think this can be phased out essentially this can be seen as a hack around a lack of compound transactions.
 boolean isExonChange()
          Replaces Object Class EXON
 boolean isMerge()
           
 boolean isMove()
          Move is a special case of UPDATE - updating parent subpart AnnotationUpdateEvent overrides this
 boolean isRootAnnotChange()
          This takes place of ObjectClass ANNOTATION
 boolean isSplit()
           
 boolean isSync()
           
 boolean isTranscriptChange()
          Replaces Object Class TRANSCRIPT
 boolean isUpdate()
          Default false - overridden by AnnotationUpdateEvent
protected  void setChangeTop(SeqFeatureI changeTop)
           
 void setParentFeature(SeqFeatureI parent)
          Set the parent of the edited feature.
protected  void setReplacedFeature(AnnotatedFeatureI replacedFeature)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

ADD

public static final int ADD
Replace these with TransactionOperation!

See Also:
Constant Field Values

DELETE

public static final int DELETE
See Also:
Constant Field Values

REDRAW

public static final int REDRAW
See Also:
Constant Field Values

SYNC

public static final int SYNC
See Also:
Constant Field Values

SPLIT

public static final int SPLIT
See Also:
Constant Field Values

MERGE

public static final int MERGE
See Also:
Constant Field Values

REPLACE

public static final int REPLACE
Replace means rip out the old, put in new feat

See Also:
Constant Field Values

parentFeature

protected SeqFeatureI parentFeature
parent only explictly set for deletes

Constructor Detail

FeatureChangeEvent

public FeatureChangeEvent(java.lang.Object source,
                          SeqFeatureI changeTop,
                          int operation,
                          SeqFeatureI feature1,
                          SeqFeatureI feature2)
This constructor needs to be vanquished i think. Going away from generic feature1 and feature 2.


FeatureChangeEvent

protected FeatureChangeEvent(java.lang.Object source,
                             SeqFeatureI changedFeature)
No subpart


FeatureChangeEvent

protected FeatureChangeEvent(java.lang.Object source,
                             SeqFeatureI changedFeature,
                             TransactionSubpart subpart)
With subpart


FeatureChangeEvent

protected FeatureChangeEvent(java.lang.Object source)
For edit session done event.

Method Detail

isEndOfEditSession

public boolean isEndOfEditSession()
once compound transactions are fully in place i think this can be phased out essentially this can be seen as a hack around a lack of compound transactions.


getSource

public java.lang.Object getSource()
Overrides:
getSource in class java.util.EventObject

getChangeTop

public SeqFeatureI getChangeTop()

setChangeTop

protected void setChangeTop(SeqFeatureI changeTop)

getOperation

public int getOperation()

isRootAnnotChange

public boolean isRootAnnotChange()
This takes place of ObjectClass ANNOTATION


isTranscriptChange

public boolean isTranscriptChange()
Replaces Object Class TRANSCRIPT


isExonChange

public boolean isExonChange()
Replaces Object Class EXON


getOperationAsString

protected java.lang.String getOperationAsString()

isAdd

public boolean isAdd()

getAddedFeature

public SeqFeatureI getAddedFeature()
Convenience. If operation is ADD then feature2 is the added feature is getChangedFeature good enough? get rid of?


getChangedFeature

public SeqFeatureI getChangedFeature()
This is the feature that has been added,deleted,updated,...


setParentFeature

public void setParentFeature(SeqFeatureI parent)
Set the parent of the edited feature. I think this will only be needed for deletes, where parent and child have been severed (how tragic)


getParentFeature

public SeqFeatureI getParentFeature()

isDelete

public boolean isDelete()

isMerge

public boolean isMerge()

isSplit

public boolean isSplit()

isMove

public boolean isMove()
Move is a special case of UPDATE - updating parent subpart AnnotationUpdateEvent overrides this


getReplacedFeature

public AnnotatedFeatureI getReplacedFeature()
Returns feature replaced for replace event. getChangedFeature returns the feature that has taken its place. Replace is solely for annot info editors limited undo. Once we have real undo Replace will go by the wayside.


setReplacedFeature

protected void setReplacedFeature(AnnotatedFeatureI replacedFeature)

isSync

public boolean isSync()

isUpdate

public boolean isUpdate()
Default false - overridden by AnnotationUpdateEvent


getUpdateDetails

public UpdateDetailsI getUpdateDetails()
Update event has a bunch of stuff - need to be able to acces this from superclass - separate UpdateDetail class with update stuff? EventDetail? for now just get the update event


hasSubpart

public boolean hasSubpart()

getSubpart

public TransactionSubpart getSubpart()
Returns null if no subpart


isCompound

public boolean isCompound()
whether event is a compound event - ie contains child transactions/events. default is false.


toString

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