org.apache.avalon.fortress.examples.swing
Class SwingContainer
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.fortress.impl.AbstractContainer
org.apache.avalon.fortress.impl.DefaultContainer
org.apache.avalon.fortress.examples.swing.SwingContainer
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener, org.apache.avalon.fortress.Container, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable
public final class SwingContainer
- extends org.apache.avalon.fortress.impl.DefaultContainer
- implements org.apache.avalon.framework.activity.Startable, java.awt.event.ActionListener, java.lang.Runnable
Simple Fortress based container containing a Swing implementation of Hello World.
This container creates a small Swing based GUI displaying a combobox of available
languages from the translator component.
- Version:
- CVS $Revision: 1.8 $ $Date: 2004/02/24 22:31:22 $
- Author:
- Avalon Development Team
Fields inherited from class org.apache.avalon.fortress.impl.AbstractContainer |
DEFAULT_ENTRY, m_classLoader, m_commandSink, m_componentContext, m_components, m_context, m_extManager, m_instrumentManager, m_loggerManager, m_mapper, m_metaManager, m_poolManager, m_serviceManager, m_shutDownOrder, SELECTOR_ENTRY |
Fields inherited from interface org.apache.avalon.fortress.Container |
ROLE |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent evt)
Method called when the user changes the selected item in the
combobox. |
void |
dispose()
Cleans up references to retrieved components. |
void |
initialize()
Initializes this component. |
void |
run()
|
void |
start()
Starts the component, makes GUI visible, ready for use. |
void |
stop()
Stops component, make GUI invisible, ready for decomissioning. |
Methods inherited from class org.apache.avalon.fortress.impl.DefaultContainer |
configure, getServiceManager, interpretProxy |
Methods inherited from class org.apache.avalon.fortress.impl.AbstractContainer |
addComponent, contextualize, createHintMap, createObjectFactory, get, getProxyManager, getRoleKey, has, provideComponentContext, provideServiceManager, service, setProxyManager |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_translator
private Translator m_translator
m_frame
private javax.swing.JFrame m_frame
m_label
private javax.swing.JLabel m_label
m_key
private java.lang.String m_key
SwingContainer
public SwingContainer()
initialize
public void initialize()
throws java.lang.Exception
- Initializes this component. Creates simple Swing GUI containing
available translations for the key 'hello-world'.
- Specified by:
initialize
in interface org.apache.avalon.framework.activity.Initializable
- Overrides:
initialize
in class org.apache.avalon.fortress.impl.AbstractContainer
- Throws:
java.lang.Exception
- if an error occurs
start
public void start()
- Starts the component, makes GUI visible, ready for use.
- Specified by:
start
in interface org.apache.avalon.framework.activity.Startable
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
stop
public void stop()
- Stops component, make GUI invisible, ready for decomissioning.
- Specified by:
stop
in interface org.apache.avalon.framework.activity.Startable
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent evt)
- Method called when the user changes the selected item in the
combobox.
- Specified by:
actionPerformed
in interface java.awt.event.ActionListener
- Parameters:
evt
- an ActionEvent
instance
dispose
public void dispose()
- Cleans up references to retrieved components.
- Specified by:
dispose
in interface org.apache.avalon.framework.activity.Disposable
- Overrides:
dispose
in class org.apache.avalon.fortress.impl.AbstractContainer