apollo.gui
Class Controller

java.lang.Object
  extended by apollo.gui.Controller
All Implemented Interfaces:
PropSchemeChangeListener, DataLoadListener, AnnotationChangeListener, ResultChangeListener, BaseFocusListener, FeatureSelectionListener, LazyLoadListener, NamedFeatureSelectionListener, OrientationListener, ReverseComplementListener, ScrollListener, SetActiveCurStateListener, ZoomListener, java.awt.event.WindowListener, java.util.EventListener
Direct Known Subclasses:
MultiController

public class Controller
extends java.lang.Object
implements BaseFocusListener, AnnotationChangeListener, FeatureSelectionListener, LazyLoadListener, NamedFeatureSelectionListener, SetActiveCurStateListener, OrientationListener, DataLoadListener, ResultChangeListener, ReverseComplementListener, PropSchemeChangeListener, java.awt.event.WindowListener, ScrollListener, ZoomListener

An event controller forwarding multiple types of event to registered listeners.


Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
Controller()
           
 
Method Summary
 void addListener(java.util.EventListener l)
           
 void clear(boolean keepListenerToMaster)
          Clear called by handleDataLoadEvent with clearOnDataLoadEvent set to true, for species controllers not master controllers also called by CurationState when removed
 void curationSetIsLoaded(boolean loaded)
           
 java.util.Vector getListeners()
           
static Controller getMasterController()
          static master controller - should be renamed master listener.
 java.util.Vector getWindowList()
           
 java.util.Vector getWindowList(java.awt.Window skipMe)
           
 boolean handleAnnotationChangeEvent(AnnotationChangeEvent evt)
           
 boolean handleBaseFocusEvent(BaseFocusEvent evt)
           
 boolean handleChainedRepaintEvent(ChainedRepaintEvent event)
           
 boolean handleDataLoadEvent(DataLoadEvent evt)
           
 boolean handleFeatureSelectionEvent(FeatureSelectionEvent evt)
           
 boolean handleLazyLoadEvent(LazyLoadEvent evt)
           
 boolean handleNamedFeatureSelectionEvent(NamedFeatureSelectionEvent evt)
           A NamedFeatureSelectionEvent nominates only the name of the feature to be selected - the panel responds by (1) finding the feature of interest and rebouncing the event as a feature selection event.
 boolean handleOrientationEvent(OrientationEvent evt)
           
 boolean handlePropSchemeChangeEvent(PropSchemeChangeEvent evt)
           
 boolean handleResultChangeEvent(ResultChangeEvent evt)
           
 boolean handleReverseComplementEvent(ReverseComplementEvent evt)
           
 boolean handleScrollEvent(ScrollEvent event)
           
 boolean handleSetActiveCurStateEvent(SetActiveCurStateEvent evt)
           
 boolean handleZoomEvent(ZoomEvent evt)
           
 boolean hasListener(java.util.EventListener l)
           
 boolean isAnnotationChanged()
           
 boolean isCurationSetLoaded()
           
 void removeListener(java.util.EventListener l)
          Remove from listeners vector.
 void setAnnotationChanged(boolean un_saved)
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
          windowClosed happens on dispose
 void windowClosing(java.awt.event.WindowEvent e)
          WindowClosing happens when user closes a window, not dispose This removes ControlledWindow of event source as window listener unless needsAutoRemoval returns false It also removes all children of ControlledWindow as listeners.
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

Controller

public Controller()
Method Detail

getMasterController

public static Controller getMasterController()
static master controller - should be renamed master listener. Listens to all curation controllers. Does not fire to them. Should there be another controller (called masterController?) that fires to all curations but doesnt listen to them? Cant do both in one or all events would go everywhere - in fact youd have an endless loop.


hasListener

public boolean hasListener(java.util.EventListener l)

addListener

public void addListener(java.util.EventListener l)

getWindowList

public java.util.Vector getWindowList()

getWindowList

public java.util.Vector getWindowList(java.awt.Window skipMe)

clear

public void clear(boolean keepListenerToMaster)
Clear called by handleDataLoadEvent with clearOnDataLoadEvent set to true, for species controllers not master controllers also called by CurationState when removed


removeListener

public void removeListener(java.util.EventListener l)
Remove from listeners vector. Also if a ControlledObjectI with a non-null ControllerWindow, then remove as child of ControlledWindow


getListeners

public java.util.Vector getListeners()

isAnnotationChanged

public boolean isAnnotationChanged()

isCurationSetLoaded

public boolean isCurationSetLoaded()

setAnnotationChanged

public void setAnnotationChanged(boolean un_saved)

curationSetIsLoaded

public void curationSetIsLoaded(boolean loaded)

handleZoomEvent

public boolean handleZoomEvent(ZoomEvent evt)
Specified by:
handleZoomEvent in interface ZoomListener

handleAnnotationChangeEvent

public boolean handleAnnotationChangeEvent(AnnotationChangeEvent evt)
Specified by:
handleAnnotationChangeEvent in interface AnnotationChangeListener

handleSetActiveCurStateEvent

public boolean handleSetActiveCurStateEvent(SetActiveCurStateEvent evt)
Specified by:
handleSetActiveCurStateEvent in interface SetActiveCurStateListener

handleNamedFeatureSelectionEvent

public boolean handleNamedFeatureSelectionEvent(NamedFeatureSelectionEvent evt)

A NamedFeatureSelectionEvent nominates only the name of the feature to be selected - the panel responds by (1) finding the feature of interest and rebouncing the event as a feature selection event. Note that we will preserve the source of the original event in the new events we throw.

This is being written to allow a SyntenyLinkPanel to throw feature selections at the linked StrandedZoomableApolloPanels, even though they don't actually have the features (genes) to select.

Specified by:
handleNamedFeatureSelectionEvent in interface NamedFeatureSelectionListener

handleFeatureSelectionEvent

public boolean handleFeatureSelectionEvent(FeatureSelectionEvent evt)
Specified by:
handleFeatureSelectionEvent in interface FeatureSelectionListener

handleDataLoadEvent

public boolean handleDataLoadEvent(DataLoadEvent evt)
Specified by:
handleDataLoadEvent in interface DataLoadListener

handleReverseComplementEvent

public boolean handleReverseComplementEvent(ReverseComplementEvent evt)
Specified by:
handleReverseComplementEvent in interface ReverseComplementListener

handleOrientationEvent

public boolean handleOrientationEvent(OrientationEvent evt)
Specified by:
handleOrientationEvent in interface OrientationListener

handleLazyLoadEvent

public boolean handleLazyLoadEvent(LazyLoadEvent evt)
Specified by:
handleLazyLoadEvent in interface LazyLoadListener

handleResultChangeEvent

public boolean handleResultChangeEvent(ResultChangeEvent evt)
Specified by:
handleResultChangeEvent in interface ResultChangeListener

handlePropSchemeChangeEvent

public boolean handlePropSchemeChangeEvent(PropSchemeChangeEvent evt)
Specified by:
handlePropSchemeChangeEvent in interface PropSchemeChangeListener

handleBaseFocusEvent

public boolean handleBaseFocusEvent(BaseFocusEvent evt)
Specified by:
handleBaseFocusEvent in interface BaseFocusListener

handleChainedRepaintEvent

public boolean handleChainedRepaintEvent(ChainedRepaintEvent event)

handleScrollEvent

public boolean handleScrollEvent(ScrollEvent event)
Specified by:
handleScrollEvent in interface ScrollListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
windowClosed happens on dispose

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
WindowClosing happens when user closes a window, not dispose This removes ControlledWindow of event source as window listener unless needsAutoRemoval returns false It also removes all children of ControlledWindow as listeners. Children are ControlledObjectIs that have the window as its getControlledWindow. Children of ControlledWindow are usually but not always subparts of that window. TierManagers are non-gui ControlledObject thet list the ancestor of its view (ApolloFrame) as its controller window This is nice but most listeners are children of ApolloFrame which currently when it closes apollo exits so who cares if the children are being removed as listeners. Presently this is really only useful for non-ApolloFrame children (EDE?,AnnotEditor?,...?) If apollo lives on beyond a frame closing this would be useful. Also what might be cool is to somehow automate the removing of listeners to a curationController when the curation has been downsized (e.g. go from 2 to 1 curation).

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener