Class AbstractPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Comparable<IPanel>, Accessible, IPanel
Direct Known Subclasses:
AbstractFilterQueryJPanel, TreePanel.DefaultPanel

public abstract class AbstractPanel extends JPanel implements IPanel

Represents a JPanel adapted to work as a panel of an AbstractPanelGroup.

Version:
16/10/2007
Author:
Pablo Piqueras Bartolomé (pablo.piqueras@iver.es)
See Also:
  • Field Details

    • remainsWithDefaultPreferredSize

      protected boolean remainsWithDefaultPreferredSize

      If this panel remains with its initial preferred size of it has been changed.

      See Also:
    • hasChanged

      protected boolean hasChanged

      Determines if this component has changed since it was created, or applied (or accepted).

  • Constructor Details

    • AbstractPanel

      public AbstractPanel()

      Initializes this panel.

    • AbstractPanel

      public AbstractPanel(String id, String label, String labelGroup)

      Initializes this panel using three parameters.

      Parameters:
      id - optional attribute that identifies this panel
      label - identifier used by a AbstractPanelGroup to identify this panel
      labelGroup - identifier used to group together different IPanel panels in a AbstractPanelGroup
  • Method Details

    • initialize

      protected abstract void initialize()

      This method is used by each concrete implementation of AbstractPanel to execute its particular initialization tasks.

    • getID

      public String getID()
      Description copied from interface: IPanel

      Gets the panel identifier.

      .
      Specified by:
      getID in interface IPanel
      Returns:
      panel identifier, or null if undefined
      See Also:
    • getLabel

      public String getLabel()
      Description copied from interface: IPanel

      Gets the identifier of the panel used by a AbstractPanelGroup.

      Specified by:
      getLabel in interface IPanel
      Returns:
      panel label identifier, or null if undefined
      See Also:
    • getLabelGroup

      public String getLabelGroup()
      Description copied from interface: IPanel

      Gets the identifier of the panel used to group together different IPanel panels in a AbstractPanelGroup.

      Specified by:
      getLabelGroup in interface IPanel
      Returns:
      panel label group identifier, or null if undefined
      See Also:
    • setID

      public void setID(String id)
      Description copied from interface: IPanel

      Sets the identifier of the panel used by a AbstractPanelGroup.

      Specified by:
      setID in interface IPanel
      Parameters:
      id - panel label identifier, or null if undefined
      See Also:
    • setLabel

      public void setLabel(String label)
      Description copied from interface: IPanel

      Sets the identifier of the panel used by a AbstractPanelGroup.

      Specified by:
      setLabel in interface IPanel
      Parameters:
      label - panel label identifier, or null if undefined
      See Also:
    • setLabelGroup

      public void setLabelGroup(String labelGroup)
      Description copied from interface: IPanel

      Sets the identifier of the panel used to group together different IPanel panels of a AbstractPanelGroup.

      Specified by:
      setLabelGroup in interface IPanel
      Parameters:
      labelGroup - label group identifier, or null if undefined
      See Also:
    • getReference

      public Object getReference()
      Description copied from interface: IPanel

      Gets the object that has a ''semantically'' or ''conceptually'' relation to this panel, this is used to group IPanel panels on a IPanelGroup object.

      Specified by:
      getReference in interface IPanel
      Returns:
      object that has reference this panel, or null if there has reference to no object
      See Also:
    • setReference

      public void setReference(Object ref)
      Description copied from interface: IPanel

      Sets a reference to an object that is ''semantically' or 'contextually' related to this panel.

      Specified by:
      setReference in interface IPanel
      Parameters:
      ref - an object
      See Also:
    • getPanelGroup

      public AbstractPanelGroup getPanelGroup()
      Description copied from interface: IPanel

      Gets a reference to the object that contains the group which this panel is a member.

      Specified by:
      getPanelGroup in interface IPanel
      Returns:
      an object that contains this panel's group
      See Also:
    • setPanelGroup

      public void setPanelGroup(AbstractPanelGroup panelGroup)
      Description copied from interface: IPanel

      Sets a reference to the object that contains the group which this panel is a member.

      Specified by:
      setPanelGroup in interface IPanel
      Parameters:
      panelGroup - object that contains this panel's group
      See Also:
    • setInGroupGUI

      public void setInGroupGUI(boolean visible)
      Description copied from interface: IPanel

      If this panel belongs to a 'panel group', changes its visibility at the interface of the panel group. If changes to invisible, then this panel won't be accessible by the user interface. But if changes to visible and was invisible before, then will appear at the same position it was in the user interface. The position is according the order of the insertion at the group. Anyway, the group will have this panel.

      Specified by:
      setInGroupGUI in interface IPanel
      Parameters:
      visible - the new visibility for that panel.
    • isInGroupGUI

      public boolean isInGroupGUI()
      Description copied from interface: IPanel

      Returns true if this panel belongs to a 'panel group' and it's loaded in the graphical user interface of that component; otherwise returns false.

      Specified by:
      isInGroupGUI in interface IPanel
      Returns:
      true if this panel belongs to a 'panel group' and it's loaded in the graphical user interface of that component
    • toString

      public String toString()
      Overrides:
      toString in class Component
    • remainsWithItsDefaultPreferredSize

      public boolean remainsWithItsDefaultPreferredSize()
      Description copied from interface: IPanel

      Returns if this panel remains with its initial preferred size of it has been changed.

      Specified by:
      remainsWithItsDefaultPreferredSize in interface IPanel
      Returns:
      if this panel remains with its initial preferred size of it has been changed
    • setPreferredSize

      public void setPreferredSize(Dimension preferredSize)
      Overrides:
      setPreferredSize in class JComponent
    • hasChanged

      public boolean hasChanged()
      Description copied from interface: IPanel

      Determines if this panel has changed since it was created, or applied (or accepted or cancelled). The programmer of each panel will be whom would set to true that a panel has changed.

      Specified by:
      hasChanged in interface IPanel
      Returns:
      true if this panel has changed since it was created, or applied (or accepted or cancelled); otherwise false
    • resetChangedStatus

      public void resetChangedStatus()
      Description copied from interface: IPanel

      Resets this panel changed status to its initial value.

      Specified by:
      resetChangedStatus in interface IPanel
    • setAlwaysApplicable

      public void setAlwaysApplicable(boolean b)
      Description copied from interface: IPanel

      Sets if this panel will always be applied and accepted (by default), or only when has changed.

      Specified by:
      setAlwaysApplicable in interface IPanel
      Parameters:
      b - if this panel will always be applied and accepted, or only when has changed
      See Also:
    • isAlwaysApplicable

      public boolean isAlwaysApplicable()
      Description copied from interface: IPanel

      Gets if this panel will always be applied and accepted (by default), or only when has changed.

      Specified by:
      isAlwaysApplicable in interface IPanel
      Returns:
      if this panel will always be applied and accepted, or only when has changed
      See Also:
    • getPriority

      public int getPriority()
      Description copied from interface: IPanel
      The priority of this properties page. When more high is the priority more to the left are set properties page.
      Specified by:
      getPriority in interface IPanel
      Returns:
      the priority of the properties page
    • setPriority

      public void setPriority(int priority)
      Description copied from interface: IPanel
      Sets priority of this properties page. When more high is the priority more to the left are set properties page.
      Specified by:
      setPriority in interface IPanel
    • compareTo

      public int compareTo(IPanel comparedPanel)
      Specified by:
      compareTo in interface Comparable<IPanel>