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

public Class BasicToolBarUI

extends ToolBarUI
implements SwingConstants
Class Inheritance
All Implemented Interfaces
javax.swing.SwingConstants
Known Direct Subclasses
javax.swing.plaf.metal.MetalToolBarUI, javax.swing.plaf.synth.SynthToolBarUI
Imports
javax.swing.*, javax.swing.event.*, java.awt.*, java.awt.event.*, java.beans.*, java.util.Hashtable, .HashMap, javax.swing.border.*, javax.swing.plaf.*, sun.swing.DefaultLookup, .UIAction

A Basic L&F implementation of ToolBarUI. This implementation is a "combined" view/controller.
Authors
Georges Saab, Jeff Shapiro

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public class
BasicToolBarUI.DockingListener

This class should be treated as a "protected" inner class.

protected class
BasicToolBarUI.DragWindow

The window which appears during dragging the JToolBar.

protected class
BasicToolBarUI.FrameListener

The class listens for window events.

private class
protected class
BasicToolBarUI.PropertyListener

The class listens for property changed events.

protected class
BasicToolBarUI.ToolBarContListener

The class listens for component events.

protected class
BasicToolBarUI.ToolBarFocusListener

The class listens for focus events.

Field Summary

Modifier and TypeField and Description
private HashMap<AbstractButton, Border>
protected String
constraintBeforeFloating

The layout before floating.

protected Color
dockingBorderColor

The color of the docking border.

protected Color
dockingColor

The background color of the docking border.

protected MouseInputListener
dockingListener

The instance of a MouseInputListener.

private int
private Container
protected KeyStroke
downKey

Deprecated As of Java 2 platform v1.3.
As of Java 2 platform v1.3 this previously undocumented field is no longer used.
protected BasicToolBarUI.DragWindow
dragWindow

The instance of DragWindow.

private boolean
protected Color
floatingBorderColor

The color of the not docking border.

protected Color
floatingColor

The background color of the not docking border.

private JFrame
private RootPaneContainer
private int
private int
private static String
protected int
focusedCompIndex

The index of the focused component.

private BasicToolBarUI.Handler
private static String
protected KeyStroke
leftKey

Deprecated As of Java 2 platform v1.3.
As of Java 2 platform v1.3 this previously undocumented field is no longer used.
private static Border
private static Border
protected PropertyChangeListener
propertyListener

The instance of a PropertyChangeListener.

protected KeyStroke
rightKey

Deprecated As of Java 2 platform v1.3.
As of Java 2 platform v1.3 this previously undocumented field is no longer used.
private static Border
private boolean
private Hashtable<AbstractButton, Boolean>
protected JToolBar
toolBar

The instance of JToolBar.

protected ContainerListener
toolBarContListener

The instance of a ContainerListener.

protected FocusListener
toolBarFocusListener

The instance of a FocusListener.

protected KeyStroke
upKey

Deprecated As of Java 2 platform v1.3.
As of Java 2 platform v1.3 this previously undocumented field is no longer used.

Constructor Summary

AccessConstructor and Description
public
BasicToolBarUI()

Constructs a BasicToolBarUI.

Method Summary

Modifier and TypeMethod and Description
private String
public boolean

Returns:

true if the JToolBar can dock at the given position
canDock
(Component
a component
c
,
Point
a position
p
)

Returns true if the JToolBar can dock at the given position.

protected MouseInputListener

Returns:

an instance of MouseInputListener
createDockingListener
()

Returns an instance of MouseInputListener.

protected BasicToolBarUI.DragWindow

Returns:

an instance of DragWindow
createDragWindow
(JToolBar
an instance of JToolBar
toolbar
)

Returns an instance of DragWindow.

protected JFrame

Returns:

an instance of JFrame
createFloatingFrame
(JToolBar
an instance of JToolBar
toolbar
)
Deprecated for removal since 17. It is recommended that BasicToolBarUI#createFloatingWindow(JToolBar) be used instead

No longer used, use BasicToolBarUI.createFloatingWindow(JToolBar)

protected RootPaneContainer

Returns:

a RootPaneContainer object, containing the toolbar
createFloatingWindow
(JToolBar
an instance of JToolBar
toolbar
)

Creates a window which contains the toolbar after it has been dragged out from its container

protected WindowListener

Returns:

a new instance of WindowListener
createFrameListener
()

Constructs a new instance of WindowListener.

protected Border

Returns:

the non rollover border for toolbar components
createNonRolloverBorder
()

Creates the non rollover border for toolbar components.

private Border
createNonRolloverToggleBorder()

Creates a non rollover border for Toggle buttons in the toolbar.

protected PropertyChangeListener

Returns:

an instance of PropertyChangeListener
createPropertyListener
()

Returns an instance of PropertyChangeListener.

protected Border

Returns:

a rollover border for toolbar components
createRolloverBorder
()

Creates a rollover border for toolbar components.

protected ContainerListener

Returns:

an instance of ContainerListener
createToolBarContListener
()

Returns an instance of ContainerListener.

protected FocusListener

Returns:

an instance of FocusListener
createToolBarFocusListener
()

Returns an instance of FocusListener.

public static ComponentUI

Returns:

a new instance of BasicToolBarUI
createUI
(JComponent
a component
c
)

Hides javax.swing.plaf.ComponentUI.createUI.

Constructs a new instance of BasicToolBarUI.

protected void
dragTo(Point
the relative to the JTollBar position
position
,
Point
the screen position of JToolBar before dragging
origin
)

The method is used to drag DragWindow during the JToolBar is being dragged.

protected void
floatAt(Point
the relative to the JTollBar position
position
,
Point
the screen position of JToolBar before dragging
origin
)

The method is called at end of dragging to place the frame in either its original place or in its floating frame.

public Color

Returns:

the color displayed when over a docking area
getDockingColor
()

Gets the color displayed when over a docking area

private String
public Color

Returns:

the color displayed when over a floating area
getFloatingColor
()

Gets the color displayed when over a floating area

private BasicToolBarUI.Handler
pack-priv InputMap
getInputMap(int condition)

protected Border

Returns:

the non-rollover border
getNonRolloverBorder
(AbstractButton
the button to calculate the non-rollover border for
b
)

Returns a non-rollover border for the button.

protected Border

Returns:

the rollover border
getRolloverBorder
(AbstractButton
the button to calculate the rollover border for
b
)

Returns a rollover border for the button.

protected void
installComponents()

Registers components.

protected void
installDefaults()

Installs default properties.

protected void
installKeyboardActions()

Registers keyboard actions.

protected void
installListeners()

Registers listeners.

protected void
installNonRolloverBorders(JComponent
container which holds the child components (usually a JToolBar)
c
)

Installs non-rollover borders on all the child components of the JComponent.

protected void
installNormalBorders(JComponent
container which holds the child components (usually a JToolBar)
c
)

Installs normal borders on all the child components of the JComponent.

protected void
installRolloverBorders(JComponent
container which holds the child components (usually a JToolBar)
c
)

Installs rollover borders on all the child components of the JComponent.

public void
installUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.installUI.

Configures the specified component appropriately for the look and feel.

private boolean
isBlocked(Component comp, Object constraint)

public boolean

Returns:

true if the JToolBar is floating
isFloating
()

Returns true if the JToolBar is floating

public boolean

Returns:

true if rollover borders are enabled; false otherwise
isRolloverBorders
()

Returns a flag to determine whether rollover button borders are enabled.

pack-priv static void
private int
protected void
paintDragWindow(Graphics
Graphics to paint to.
g
)

Paints the contents of the window used for dragging.

protected void
setBorderToNonRollover(Component
component which will have a non-rollover border installed
c
)

Sets the border of the component to have a non-rollover border which was created by the createNonRolloverBorder method.

protected void
setBorderToNormal(Component
component which will have a normal border re-installed
c
)

Sets the border of the component to have a normal border.

protected void
setBorderToRollover(Component
component which will have a rollover border installed
c
)

Sets the border of the component to have a rollover border which was created by the createRolloverBorder method.

public void
setDockingColor(Color
the new color
c
)

Sets the color displayed when over a docking area

public void
setFloating(boolean
true if the JToolBar is floating
b
,
Point
the position
p
)

Sets the floating property.

public void
setFloatingColor(Color
the new color
c
)

Sets the color displayed when over a floating area

public void
setFloatingLocation(int
an X coordinate
x
,
int
an Y coordinate
y
)

Sets the floating location.

public void
setOrientation(int
the new orientation
orientation
)

Sets the tool bar's orientation.

public void
setRolloverBorders(boolean
if true, rollover borders are installed. Otherwise non-rollover borders are installed
rollover
)

Sets the flag for enabling rollover borders on the toolbar and it will also install the appropriate border depending on the state of the flag.

protected void
uninstallComponents()

Unregisters components.

protected void
uninstallDefaults()

Uninstalls default properties.

protected void
uninstallKeyboardActions()

Unregisters keyboard actions.

protected void
uninstallListeners()

Unregisters listeners.

public void
uninstallUI(JComponent c)

Overrides javax.swing.plaf.ComponentUI.uninstallUI.

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