Package org.biojava.utils
Interface ChangeListener
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
AbstractSymbolList.EditScreener
,AbstractSymbolList.EditTranslater
,Annotatable.AnnotationForwarder
,ChangeAdapter
,ChangeForwarder
,ChangeForwarder.Retyper
,ChangeListener.AlwaysVetoListener
,ChangeListener.ChangeEventRecorder
,ChangeListener.LoggingListener
,Distribution.NullModelForwarder
,MergeAnnotation.PropertyForwarder
,OverlayAnnotation.PropertyForwarder
,PairwiseSequenceRenderer.PairwiseRendererForwarder
,SequenceDBWrapper.SequencesForwarder
,SequenceRenderer.RendererForwarder
,SimpleSymbolList
Interface for objects which listen to ChangeEvents.
- Since:
- 1.1
- Author:
- Thomas Down, Matthew Pocock, Keith James
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
An implementation that always vetoes everything.static class
A listener that remembers the ChangeEvent of the last change.static class
A listener that writes information about the event stream to a PrintStream. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ChangeListener
Convenience implementation which vetoes every change of which it is notified.static final ChangeListener
Convenience implementation that echoes all events to out. -
Method Summary
Modifier and TypeMethodDescriptionvoid
postChange
(ChangeEvent cev) Called when a change has just taken place.void
preChange
(ChangeEvent cev) Called before a change takes place.
-
Field Details
-
ALWAYS_VETO
Convenience implementation which vetoes every change of which it is notified. You could add this to an object directly to stop it changing in any way, or alternatively you could add it for a specific ChangeType to stop that single item from altering. -
LOG_TO_OUT
Convenience implementation that echoes all events to out.
-
-
Method Details
-
preChange
Called before a change takes place.
This is your chance to stop the change by throwing a ChangeVetoException. This method does not indicate that the change will definitely take place, so it is not recomended that you take any positive action within this handler.
- Parameters:
cev
- An event encapsulating the change which is about to take place.- Throws:
ChangeVetoException
- Description of ExceptionChangeVetoException
- if the receiver does not wish this change to occur at this time.
-
postChange
Called when a change has just taken place.
This method is the place to perform any behavior in response to the change event.
- Parameters:
cev
- An event encapsulating the change which has occured.
-