javax.swing.plaf.metal

Class MetalToolBarUI

public class MetalToolBarUI extends BasicToolBarUI

A UI delegate for the {@link JToolBar} component.
Nested Class Summary
protected classMetalToolBarUI.MetalContainerListener
A listener (no longer used) that responds when components are added to or removed from the {@link JToolBar}.
protected classMetalToolBarUI.MetalDockingListener
This is the MouseHandler class that allows the user to drag the JToolBar in and out of the parent and dock it if it can.
protected classMetalToolBarUI.MetalRolloverListener
A listener (no longer used) that responds to property change events in a {@link JToolBar} component.
Field Summary
protected ContainerListenercontListener
The container listener (an implementation specific field, according to the spec, and not used in GNU Classpath).
protected PropertyChangeListenerrolloverListener
The rollover listener (an implementation specific field, according to the spec, and not used in GNU Classpath).
Constructor Summary
MetalToolBarUI()
Creates a new instance of this UI delegate.
Method Summary
protected ContainerListenercreateContainerListener()
Returns null as permitted by recent versions of the API specification.
protected MouseInputListenercreateDockingListener()
Creates and returns an instance of MetalDockingListener.
protected BordercreateNonRolloverBorder()
Returns a border with no rollover effect for buttons in the tool bar.
protected PropertyChangeListenercreateRolloverListener()
Returns null as permitted by recent versions of the API specification.
static ComponentUIcreateUI(JComponent component)
Returns a new instance of MetalToolBarUI.
voidinstallUI(JComponent c)
Installs the UI on the toolbar.
protected voidsetDragOffset(Point p)
Sets the offset for the window used for dragging the toolbar.
voiduninstallUI(JComponent c)
Uninstalls the UI from the toolbar.
voidupdate(Graphics g, JComponent c)
Paints the background of the component if necessary and then calls paint(g, c).

Field Detail

contListener

protected ContainerListener contListener
The container listener (an implementation specific field, according to the spec, and not used in GNU Classpath).

rolloverListener

protected PropertyChangeListener rolloverListener
The rollover listener (an implementation specific field, according to the spec, and not used in GNU Classpath).

Constructor Detail

MetalToolBarUI

public MetalToolBarUI()
Creates a new instance of this UI delegate.

Method Detail

createContainerListener

protected ContainerListener createContainerListener()
Returns null as permitted by recent versions of the API specification. Originally it seems this method returned a new instance of {@link MetalContainerListener}, but this is now redundant.

Returns: null.

createDockingListener

protected MouseInputListener createDockingListener()
Creates and returns an instance of MetalDockingListener.

Returns: an instance of MetalDockingListener.

createNonRolloverBorder

protected Border createNonRolloverBorder()
Returns a border with no rollover effect for buttons in the tool bar.

Returns: A border.

See Also: getToolbarButtonBorder

createRolloverListener

protected PropertyChangeListener createRolloverListener()
Returns null as permitted by recent versions of the API specification. Originally it seems this method returned a new instance of {@link MetalRolloverListener}, but this is now redundant.

Returns: null.

createUI

public static ComponentUI createUI(JComponent component)
Returns a new instance of MetalToolBarUI.

Parameters: component the component for which we return an UI instance

Returns: A new instance of MetalToolBarUI.

installUI

public void installUI(JComponent c)
Installs the UI on the toolbar. This calls super and sets the rollover property according to the UIManager property "ToolBar.isRollover".

Parameters: c the component to install the UI on

setDragOffset

protected void setDragOffset(Point p)
Sets the offset for the window used for dragging the toolbar. It is set as long as the window is not null (it has been installed).

uninstallUI

public void uninstallUI(JComponent c)
Uninstalls the UI from the toolbar. This calls super and resets the rollover property.

Parameters: c the component to uninstall the UI from

update

public void update(Graphics g, JComponent c)
Paints the background of the component if necessary and then calls paint(g, c). This is overridden to implement the OceanTheme gradient when an OceanTheme is installed.

Parameters: g the graphics to use c the component to paint.

Since: 1.5