Class BrolPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible
Direct Known Subclasses:
AbstractBeDataPanel, BeCitizenFrontPanel, ForeignerFrontPanel, PersonSimpleDataEditPanel

public abstract class BrolPanel extends JPanel implements PropertyChangeListener
Implemented a panel with some predefined methods to initialize what is most often needed in broldev applications, and in a particular order.

Some methods can be overridden, and others absolutely must be implemented (but may not contain any code) because they are called in constructors.

This panel can observe the changes of LanguageHelper. Additionally, if a key is provided in the constructor, a language resource file is loaded to provide the necessary translations.
Since:
1.0 Jun 15, 2009
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • BrolPanel

      public BrolPanel()
      Constructs a panel that observes changes to LanguageHelper, but without a predefined key to access a language resource file. The setLanguage() method is still called each time LanguageHelper changes
      See Also:
      LanguageHelper
    • BrolPanel

      public BrolPanel(String localePropertyKey)
      Constructs a panel that observes changes to LanguageHelper, with a predefined key to access a language resource file. The {#setLanguage()} method is called each time LanguageHelper changes.
      Parameters:
      localePropertyKey - the base name of the resource bundle, a fully qualified class name
      See Also:
      LanguageHelper
    • BrolPanel

      public BrolPanel(boolean observable)
      Constructs a panel that can observe changes to LanguageHelper, but without a predefined key to access a language resource file. The setLanguage() method is still called each time LanguageHelper changes if observable parameter is true.

      This constructor should be used with observable which is false, otherwise it is better to use the default constructor, or the one with a language key (BrolPanel(String)).
      Parameters:
      observable -
      See Also:
      LanguageHelper
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • getString

      protected String getString(String key, String defaultText)
      Parameters:
      key - the key for the desired string
      defaultText -
      Returns:
    • setLanguage

      protected abstract void setLanguage()
      Method used to define the different texts or images according to a language. If this panel observes LanguageHelper, each time it changes, this method is called.
      For texts, it is possible to call the method getString(String, String) to retrieve a text according to the default language
    • initGUI

      protected abstract void initGUI()
      Method that places the various graphical components on the panel. This method is also used by jgloo to build the view.
    • initData

      protected void initData()
      Method used to initialize certain data before building the various graphical components that will then be added to the panel, during the call to initGUI().
    • customizeGUI

      protected void customizeGUI()
      Method used to adapt the various graphical components already present in the panel, after a call to initGUI().
    • initListeners

      protected void initListeners()
      Method that allows to initialize listeners and bind them to already built GUI components when calling initGUI, or to bind actions (initialized in initData()) to components such as buttons etc.
      This is also where the different menus are attached to the components.
    • propertyChange

      public final void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener