cern.stopmi.OPGeneric
Class OPController

java.lang.Object
  |
  +--cern.stopmi.OPGeneric.OPController

public class OPController
extends java.lang.Object

Title: Description: Copyright: Copyright (c) 2001 Company:


Constructor Summary
OPController()
           
 
Method Summary
 void addListenersNeeded(java.awt.Container panel)
          Add ALL listeners defined by this controller to ALL components found in the given panel.
 void addListenersNeeded(java.awt.Container panel, java.lang.Class[] listeners)
          Add the given listeners, if defined by this controller, to ALL components found in the given panel.
 void addListenersNeeded(java.util.Vector theBeans)
          Add ALL listeners defined by this controller to the components contained in the given vector
 void addListenersNeeded(java.util.Vector theBeans, java.lang.Class[] listeners)
          Add the given listeners, if defined by this controller, to ALL components in the given vector of components
 void addObjectReference(java.lang.Object o)
          Add a reference to an arbitary object.
 java.lang.Object getObject(java.lang.Class toSearchFor)
          Get a previously registered Object This function would normally be used from within the code for the listener itself to act on an arbitary Object
 OPPanel getOPPanel(java.lang.Class toSearchFor)
          Convenience function to extract a previously registered OPPanel.
 OPPanel getOPPanel(java.lang.Object object)
          Get the OPPanel which is the registered 'parent' of the given Object in the visual hierarchy.
static void setIsDebug(boolean f)
          If the controller is set to dubug (static class variable), windows showing 'controlled' objects will be displayed for each subsequent instantiation of OPController
 void setRegisterSubPanels(boolean f)
          When a panel is added to the controller, you have the option to disable recursion through sub-panels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OPController

public OPController()
Method Detail

setIsDebug

public static void setIsDebug(boolean f)
If the controller is set to dubug (static class variable), windows showing 'controlled' objects will be displayed for each subsequent instantiation of OPController
Parameters:
f - true if debug is set, else false (false by default)

setRegisterSubPanels

public void setRegisterSubPanels(boolean f)
When a panel is added to the controller, you have the option to disable recursion through sub-panels. In other words, the controlled OPPanel has another OPPanel inside it, the components inside this panel will also be added to the controller.
Parameters:
f - true if 'inner' panels should be searched

addObjectReference

public void addObjectReference(java.lang.Object o)
Add a reference to an arbitary object. This object can be anything.
Parameters:
o - the object

addListenersNeeded

public void addListenersNeeded(java.awt.Container panel)
Add ALL listeners defined by this controller to ALL components found in the given panel.
Parameters:
panel - the panel to be searched

addListenersNeeded

public void addListenersNeeded(java.awt.Container panel,
                               java.lang.Class[] listeners)
Add the given listeners, if defined by this controller, to ALL components found in the given panel.
Parameters:
panel - the panel to be searched
listeners - an array of listeners to add to found components

addListenersNeeded

public void addListenersNeeded(java.util.Vector theBeans)
Add ALL listeners defined by this controller to the components contained in the given vector
Parameters:
theBeans - a vector containing the target components

addListenersNeeded

public void addListenersNeeded(java.util.Vector theBeans,
                               java.lang.Class[] listeners)
Add the given listeners, if defined by this controller, to ALL components in the given vector of components
Parameters:
theBeans - the target components
listeners - an array of listeners to add to given components

getOPPanel

public OPPanel getOPPanel(java.lang.Class toSearchFor)
Convenience function to extract a previously registered OPPanel. This function would normally be used from within the code for the listener itself to determine the source of the 'event'. This function has exactly the same functionality as getObject, but it verifies that the class found is indeed an OPPanel (and then casts it accordingly)
Parameters:
toSearchFor - class to search for
Returns:
null if not found (or not an OPPanel), or the found OPPanel

getObject

public java.lang.Object getObject(java.lang.Class toSearchFor)
Get a previously registered Object This function would normally be used from within the code for the listener itself to act on an arbitary Object
Parameters:
toSearchFor - class to search for
Returns:
null if not found, or the found Object

getOPPanel

public OPPanel getOPPanel(java.lang.Object object)
Get the OPPanel which is the registered 'parent' of the given Object in the visual hierarchy. This function would normally be used from within the code for the listener to group events by panel, and to help identify the component that fired the event
Parameters:
object - the JComponent to get parent of
Returns:
OPPanel which contains object or null if not found