JComponentPack 1.5.0

com.zfqjava.swing
Class JStatusBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.zfqjava.swing.JStatusBar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class JStatusBar
extends JComponent
implements Accessible

JStatusBar provides a component to attach a status bar.

Client Property:

NameValueDefault Value
JStatusBar.clientBorder
  • Flat
  • Lowered
Auto

See Also:
Serialized Form

Nested Class Summary
protected  class JStatusBar.AccessibleJStatusBar
          This class implements accessibility support for the JStatusBar class.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
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(Component comp, Object constraints, int index)
          If a JButton is being added, it is initially set to be disabled.
 AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JStatusBar.
 Component getComponentAt(int index)
          Returns the component at the specified index.
 Insets getMargin()
          Returns the margin between the status bar's border and its buttons.
 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.
 String getUIClassID()
          Returns the name of the L&F class that renders this component.
 double getWeight(Component comp)
          Returns the weight for the specified component.
 int indexOfComponent(Component c)
          Returns the index of the specified component.
 boolean isBorderPainted()
          Gets the borderPainted property.
protected  void paintBorder(Graphics g)
          Paints the status bar's border if the borderPainted property is true.
protected  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(Icon icon)
          Sets the icon for current status bar.
 void setLayout(LayoutManager mgr)
           
 void setMargin(Insets m)
          Sets the margin between the status bar's border and its buttons.
 void setText(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(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, 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, 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
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, 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

EXPLORER

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

See Also:
Constant Field Values

EDITOR

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

See Also:
Constant Field Values

VIEWER

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

See Also:
Constant Field Values
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 JComponent
See Also:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
Returns the name of the L&F class that renders this component.

Overrides:
getUIClassID in class 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(String text)
Sets the text for current status bar.

Parameters:
text - the text

setIcon

public void setIcon(Icon icon)
Sets the icon for current status bar.

Parameters:
icon - the icon

getProgressBar

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

Returns:
the progress bar

setMargin

public void setMargin(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 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(Graphics g)
Paints the status bar's border if the borderPainted property is true.

Overrides:
paintBorder in class 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(LayoutManager mgr)
Overrides:
setLayout in class Container

setWeight

public void setWeight(Component comp,
                      double weight)
Sets the weight for the specified component.

Parameters:
comp - the component
weight - the weight
See Also:
getWeight(java.awt.Component)

getWeight

public double getWeight(Component comp)
Returns the weight for the specified component.

Parameters:
comp - the component
See Also:
setWeight(java.awt.Component, double)

indexOfComponent

public int indexOfComponent(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 Component getComponentAt(int index)
Returns the component at the specified index.

Parameters:
index - the component's position, where 0 is first
Returns:
the Component at that position, or null for an invalid index

addImpl

protected void addImpl(Component comp,
                       Object constraints,
                       int index)
If a JButton is being added, it is initially set to be disabled.

Overrides:
addImpl in class 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 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 JComponent
Returns:
a string representation of this JStatusBar.

getAccessibleContext

public 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 Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
an AccessibleJStatusBar that serves as the AccessibleContext of this JStatusBar

JComponentPack 1.5.0

Send your Feedback
JComponentPack 1.5.0
Copyright © 2001-2007 Extreme Component, Inc. All rights reserved.