Package org.jjazz.uiutilities.api
Class TextOverlayLayerUI
- All Implemented Interfaces:
Serializable
A LayerUI that display a centered text over the view component using a semi-transparent background.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate the overlay in invisible state (text is null).TextOverlayLayerUI
(String text) Create the overlay with the specified text. -
Method Summary
Methods inherited from class javax.swing.plaf.LayerUI
addPropertyChangeListener, addPropertyChangeListener, applyPropertyChange, doLayout, eventDispatched, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, imageUpdate, installUI, paintImmediately, removePropertyChangeListener, removePropertyChangeListener, uninstallUI, updateUI
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, update
-
Constructor Details
-
TextOverlayLayerUI
public TextOverlayLayerUI()Create the overlay in invisible state (text is null). -
TextOverlayLayerUI
Create the overlay with the specified text.
-
-
Method Details
-
setText
The text to be displayed on a semi-transparent background over the view component.NOTE: caller should call repaint() after having called setText().
- Parameters:
text
- If null nothing is shown (overlay is invisible). If text contains '\n', text is shown a multiple lines.
-
getText
The displayed text.- Returns:
- If null it means the overlay is invisible.
-
paint
- Overrides:
paint
in classLayerUI<JComponent>
-