Class UI

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

public class UI extends Object implements UIFactory, UIObjectFactory
See Also:
  • Constructor Details

    • UI

      public UI()
      Create a new UI object
    • UI

      public UI(org.jdom2.Element config)
      Creates a new UI object
      Parameters:
      config - configuration element
  • Method Details

    • 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.jdom2.Element config)
      Parameters:
      config - the Configuration element
    • setLog

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

      public Log getLog()
    • getRegistrar

      public Map getRegistrar()
      UI uses a map to hold references to its components ("id" attribute)
      Returns:
      UI component registrar
    • get

      public Object get(String id)
      Parameters:
      id - Component id ("id" configuration attribute)
      Returns:
      the Object or null
    • create

      public JComponent create(UI ui, org.jdom2.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 Object newInstance(String clazz) throws Exception
      UIObjectFactory implementation. uses default classloader
      Specified by:
      newInstance in interface UIObjectFactory
      Parameters:
      clazz - the Clazzzz
      Returns:
      the Object
      Throws:
      Exception - if unable to instantiate
      See Also:
    • configure

      public void configure() throws org.jdom2.JDOMException
      configure this UI object
      Throws:
      org.jdom2.JDOMException
    • reconfigure

      public void reconfigure(String elementName, 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:
    • 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.jdom2.Element ui) throws org.jdom2.JDOMException
      Throws:
      org.jdom2.JDOMException
    • setLookAndFeel

      protected void setLookAndFeel(org.jdom2.Element ui)
    • doScript

      protected JComponent doScript(JComponent component, org.jdom2.Element e)
    • create

      public JComponent create(org.jdom2.Element e)
    • getMainFrame

      public JFrame getMainFrame()
    • warn

      protected void warn(Object obj)
    • warn

      protected void warn(Object obj, Exception ex)