net.sourceforge.spark.framework
Class Container

java.lang.Object
  extended bynet.sourceforge.spark.framework.Widget
      extended bynet.sourceforge.spark.framework.Container
All Implemented Interfaces:
CommandHolder, org.w3c.dom.events.EventListener, Observer, Subject

public abstract class Container
extends Widget
implements Subject, Observer

The Container widget class has the ability to contain other Atom's and/or other Containers. It may itself has some sort of visible characteristics or it may not.

  1. An example of a Container widget that does not contain and visible characteristics is the RadiobuttonGroup container widget. It only adds functionality.
  2. An example of a Container widget that has some visible characteristic is a Window widget. It may contain other widgets but also is visible to the user and they may interact with it.
  3. The Container widget implements both Subject and Observer interfaces.

    $Source: /cvsroot/spark/spark/source/java/net/sourceforge/spark/framework/Container.java,v $
     $Log: Container.java,v $
     Revision 1.2  2005/07/24 04:03:28  afettes
     no message
    
     Revision 1.1  2005/07/24 03:55:32  afettes
     Initial commit to CVS.
     

    Version:
    $Revision: 1.2 $ - $Date: 2005/07/24 04:03:28 $
    Author:
    $Author: afettes $, Alastair Fettes
    See Also:
    Atom, Widget, Subject, Observer

    Field Summary
    private  java.util.Vector m_vpObservers
              List of this atoms Observers.
    private  java.util.Vector m_vpWidgets
              List of this atoms Observers.
     
    Fields inherited from class net.sourceforge.spark.framework.Widget
    ID, TYPE
     
    Constructor Summary
    Container(java.lang.String id, java.lang.String type)
              Create a new container object with the given id.
     
    Method Summary
     void addWidget(Widget in_widget)
              Add a widget to this container.
     void attach(Observer in_observer)
              The observer to be attached.
     void detach(Observer in_observer)
              The observer to be detached.
    protected  void notifyObservers()
              Notify all observers of the state change.
     void removeWidget(Widget in_widget)
              Remove a widget from this container.
     
    Methods inherited from class net.sourceforge.spark.framework.Widget
    addCommand, getState, handleEvent, removeCommand, runCommands, setState
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface net.sourceforge.spark.framework.Observer
    update
     

    Field Detail

    m_vpObservers

    private java.util.Vector m_vpObservers
    List of this atoms Observers.


    m_vpWidgets

    private java.util.Vector m_vpWidgets
    List of this atoms Observers.

    Constructor Detail

    Container

    public Container(java.lang.String id,
                     java.lang.String type)
    Create a new container object with the given id.

    Parameters:
    id - The id for the widget.
    Method Detail

    addWidget

    public void addWidget(Widget in_widget)
    Add a widget to this container.

    Parameters:
    in_widget - The widget to be added.

    removeWidget

    public void removeWidget(Widget in_widget)
    Remove a widget from this container.

    Parameters:
    in_widget - The widget to be removed.

    attach

    public void attach(Observer in_observer)
    The observer to be attached. It will now be observering this subject.

    Specified by:
    attach in interface Subject
    Parameters:
    in_observer - The observer to add.

    detach

    public void detach(Observer in_observer)
    The observer to be detached. It will no longer be observering this subject.

    Specified by:
    detach in interface Subject
    Parameters:
    in_observer - The observer to remove.

    notifyObservers

    protected void notifyObservers()
    Notify all observers of the state change.