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.JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected boolean |
collectDataFromInvisiblePanels
Set this to true if you want invisible panels to participate
in data collection.
|
protected boolean |
isTracking |
protected LinkedList |
mIAList |
protected PComponentImpl |
mImpl |
IMAGE_CENTERED, IMAGE_SCALE_TO_HEIGHT, IMAGE_SCALE_TO_WIDTH, IMAGE_SCALED, IMAGE_TILED, mImageIcon, mScaledImage
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
PIAPanel()
Creates a
PIAPanel that contains some knowledge of Portal. |
PIAPanel(ImageIcon img,
int mode)
Creates a
PIAPanel that contains some knowledge of Portal. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
A convenience method to clear every Portal-aware descendant of
this panel.
|
void |
collectData(PCollectDataEvent event)
Overrides
PCollectDataListener . |
void |
componentAdded(ContainerEvent e)
Tracks all Portal-aware components that are added to this panel.
|
void |
componentRemoved(ContainerEvent e)
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.
|
String |
getBackgroundImageSource() |
static ResourceBundle |
getBundle(String name)
Intended for use by
PIAPanel subclasses that are set up for use
in Borland JBuilder. |
String |
getControllerClassName()
Retrieves the class name of this component's controller.
|
PModelHandle |
getModelHandle()
Retrieves the
PModelHandle for this component. |
PRemoteComponent |
getRemoteComponent()
Gets a reference to the remote component for this object.
|
String |
getResourceName()
Gets the base resource name used in resource look up.
|
Vector |
getTools()
Gets a list of actions supported by this component.
|
boolean |
isClean()
Determines if any descendant is marked DIRTY or ERROR.
|
boolean |
isCurrencyDisplay()
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 |
isInputTracking()
Determines if
inputTracking is on for this panel (itself). |
boolean |
isLight()
Determines if this component defers
PModelHandle
knowledge to its parent container. |
boolean |
isRequired()
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 |
resetToDefault()
A convenience method to reset every field on this panel.
|
void |
revertToPrimary(int primary)
Causes the widget to display its data in the primary currency
|
void |
setBackgroundImageMode(int drawMode) |
void |
setBackgroundImageSource(String loc) |
void |
setClean()
A convenience method that marks all
PFieldComponent
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 |
setDefault()
Establishes the current value of every Portal-aware descendant
as the default value for that component.
|
void |
setError(boolean b)
Passes the
setError() method call to all Portal-aware
descendants. |
void |
setInputTracking(boolean b)
A convenience method to toggle the
inputTracking property for all
descendants of this panel. |
void |
setModelHandle(PModelHandle data)
Establishes the
PModelHandle for this component and
all its descendants. |
void |
setRequired(boolean b)
Passes the
setRequired() method call to all Portal-aware
descendants. |
void |
setResourceName(String name)
Sets the base resource name used in resource look up.
|
Object |
togglePrimaryToSecondary(int primary,
int secondary)
This method is not implemented for
PIAPanel . |
void |
unregister()
Disassociates the controller from the component
|
void |
viewDataChange(PViewDataChangeEvent event)
Overrides
PViewDataChangeListener . |
getBackgroundImageIcon, getBackgroundImageMode, imageUpdate, paintComponent, setBackgroundImageIcon
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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
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, 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, 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
protected transient LinkedList mIAList
protected transient PComponentImpl mImpl
protected boolean isTracking
protected boolean collectDataFromInvisiblePanels
public PIAPanel()
PIAPanel
that contains some knowledge of Portal.
This Panel
displays an image, centered in the background.public PIAPanel(ImageIcon img, int mode)
PIAPanel
that contains some knowledge of Portal.
This Panel
also knows how to display an image in the background.img
- the image to displaymode
- indicates how to display the background imagepublic void unregister() throws RemoteException
unregister
in interface PClientComponent
RemoteException
public void setModelHandle(PModelHandle data) throws RemoteException
PModelHandle
for this component and
all its descendants.setModelHandle
in interface PComponent
data
- the new PModelHandle
from
which to extract informationRemoteException
- thrown for errorspublic PModelHandle getModelHandle() throws RemoteException
PModelHandle
for this component.getModelHandle
in interface PComponent
PModelHandle
associated
with this component.RemoteException
- thrown for errorspublic boolean isLight() throws RemoteException
PModelHandle
knowledge to its parent container. If so, the parent container passes the
PModelHandle
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.isLight
in interface PComponent
RemoteException
- thrown for errorspublic String getControllerClassName() throws RemoteException
getControllerClassName
in interface PComponent
String
with the name
of the controller.RemoteException
- thrown for errorspublic Vector getTools()
getTools
in interface PClientComponent
Vector
that contains Action
objects.public void setResourceName(String name)
setResourceName
in interface PClientComponent
name
- the new base resource namepublic String getResourceName()
getResourceName
in interface PClientComponent
String
with the base resource name.public void firePropertyChange(String prop, Object oldV, Object newV)
firePropertyChange
in interface PViewComponent
firePropertyChange
in class Component
prop
- the property that has changedoldV
- the old valuenewV
- the new valuepublic void fireVetoableChange(String prop, Object oldV, Object newV) throws PropertyVetoException
fireVetoableChange
in interface PViewComponent
fireVetoableChange
in class JComponent
prop
- the property that has changedoldV
- the old valuenewV
- the new valuePropertyVetoException
- thrown when a proposed
change to a property represents an
unacceptable valuepublic PRemoteComponent getRemoteComponent()
getRemoteComponent
in interface PViewComponent
Remote
component.public Object togglePrimaryToSecondary(int primary, int secondary) throws RemoteException
PIAPanel
. Use
PIACustomizablePanel
instead.togglePrimaryToSecondary
in interface PComponentAttribute
from
- the current Portal currency IDto
- the new Portal currency IDprimary
- The primary currency IDsecondary
- The secondary currency IDRemoteException
public void revertToPrimary(int primary) throws RemoteException
revertToPrimary
in interface PComponentAttribute
primary
- The primary currency ID for an accountRemoteException
public void viewDataChange(PViewDataChangeEvent event) throws RemoteException
PViewDataChangeListener
. 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 appropriate
get()
methods on the controller to get the data, as the
PViewDataChangeEvent
parameter is no longer used.viewDataChange
in interface PViewDataChangeListener
event
- the PViewDataChangeEvent
event that
describes the change. No longer used. By default, the value
passed in is always set to null.RemoteException
- thrown for errorspublic void setBackgroundImageSource(String loc)
public String getBackgroundImageSource()
public void setBackgroundImageMode(int drawMode)
setBackgroundImageMode
in class ImagePanel
public void componentAdded(ContainerEvent e)
componentAdded
in interface ContainerListener
e
- the event that indicates a child was addedpublic void componentRemoved(ContainerEvent e)
componentRemoved
in interface ContainerListener
e
- the event that indicates a child was removedpublic void setRequired(boolean b)
setRequired()
method call to all Portal-aware
descendants.setRequired
in interface PComponentAttribute
b
- if true, puts the component in the REQUIRED statepublic boolean isRequired()
isRequired
in interface PComponentAttribute
public void setError(boolean b)
setError()
method call to all Portal-aware
descendants.setError
in interface PComponentAttribute
b
- if true, puts the component in the ERROR statepublic boolean isError()
isError
in interface PComponentAttribute
public boolean isDirty()
isDirty
in interface PComponentAttribute
public void setDefault()
setDefault
in interface PComponentAttribute
public boolean isClean()
public void setClean()
PFieldComponent
components in this panel as CLEAN. Useful if components were marked DIRTY
because inputTracking
is on and the data was modified.setClean
in interface PComponentAttribute
public void setInputTracking(boolean b)
inputTracking
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.
setInputTracking
in interface PComponentAttribute
b
- the state of the inputTracking
propertypublic boolean isInputTracking()
inputTracking
is on for this panel (itself).isInputTracking
in interface PComponentAttribute
inputTracking
is on; false otherwise.public void clear()
clear
in interface PComponentAttribute
public void resetToDefault()
resetToDefault
in interface PComponentAttribute
public boolean isCurrencyDisplay()
isCurrencyDisplay
in interface PComponentAttribute
public void setCurrencyDisplay(boolean b)
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.
setCurrencyDisplay
in interface PComponentAttribute
b
- if true, indicates that the widget currently displays currency datapublic void collectData(PCollectDataEvent event)
PCollectDataListener
. Forewarded to all
contained GUI components that are also a PCollectDataListener
.collectData
in interface PCollectDataListener
event
- the PCollectDataEvent
data eventpublic boolean containsError(Object obj)
Typically the argument to this method is an array of
CustomerValErrorData
objects, but
the possibility for other types is left open.
obj
- a generic parameter used to pass error data to the panelpublic static ResourceBundle getBundle(String name)
PIAPanel
subclasses that are set up for use
in Borland JBuilder. JBuilder requires that resource bundles be statically
loaded using the ResourceBundle.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.protected Object processError(PModelHandle err)
collectData()
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.err
- the error model handleCopyright © 2003, 2023, Oracle and/or its affiliates.