javax.swing.plaf.metal
public class MetalToolTipUI extends BasicToolTipUI
JToolTip
component.Modifier and Type | Field and Description |
---|---|
static int |
padSpaceBetweenStrings
The amount of space between the tool tip text and the accelerator
description (if visible).
|
Constructor and Description |
---|
MetalToolTipUI()
Constructs a new instance of
MetalToolTipUI . |
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent component)
Returns a shared instance of the
MetalToolTipUI class. |
String |
getAcceleratorString()
Returns a string representing the accelerator key (if there is one) for
the component that the tool tip belongs to.
|
Dimension |
getPreferredSize(JComponent c)
Returns the preferred size for the
JToolTip component. |
void |
installUI(JComponent c)
Installs the UI for the specified component (a
JToolTip ). |
protected boolean |
isAcceleratorHidden()
Returns
true if the accelerator string is hidden, and
false otherwise. |
void |
paint(Graphics g,
JComponent c)
Paints the tool tip.
|
void |
uninstallUI(JComponent c)
Clears the defaults set in
installUI(JComponent) . |
getMaximumSize, getMinimumSize, installDefaults, installListeners, uninstallDefaults, uninstallListeners
contains, getAccessibleChild, getAccessibleChildrenCount, update
public static final int padSpaceBetweenStrings
public MetalToolTipUI()
MetalToolTipUI
.public static ComponentUI createUI(JComponent component)
MetalToolTipUI
class.
Although this UI delegate does maintain state information, there is never
more than one tool tip visible, so it is OK to use a shared instance.component
- the component (a JToolTip
).MetalToolTipUI
class.public String getAcceleratorString()
public void installUI(JComponent c)
JToolTip
).installUI
in class BasicToolTipUI
c
- the JToolTip
component.ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
installUI(JComponent)
.uninstallUI
in class BasicToolTipUI
c
- the component.ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected boolean isAcceleratorHidden()
true
if the accelerator string is hidden, and
false
otherwise. This setting is controlled by the
ToolTip.hideAccelerator
entry in the UI defaults table.public Dimension getPreferredSize(JComponent c)
JToolTip
component.getPreferredSize
in class BasicToolTipUI
c
- the component (a JToolTip
).public void paint(Graphics g, JComponent c)
paint
in class BasicToolTipUI
g
- the graphics context.c
- the JToolTip
component.