Package org.jpos.ui

Class UI

    • Constructor Summary

      Constructors 
      Constructor Description
      UI()
      Create a new UI object
      UI​(org.jdom2.Element config)
      Creates a new UI object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void configure()
      configure this UI object
      protected void configure​(org.jdom2.Element ui)  
      javax.swing.JComponent create​(org.jdom2.Element e)  
      javax.swing.JComponent create​(UI ui, org.jdom2.Element e)
      UI is itself a UIFactory.
      void dispose()
      dispose this UI object
      protected javax.swing.JComponent doScript​(javax.swing.JComponent component, org.jdom2.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.jdom2.Element config)  
      void setLog​(Log log)  
      protected void setLookAndFeel​(org.jdom2.Element ui)  
      void setObjectFactory​(UIObjectFactory objFactory)
      Assigns an object factory use to create new object instances.
      protected void warn​(java.lang.Object obj)  
      protected void warn​(java.lang.Object obj, java.lang.Exception ex)  
      • 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.jdom2.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.jdom2.Element config)
        Parameters:
        config - the Configuration element
      • setLog

        public void setLog​(Log log)
        Parameters:
        log - an optional Log instance
        See Also:
        Log
      • 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.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 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.jdom2.JDOMException
        configure this UI object
        Throws:
        org.jdom2.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.jdom2.Element ui)
                          throws org.jdom2.JDOMException
        Throws:
        org.jdom2.JDOMException
      • setLookAndFeel

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

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

        public javax.swing.JComponent create​(org.jdom2.Element e)
      • warn

        protected void warn​(java.lang.Object obj)
      • warn

        protected void warn​(java.lang.Object obj,
                            java.lang.Exception ex)