Package com.portal.bas.comp
Class PIAPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.portal.pfc.ui.ImagePanel
com.portal.bas.comp.PIAPanel
- All Implemented Interfaces:
PClientComponent
,PCollectDataListener
,PComponent
,PComponentAttribute
,PViewComponent
,PViewDataChangeListener
,ContainerListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
- Direct Known Subclasses:
PIAExpirationField
,PIANotesPanel
,PIAPanelGroup
,PPayInfoPanel
,SearchPanel
public class PIAPanel
extends ImagePanel
implements PViewComponent, PComponentAttribute, PCollectDataListener, ContainerListener, Serializable
PIAPanel
is a Swing-compatible, Portal-aware Panel
.
This component tracks the Portal-aware components that are added to it and
passes data (model handles) and method calls (for example, from
PComponentAttribute
) to all of the children components.- Version:
- 8
- Author:
- Larry Lynch-Freshner
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Set this to true if you want invisible panels to participate in data collection.protected boolean
protected LinkedList
protected PComponentImpl
Fields inherited from class com.portal.pfc.ui.ImagePanel
IMAGE_CENTERED, IMAGE_SCALE_TO_HEIGHT, IMAGE_SCALE_TO_WIDTH, IMAGE_SCALED, IMAGE_TILED, mImageIcon, mScaledImage
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
A convenience method to clear every Portal-aware descendant of this panel.void
collectData
(PCollectDataEvent event) OverridesPCollectDataListener
.void
Tracks all Portal-aware components that are added to this panel.void
Tracks all Portal-aware components that are removed from this panel.boolean
containsError
(Object obj) Not implemented in this class, but provides a mechanism to pass error data to subclasses.void
firePropertyChange
(String prop, Object oldV, Object newV) Fires a property change event to any registered listener.void
fireVetoableChange
(String prop, Object oldV, Object newV) Fires a vetoable property change event to any registered listener.static ResourceBundle
Intended for use byPIAPanel
subclasses that are set up for use in Borland JBuilder.Retrieves the class name of this component's controller.Retrieves thePModelHandle
for this component.Gets a reference to the remote component for this object.Gets the base resource name used in resource look up.getTools()
Gets a list of actions supported by this component.boolean
isClean()
Determines if any descendant is marked DIRTY or ERROR.boolean
Determines whether any descendants currently display currency data.boolean
isDirty()
Determines if any descendant is marked DIRTY in its current context.boolean
isError()
Determines if any descendant is marked ERROR in its current context.boolean
Determines ifinputTracking
is on for this panel (itself).boolean
isLight()
Determines if this component defersPModelHandle
knowledge to its parent container.boolean
Determines if any descendant is required in its current context.protected Object
processError
(PModelHandle err) Provides a hook for subclasses to react to errors if they choose to do so.void
A convenience method to reset every field on this panel.void
revertToPrimary
(int primary) Causes the widget to display its data in the primary currencyvoid
setBackgroundImageMode
(int drawMode) void
void
setClean()
A convenience method that marks allPFieldComponent
components in this panel as CLEAN.void
setCurrencyDisplay
(boolean b) A convenience method to mark whether all components in this panel can display currency data.void
Establishes the current value of every Portal-aware descendant as the default value for that component.void
setError
(boolean b) Passes thesetError()
method call to all Portal-aware descendants.void
setInputTracking
(boolean b) A convenience method to toggle theinputTracking
property for all descendants of this panel.void
setModelHandle
(PModelHandle data) Establishes thePModelHandle
for this component and all its descendants.void
setRequired
(boolean b) Passes thesetRequired()
method call to all Portal-aware descendants.void
setResourceName
(String name) Sets the base resource name used in resource look up.togglePrimaryToSecondary
(int primary, int secondary) This method is not implemented forPIAPanel
.void
Disassociates the controller from the componentvoid
OverridesPViewDataChangeListener
.Methods inherited from class com.portal.pfc.ui.ImagePanel
getBackgroundImageIcon, getBackgroundImageMode, imageUpdate, paintComponent, setBackgroundImageIcon
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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
Methods inherited from class java.awt.Container
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
Methods inherited from class java.awt.Component
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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
mIAList
-
mImpl
-
isTracking
protected boolean isTracking -
collectDataFromInvisiblePanels
protected boolean collectDataFromInvisiblePanelsSet this to true if you want invisible panels to participate in data collection. By default, they do not.
-
-
Constructor Details
-
PIAPanel
public PIAPanel()Creates aPIAPanel
that contains some knowledge of Portal. ThisPanel
displays an image, centered in the background. -
PIAPanel
Creates aPIAPanel
that contains some knowledge of Portal. ThisPanel
also knows how to display an image in the background.- Parameters:
img
- the image to displaymode
- indicates how to display the background image
-
-
Method Details
-
unregister
Disassociates the controller from the component- Specified by:
unregister
in interfacePClientComponent
- Throws:
RemoteException
-
setModelHandle
Establishes thePModelHandle
for this component and all its descendants.- Specified by:
setModelHandle
in interfacePComponent
- Parameters:
data
- the newPModelHandle
from which to extract information- Throws:
RemoteException
- thrown for errors
-
getModelHandle
Retrieves thePModelHandle
for this component.- Specified by:
getModelHandle
in interfacePComponent
- Returns:
- The
PModelHandle
associated with this component. - Throws:
RemoteException
- thrown for errors
-
isLight
Determines if this component defersPModelHandle
knowledge to its parent container. If so, the parent container passes thePModelHandle
to this component on the server side (by way of the controller), which saves a client/server round trip for data exchange. Containers typically do not defer processing but instead handle it themselves.- Specified by:
isLight
in interfacePComponent
- Returns:
- False, by default.
- Throws:
RemoteException
- thrown for errors
-
getControllerClassName
Retrieves the class name of this component's controller.- Specified by:
getControllerClassName
in interfacePComponent
- Returns:
- A
String
with the name of the controller. - Throws:
RemoteException
- thrown for errors
-
getTools
Gets a list of actions supported by this component. When subclassed, the overriding class should call its super class version, then add its actions to the returned list. This preserves actions supplied by base classes. The default, supplied here, includes help for this component.- Specified by:
getTools
in interfacePClientComponent
- Returns:
- A
Vector
that containsAction
objects.
-
setResourceName
Sets the base resource name used in resource look up. Basically, the resource name is this base, followed by a dot, followed by the local name (label).- Specified by:
setResourceName
in interfacePClientComponent
- Parameters:
name
- the new base resource name
-
getResourceName
Gets the base resource name used in resource look up.- Specified by:
getResourceName
in interfacePClientComponent
- Returns:
- A
String
with the base resource name.
-
firePropertyChange
Fires a property change event to any registered listener.- Specified by:
firePropertyChange
in interfacePViewComponent
- Overrides:
firePropertyChange
in classComponent
- Parameters:
prop
- the property that has changedoldV
- the old valuenewV
- the new value
-
fireVetoableChange
Fires a vetoable property change event to any registered listener.- Specified by:
fireVetoableChange
in interfacePViewComponent
- Overrides:
fireVetoableChange
in classJComponent
- Parameters:
prop
- the property that has changedoldV
- the old valuenewV
- the new value- Throws:
PropertyVetoException
- thrown when a proposed change to a property represents an unacceptable value
-
getRemoteComponent
Gets a reference to the remote component for this object. The remote component is used to interface with this component's controller.- Specified by:
getRemoteComponent
in interfacePViewComponent
- Returns:
- A
Remote
component.
-
togglePrimaryToSecondary
This method is not implemented forPIAPanel
. UsePIACustomizablePanel
instead.- Specified by:
togglePrimaryToSecondary
in interfacePComponentAttribute
- Parameters:
primary
- The primary currency IDsecondary
- The secondary currency IDfrom
- the current Portal currency IDto
- the new Portal currency ID- Throws:
RemoteException
-
revertToPrimary
Causes the widget to display its data in the primary currency- Specified by:
revertToPrimary
in interfacePComponentAttribute
- Parameters:
primary
- The primary currency ID for an account- Throws:
RemoteException
-
viewDataChange
OverridesPViewDataChangeListener
. This method is no longer called by the controller itself. To ensure backward compatibility, it is called after the model is set, by any operation that causes a change in the display data. The client code should call the appropriateget
methods on the controller to get the data, as the() PViewDataChangeEvent
parameter is no longer used.- Specified by:
viewDataChange
in interfacePViewDataChangeListener
- Parameters:
event
- thePViewDataChangeEvent
event that describes the change. No longer used. By default, the value passed in is always set to null.- Throws:
RemoteException
- thrown for errors
-
setBackgroundImageSource
-
getBackgroundImageSource
-
setBackgroundImageMode
public void setBackgroundImageMode(int drawMode) - Overrides:
setBackgroundImageMode
in classImagePanel
-
componentAdded
Tracks all Portal-aware components that are added to this panel.- Specified by:
componentAdded
in interfaceContainerListener
- Parameters:
e
- the event that indicates a child was added
-
componentRemoved
Tracks all Portal-aware components that are removed from this panel.- Specified by:
componentRemoved
in interfaceContainerListener
- Parameters:
e
- the event that indicates a child was removed
-
setRequired
public void setRequired(boolean b) Passes thesetRequired()
method call to all Portal-aware descendants.- Specified by:
setRequired
in interfacePComponentAttribute
- Parameters:
b
- if true, puts the component in the REQUIRED state
-
isRequired
public boolean isRequired()Determines if any descendant is required in its current context.- Specified by:
isRequired
in interfacePComponentAttribute
- Returns:
- True if any descendant is marked REQUIRED; false otherwise.
-
setError
public void setError(boolean b) Passes thesetError()
method call to all Portal-aware descendants.- Specified by:
setError
in interfacePComponentAttribute
- Parameters:
b
- if true, puts the component in the ERROR state
-
isError
public boolean isError()Determines if any descendant is marked ERROR in its current context.- Specified by:
isError
in interfacePComponentAttribute
- Returns:
- True if any descendant is marked ERROR; false otherwise.
-
isDirty
public boolean isDirty()Determines if any descendant is marked DIRTY in its current context.- Specified by:
isDirty
in interfacePComponentAttribute
- Returns:
- True if any descendant is marked DIRTY; false otherwise.
-
setDefault
public void setDefault()Establishes the current value of every Portal-aware descendant as the default value for that component.- Specified by:
setDefault
in interfacePComponentAttribute
-
isClean
public boolean isClean()Determines if any descendant is marked DIRTY or ERROR.- Returns:
- True if no descendant is marked DIRTY or ERROR; false otherwise.
-
setClean
public void setClean()A convenience method that marks allPFieldComponent
components in this panel as CLEAN. Useful if components were marked DIRTY becauseinputTracking
is on and the data was modified.- Specified by:
setClean
in interfacePComponentAttribute
-
setInputTracking
public void setInputTracking(boolean b) A convenience method to toggle theinputTracking
property for all descendants of this panel.If the
inputTracking
property is enabled, any changes made by the user to the component are tracked and the component is marked DIRTY. If the user modifies the data and returns it to its default or original state, the component is marked CLEAN or not DIRTY.- Specified by:
setInputTracking
in interfacePComponentAttribute
- Parameters:
b
- the state of theinputTracking
property
-
isInputTracking
public boolean isInputTracking()Determines ifinputTracking
is on for this panel (itself).- Specified by:
isInputTracking
in interfacePComponentAttribute
- Returns:
- True if
inputTracking
is on; false otherwise.
-
clear
public void clear()A convenience method to clear every Portal-aware descendant of this panel.- Specified by:
clear
in interfacePComponentAttribute
-
resetToDefault
public void resetToDefault()A convenience method to reset every field on this panel.- Specified by:
resetToDefault
in interfacePComponentAttribute
-
isCurrencyDisplay
public boolean isCurrencyDisplay()Determines whether any descendants currently display currency data.- Specified by:
isCurrencyDisplay
in interfacePComponentAttribute
- Returns:
- True if a descendant currently displays currency data; false otherwise.
- Since:
- Release 6.2
-
setCurrencyDisplay
public void setCurrencyDisplay(boolean b) A convenience method to mark whether all components in this panel can display currency data.Widgets that display currency data are capable of automatically toggling their data between a primary and secondary Portal currency type.
Use this API if the application you are building allows the user to switch between multiple currencies. For each widget that displays currency data, set this property to true.
- Specified by:
setCurrencyDisplay
in interfacePComponentAttribute
- Parameters:
b
- if true, indicates that the widget currently displays currency data- Since:
- Release 6.2
-
collectData
OverridesPCollectDataListener
. Forewarded to all contained GUI components that are also aPCollectDataListener
.- Specified by:
collectData
in interfacePCollectDataListener
- Parameters:
event
- thePCollectDataEvent
data event
-
containsError
Not implemented in this class, but provides a mechanism to pass error data to subclasses. If a subclass contains non-PIA components that subclass may want to flag that those components contain errors. This method provides that mechanism.Typically the argument to this method is an array of
CustomerValErrorData
objects, but the possibility for other types is left open.- Parameters:
obj
- a generic parameter used to pass error data to the panel- Returns:
- False, by default
-
getBundle
Intended for use byPIAPanel
subclasses that are set up for use in Borland JBuilder. JBuilder requires that resource bundles be statically loaded using theResourceBundle.getBundle()
method, but at runtime, the BAS methodology should be used. This method differentiates between design time and run time and retrieves the appropriate resources. -
processError
Provides a hook for subclasses to react to errors if they choose to do so. A subclass may need to overridecollectData()
to pass along other data. If an error occurs, that subclass needs to check to determine if it is the cause of the error and respond to it appropriately.- Parameters:
err
- the error model handle- Returns:
- Another hook, in case data needs to be returned.
-