jPOS 1.6.1 API Documentation

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

Author:
Alejandro Revilla

jPOS UI main class

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
 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
 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)
           
 void setObjectFactory(UIObjectFactory objFactory)
          Assigns an object factory use to create new object instances.
 
Methods inherited from class java.lang.Object
equals, 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
config - 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:
throw - exception if unable to instantiate
java.lang.Exception
See Also:
setLog

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

create

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

getMainFrame

public javax.swing.JFrame getMainFrame()

jPOS.org