|
qflib 0.99 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
de.qfs.lib.gui.StatusLine
The StatusLine is a component that is typically placed at the bottom of a Frame and used to display status and other messages.
The StatusLine is built from a simple JComponent with a BorderLayout, containing one JLabel in the center, so it can easily be extended to display additional information.
These are some common uses for a status line:
setPermanentMessage
,
pushMessage
and setTemporaryMessage
. The status line will be redrawn immediately after changing the message, since standard AWT redraw during idle time is typically too late.
New since qflib version 0.96.0 is support for a progress bar which
can be displayed with showProgressBar
and turned
off with removeProgressBar
. The progress value
can be set with setProgressValue
. Alternatively
StatusLine now implements the CountListener
interface and can be registered with a CountingInputStream
.
Nested Class Summary |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected javax.swing.JLabel |
message
The Label displaying the messages. |
protected javax.swing.JProgressBar |
progress
Optional progress bar. |
protected boolean |
progressShowing
Whether the progress bar is currently shown. |
protected boolean |
showPercent
Whether to display a percent string in the progress bar. |
Fields inherited from class javax.swing.JComponent |
accessibleContext, 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 |
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 | |
StatusLine()
Create a new StatusLine. |
Method Summary | |
void |
countChanged(CountEvent event)
Notify the progress bar of a new value. |
void |
forceUpdate()
Force redraw of StatusLine |
javax.swing.JLabel |
getMessageLabel()
Get the JLabel component that displays the status message. |
javax.swing.JProgressBar |
getProgressBar()
Get the progress bar of the status line. |
protected void |
init()
Initialize the StatusLine. |
boolean |
isProgressShowing()
Query whther the progess bar is currently showing. |
void |
popMessage()
Remove the semi permanent message set with pushMessage and display the permanent message. |
void |
pushMessage(java.lang.String msg)
Display a message until it is either removed with popMessage or replaced with another call to pushMessage. |
void |
removeProgressBar()
Remove the progress bar from the StatusLine. |
void |
setPermanentMessage(java.lang.String msg)
Set the message to display in the StatusLine whenever no other message is displayed. |
void |
setProgressValue(int value)
Set the value for the progress bar and force a redisplay of the StatusLine. |
void |
setTemporaryMessage(java.lang.String msg)
Display a message temporarily. |
void |
setTemporaryMessage(java.lang.String msg,
int delay)
Display a message temporarily. |
void |
setTemporaryMessageDelay(int delay)
Set the delay in milliseconds after which to replace the temporary message with the previous message. |
void |
showProgressBar(int min,
int max,
java.lang.String where,
boolean showPercent)
Display a progress bar. |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected javax.swing.JLabel message
protected javax.swing.JProgressBar progress
protected boolean progressShowing
protected boolean showPercent
Constructor Detail |
public StatusLine()
Method Detail |
protected void init()
public final javax.swing.JLabel getMessageLabel()
public void setPermanentMessage(java.lang.String msg)
msg
- The permanent message to set.public void pushMessage(java.lang.String msg)
popMessage
or replaced with another call to pushMessage.
msg
- The message to display.public void popMessage()
pushMessage
and display the permanent message.
public void setTemporaryMessage(java.lang.String msg)
msg
- The message to display.public void setTemporaryMessage(java.lang.String msg, int delay)
msg
- The message to display.delay
- The duration in ms that the message will remain
visible.public void setTemporaryMessageDelay(int delay)
delay
- The delay to set.public void forceUpdate()
public void showProgressBar(int min, int max, java.lang.String where, boolean showPercent)
min
- Minimum value for the progress bar.max
- Maximum value for the progress bar.where
- BorderLayout constraint, e.g. "West".showPercent
- Whether to display a percent string inside the
progress bar.public void removeProgressBar()
public void setProgressValue(int value)
value
- The new value.public void countChanged(CountEvent event)
countChanged
in interface CountListener
event
- The event containing the details.public javax.swing.JProgressBar getProgressBar()
public boolean isProgressShowing()
|
qflib 0.99 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |