public abstract class AbstractPanelGroup extends javax.swing.JPanel implements javax.swing.event.ChangeListener, IPanelGroup, IButtonsPanel
Represents a JPanel
adapted to work with as a group of IPanel
's.
IPanelGroup
,
Serialized Formjavax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected byte |
ACCEPT_ACTION
Accept action identifier.
|
protected boolean |
accepted
If the last notification received has been accept().
|
protected byte |
APPLY_ACTION
Apply action identifier.
|
protected byte |
CANCEL_ACTION
Cancel action identifier.
|
protected IPanelGroup |
parentPanelGroup
Reference to another
IPanelGroup component which contains this one. |
protected java.lang.Object |
reference
Object that has a a ''semantically'' or ''conceptually'' relation to this panel.
|
protected java.util.ArrayList<IPanel> |
registeredPanels
Array list with all
IPanel of this group. |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
AbstractPanelGroup(java.lang.Object reference)
Default constructor of a group of
IPanel . |
Modifier and Type | Method and Description |
---|---|
void |
accept()
Notifies this panel of an accept action.
|
void |
addPanel(IPanel panel)
Adds another
IPanel to this group. |
void |
apply()
Notifies this panel of an apply action.
|
protected boolean |
belongsThisGroup(IPanel panel)
Validates if the panel as parameter belongs this panel group.
|
void |
cancel()
Notifies this panel of a cancel action.
|
int |
getPanelCount()
Returns the number of panels registered in this group.
|
java.util.Hashtable |
getProperties()
Gets the properties associated to this group of panels.
|
java.lang.Object |
getReference()
Gets the object that has a a ''semantically'' or ''conceptually'' relation to this panel.
|
protected void |
initialize()
This method is used by each concrete implementation of
AbstractPanelGroup to
execute its particular initialization tasks. |
boolean |
isAccepted()
Determines if the last notification received has been IPanel.accept().
|
boolean |
isEnabledAcceptButton()
Determines whether the accept button is enabled.
|
boolean |
isEnabledApplyButton()
Determines whether the apply button is enabled.
|
boolean |
isEnabledCancelButton()
Determines whether the cancel button is enabled.
|
boolean |
isEnabledCloseButton()
Determines whether the close button is enabled.
|
boolean |
isEnabledExitButton()
Determines whether the exit button is enabled.
|
boolean |
isEnabledHideDetailsButton()
Determines whether the hide details button is enabled.
|
boolean |
isEnabledNoButton()
Determines whether the no button is enabled.
|
boolean |
isEnabledPauseButton()
Determines whether the pause button is enabled.
|
boolean |
isEnabledRestartButton()
Determines whether the restart button is enabled.
|
boolean |
isEnabledSaveButton()
Determines whether the save button is enabled.
|
boolean |
isEnabledSeeDetailsButton()
Determines whether the see details button is enabled.
|
boolean |
isEnabledYesButton()
Determines whether the yes button is enabled.
|
protected void |
loadPanel(IPanel panel)
Loads a particular panel.
|
void |
loadPanels(IPanelGroupLoader loader)
Tries to load as most as possible panels using an
IPanelGroupLoader . |
void |
removePanel(IPanel panel)
Removes an
IPanel from this group. |
void |
setEnabledAcceptButton(boolean b)
Enables (or disables) the accept button.
|
void |
setEnabledApplyButton(boolean b)
Enables (or disables) the apply button.
|
void |
setEnabledCancelButton(boolean b)
Enables (or disables) the cancel button.
|
void |
setEnabledCloseButton(boolean b)
Enables (or disables) the close button.
|
void |
setEnabledExitButton(boolean b)
Enables (or disables) the exit button.
|
void |
setEnabledHideDetailsButton(boolean b)
Enables (or disables) the hide details button.
|
void |
setEnabledNoButton(boolean b)
Enables (or disables) the no button.
|
void |
setEnabledPauseButton(boolean b)
Enables (or disables) the pause button.
|
void |
setEnabledRestartButton(boolean b)
Enables (or disables) the restart button.
|
void |
setEnabledSaveButton(boolean b)
Enables (or disables) the save button.
|
void |
setEnabledSeeDetailsButton(boolean b)
Enables (or disables) the see details button.
|
void |
setEnabledYesButton(boolean b)
Enables (or disables) the yes button.
|
void |
setParentPanelGroup(IPanelGroup parent)
Sets the parent of this component.
|
abstract void |
stateChanged(javax.swing.event.ChangeEvent e) |
protected void |
unLoadPanel(IPanel panel)
Unloads a particular panel.
|
void |
updateReference(java.lang.Object reference)
Updates the reference of all elements of the group with the new one.
|
java.util.Collection<IPanel> |
values()
Returns all panels of this group.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getActivePanel, getPanelInGUICount, isPanelInGUI, setPanelInGUI
protected boolean accepted
If the last notification received has been accept().
accept()
protected java.lang.Object reference
Object that has a a ''semantically'' or ''conceptually'' relation to this panel.
getReference()
protected java.util.ArrayList<IPanel> registeredPanels
Array list with all IPanel
of this group.
loadPanels(IPanelGroupLoader)
,
addPanel(IPanel)
,
values()
protected final byte ACCEPT_ACTION
Accept action identifier.
protected final byte APPLY_ACTION
Apply action identifier.
protected final byte CANCEL_ACTION
Cancel action identifier.
protected IPanelGroup parentPanelGroup
Reference to another IPanelGroup
component which contains this one.
public AbstractPanelGroup(java.lang.Object reference)
Default constructor of a group of IPanel
.
reference
- object that is ''semantically' or 'contextually' related to the group of panelspublic final java.util.Collection<IPanel> values()
Returns all panels of this group.
loadPanels(IPanelGroupLoader)
,
addPanel(IPanel)
protected void initialize()
This method is used by each concrete implementation of AbstractPanelGroup
to
execute its particular initialization tasks.
public void loadPanels(IPanelGroupLoader loader) throws ListCouldntAddPanelException, EmptyPanelGroupException, EmptyPanelGroupGUIException
IPanelGroup
Tries to load as most as possible panels using an IPanelGroupLoader
.
loadPanels
in interface IPanelGroup
loader
- used to load the panels into this groupListCouldntAddPanelException
- list with all exceptions produced loading and adding the panelsEmptyPanelGroupException
- launched if there was no exception during the loading and adding processes
but there is no panel registered finally in this componentEmptyPanelGroupGUIException
- launched if there was no exception during the loading and adding processes
there is at least one panel registered, but finally none of them is in the graphical interface of this componentIPanelGroup.addPanel(IPanel)
protected void loadPanel(IPanel panel)
Loads a particular panel. It's supposed that this panel is valid.
panel
- the panel to addaddPanel(IPanel)
,
loadPanels(IPanelGroupLoader)
protected boolean belongsThisGroup(IPanel panel)
Validates if the panel as parameter belongs this panel group.
One panel belongs this panel group if have the same references, or
both references are null
.
panel
- the panel to validatetrue
if belong to this group; otherwise false
public boolean isAccepted()
IPanelGroup
Determines if the last notification received has been IPanel.accept().
isAccepted
in interface IPanelGroup
true
if that has been the last notification received, false
otherwisepublic java.util.Hashtable getProperties()
IPanelGroup
Gets the properties associated to this group of panels.
getProperties
in interface IPanelGroup
public java.lang.Object getReference()
IPanelGroup
Gets the object that has a a ''semantically'' or ''conceptually'' relation to this panel.
getReference
in interface IPanelGroup
null
if there has reference
to no objectpublic void updateReference(java.lang.Object reference)
IPanelGroup
Updates the reference of all elements of the group with the new one.
updateReference
in interface IPanelGroup
reference
- type of object that has reference this panel, or null
if there has reference
to no objectpublic void accept()
IPanelGroup
Notifies this panel of an accept action.
accept
in interface IPanelGroup
public void apply()
IPanelGroup
Notifies this panel of an apply action.
apply
in interface IPanelGroup
public void cancel()
IPanelGroup
Notifies this panel of a cancel action.
cancel
in interface IPanelGroup
public abstract void stateChanged(javax.swing.event.ChangeEvent e)
stateChanged
in interface javax.swing.event.ChangeListener
public void addPanel(IPanel panel) throws BaseException
IPanelGroup
Adds another IPanel
to this group.
addPanel
in interface IPanelGroup
panel
- the IPanel
to addEmptyPanelGroupException
- if there was no panel loaded and tries to add a new one, launches this exception
if the panel to add hasn't been registered to this component and then, no remains without panelsEmptyPanelGroupGUIException
- if there was no panel loaded and tries to add a new one, launches this exception
if the panel to add hasn't been set to this component graphical interface and then, no remains without panels
in its graphical interfaceBaseException
IPanelGroup.loadPanels(IPanelGroupLoader)
,
IPanelGroup.removePanel(IPanel)
public void removePanel(IPanel panel)
IPanelGroup
Removes an IPanel
from this group.
removePanel
in interface IPanelGroup
panel
- the IPanel
to removeIPanelGroup.addPanel(IPanel)
,
IPanelGroup.loadPanels(IPanelGroupLoader)
protected void unLoadPanel(IPanel panel)
Unloads a particular panel. It's supposed that this panel is valid.
panel
- the panel to addremovePanel(IPanel)
,
loadPanel(IPanel)
,
loadPanels(IPanelGroupLoader)
public int getPanelCount()
IPanelGroup
Returns the number of panels registered in this group.
getPanelCount
in interface IPanelGroup
public void setParentPanelGroup(IPanelGroup parent)
IPanelGroup
Sets the parent of this component. That object must be another IPanelGroup
component.
setParentPanelGroup
in interface IPanelGroup
parent
- parent of this componentpublic boolean isEnabledAcceptButton()
IButtonsPanel
Determines whether the accept button is enabled. An enabled component can respond to user input and generate events.
isEnabledAcceptButton
in interface IButtonsPanel
true
if the accept button is enabled, false
otherwiseIButtonsPanel.setEnabledAcceptButton(boolean)
public boolean isEnabledApplyButton()
IButtonsPanel
Determines whether the apply button is enabled. An enabled component can respond to user input and generate events.
isEnabledApplyButton
in interface IButtonsPanel
true
if the apply button is enabled, false
otherwiseIButtonsPanel.setEnabledApplyButton(boolean)
public boolean isEnabledCancelButton()
IButtonsPanel
Determines whether the cancel button is enabled. An enabled component can respond to user input and generate events.
isEnabledCancelButton
in interface IButtonsPanel
true
if the cancel button is enabled, false
otherwiseIButtonsPanel.setEnabledCancelButton(boolean)
public boolean isEnabledCloseButton()
IButtonsPanel
Determines whether the close button is enabled. An enabled component can respond to user input and generate events.
isEnabledCloseButton
in interface IButtonsPanel
true
if the close button is enabled, false
otherwiseIButtonsPanel.setEnabledCloseButton(boolean)
public boolean isEnabledExitButton()
IButtonsPanel
Determines whether the exit button is enabled. An enabled component can respond to user input and generate events.
isEnabledExitButton
in interface IButtonsPanel
true
if the exit button is enabled, false
otherwiseIButtonsPanel.setEnabledExitButton(boolean)
public boolean isEnabledHideDetailsButton()
IButtonsPanel
Determines whether the hide details button is enabled. An enabled component can respond to user input and generate events.
isEnabledHideDetailsButton
in interface IButtonsPanel
true
if the hide details button is enabled, false
otherwiseIButtonsPanel.setEnabledHideDetailsButton(boolean)
public boolean isEnabledNoButton()
IButtonsPanel
Determines whether the no button is enabled. An enabled component can respond to user input and generate events.
isEnabledNoButton
in interface IButtonsPanel
true
if the no button is enabled, false
otherwiseIButtonsPanel.setEnabledNoButton(boolean)
public boolean isEnabledPauseButton()
IButtonsPanel
Determines whether the pause button is enabled. An enabled component can respond to user input and generate events.
isEnabledPauseButton
in interface IButtonsPanel
true
if the pause button is enabled, false
otherwiseIButtonsPanel.setEnabledPauseButton(boolean)
public boolean isEnabledRestartButton()
IButtonsPanel
Determines whether the restart button is enabled. An enabled component can respond to user input and generate events.
isEnabledRestartButton
in interface IButtonsPanel
true
if the restart button is enabled, false
otherwiseIButtonsPanel.setEnabledRestartButton(boolean)
public boolean isEnabledSaveButton()
IButtonsPanel
Determines whether the save button is enabled. An enabled component can respond to user input and generate events.
isEnabledSaveButton
in interface IButtonsPanel
true
if the save button is enabled, false
otherwiseIButtonsPanel.setEnabledSaveButton(boolean)
public boolean isEnabledSeeDetailsButton()
IButtonsPanel
Determines whether the see details button is enabled. An enabled component can respond to user input and generate events.
isEnabledSeeDetailsButton
in interface IButtonsPanel
true
if the see details button is enabled, false
otherwiseIButtonsPanel.setEnabledSeeDetailsButton(boolean)
public boolean isEnabledYesButton()
IButtonsPanel
Determines whether the yes button is enabled. An enabled component can respond to user input and generate events.
isEnabledYesButton
in interface IButtonsPanel
true
if the yes button is enabled, false
otherwiseIButtonsPanel.setEnabledYesButton(boolean)
public void setEnabledAcceptButton(boolean b)
IButtonsPanel
Enables (or disables) the accept button.
setEnabledAcceptButton
in interface IButtonsPanel
b
- true
to enable the accept button, otherwise false
IButtonsPanel.isEnabledAcceptButton()
public void setEnabledApplyButton(boolean b)
IButtonsPanel
Enables (or disables) the apply button.
setEnabledApplyButton
in interface IButtonsPanel
b
- true
to enable the apply button, otherwise false
IButtonsPanel.isEnabledApplyButton()
public void setEnabledCancelButton(boolean b)
IButtonsPanel
Enables (or disables) the cancel button.
setEnabledCancelButton
in interface IButtonsPanel
b
- true
to enable the cancel button, otherwise false
IButtonsPanel.isEnabledCancelButton()
public void setEnabledCloseButton(boolean b)
IButtonsPanel
Enables (or disables) the close button.
setEnabledCloseButton
in interface IButtonsPanel
b
- true
to enable the close button, otherwise false
IButtonsPanel.isEnabledCloseButton()
public void setEnabledExitButton(boolean b)
IButtonsPanel
Enables (or disables) the exit button.
setEnabledExitButton
in interface IButtonsPanel
b
- true
to enable the exit button, otherwise false
IButtonsPanel.isEnabledExitButton()
public void setEnabledHideDetailsButton(boolean b)
IButtonsPanel
Enables (or disables) the hide details button.
setEnabledHideDetailsButton
in interface IButtonsPanel
b
- true
to enable the hide details button, otherwise false
IButtonsPanel.isEnabledHideDetailsButton()
public void setEnabledNoButton(boolean b)
IButtonsPanel
Enables (or disables) the no button.
setEnabledNoButton
in interface IButtonsPanel
b
- true
to enable the no button, otherwise false
IButtonsPanel.isEnabledNoButton()
public void setEnabledPauseButton(boolean b)
IButtonsPanel
Enables (or disables) the pause button.
setEnabledPauseButton
in interface IButtonsPanel
b
- true
to enable the pause button, otherwise false
IButtonsPanel.isEnabledPauseButton()
public void setEnabledRestartButton(boolean b)
IButtonsPanel
Enables (or disables) the restart button.
setEnabledRestartButton
in interface IButtonsPanel
b
- true
to enable the restart button, otherwise false
IButtonsPanel.isEnabledRestartButton()
public void setEnabledSaveButton(boolean b)
IButtonsPanel
Enables (or disables) the save button.
setEnabledSaveButton
in interface IButtonsPanel
b
- true
to enable the save button, otherwise false
IButtonsPanel.isEnabledSaveButton()
public void setEnabledSeeDetailsButton(boolean b)
IButtonsPanel
Enables (or disables) the see details button.
setEnabledSeeDetailsButton
in interface IButtonsPanel
b
- true
to enable the see details button, otherwise false
IButtonsPanel.isEnabledSeeDetailsButton()
public void setEnabledYesButton(boolean b)
IButtonsPanel
Enables (or disables) the yes button.
setEnabledYesButton
in interface IButtonsPanel
b
- true
to enable the yes button, otherwise false
IButtonsPanel.isEnabledYesButton()