org.jpos.ui
Class UI

java.lang.Object
  extended by org.jpos.ui.UI
All Implemented Interfaces:
UIFactory, UIObjectFactory
Direct Known Subclasses:
BSHUI

public class UI
extends java.lang.Object
implements UIFactory, UIObjectFactory

See Also:
See src/examples/ui/* for usage details

Constructor Summary
UI()
          Create a new UI object
UI(org.jdom.Element config)
          Creates a new UI object
 
Method Summary
 void configure()
          configure this UI object
protected  void configure(org.jdom.Element ui)
           
 javax.swing.JComponent create(org.jdom.Element e)
           
 javax.swing.JComponent create(UI ui, org.jdom.Element e)
          UI is itself a UIFactory.
 void dispose()
          dispose this UI object
protected  javax.swing.JComponent doScript(javax.swing.JComponent component, org.jdom.Element e)
           
 java.lang.Object get(java.lang.String id)
           
 Log getLog()
           
 javax.swing.JFrame getMainFrame()
           
 java.util.Map getRegistrar()
          UI uses a map to hold references to its components ("id" attribute)
 boolean isDestroyed()
           
 java.lang.Object newInstance(java.lang.String clazz)
          UIObjectFactory implementation.
 void reconfigure(java.lang.String elementName, java.lang.String panelName)
          reconfigure can be used in order to re-configure components inside a container (i.e.
 void setConfig(org.jdom.Element config)
           
 void setLog(Log log)
           
protected  void setLookAndFeel(org.jdom.Element ui)
           
 void setObjectFactory(UIObjectFactory objFactory)
          Assigns an object factory use to create new object instances.
protected  void warn(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UI

public UI()
Create a new UI object


UI

public UI(org.jdom.Element config)
Creates a new UI object

Parameters:
config - configuration element
Method Detail

setObjectFactory

public void setObjectFactory(UIObjectFactory objFactory)
Assigns an object factory use to create new object instances. If no object factory is asigned, UI uses the default classloader

Parameters:
objFactory - reference to an Object Factory

setConfig

public void setConfig(org.jdom.Element config)
Parameters:
config - the Configuration element

setLog

public void setLog(Log log)
Parameters:
log - an optional Log instance
See Also:
Log

getLog

public Log getLog()

getRegistrar

public java.util.Map getRegistrar()
UI uses a map to hold references to its components ("id" attribute)

Returns:
UI component registrar

get

public java.lang.Object get(java.lang.String id)
Parameters:
id - Component id ("id" configuration attribute)
Returns:
the Object or null

create

public javax.swing.JComponent create(UI ui,
                                     org.jdom.Element e)
UI is itself a UIFactory. This strategy is used to recursively instantiate components inside a container

Specified by:
create in interface UIFactory
Parameters:
ui - reference to this UI instance
e - free form configuration Element
Returns:
JComponent

newInstance

public java.lang.Object newInstance(java.lang.String clazz)
                             throws java.lang.Exception
UIObjectFactory implementation. uses default classloader

Specified by:
newInstance in interface UIObjectFactory
Parameters:
clazz - the Clazzzz
Returns:
the Object
Throws:
java.lang.Exception - if unable to instantiate
See Also:
setLog(org.jpos.util.Log)

configure

public void configure()
               throws org.jdom.JDOMException
configure this UI object

Throws:
org.jdom.JDOMException

reconfigure

public void reconfigure(java.lang.String elementName,
                        java.lang.String panelName)
reconfigure can be used in order to re-configure components inside a container (i.e. changing a panel in response to an event).

Parameters:
elementName - the element name used as new configuration
panelName - panel ID (see "id" attribute)
See Also:
Redirect

dispose

public void dispose()
dispose this UI object


isDestroyed

public boolean isDestroyed()
Returns:
true if this UI object has been disposed and is no longer valid

configure

protected void configure(org.jdom.Element ui)
                  throws org.jdom.JDOMException
Throws:
org.jdom.JDOMException

setLookAndFeel

protected void setLookAndFeel(org.jdom.Element ui)

doScript

protected javax.swing.JComponent doScript(javax.swing.JComponent component,
                                          org.jdom.Element e)

create

public javax.swing.JComponent create(org.jdom.Element e)

getMainFrame

public javax.swing.JFrame getMainFrame()

warn

protected void warn(java.lang.Object obj)