|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--org.moyoman.client.reference.util.StatusBar
Provides a UI for a status message area. The status bar may contain one to many separate message areas.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
private JLabel[] |
_labelsUI
Collection of message labels. |
private int[] |
_relativeSizes
Array of the relative sizes of the message labels. |
private Timer[] |
_timers
Collection of timers, one for each label. |
static int |
DEFAULT_DISPLAY_TIME
The time text is displayed by default in milliseconds. |
static int |
FOREVER_DISPLAY_TIME
The time text is displayed forever. |
Fields inherited from class javax.swing.JPanel |
|
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.Container |
|
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(int[] relativeSizes)
Construct a message area which contains the same number of message labels as the size of the input array of their relative sizes. |
|
StatusBar(int[] relativeSizes,
Color fontColor,
Font font)
Construct a message area which contains the same number of message labels as the size of the input array of their relative sizes. |
Method Summary | |
void |
clear(int position)
Clear the specified message label. |
void |
clearAll()
Clear all the message labels. |
private void |
constructLabels(int[] relativeSizes,
Color color,
Font font)
Construct the message labels. |
String |
getText(int position)
Return the display string on the specified message label. |
void |
setEnabled(int position,
boolean enabled)
Set the enabled state of the specified message label. |
void |
setHorizontalAlignment(int position,
int alignment)
Sets the alignment of the label's contents along the X axis. |
void |
setIcon(int position,
Icon icon)
Set the icon on the specified message label. |
void |
setText(int position,
String message)
Set the display string on the specified message label. |
void |
setText(int position,
String message,
int displayTime)
Set the display string on the specified message label. |
void |
setToolTipText(int position,
String toolTip)
Set the tool tip on the specified message label. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int DEFAULT_DISPLAY_TIME
public static final int FOREVER_DISPLAY_TIME
private JLabel[] _labelsUI
private int[] _relativeSizes
private Timer[] _timers
Constructor Detail |
public StatusBar(int[] relativeSizes)
relativeSizes
- Supplies the number and relative sizes of the
message areas.public StatusBar(int[] relativeSizes, Color fontColor, Font font)
relativeSizes
- Supplies the number and relative sizes of the
message areas.fontColor
- Font color used for all message areas.font
- Font used for all message areas.Method Detail |
public void setEnabled(int position, boolean enabled)
position
- The position of the label in the status bar. 0==far
left.enabled
- New enable state.public void setHorizontalAlignment(int position, int alignment)
position
- The position of the label in the status bar. 0==far
left.alignment
- Alignment.JLabel
public void setIcon(int position, Icon icon)
position
- The position of the label in the status bar. 0==far
left.icon
- Icon.public void setText(int position, String message)
position
- The position of the label in the status bar. 0==far
left.message
- Message.public void setText(int position, String message, int displayTime)
position
- The position of the label in the status bar. 0==far
left.message
- The message to display.displayTime
- The time to display the message. If <= 0, the
message remains until replaced.public String getText(int position)
position
- The position of the label in the status bar. 0==far
left.public void setToolTipText(int position, String toolTip)
position
- The position of the label in the status bar. 0==far
left.toolTip
- Tool tip text.public void clear(int position)
position
- The position of the label in the status bar. 0==far
left.public void clearAll()
private void constructLabels(int[] relativeSizes, Color color, Font font)
relativeSizes
- Supplies the number and relative sizes of the
message areas.color
- Foreground color.font
- Font.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |