java.lang.Object
javax.swing.plaf.ComponentUI
javax.swing.plaf.ToolTipUI
javax.swing.plaf.basic.BasicToolTipUI
javax.swing.plaf.metal.MetalToolTipUI
A Metal L&F extension of BasicToolTipUI.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see XMLEncoder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe space between strings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentUIReturns an instance of theMetalToolTipUI.Returns the accelerator string.Returns the specified component's preferred size appropriate for the look and feel.voidConfigures the specified component appropriately for the look and feel.protected booleanIf the accelerator is hidden, the method returnstrue, otherwise, returnsfalse.voidpaint(Graphics g, JComponent c) Paints the specified component appropriately for the look and feel.voidReverses configuration which was done on the specified component duringinstallUI.Methods inherited from class javax.swing.plaf.basic.BasicToolTipUI
getMaximumSize, getMinimumSize, installDefaults, installListeners, uninstallDefaults, uninstallListenersMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, update
-
Field Details
-
padSpaceBetweenStrings
public static final int padSpaceBetweenStringsThe space between strings.- See Also:
-
-
Constructor Details
-
MetalToolTipUI
public MetalToolTipUI()Constructs an instance of theMetalToolTipUI.
-
-
Method Details
-
createUI
Returns an instance of theMetalToolTipUI.- Parameters:
c- a component- Returns:
- an instance of the
MetalToolTipUI.
-
installUI
Description copied from class:ComponentUIConfigures the specified component appropriately for the look and feel. This method is invoked when theComponentUIinstance is being installed as the UI delegate on the specified component. This method should completely configure the component for the look and feel, including the following:- Install default property values for color, fonts, borders, icons, opacity, etc. on the component. Whenever possible, property values initialized by the client program should not be overridden.
- Install a
LayoutManageron the component if necessary. - Create/add any required sub-components to the component.
- Create/install event listeners on the component.
- Create/install a
PropertyChangeListeneron the component in order to detect and respond to component property changes appropriately. - Install keyboard UI (mnemonics, traversal, etc.) on the component.
- Initialize any appropriate instance data.
- Overrides:
installUIin classBasicToolTipUI- Parameters:
c- the component where this UI delegate is being installed- See Also:
-
uninstallUI
Description copied from class:ComponentUIReverses configuration which was done on the specified component duringinstallUI. This method is invoked when thisUIComponentinstance is being removed as the UI delegate for the specified component. This method should undo the configuration performed ininstallUI, being careful to leave theJComponentinstance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:- Remove any UI-set borders from the component.
- Remove any UI-set layout managers on the component.
- Remove any UI-added sub-components from the component.
- Remove any UI-added event/property listeners from the component.
- Remove any UI-installed keyboard UI from the component.
- Nullify any allocated instance data objects to allow for GC.
- Overrides:
uninstallUIin classBasicToolTipUI- Parameters:
c- the component from which this UI delegate is being removed; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
-
paint
Description copied from class:ComponentUIPaints the specified component appropriately for the look and feel. This method is invoked from theComponentUI.updatemethod when the specified component is being painted. Subclasses should override this method and use the specifiedGraphicsobject to render the content of the component.- Overrides:
paintin classBasicToolTipUI- Parameters:
g- theGraphicscontext in which to paintc- the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- See Also:
-
getPreferredSize
Description copied from class:ComponentUIReturns the specified component's preferred size appropriate for the look and feel. Ifnullis returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returnsnull.- Overrides:
getPreferredSizein classBasicToolTipUI- Parameters:
c- the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components- Returns:
- a
Dimensionobject containing given component's preferred size appropriate for the look and feel - See Also:
-
isAcceleratorHidden
protected boolean isAcceleratorHidden()If the accelerator is hidden, the method returnstrue, otherwise, returnsfalse.- Returns:
trueif the accelerator is hidden.
-
getAcceleratorString
Returns the accelerator string.- Returns:
- the accelerator string.
-