APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javax.swing.plaf.basic

public Class BasicToolTipUI

extends ToolTipUI
Class Inheritance
Known Direct Subclasses
javax.swing.plaf.metal.MetalToolTipUI, javax.swing.plaf.synth.SynthToolTipUI
Imports
sun.swing.SwingUtilities2, java.awt.*, java.beans.PropertyChangeEvent, .PropertyChangeListener, javax.swing.*, .BorderFactory, javax.swing.border.Border, javax.swing.plaf.ToolTipUI, .ComponentUI, .UIResource, javax.swing.text.View

Standard tool tip L&F.
Author
Dave Moore

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private PropertyChangeListener
pack-priv static BasicToolTipUI
private static PropertyChangeListener
sharedPropertyChangedListener

Global PropertyChangeListener that createPropertyChangeListener returns.

Constructor Summary

AccessConstructor and Description
public
BasicToolTipUI()

Constructs a new instance of BasicToolTipUI.

Method Summary

Modifier and TypeMethod and Description
private void
componentChanged(JComponent
the JToolTip the JComponent has changed on.
c
)

Invoked when the JComponent associated with the JToolTip has changed, or at initialization time.

private PropertyChangeListener
public static ComponentUI

Returns:

the instance of BasicToolTipUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns the instance of BasicToolTipUI.

public Dimension
getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Returns the specified component's maximum size appropriate for the look and feel.

public Dimension
getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel.

public Dimension
getPreferredSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel.

private void
protected void
installDefaults(JComponent
a component
c
)

Installs default properties.

protected void
installListeners(JComponent
a component
c
)

Registers listeners.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

public void
paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.paint.

Paints the specified component appropriately for the look and feel.

private void
protected void
uninstallDefaults(JComponent
a component
c
)

Uninstalls default properties.

protected void
uninstallListeners(JComponent
a component
c
)

Unregisters listeners.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI.

Field Detail

propertyChangeListenerback to summary
private PropertyChangeListener propertyChangeListener
sharedInstanceback to summary
pack-priv static BasicToolTipUI sharedInstance
sharedPropertyChangedListenerback to summary
private static PropertyChangeListener sharedPropertyChangedListener

Global PropertyChangeListener that createPropertyChangeListener returns.

Constructor Detail

BasicToolTipUIback to summary
public BasicToolTipUI()

Constructs a new instance of BasicToolTipUI.

Method Detail

componentChangedback to summary
private void componentChanged(JComponent c)

Invoked when the JComponent associated with the JToolTip has changed, or at initialization time. This should update any state dependent upon the JComponent.

Parameters
c:JComponent

the JToolTip the JComponent has changed on.

createPropertyChangeListenerback to summary
private PropertyChangeListener createPropertyChangeListener(JComponent c)
createUIback to summary
public static ComponentUI createUI(JComponent c)

Hides javax.swing.plaf.ComponentUI.createUI.

Returns the instance of BasicToolTipUI.

Parameters
c:JComponent

a component

Returns:ComponentUI

the instance of BasicToolTipUI

getMaximumSizeback to summary
public Dimension getMaximumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMaximumSize.

Doc from javax.swing.plaf.ComponentUI.getMaximumSize.

Returns the specified component's maximum size appropriate for the look and feel. If null is returned, the maximum 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 invokes getPreferredSize and returns that value.

getMinimumSizeback to summary
public Dimension getMinimumSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getMinimumSize.

Doc from javax.swing.plaf.ComponentUI.getMinimumSize.

Returns the specified component's minimum size appropriate for the look and feel. If null is returned, the minimum 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 invokes getPreferredSize and returns that value.

getPreferredSizeback to summary
public Dimension getPreferredSize(JComponent c)

Overrides javax.swing.plaf.ComponentUI.getPreferredSize.

Doc from javax.swing.plaf.ComponentUI.getPreferredSize.

Returns the specified component's preferred size appropriate for the look and feel. If null is 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 returns null.

installComponentsback to summary
private void installComponents(JComponent c)
installDefaultsback to summary
protected void installDefaults(JComponent c)

Installs default properties.

Parameters
c:JComponent

a component

installListenersback to summary
protected void installListeners(JComponent c)

Registers listeners.

Parameters
c:JComponent

a component

installUIback to summary
public void installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Doc from javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel. This method is invoked when the ComponentUI instance 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:

  1. 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.
  2. Install a LayoutManager on the component if necessary.
  3. Create/add any required sub-components to the component.
  4. Create/install event listeners on the component.
  5. Create/install a PropertyChangeListener on the component in order to detect and respond to component property changes appropriately.
  6. Install keyboard UI (mnemonics, traversal, etc.) on the component.
  7. Initialize any appropriate instance data.
paintback to summary
public void paint(Graphics g, JComponent c)

Overrides javax.swing.plaf.ComponentUI.paint.

Doc from javax.swing.plaf.ComponentUI.paint.

Paints the specified component appropriately for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

uninstallComponentsback to summary
private void uninstallComponents(JComponent c)
uninstallDefaultsback to summary
protected void uninstallDefaults(JComponent c)

Uninstalls default properties.

Parameters
c:JComponent

a component

uninstallListenersback to summary
protected void uninstallListeners(JComponent c)

Unregisters listeners.

Parameters
c:JComponent

a component

uninstallUIback to summary
public void uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

Doc from javax.swing.plaf.ComponentUI.uninstallUI.

Reverses configuration which was done on the specified component during installUI. This method is invoked when this UIComponent instance is being removed as the UI delegate for the specified component. This method should undo the configuration performed in installUI, being careful to leave the JComponent instance in a clean state (no extraneous listeners, look-and-feel-specific property objects, etc.). This should include the following:

  1. Remove any UI-set borders from the component.
  2. Remove any UI-set layout managers on the component.
  3. Remove any UI-added sub-components from the component.
  4. Remove any UI-added event/property listeners from the component.
  5. Remove any UI-installed keyboard UI from the component.
  6. Nullify any allocated instance data objects to allow for GC.
javax.swing.plaf.basic back to summary

private Class BasicToolTipUI.PropertyChangeHandler

extends Object
implements PropertyChangeListener
Class Inheritance
All Implemented Interfaces
java.beans.PropertyChangeListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PropertyChangeHandlerback to summary
private PropertyChangeHandler()

Method Detail

propertyChangeback to summary
public void propertyChange(PropertyChangeEvent e)

Implements java.beans.PropertyChangeListener.propertyChange.

Doc from java.beans.PropertyChangeListener.propertyChange.

This method gets called when a bound property is changed.