Package com.portal.pfc.ui
Class StatusBar
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.portal.pfc.ui.StatusBar
- All Implemented Interfaces:
ActionListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
- Direct Known Subclasses:
InfranetStatusBar
Provides ability to control contents of the status bar. The status bar
has three main areas:
- Message area: allows showing textual info or a user-defned panel
- Progress area: animation showing progress of some activity. The ui components in this area can appear in these combinations
- Progress bar only
- Progress bar and counter
- Progress bar and Cancel button
- Progress bar and counter and Cancel button
- 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
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
ConstructorsConstructorDescriptionDefault constructor.StatusBar
(boolean showProgressBar) This builds a status-bar with a message panel and optionally a progress panel with a progress bar, progress text and a progress cancel button.StatusBar
(boolean showProgressText, boolean showProgressCancel) This builds a status-bar with a message panel and a progress panel with a progress bar and optionally a progress text and a progress cancel button. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addAsLastComponent
(JPanel panel) Adds the panel as the last one to the status bar, just before the gripper.void
Adds an action listener to the cancel progress button.void
Adds a user-defined component to the far left of the status bar, after the status text(if any).protected JPanel
Create an internal panel, positioned using an east layout constaint, to hold optional subpanels such as progress bar, connection info, or user defined panels.protected JPanel
Creates a GripperPanel.protected JPanel
Creates a simple message area with the default layoutprotected JPanel
A simple progress bar implementationprotected void
init()
void
Removes the given action listener from the cancel progress button.void
setMessage
(String message) Sets the message to display in the message display area of status bar.void
setMessage
(String message, int visible) Sets the message to display in the message display area of status bar.void
setProgressDefaults
(boolean indeterminate, int start, int max, String progressStr) Sets the progress area defaults.void
setProgressText
(String value) Set progress textvoid
setProgressValue
(int value) Set scalar progress valueMethods 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, 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
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, 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, 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, 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
-
Constructor Details
-
StatusBar
public StatusBar()Default constructor. This builds a status-bar with just a message panel -
StatusBar
public StatusBar(boolean showProgressBar) This builds a status-bar with a message panel and optionally a progress panel with a progress bar, progress text and a progress cancel button.- Parameters:
showProgressBar
- if true, displays the progress bar, the progress text(if set) and the Cancel button
-
StatusBar
public StatusBar(boolean showProgressText, boolean showProgressCancel) This builds a status-bar with a message panel and a progress panel with a progress bar and optionally a progress text and a progress cancel button.- Parameters:
showProgressText
- if true, displays the progress text(if set)showProgressCancel
- if true, displays the progress Cancel button
-
-
Method Details
-
init
protected void init() -
createEastPanel
Create an internal panel, positioned using an east layout constaint, to hold optional subpanels such as progress bar, connection info, or user defined panels. etc.Gripper panel will always be placed as the last component on this panel.
- Returns:
- mEastPanel.
-
addAsLastComponent
Adds the panel as the last one to the status bar, just before the gripper.Panel background will be set to default status bar background.
- Parameters:
panel
- the panel to be set as the last component.
-
createGripperPanel
Creates a GripperPanel. A GripperPanel is a panel which paints hatch marks that provide a visual cue that the screen can be resized.- Returns:
- GripperPanel;
-
createMessagePanel
Creates a simple message area with the default layout- Returns:
- message panel
-
createProgressPanel
A simple progress bar implementation- Returns:
- JPanel
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
setMessage
Sets the message to display in the message display area of status bar. Message will be truncated if its length is too long; visible length depends on current size of window.- Parameters:
message
- Message to display.
-
setMessage
Sets the message to display in the message display area of status bar. Message will be truncated if its length is too long; visible length depends on current size of window. Message will remain visible for time specified.- Parameters:
message
- Message to display.visible
- How long the message should be visible, in seconds. If less than or equal to zero, the default time-out is used
-
addToStatusBar
Adds a user-defined component to the far left of the status bar, after the status text(if any).- Parameters:
c
- Any component
-
setProgressDefaults
Sets the progress area defaults.- Parameters:
indeterminate
- If true, indeterminate progress bar will be shown. In that case, the other arguments are ignored. If false, progress bar with bounds specified by start and max params will be shown. The progress bar is updated by setProgressValue().start
- Specifies starting value of the progress bar and countermax
- Specifies maximum value of the progress bar and counterprogressStr
- If not null, sets the value of progress string used in the counter.
-
setProgressValue
public void setProgressValue(int value) Set scalar progress value- Parameters:
value
- Current progress value
-
setProgressText
Set progress text- Parameters:
value
- String to display in the optional progress text area
-
addCancelProgressListener
Adds an action listener to the cancel progress button.- Parameters:
l
- the action listener to be added
-
removeCancelProgressListener
Removes the given action listener from the cancel progress button.- Parameters:
l
- the action listener to be removed
-