HOME

com.ultraswing
Class StatusBar

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ultraswing.StatusBar
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class StatusBar
extends JPanel

Frame's status bar.



Usage exampe:

      CFrame frame = ...;

      StatusBar status = new StatusBar( new JComponent[]
                {StatusBar.INDICATOR_STATUS,
                 StatusBar.SEPARATOR,
                 StatusBar.INDICATOR_DATE,
                 StatusBar.SEPARATOR,
                 StatusBar.INDICATOR_TIME,
                 StatusBar.SEPARATOR,
                 StatusBar.INDICATOR_JVM
                 }, true);
      frame.addStatusBar(status);
 

See Also:
Serialized Form

Nested Class Summary
protected static class StatusBar.Separator
           
 
Field Summary
static JLabel INDICATOR_DATE
          Date pane
static JLabel INDICATOR_JVM
          JVM pane which shows JVM memory usage and a garbage collector icon
static JProgressBar INDICATOR_PROGRESS_BAR
          Progress bar pane
static JLabel INDICATOR_STATUS
          Status pane
static JLabel INDICATOR_TIME
          Time pane
static StatusBar.Separator SEPARATOR
          Separator object
 
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()
          Creates a status bar object
StatusBar(JComponent[] indicators)
          Creates a non-flat status bar with passed components
StatusBar(JComponent[] indicators, boolean isFlat)
          Creates a status bar with passed components
StatusBar(JComponent[] indicators, boolean isFlat, Color borderColor)
          Creates a status bar with passed components
 
Method Summary
 void addSeparator()
          Adds a separator
 int getHeight()
          Returns the status bar's height
 Dimension getPreferredSize()
           
 JProgressBar getProgressBar()
          Returns the progress bar
 void setDateFormat(String format)
          Sets date format
 void setHeight(int height)
          Sets status bar's height
 void setPane(int index, JComponent comp)
          Applys passed comp at specified index
 void setPanes(JComponent[] indicators)
          Sets each pane's component
 void setStatusMessage(String str)
          Sets the text of status pane
 void setTimeFormat(String format)
          Sets time format
 void setToolTipText(JComponent comp, String tooltip)
          Sets tooltip text for the passed comp
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
 
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

SEPARATOR

public static final StatusBar.Separator SEPARATOR
Separator object


INDICATOR_STATUS

public static final JLabel INDICATOR_STATUS
Status pane


INDICATOR_DATE

public static final JLabel INDICATOR_DATE
Date pane


INDICATOR_TIME

public static final JLabel INDICATOR_TIME
Time pane


INDICATOR_JVM

public static final JLabel INDICATOR_JVM
JVM pane which shows JVM memory usage and a garbage collector icon


INDICATOR_PROGRESS_BAR

public static final JProgressBar INDICATOR_PROGRESS_BAR
Progress bar pane

Constructor Detail

StatusBar

public StatusBar()
Creates a status bar object


StatusBar

public StatusBar(JComponent[] indicators)
Creates a non-flat status bar with passed components

Parameters:
indicators - components on status bar, one of them must be StatusBar.INDICATOR_STATUS. Separators are not added automatically. You can use StatusBar.SEPARATOR to add separators.

Example:

StatusBar bar = new StatusBar(new JComponent[]{StatusBar.INDICATOR_STATUS, StatusBar.SEPARATOR, StatusBar.INDICATOR_TIME});
It creates a statusbar with two panes, status and time panes, and one separator between them.


StatusBar

public StatusBar(JComponent[] indicators,
                 boolean isFlat)
Creates a status bar with passed components

Parameters:
indicators - components on status bar, one of them must be StatusBar.INDICATOR_STATUS. Separators are not added automatically. You can use StatusBar.SEPARATOR to add separators.

Example:

StatusBar bar = new StatusBar(new JComponent[]{StatusBar.INDICATOR_STATUS, StatusBar.SEPARATOR, StatusBar.INDICATOR_TIME});
It creates a statusbar with two panes, status and time panes, and one separator between them.

isFlat - if true, creates a flat status bar

StatusBar

public StatusBar(JComponent[] indicators,
                 boolean isFlat,
                 Color borderColor)
Creates a status bar with passed components

Parameters:
isFlat - if true, creates a flat status bar
borderColor - the border color of each pane
indicators - components on status bar, one of them must be StatusBar.INDICATOR_STATUS. Separators are not added automatically. You can use StatusBar.SEPARATOR to add separators.

Example:

StatusBar bar = new StatusBar(new JComponent[]{StatusBar.INDICATOR_STATUS, StatusBar.SEPARATOR, StatusBar.INDICATOR_TIME});
It creates a statusbar with two panes, status and time panes, and one separator between them.

Method Detail

setPanes

public void setPanes(JComponent[] indicators)
Sets each pane's component


setToolTipText

public void setToolTipText(JComponent comp,
                           String tooltip)
Sets tooltip text for the passed comp


setHeight

public void setHeight(int height)
Sets status bar's height


getHeight

public int getHeight()
Returns the status bar's height

Overrides:
getHeight in class JComponent

addSeparator

public void addSeparator()
Adds a separator


setStatusMessage

public void setStatusMessage(String str)
Sets the text of status pane


getProgressBar

public JProgressBar getProgressBar()
Returns the progress bar


setPane

public void setPane(int index,
                    JComponent comp)
Applys passed comp at specified index

Parameters:
index - component index, separator also counts

setDateFormat

public void setDateFormat(String format)
Sets date format

Parameters:
format - refer to the format in java.text.SimpleDateFormat

setTimeFormat

public void setTimeFormat(String format)
Sets time format

Parameters:
format - refer to the format in java.text.SimpleDateFormat

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

HOME

Copyright © 2002 iReasoning Networks. All Rights Reserved.