Class AbstractChangeable
- All Implemented Interfaces:
Changeable
- Direct Known Subclasses:
AbiTraceRenderer
,AbstractAlphabet
,AbstractAnnotation
,AbstractBeadRenderer
,AbstractBioEntryDB
,AbstractCrossOverFunction
,AbstractDistribution
,AbstractFeatureHolder
,AbstractGeneticAlgorithm
,AbstractMutationFunction
,AbstractOrganism
,AbstractOrthologueSet
,AbstractOrthoPairSet
,AbstractPopulation
,AbstractSequenceDB
,AbstractSymbol
,AbstractSymbolList
,AbstractTaxon
,AbstractTerm
,BasicFeatureRenderer
,BioSQLSequenceDB
,CrosshairRenderer
,DummySequence
,FeatureBlockSequenceRenderer
,FeatureLabelRenderer
,FeatureTypes.RepositoryImpl
,GFF3Record.Impl
,IndexedCount
,LabelledSequenceRenderer
,LazyFeatureHolder
,MergeAnnotation
,MultiLineRenderer
,NewSimpleAssembly
,OffsetRulerRenderer
,Ontology.Impl
,OntologyTerm.Impl
,OverlayAnnotation
,OverlayRendererWrapper
,PairDistribution
,PairwiseDiagonalRenderer
,PairwiseFilteringRenderer
,PairwiseOverlayRenderer
,SequenceDBSearchHit
,SequenceDBSearchResult
,SequenceDBSearchSubHit
,SequenceRendererWrapper
,SimpleAssembly
,SimpleBioEntry
,SimpleBioEntryRelationship
,SimpleCodonPref
,SimpleComment
,SimpleComparableOntology
,SimpleComparableTerm
,SimpleComparableTriple
,SimpleDocRef
,SimpleEmissionState
,SimpleFeature
,SimpleHomology
,SimpleLabelRenderer
,SimpleMarkovModel
,SimpleNamespace
,SimpleNCBITaxon
,SimpleNote
,SimpleRankedCrossRef
,SimpleRankedDocRef
,SimpleRichAnnotation
,SimpleRichFeature
,SimpleRichFeatureRelationship
,SimpleRichLocation
,SimpleSeqSimilaritySearchHit
,SimpleSeqSimilaritySearchResult
,SimpleSeqSimilaritySearchSubHit
,SimpleSequence
,SixFrameRenderer
,SixFrameZiggyRenderer
,StackedFeatureRenderer
,TickFeatureRenderer
,TranslatedDistribution
,WebSequenceDB
,WMAsMM
,ZiggyFeatureRenderer
- Author:
- Matthew Pocock, Thomas Down, George Waldon - private lock on synchronization
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Add a listener that will be informed of all changes.final void
Add a listener that will be informed of changes of a given type.protected ChangeSupport
Called the first time a ChangeSupport object is needed.protected ChangeSupport
Called to retrieve the ChangeSupport for this object.protected boolean
Deprecated.use hasListeners(ChangeType) if at all possibleprotected boolean
Discover if we have listeners registered for a particular change type.final boolean
A particular ChangeType can never be raised by this Changeable.final void
Remove a listener that was interested in all types of changes.final void
Remove a listener that was interested in a specific types of changes.
-
Constructor Details
-
AbstractChangeable
public AbstractChangeable()
-
-
Method Details
-
hasListeners
Deprecated.use hasListeners(ChangeType) if at all possibleDiscover if we have any listeners registered.- Returns:
- true if there is at least one listener
-
hasListeners
Discover if we have listeners registered for a particular change type.- Parameters:
ct
- the ChangeType we are interested in- Returns:
- true if there is at least one listener
-
generateChangeSupport
Called the first time a ChangeSupport object is needed. Override this if you want to set the Unchanging set on the ChangeSupport, or if you want to install listeners on other objects when the change system is initialized.- Since:
- 1.3
-
getChangeSupport
Called to retrieve the ChangeSupport for this object.Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register invalid input: '&' unregister the forwarder in the code that does the ChangeEvent handling in setter methods.ChangeSupport cs = super.getChangeSupport(ct); if(someForwarder == null invalid input: '&'invalid input: '&' ct.isMatching(SomeInterface.SomeChangeType)) { someForwarder = new ChangeForwarder(... this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange); } return cs;
-
addChangeListener
Description copied from interface:Changeable
Add a listener that will be informed of all changes.- Specified by:
addChangeListener
in interfaceChangeable
- Parameters:
cl
- the ChangeListener to add
-
addChangeListener
Description copied from interface:Changeable
Add a listener that will be informed of changes of a given type.- Specified by:
addChangeListener
in interfaceChangeable
- Parameters:
cl
- the ChangeListenerct
- the ChangeType it is to be informed of
-
removeChangeListener
Description copied from interface:Changeable
Remove a listener that was interested in all types of changes.- Specified by:
removeChangeListener
in interfaceChangeable
- Parameters:
cl
- a ChangeListener to remove
-
removeChangeListener
Description copied from interface:Changeable
Remove a listener that was interested in a specific types of changes.- Specified by:
removeChangeListener
in interfaceChangeable
- Parameters:
cl
- a ChangeListener to removect
- the ChangeType that it was interested in
-
isUnchanging
Description copied from interface:Changeable
A particular ChangeType can never be raised by this Changeable.
If this returns true, then it is guaranteed that change events of this type (and all child types) can never under any circumstances be fired by this Changeable instance. If it returns false, that does not mean that this type of event will or even can be raised, but that it is worth registering listeners incase.
- Specified by:
isUnchanging
in interfaceChangeable
- Parameters:
ct
- the ChangeType to check- Returns:
- true if ChangeEvents of this type are guaranteed to never be fired
-