|
qflib 0.98.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.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.
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| 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 |
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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus |
| 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 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 CountListenerevent - The event containing the details.public javax.swing.JProgressBar getProgressBar()
public boolean isProgressShowing()
|
qflib 0.98.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||