com.zfqjava.swing
Class JStatusBar

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.zfqjava.swing.JStatusBar
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JStatusBar
extends javax.swing.JComponent
implements javax.accessibility.Accessible

JStatusBar provides a component to attach a status bar.

Client Property:
NameValueDefault Value
JStatusBar.clientBorder
  • Flat
  • Lowered
Auto

See Also:
Serialized Form

Inner Class Summary
protected  class JStatusBar.AccessibleJStatusBar
          This class implements accessibility support for the JStatusBar class.
 
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
static int EDITOR
          Identifies the editor status bar type.
static int EXPLORER
          Identifies the explorer status bar type.
static int VIEWER
          Identifies the viewer status bar type.
 
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
JStatusBar()
          Creates a status bar instance.
JStatusBar(int type)
          Constructs a status bar for the specified type.
 
Method Summary
protected  void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
          If a JButton is being added, it is initially set to be disabled.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JStatusBar.
 java.awt.Component getComponentAt(int index)
          Returns the component at the specified index.
 java.awt.Insets getMargin()
          Returns the margin between the status bar's border and its buttons.
 javax.swing.JProgressBar getProgressBar()
          Returns the progress bar in this status bar.
 int getType()
          Returns the status bar type.
 StatusBarUI getUI()
          Returns the status bar's current UI.
 java.lang.String getUIClassID()
          Returns the name of the L&F class that renders this component.
 double getWeight(java.awt.Component comp)
          Returns the weight for the specified component.
 int indexOfComponent(java.awt.Component c)
          Returns the index of the specified component.
 boolean isBorderPainted()
          Gets the borderPainted property.
protected  void paintBorder(java.awt.Graphics g)
          Paints the status bar's border if the borderPainted property is true.
protected  java.lang.String paramString()
          Returns a string representation of this JStatusBar.
 void setBorderPainted(boolean b)
          Sets the borderPainted property, which is true if the border should be painted.
 void setIcon(javax.swing.Icon icon)
          Sets the icon for current status bar.
 void setLayout(java.awt.LayoutManager mgr)
           
 void setMargin(java.awt.Insets m)
          Sets the margin between the status bar's border and its buttons.
 void setText(java.lang.String text)
          Sets the text for current status bar.
 void setType(int type)
          Sets the status bar type.
 void setUI(StatusBarUI ui)
          Sets the L&F object that renders this component.
 void setWeight(java.awt.Component comp, double weight)
          Sets the weight for the specified component.
 void updateUI()
          Notification from the UIFactory that the L&F has changed.
 
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, 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, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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

EXPLORER

public static final int EXPLORER
Identifies the explorer status bar type.

EDITOR

public static final int EDITOR
Identifies the editor status bar type.

VIEWER

public static final int VIEWER
Identifies the viewer status bar type.
Constructor Detail

JStatusBar

public JStatusBar()
Creates a status bar instance.

JStatusBar

public JStatusBar(int type)
Constructs a status bar for the specified type.
Parameters:
type - the status bar type
Method Detail

getUI

public StatusBarUI getUI()
Returns the status bar's current UI.
See Also:
setUI(com.zfqjava.swing.plaf.StatusBarUI)

setUI

public void setUI(StatusBarUI ui)
Sets the L&F object that renders this component.
Parameters:
ui - the StatusBarUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

updateUI

public void updateUI()
Notification from the UIFactory that the L&F has changed. Called to replace the UI with the latest version from the UIFactory.
Overrides:
updateUI in class javax.swing.JComponent
See Also:
JComponent.updateUI()

getUIClassID

public java.lang.String getUIClassID()
Returns the name of the L&F class that renders this component.
Overrides:
getUIClassID in class javax.swing.JComponent
Returns:
the string "StatusBarUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

setType

public void setType(int type)
Sets the status bar type.

One of 3 legal values:

Parameters:
type - the status bar type
See Also:
getType()

getType

public int getType()
Returns the status bar type.
Returns:
the status bar type
See Also:
setType(int)

setText

public void setText(java.lang.String text)
Sets the text for current status bar.
Parameters:
text - the text

setIcon

public void setIcon(javax.swing.Icon icon)
Sets the icon for current status bar.
Parameters:
icon - the icon

getProgressBar

public javax.swing.JProgressBar getProgressBar()
Returns the progress bar in this status bar.
Returns:
the progress bar

setMargin

public void setMargin(java.awt.Insets m)
Sets the margin between the status bar's border and its buttons. Setting to null causes the status bar to use the default margins. The status bar's default Border object uses this value to create the proper margin. However, if a non-default border is set on the status bar, it is that Border object's responsibility to create the appropriate margin space (otherwise this property will effectively be ignored).
Parameters:
m - an Insets object that defines the space between the border and the buttons
See Also:
Insets

getMargin

public java.awt.Insets getMargin()
Returns the margin between the status bar's border and its buttons.
Returns:
an Insets object containing the margin values
See Also:
Insets

isBorderPainted

public boolean isBorderPainted()
Gets the borderPainted property.
Returns:
the value of the borderPainted property
See Also:
setBorderPainted(boolean)

setBorderPainted

public void setBorderPainted(boolean b)
Sets the borderPainted property, which is true if the border should be painted. The default value for this property is true. Some look and feels might not implement painted borders; they will ignore this property.
Parameters:
b - if true, the border is painted
See Also:
isBorderPainted()

paintBorder

protected void paintBorder(java.awt.Graphics g)
Paints the status bar's border if the borderPainted property is true.
Overrides:
paintBorder in class javax.swing.JComponent
Parameters:
g - the Graphics context in which the painting is done
See Also:
JComponent.paint(java.awt.Graphics), JComponent.setBorder(javax.swing.border.Border)

setLayout

public final void setLayout(java.awt.LayoutManager mgr)
Overrides:
setLayout in class java.awt.Container

setWeight

public void setWeight(java.awt.Component comp,
                      double weight)
Sets the weight for the specified component.
Parameters:
component - the component
weight - the weight
See Also:
getWeight(java.awt.Component)

getWeight

public double getWeight(java.awt.Component comp)
Returns the weight for the specified component.
Parameters:
comp - the component
See Also:
setWeight(java.awt.Component, double)

indexOfComponent

public int indexOfComponent(java.awt.Component c)
Returns the index of the specified component. (Note: Separators occupy index positions.)
Parameters:
c - the Component to find
Returns:
an integer indicating the component's position, where 0 is first

getComponentAt

public java.awt.Component getComponentAt(int index)
Returns the component at the specified index.
Parameters:
i - the component's position, where 0 is first
Returns:
the Component at that position, or null for an invalid index

addImpl

protected void addImpl(java.awt.Component comp,
                       java.lang.Object constraints,
                       int index)
If a JButton is being added, it is initially set to be disabled.
Overrides:
addImpl in class java.awt.Container
Parameters:
comp - the component to be enhanced
constraints - the constraints to be enforced on the component
index - the index of the component

paramString

protected java.lang.String paramString()
Returns a string representation of this JStatusBar. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Overrides:
paramString in class javax.swing.JComponent
Returns:
a string representation of this JStatusBar.

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JStatusBar. For JStatusBars, the AccessibleContext takes the form of an AccessibleJStatusBar. A new AccessibleJStatusBar instance is created if necessary.
Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class javax.swing.JComponent
Returns:
an AccessibleJStatusBar that serves as the AccessibleContext of this JStatusBar


Copyright © 2001-2003 Extreme Component, Inc. All rights reserved.