com.mucommander.ui.main
Class StatusBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.mucommander.ui.main.StatusBar
All Implemented Interfaces:
ActivePanelListener, LocationListener, TableSelectionListener, ThemeListener, java.awt.event.ComponentListener, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible

public class StatusBar
extends javax.swing.JPanel
implements java.lang.Runnable, java.awt.event.MouseListener, ActivePanelListener, TableSelectionListener, LocationListener, java.awt.event.ComponentListener, ThemeListener

StatusBar is the component that sits at the bottom of each MainFrame, between the folder panels and command bar. There is one and only one StatusBar per MainFrame, created by the associated MainFrame. It can be hidden, but the instance will always remain, until the MainFrame is disposed.

StatusBar is used to display info about the total/selected number of files in the current folder and current volume's free/total space. When a folder is being changed, a waiting message is displayed. When quick search is being used, the current quick search string is displayed.

StatusBar receives LocationListener events when the folder has or is being changed, and automatically updates selected files and volume info, and display the waiting message when the folder is changing. Quick search info is set by FileTable.QuickSearch.

When StatusBar is visible, a Thread runs in the background to periodically update free/total space volume info. This thread stops when the StatusBar is hidden.

Author:
Maxence Bernard
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static ConfigurationListener CONFIGURATION_ADAPTER
          Listens to configuration changes and updates static fields accordingly
static java.lang.String WAITING_ICON
          Icon that is displayed when folder is changing
 
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
StatusBar(MainFrame mainFrame)
          Creates a new StatusBar instance.
 
Method Summary
 void activePanelChanged(FolderPanel folderPanel)
          This method is invoked when the currently active (i.e.
 void colorChanged(ColorChangedEvent event)
          Notifies the listener that a color has been changed.
 void componentHidden(java.awt.event.ComponentEvent e)
           
 void componentMoved(java.awt.event.ComponentEvent e)
           
 void componentResized(java.awt.event.ComponentEvent e)
           
 void componentShown(java.awt.event.ComponentEvent e)
           
 void fontChanged(FontChangedEvent event)
          Notifies the listener that a font has been changed.
 void locationCancelled(LocationEvent e)
          This method is invoked when the current folder has been cancelled by the user.
 void locationChanged(LocationEvent e)
          This method is invoked when the current folder has changed.
 void locationChanging(LocationEvent e)
          This method is invoked when the current folder is being changed.
 void locationFailed(LocationEvent e)
          This method is invoked when the current folder could not be changed, as a result of the folder not existing or failing to list its contents.
 void markedFilesChanged(FileTable source)
          This method is invoked when the files marked have changed on the specified FileTable.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void run()
          Periodically updates volume info (free / total space).
 void selectedFileChanged(FileTable source)
          This method is invoked when the selected file has changed on the specified FileTable .
 void setStatusInfo(java.lang.String infoMessage)
          Displays the specified text on the left-side of the status bar, replacing any previous text and icon.
 void setStatusInfo(java.lang.String text, javax.swing.Icon icon, boolean iconBeforeText)
          Displays the specified text and icon on the left-side of the status bar, replacing any previous information.
 void setVisible(boolean visible)
          Overrides JComponent.setVisible(boolean) to start/stop volume info auto-update thread.
 void updateSelectedFilesInfo()
          Updates info about currently selected files ((nb of selected files, combined size), displayed on the left-side of this status bar.
 
Methods 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WAITING_ICON

public static final java.lang.String WAITING_ICON
Icon that is displayed when folder is changing

See Also:
Constant Field Values

CONFIGURATION_ADAPTER

public static final ConfigurationListener CONFIGURATION_ADAPTER
Listens to configuration changes and updates static fields accordingly

Constructor Detail

StatusBar

public StatusBar(MainFrame mainFrame)
Creates a new StatusBar instance.

Method Detail

updateSelectedFilesInfo

public void updateSelectedFilesInfo()
Updates info about currently selected files ((nb of selected files, combined size), displayed on the left-side of this status bar.


setStatusInfo

public void setStatusInfo(java.lang.String text,
                          javax.swing.Icon icon,
                          boolean iconBeforeText)
Displays the specified text and icon on the left-side of the status bar, replacing any previous information.

Parameters:
text - the piece of text to display
icon - the icon to display next to the text
iconBeforeText - if true, icon will be placed on the left side of the text, if not on the right side

setStatusInfo

public void setStatusInfo(java.lang.String infoMessage)
Displays the specified text on the left-side of the status bar, replacing any previous text and icon.

Parameters:
infoMessage - the piece of text to display

setVisible

public void setVisible(boolean visible)
Overrides JComponent.setVisible(boolean) to start/stop volume info auto-update thread.

Overrides:
setVisible in class javax.swing.JComponent

run

public void run()
Periodically updates volume info (free / total space).

Specified by:
run in interface java.lang.Runnable

activePanelChanged

public void activePanelChanged(FolderPanel folderPanel)
Description copied from interface: ActivePanelListener
This method is invoked when the currently active (i.e. that has focus) folder panel has changed on the MainFrame.

Specified by:
activePanelChanged in interface ActivePanelListener
Parameters:
folderPanel - the new active FolderPanel.

selectedFileChanged

public void selectedFileChanged(FileTable source)
Description copied from interface: TableSelectionListener
This method is invoked when the selected file has changed on the specified FileTable .

Specified by:
selectedFileChanged in interface TableSelectionListener
Parameters:
source - the FileTable instance on which the file selection has changed

markedFilesChanged

public void markedFilesChanged(FileTable source)
Description copied from interface: TableSelectionListener
This method is invoked when the files marked have changed on the specified FileTable.

Specified by:
markedFilesChanged in interface TableSelectionListener
Parameters:
source - the FileTable instance on which the files marked have changed

locationChanged

public void locationChanged(LocationEvent e)
Description copied from interface: LocationListener
This method is invoked when the current folder has changed.

Specified by:
locationChanged in interface LocationListener
Parameters:
e - describes the location change event

locationChanging

public void locationChanging(LocationEvent e)
Description copied from interface: LocationListener
This method is invoked when the current folder is being changed.

A call to either LocationListener.locationChanged(LocationEvent), LocationListener.locationCancelled(LocationEvent) or LocationListener.locationFailed(LocationEvent) will always follow to indicate the outcome of the folder change.

Specified by:
locationChanging in interface LocationListener
Parameters:
e - describes the location change event

locationCancelled

public void locationCancelled(LocationEvent e)
Description copied from interface: LocationListener
This method is invoked when the current folder has been cancelled by the user.

Specified by:
locationCancelled in interface LocationListener
Parameters:
e - describes the location change event

locationFailed

public void locationFailed(LocationEvent e)
Description copied from interface: LocationListener
This method is invoked when the current folder could not be changed, as a result of the folder not existing or failing to list its contents.

Specified by:
locationFailed in interface LocationListener
Parameters:
e - describes the location change event

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Specified by:
componentShown in interface java.awt.event.ComponentListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Specified by:
componentResized in interface java.awt.event.ComponentListener

fontChanged

public void fontChanged(FontChangedEvent event)
Description copied from interface: ThemeListener
Notifies the listener that a font has been changed.

Specified by:
fontChanged in interface ThemeListener

colorChanged

public void colorChanged(ColorChangedEvent event)
Description copied from interface: ThemeListener
Notifies the listener that a color has been changed.

Specified by:
colorChanged in interface ThemeListener


This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard