public class NewStatusBar
extends javax.swing.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.
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
NewStatusBar()
This is the default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addControl(java.lang.String id,
java.awt.Component control)
Adds a control to the status bar
|
void |
ajustar()
Hides the empty labels and adjust the space in the bar.
|
void |
clearMessage() |
java.awt.Component |
getControl(java.lang.String id)
Gets a control from the status bar
|
java.lang.String |
getStatusText()
Gets the status bar main text.
|
void |
message(java.lang.String msg,
int messageType) |
java.awt.Component |
removeControl(java.lang.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(java.lang.String id,
java.lang.String value)
Sets the control identified by 'id' with the provided value.
|
void |
setErrorText(java.lang.String texto)
Sets a permanent error message in the status bar, and changes the
permanent icon to an Error icon.
|
void |
setErrorTextTemporal(java.lang.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(java.lang.String texto)
Sets a permanent info message in the status bar, and changes the
permanent icon to an Info icon.
|
void |
setInfoTextTemporal(java.lang.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(java.lang.String id,
java.lang.String msg)
Sets the text of the provided label.
|
void |
setProgress(int p)
Deprecated.
use instead TaskStatus and TaskStatusManager
|
void |
setWarningText(java.lang.String texto)
Sets a permanent warning message in the status bar, and changes the
permanent icon to a Warning icon.
|
void |
setWarningTextTemporal(java.lang.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(java.lang.String msg, int messageType)
public java.lang.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(java.lang.String texto)
restaurarTexto()
method.texto
- The text to setrestaurarTexto()
public void setWarningTextTemporal(java.lang.String texto)
restaurarTexto()
method.texto
- The text to setrestaurarTexto()
public void setErrorTextTemporal(java.lang.String texto)
restaurarTexto()
method.texto
- The text to setrestaurarTexto()
public void setInfoText(java.lang.String texto)
restaurarTexto()
method is called.texto
- The permanent info message to setrestaurarTexto()
public void setWarningText(java.lang.String texto)
restaurarTexto()
method is called.texto
- The permanent warning message to setrestaurarTexto()
public void setErrorText(java.lang.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(java.lang.String id, java.lang.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(java.lang.String id, java.lang.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(java.lang.String id, java.awt.Component control)
id
- The ID of the control, useful to later retrive it or set its
valuecontrol
- The control to addpublic java.awt.Component removeControl(java.lang.String id)
id
- The ID of the control to getpublic java.awt.Component getControl(java.lang.String id)
id
- The ID of the control to get