public class NewStatusBar extends JPanel
This class contains the status bar. It contains the graphical component, and the methods to manage it.
The status bar is divided in several areas. At the very left, there is an
icon and the main status text. There are three icons to show: Info, Warning
and Error icons. They can be set together with the main status text using the
methods setInfoText()
, setWarningText()
and
setErrorText()
(and also with setInfoTextTemporal()
, etc). Then, there is a right area which contains labels and other controls.
Labels are set in the config.xml files and are visible or not depending on
the currently selected Andami window. Controls are associated to extensions,
and are enabled/disabled and visible/hidden depending on the associated
extension.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
NewStatusBar()
This is the default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addControl(String id,
Component control)
Adds a control to the status bar
|
void |
ajustar()
Hides the empty labels and adjust the space in the bar.
|
void |
clearMessage() |
Component |
getControl(String id)
Gets a control from the status bar
|
String |
getStatusText()
Gets the status bar main text.
|
void |
message(String msg,
int messageTyoe) |
Component |
removeControl(String id)
Remove a control from the status bar
|
void |
restaurarTexto()
Restores the previous contents in the status bar main text,
after the
setInfoTextTemporal(String) ,
setWarningTextTemporal(String) or
setErrorTextTemporal(String) have been called. |
void |
setControlValue(String id,
String value)
Sets the control identified by 'id' with the provided value.
|
void |
setErrorText(String texto)
Sets a permanent error message in the status bar, and changes the
permanent icon to an Error icon.
|
void |
setErrorTextTemporal(String texto)
Sets a temporary error message in the status bar, and changes the
icon to an Error icon.
|
void |
setFixedLabelWidth(double d)
Deprecated.
|
void |
setInfoText(String texto)
Sets a permanent info message in the status bar, and changes the
permanent icon to an Info icon.
|
void |
setInfoTextTemporal(String texto)
Sets a temporary information message in the status bar, and changes the
icon to an Info icon.
|
void |
setLabelSet(Label[] labels)
Sets a label-set to be shown in the status bar.
|
void |
setMessage(String id,
String msg)
Sets the text of the provided label.
|
void |
setProgress(int p)
Deprecated.
use instead TaskStatus and TaskStatusManager
|
void |
setWarningText(String texto)
Sets a permanent warning message in the status bar, and changes the
permanent icon to a Warning icon.
|
void |
setWarningTextTemporal(String texto)
Sets a temporary warning message in the status bar, and changes the
icon to a Warning icon.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, setVisible, unregisterKeyboardAction, update
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, transferFocusDownCycle, validate, validateTree
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, 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, transferFocusBackward, transferFocusUpCycle
public void clearMessage()
public void message(String msg, int messageTyoe)
public String getStatusText()
setInfoText(String)
,
setWarningText(String)
,
setErrorText(String)
,
setInfoTextTemporal(String)
,
setWarningTextTemporal(String)
,
setErrorTextTemporal(String)
public void restaurarTexto()
setInfoTextTemporal(String)
,
setWarningTextTemporal(String)
or
setErrorTextTemporal(String)
have been called.public void setInfoTextTemporal(String texto)
restaurarTexto()
method.texto
- The text to setrestaurarTexto()
public void setWarningTextTemporal(String texto)
restaurarTexto()
method.texto
- The text to setrestaurarTexto()
public void setErrorTextTemporal(String texto)
restaurarTexto()
method.texto
- The text to setrestaurarTexto()
public void setInfoText(String texto)
restaurarTexto()
method is called.texto
- The permanent info message to setrestaurarTexto()
public void setWarningText(String texto)
restaurarTexto()
method is called.texto
- The permanent warning message to setrestaurarTexto()
public void setErrorText(String texto)
restaurarTexto()
method is called.texto
- The permanent info message to setrestaurarTexto()
public void setProgress(int p)
p
is a value between 0 and 99, it shows a progress bar
in the left area of the status bar, and sets the specified progress.
If p
is bigger than 99, it hides the progress bar.p
- The progress to set in the progress bar. If it is bigger
than 99, the task will be considered to be finished, and the
progress bar will be hidden.public void setLabelSet(Label[] labels)
MainFrame.setStatusBarLabels(Class, Label[])
to permanently associate a label set with a window.labels
- The labels to set.MainFrame.setStatusBarLabels(Class, Label[])
public void ajustar()
public void setMessage(String id, String msg)
id
- The ID of the label to modify. It is defined in the
config.xml filemsg
- The message to show in the labelpublic void setControlValue(String id, String value)
id
- The ID of the control to modifyvalue
- The value to set in the controlpublic void setFixedLabelWidth(double d)
d
- The width ob the main labelpublic void addControl(String id, Component control)
id
- The ID of the control, useful to later retrive it or set its
valuecontrol
- The control to addpublic Component removeControl(String id)
id
- The ID of the control to get