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.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanSet this to true if you want invisible panels to participate in data collection.protected booleanprotected LinkedListprotected PComponentImplFields inherited from class com.portal.pfc.ui.ImagePanel
IMAGE_CENTERED, IMAGE_SCALE_TO_HEIGHT, IMAGE_SCALE_TO_WIDTH, IMAGE_SCALED, IMAGE_TILED, mImageIcon, mScaledImageFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()A convenience method to clear every Portal-aware descendant of this panel.voidcollectData(PCollectDataEvent event) OverridesPCollectDataListener.voidTracks all Portal-aware components that are added to this panel.voidTracks all Portal-aware components that are removed from this panel.booleancontainsError(Object obj) Not implemented in this class, but provides a mechanism to pass error data to subclasses.voidfirePropertyChange(String prop, Object oldV, Object newV) Fires a property change event to any registered listener.voidfireVetoableChange(String prop, Object oldV, Object newV) Fires a vetoable property change event to any registered listener.static ResourceBundleIntended for use byPIAPanelsubclasses that are set up for use in Borland JBuilder.Retrieves the class name of this component's controller.Retrieves thePModelHandlefor 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.booleanisClean()Determines if any descendant is marked DIRTY or ERROR.booleanDetermines whether any descendants currently display currency data.booleanisDirty()Determines if any descendant is marked DIRTY in its current context.booleanisError()Determines if any descendant is marked ERROR in its current context.booleanDetermines ifinputTrackingis on for this panel (itself).booleanisLight()Determines if this component defersPModelHandleknowledge to its parent container.booleanDetermines if any descendant is required in its current context.protected ObjectprocessError(PModelHandle err) Provides a hook for subclasses to react to errors if they choose to do so.voidA convenience method to reset every field on this panel.voidrevertToPrimary(int primary) Causes the widget to display its data in the primary currencyvoidsetBackgroundImageMode(int drawMode) voidvoidsetClean()A convenience method that marks allPFieldComponentcomponents in this panel as CLEAN.voidsetCurrencyDisplay(boolean b) A convenience method to mark whether all components in this panel can display currency data.voidEstablishes the current value of every Portal-aware descendant as the default value for that component.voidsetError(boolean b) Passes thesetError()method call to all Portal-aware descendants.voidsetInputTracking(boolean b) A convenience method to toggle theinputTrackingproperty for all descendants of this panel.voidsetModelHandle(PModelHandle data) Establishes thePModelHandlefor this component and all its descendants.voidsetRequired(boolean b) Passes thesetRequired()method call to all Portal-aware descendants.voidsetResourceName(String name) Sets the base resource name used in resource look up.togglePrimaryToSecondary(int primary, int secondary) This method is not implemented forPIAPanel.voidDisassociates the controller from the componentvoidOverridesPViewDataChangeListener.Methods inherited from class com.portal.pfc.ui.ImagePanel
getBackgroundImageIcon, getBackgroundImageMode, imageUpdate, paintComponent, setBackgroundImageIconMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, validateTreeMethods 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 aPIAPanelthat contains some knowledge of Portal. ThisPaneldisplays an image, centered in the background. -
PIAPanel
Creates aPIAPanelthat contains some knowledge of Portal. ThisPanelalso 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:
unregisterin interfacePClientComponent- Throws:
RemoteException
-
setModelHandle
Establishes thePModelHandlefor this component and all its descendants.- Specified by:
setModelHandlein interfacePComponent- Parameters:
data- the newPModelHandlefrom which to extract information- Throws:
RemoteException- thrown for errors
-
getModelHandle
Retrieves thePModelHandlefor this component.- Specified by:
getModelHandlein interfacePComponent- Returns:
- The
PModelHandleassociated with this component. - Throws:
RemoteException- thrown for errors
-
isLight
Determines if this component defersPModelHandleknowledge to its parent container. If so, the parent container passes thePModelHandleto 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:
isLightin interfacePComponent- Returns:
- False, by default.
- Throws:
RemoteException- thrown for errors
-
getControllerClassName
Retrieves the class name of this component's controller.- Specified by:
getControllerClassNamein interfacePComponent- Returns:
- A
Stringwith 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:
getToolsin interfacePClientComponent- Returns:
- A
Vectorthat containsActionobjects.
-
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:
setResourceNamein interfacePClientComponent- Parameters:
name- the new base resource name
-
getResourceName
Gets the base resource name used in resource look up.- Specified by:
getResourceNamein interfacePClientComponent- Returns:
- A
Stringwith the base resource name.
-
firePropertyChange
Fires a property change event to any registered listener.- Specified by:
firePropertyChangein interfacePViewComponent- Overrides:
firePropertyChangein 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:
fireVetoableChangein interfacePViewComponent- Overrides:
fireVetoableChangein 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:
getRemoteComponentin interfacePViewComponent- Returns:
- A
Remotecomponent.
-
togglePrimaryToSecondary
This method is not implemented forPIAPanel. UsePIACustomizablePanelinstead.- Specified by:
togglePrimaryToSecondaryin 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:
revertToPrimaryin 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 appropriategetmethods on the controller to get the data, as the() PViewDataChangeEventparameter is no longer used.- Specified by:
viewDataChangein interfacePViewDataChangeListener- Parameters:
event- thePViewDataChangeEventevent 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:
setBackgroundImageModein classImagePanel
-
componentAdded
Tracks all Portal-aware components that are added to this panel.- Specified by:
componentAddedin 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:
componentRemovedin 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:
setRequiredin 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:
isRequiredin 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:
setErrorin 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:
isErrorin 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:
isDirtyin 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:
setDefaultin 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 allPFieldComponentcomponents in this panel as CLEAN. Useful if components were marked DIRTY becauseinputTrackingis on and the data was modified.- Specified by:
setCleanin interfacePComponentAttribute
-
setInputTracking
public void setInputTracking(boolean b) A convenience method to toggle theinputTrackingproperty for all descendants of this panel.If the
inputTrackingproperty 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:
setInputTrackingin interfacePComponentAttribute- Parameters:
b- the state of theinputTrackingproperty
-
isInputTracking
public boolean isInputTracking()Determines ifinputTrackingis on for this panel (itself).- Specified by:
isInputTrackingin interfacePComponentAttribute- Returns:
- True if
inputTrackingis on; false otherwise.
-
clear
public void clear()A convenience method to clear every Portal-aware descendant of this panel.- Specified by:
clearin interfacePComponentAttribute
-
resetToDefault
public void resetToDefault()A convenience method to reset every field on this panel.- Specified by:
resetToDefaultin interfacePComponentAttribute
-
isCurrencyDisplay
public boolean isCurrencyDisplay()Determines whether any descendants currently display currency data.- Specified by:
isCurrencyDisplayin 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:
setCurrencyDisplayin 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:
collectDatain interfacePCollectDataListener- Parameters:
event- thePCollectDataEventdata 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
CustomerValErrorDataobjects, 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 byPIAPanelsubclasses 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.
-