Class NewStatusBar
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,Accessible
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddControl(String id, Component control) Adds a control to the status barvoidajustar()Hides the empty labels and adjust the space in the bar.voidgetControl(String id) Gets a control from the status barGets the status bar main text.voidremoveControl(String id) Remove a control from the status barvoidRestores the previous contents in the status bar main text, after thesetInfoTextTemporal(String),setWarningTextTemporal(String)orsetErrorTextTemporal(String)have been called.voidsetControlValue(String id, String value) Sets the control identified by 'id' with the provided value.voidsetErrorText(String texto) Sets a permanent error message in the status bar, and changes the permanent icon to an Error icon.voidsetErrorTextTemporal(String texto) Sets a temporary error message in the status bar, and changes the icon to an Error icon.voidsetFixedLabelWidth(double d) Sets the width of the main message label.voidsetInfoText(String texto) Sets a permanent info message in the status bar, and changes the permanent icon to an Info icon.voidsetInfoTextTemporal(String texto) Sets a temporary information message in the status bar, and changes the icon to an Info icon.voidsetLabelSet(Label[] labels) Sets a label-set to be shown in the status bar.voidsetMessage(String id, String msg) Sets the text of the provided label.voidsetProgress(int p) Ifpis a value between 0 and 99, it shows a progress bar in the left area of the status bar, and sets the specified progress.voidsetWarningText(String texto) Sets a permanent warning message in the status bar, and changes the permanent icon to a Warning icon.voidsetWarningTextTemporal(String texto) Sets a temporary warning message in the status bar, and changes the icon to a Warning icon.Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, 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, updateMethods inherited from class java.awt.Container
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, validateTreeMethods 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
NewStatusBar
public NewStatusBar()This is the default constructor
-
-
Method Details
-
clearMessage
public void clearMessage() -
message
-
getStatusText
Gets the status bar main text.- Returns:
- The status bar main text.
- See Also:
-
restaurarTexto
public void restaurarTexto()Restores the previous contents in the status bar main text, after thesetInfoTextTemporal(String),setWarningTextTemporal(String)orsetErrorTextTemporal(String)have been called.- See Also:
-
setInfoTextTemporal
Sets a temporary information message in the status bar, and changes the icon to an Info icon. The previous text and icon can be restored using therestaurarTexto()method.- Parameters:
texto- The text to set- See Also:
-
setWarningTextTemporal
Sets a temporary warning message in the status bar, and changes the icon to a Warning icon. The previous text and icon can be restored using therestaurarTexto()method.- Parameters:
texto- The text to set- See Also:
-
setErrorTextTemporal
Sets a temporary error message in the status bar, and changes the icon to an Error icon. The previous text and icon can be restored using therestaurarTexto()method.- Parameters:
texto- The text to set- See Also:
-
setInfoText
Sets a permanent info message in the status bar, and changes the permanent icon to an Info icon. If there is a temporary message showing at the moment, the message set now is not shown until therestaurarTexto()method is called.- Parameters:
texto- The permanent info message to set- See Also:
-
setWarningText
Sets a permanent warning message in the status bar, and changes the permanent icon to a Warning icon. If there is a temporary message showing at the moment, the message set now is not shown until therestaurarTexto()method is called.- Parameters:
texto- The permanent warning message to set- See Also:
-
setErrorText
Sets a permanent error message in the status bar, and changes the permanent icon to an Error icon. If there is a temporary message showing at the moment, the message set now is not shown until therestaurarTexto()method is called.- Parameters:
texto- The permanent info message to set- See Also:
-
setProgress
public void setProgress(int p) Ifpis a value between 0 and 99, it shows a progress bar in the left area of the status bar, and sets the specified progress. Ifpis bigger than 99, it hides the progress bar.- Parameters:
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.
-
setLabelSet
Sets a label-set to be shown in the status bar. This method it is not intended to be used directly, because the set will be overwritten when the selected window changes. UseMainFrame.setStatusBarLabels(Class, Label[])to permanently associate a label set with a window.- Parameters:
labels- The labels to set.- See Also:
-
ajustar
public void ajustar()Hides the empty labels and adjust the space in the bar. -
setMessage
Sets the text of the provided label.- Parameters:
id- The ID of the label to modify. It is defined in the config.xml filemsg- The message to show in the label
-
setControlValue
Sets the control identified by 'id' with the provided value.- Parameters:
id- The ID of the control to modifyvalue- The value to set in the control
-
setFixedLabelWidth
public void setFixedLabelWidth(double d) Sets the width of the main message label.- Parameters:
d- The width ob the main label
-
addControl
Adds a control to the status bar- Parameters:
id- The ID of the control, useful to later retrive it or set its valuecontrol- The control to add
-
removeControl
Remove a control from the status bar- Parameters:
id- The ID of the control to get
-
getControl
Gets a control from the status bar- Parameters:
id- The ID of the control to get
-