Class PIAPanelGroup

All Implemented Interfaces:
PClientComponent, PCollectDataListener, PComponent, PComponentAttribute, PViewComponent, PViewDataChangeListener, ContainerListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
PExtendedServicePanel

public class PIAPanelGroup extends PIAPanel
PIAPanelGroup is a Swing-compatible, Portal-aware Panel with a built in cardLayout.
Author:
Kapono Carter
See Also:
  • Field Details

    • cardLayout

      protected transient com.portal.bas.comp.ResizedCardLayout cardLayout
      The layout used by this panel
    • mNames

      protected String[] mNames
      The names of the components added to this panel
    • mComponents

      protected Component[] mComponents
      The components added to this panel
    • mClasses

      protected String[] mClasses
  • Constructor Details

    • PIAPanelGroup

      public PIAPanelGroup()
      This component represents a set of panels stacked on top of each other.
  • Method Details

    • getControllerClassName

      public String getControllerClassName() throws RemoteException
      Retrieves the class name of this component's controller.
      Specified by:
      getControllerClassName in interface PComponent
      Overrides:
      getControllerClassName in class PIAPanel
      Returns:
      A String with the value "com.portal.bas.comp.PIAPanelController".
      Throws:
      RemoteException - thrown for errors
    • setLayout

      public void setLayout(LayoutManager lm)
      Overridden so the base class' layout cannot be changed.
      Overrides:
      setLayout in class Container
      Parameters:
      lm - the LayoutManager to use
    • setOpaque

      public void setOpaque(boolean opaque)
      Sets the opacity for this panel, as well as all its children.
      Overrides:
      setOpaque in class JComponent
      Parameters:
      opaque - an indication of whether or not to set opacity for this panel
    • add

      public Component add(String name, Component c)
      Adds the given component to the panel group after that component's name property is set to the given name.
      Overrides:
      add in class Container
      Parameters:
      name - the panel's name
      c - the component to add
      Returns:
      The component, with its given name.
    • add

      public Component add(Component c)
      Adds a component for layout management by this panel.
      Overrides:
      add in class Container
      Parameters:
      c - the component to add
      Returns:
      The component, with its given name.
    • add

      public void add(String[] names, Component[] comps)
      Adds components for layout management by this panel.
      Parameters:
      names - the names of the components to add
      comps - the components to add
    • add

      public void add(String[] names, String[] classes)
      Adds components for layout management by this panel, given their respective class names.
      Parameters:
      names - the names of the components to add
      classes - the class names of the components to add
    • unregister

      public void unregister() throws RemoteException
      Disassociates the controller from the component. Call this after you call removeAll(). This walks through each component within the PIAPanelGroup and attempts to call unregister() on it. Therefore you need not explicitely unregister the pages yourself.
      Specified by:
      unregister in interface PClientComponent
      Overrides:
      unregister in class PIAPanel
      Throws:
      RemoteException
    • clear

      public void clear()
      Calls removeAll() and then sets the internal component reference to null. Use this if you are completely throwing away this PIAPanelGroup and want to free everything up for garbage collection.
      Specified by:
      clear in interface PComponentAttribute
      Overrides:
      clear in class PIAPanel
    • removeAll

      public void removeAll()
      Removes all components contained within this panel group.
      Overrides:
      removeAll in class Container
    • removeComponent

      public void removeComponent(String name)
      Removes the named component from the panel group.
      Parameters:
      name - the name of the component to remove
    • removeComponent

      public void removeComponent(Component c)
      Removes the specified component from the panel group.
      Parameters:
      c - the component to remove
    • getNames

      public String[] getNames()
      Returns the names of the components contained in this group.
      Returns:
      The names of the components in this group; null if there are no components present in the group.
    • contains

      public boolean contains(String name)
      Determines if this panel group contains a component whose name matches the named component.
      Parameters:
      name - a string that contains the component name to match
      Returns:
      True if there is a component whose name matches in this panel group, false otherwise.
    • setVisiblePanel

      public void setVisiblePanel(int index)
      Flips to the panel that was added to this group at the specified index. If no such panel exists, then nothing happens.
      Parameters:
      index - the index location of the panel to display
    • setVisiblePanel

      public void setVisiblePanel(String name)
      Flips to the panel that was added to this group with the specified name. If no such panel exists, then nothing happens.
      Parameters:
      name - the name of the panel to display.
    • getVisiblePanel

      public String getVisiblePanel()
      Returns the name of the panel that is currently visible.
      Returns:
      The name of the panel that is currently visible.
    • getVisiblePanelIndex

      public int getVisiblePanelIndex()
      Returns the index of the panel that is currently visible.
      Returns:
      The index of the panel that is currently visible.
    • getVisiblePanelComponent

      public Component getVisiblePanelComponent()
      Returns the panel that is currently visible.
      Returns:
      The panel that is currently visible, or null if there isn't one.
    • nameToComponent

      public Component nameToComponent(String name)
      For the given name, retrieves the associated component.
      Parameters:
      name - the component name to look up
      Returns:
      The associated component, or null if there isn't one.
    • componentToIndex

      public int componentToIndex(Component c)
      For the given component, retrieves the associated index
      Parameters:
      c - the component to look up
      Returns:
      The index of the component found, or -1 if not found.
    • nameToIndex

      public int nameToIndex(String name)
      For the given name, retrieves the index of the associated component
      Parameters:
      name - the component name to look up
      Returns:
      The index of the component found, or -1 if not found.
    • getComponentsCount

      public int getComponentsCount()
      Returns the total number of components.
      Returns:
      The total number of components.
    • getComponentAt

      public Component getComponentAt(int i)
      For the given index, retrieves the associated component.
      Parameters:
      i - the index to look up
      Returns:
      The component, if found; null if not found.