public class StatusBar extends javax.swing.JPanel implements ConfigurableUnit
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
BUTTON_ALWAYS
The clipboard button is always on the screen.
|
static int |
BUTTON_AUTO
The clipboard button is shown when the clipboard is loaded.
|
static int |
BUTTON_NEVER
The clipboard button is disabled.
|
static java.net.URL |
ICON_CLIPBOARD_EMPTY
Icon representing an empty clipboard.
|
static java.net.URL |
ICON_CLIPBOARD_LOADED
Icon representing a loaded clipboard.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
StatusBar()
Constructor for the GUI component.
|
Modifier and Type | Method and Description |
---|---|
void |
addButton(javax.swing.JButton button)
Adds a new custom button between message area and memory controller.
|
void |
addMouseListener(java.awt.event.MouseListener listener)
Adds a mouse listener for the status bar (no buttons.
|
void |
addTask(java.lang.Runnable task)
Adds a new task executed periodically by the updater thread.
|
void |
configureUnit(java.lang.String id,
Configuration config)
Restores values from persistent data stores.
|
protected void |
finalize()
Help the garbage collector.
|
int |
getMCThreshold()
Gets the current visiblity threshold for the memory controller.
|
MemoryController |
getMemoryController()
Getter for memory controller.
|
MessageLabel |
getMessageLabel()
Provides the message label.
|
java.lang.String |
getMessageText()
Provides the message text currently displayed.
|
int |
getPriority()
Gets the priority for the update task.
|
boolean |
getShowBevelBorders()
Are the bevel borders visible or not.
|
java.util.Vector<java.lang.Runnable> |
getTasks()
Provides the tasks currently being executed by this status bar.
|
java.text.DateFormat |
getTimeFormat()
Gets the time format.
|
javax.swing.JLabel |
getTimeLabel()
Provides the time label for adding listeners etc.
|
java.text.DateFormat |
getTimeToolTipFormat()
Gets the time tooltip format.
|
boolean |
isTimeVisible()
Is the time component visible or not.
|
void |
removeButton(javax.swing.JButton button)
Removes the custom button.
|
void |
removeTask(java.lang.Runnable task)
Removes the custom button.
|
void |
setMCThreshold(int threshold)
Sets visiblity threshold for the memory controller.
|
void |
setMessage(StatusBarMessage message)
Sets a new message with optional icon and duration.
|
void |
setMessageText(java.lang.String text)
Simplest method to display a certain text message without icon.
|
void |
setMessageText(java.lang.String text,
javax.swing.ImageIcon icon)
Displays a text message together with a special icon.
|
void |
setMessageText(java.lang.String text,
javax.swing.ImageIcon icon,
int millis)
Displays an icon-supported text message for a certain period of time in milliseconds.
|
void |
setMessageText(java.lang.String text,
int millis)
Displays an icon-less text message for a certain period of time in milliseconds.
|
void |
setMessageText(java.lang.String text,
java.net.URL icon)
Displays a text message together with a special icon.
|
void |
setMessageText(java.lang.String text,
java.net.URL icon,
int millis)
Displays an icon-supported text message for a certain period of time in milliseconds.
|
void |
setPriority(int priority)
Sets the priority for the update task.
|
void |
setShowBevelBorders(boolean show)
Sets the bevel borders visible or not.
|
void |
setTimeFormat(java.lang.String format)
Sets the time format.
|
void |
setTimeToolTipFormat(java.lang.String format)
Sets the time tooltip format.
|
void |
setTimeVisible(boolean visible)
Sets the time component visible or not.
|
void |
setupClipboardButton(int mode)
Enable/disable the default clipboard button.
|
void |
startThread()
Starts the update thread based on the current configuration.
|
void |
stopThread()
Call this method if you like the update thread be terminated properly.
|
void |
storeUnit(java.lang.String id,
Configuration config)
Stores the current configuration values persistently.
|
void |
unitRegistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was registered with a model.
|
void |
unitUnregistered(ApplicationModel model,
java.lang.String id)
Informs the configurable unit that it was unregistered with a model.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, 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
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, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.net.URL ICON_CLIPBOARD_EMPTY
public static final java.net.URL ICON_CLIPBOARD_LOADED
public static final int BUTTON_NEVER
public static final int BUTTON_ALWAYS
public static final int BUTTON_AUTO
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void setMessageText(java.lang.String text)
text
- Single line of text, cleared if null
or emptypublic void setMessageText(java.lang.String text, int millis)
text
- Single line of text, cleared if null
or emptymillis
- Period of time to display the messagepublic void setMessageText(java.lang.String text, javax.swing.ImageIcon icon, int millis)
text
- Single line of text, cleared if null
or emptyicon
- Symbol to be displayedmillis
- Time in millisecondspublic void setMessageText(java.lang.String text, java.net.URL icon, int millis)
text
- Single line of text, cleared if null
or emptyicon
- Symbol to be displayedmillis
- Time in millisecondspublic void setMessageText(java.lang.String text, javax.swing.ImageIcon icon)
text
- Single line of text, cleared if null
or emptyicon
- Image to be displayed (e.g. ICON_INFO
), may be null
public void setMessageText(java.lang.String text, java.net.URL icon)
ICON_INFO
, ...
text
- Single line of text, cleared if null
or emptyicon
- URL address of image to be displayed, may be null
public void setMessage(StatusBarMessage message)
message
- Message encapsulation instancepublic java.lang.String getMessageText()
public void addButton(javax.swing.JButton button)
button
- New custom button, appears at the most left positionjava.lang.NullPointerException
- If the button is null
public void removeButton(javax.swing.JButton button)
button
- Custom button to be removedjava.lang.NullPointerException
- If the button is null
public void setPriority(int priority)
priority
- Thread prioritypublic int getPriority()
public MemoryController getMemoryController()
public void startThread()
public void stopThread()
public void setTimeVisible(boolean visible)
visible
- Shall the time be displayed?public boolean isTimeVisible()
public void setTimeFormat(java.lang.String format)
format
- The new time format to use, default is "HH:mm:ss"java.lang.NullPointerException
- If the format is null
java.lang.IllegalArgumentException
- If the format is invalidpublic java.text.DateFormat getTimeFormat()
public void setTimeToolTipFormat(java.lang.String format)
format
- The new time format to use, default is "EEEEE, d. MMMMM yyyy"java.lang.NullPointerException
- If the format is null
java.lang.IllegalArgumentException
- If the format is invalidpublic java.text.DateFormat getTimeToolTipFormat()
public void setMCThreshold(int threshold)
threshold
- The new visibility threshold in the range from 0 to 100 percentjava.lang.IllegalArgumentException
- If the threshold is invalidpublic int getMCThreshold()
public void setupClipboardButton(int mode)
mode
- BUTTON_NEVER
| ...public void addTask(java.lang.Runnable task)
task
- New task to be executed periodicallyjava.lang.NullPointerException
- If the task is null
public void removeTask(java.lang.Runnable task)
task
- Task to be removedjava.lang.NullPointerException
- If the task is null
public void addMouseListener(java.awt.event.MouseListener listener)
addMouseListener
in class java.awt.Component
listener
- Listener for the componentpublic javax.swing.JLabel getTimeLabel()
public void configureUnit(java.lang.String id, Configuration config)
configureUnit
in interface ConfigurableUnit
id
- The unique identifier for the instanceconfig
- The configurationpublic void storeUnit(java.lang.String id, Configuration config)
storeUnit
in interface ConfigurableUnit
id
- The unique identifier for the instanceconfig
- The configurationpublic void unitRegistered(ApplicationModel model, java.lang.String id)
unitRegistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void unitUnregistered(ApplicationModel model, java.lang.String id)
unitUnregistered
in interface ConfigurableUnit
model
- The application modelid
- The unique identifier for the instancepublic void setShowBevelBorders(boolean show)
show
- Shall bevel borders be displayed?public boolean getShowBevelBorders()
public java.util.Vector<java.lang.Runnable> getTasks()
public MessageLabel getMessageLabel()
Copyright © 2005-2013 Leisenfels UG (haftungsbeschränkt). All rights reserved.