This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.swing.plaf.basic
class BasicToolBarUI

java.lang.Object extended by javax.swing.plaf.ComponentUI extended by javax.swing.plaf.ToolBarUI extended by javax.swing.plaf.basic.BasicToolBarUI
All Implemented Interfaces:
SwingConstants
Direct Known Subclasses:
MetalToolBarUI

public class BasicToolBarUI
extends ToolBarUI
implements SwingConstants

A Basic L&F implementation of ToolBarUI. This implementation is a "combined" view/controller.


Nested Class Summary
 class

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

          
protected class

          
protected class

          
protected class

          
protected class

          
 
Field Summary
protected String constraintBeforeFloating
          
protected Color dockingBorderColor
          
protected Color dockingColor
          
protected MouseInputListener dockingListener
          
protected KeyStroke downKey
          As of Java 2 platform v1.3 this previously undocumented field is no longer used.
protected BasicToolBarUI.DragWindow dragWindow
          
protected Color floatingBorderColor
          
protected Color floatingColor
          
protected int focusedCompIndex
          
protected KeyStroke leftKey
          As of Java 2 platform v1.3 this previously undocumented field is no longer used.
protected PropertyChangeListener propertyListener
          
protected KeyStroke rightKey
          As of Java 2 platform v1.3 this previously undocumented field is no longer used.
protected JToolBar toolBar
          
protected ContainerListener toolBarContListener
          
protected FocusListener toolBarFocusListener
          
protected KeyStroke upKey
          As of Java 2 platform v1.3 this previously undocumented field is no longer used.
 
Constructor Summary

          
 
Method Summary
 boolean

          
protected MouseInputListener

          
protected BasicToolBarUI.DragWindow

          
protected JFrame

          No longer used, use BasicToolBarUI.createFloatingWindow(JToolBar)
protected RootPaneContainer

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

          
protected Border

          Creates the non rollover border for toolbar components.
protected PropertyChangeListener

          
protected Border

          Creates a rollover border for toolbar components.
protected ContainerListener

          
protected FocusListener

          
static ComponentUI

          
protected void
dragTo(Point position, Point origin)

          
protected void
floatAt(Point position, Point origin)

          
 Color

          Gets the color displayed when over a docking area
 Color

          Gets the color displayed when over a floating area
protected Border

          Returns a non-rollover border for the button.
protected Border

          Returns a rollover border for the button.
protected void

          
protected void

          
protected void

          
protected void

          
protected void

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

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

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

          Configures the specified component appropriate for the look and feel.
 boolean

          
 boolean

          Returns a flag to determine whether rollover button borders are enabled.
protected void
navigateFocusedComp(int direction)

          
protected void

          Paints the contents of the window used for dragging.
protected void

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

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

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

          Sets the color displayed when over a docking area
 void
setFloating(boolean b, Point p)

          
 void

          Sets the color displayed when over a floating area
 void
setFloatingLocation(int x, int y)

          
 void
setOrientation(int orientation)

          
 void
setRolloverBorders(boolean rollover)

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

          
protected void

          
protected void

          
protected void

          
 void

          Reverses configuration which was done on the specified component during installUI.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

constraintBeforeFloating

protected String constraintBeforeFloating

dockingBorderColor

protected Color dockingBorderColor

dockingColor

protected Color dockingColor

dockingListener

protected MouseInputListener dockingListener

downKey

protected KeyStroke downKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.

dragWindow

protected BasicToolBarUI.DragWindow dragWindow

floatingBorderColor

protected Color floatingBorderColor

floatingColor

protected Color floatingColor

focusedCompIndex

protected int focusedCompIndex

leftKey

protected KeyStroke leftKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.

propertyListener

protected PropertyChangeListener propertyListener

rightKey

protected KeyStroke rightKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.

toolBar

protected JToolBar toolBar

toolBarContListener

protected ContainerListener toolBarContListener

toolBarFocusListener

protected FocusListener toolBarFocusListener

upKey

protected KeyStroke upKey
As of Java 2 platform v1.3 this previously undocumented field is no longer used. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
Constructor Detail

BasicToolBarUI

public BasicToolBarUI()
Method Detail

canDock

public boolean canDock(Component c,
                       Point p)
Parameters:
c
p

createDockingListener

protected MouseInputListener createDockingListener()

createDragWindow

protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
Parameters:
toolbar

createFloatingFrame

protected JFrame createFloatingFrame(JToolBar toolbar)
No longer used, use BasicToolBarUI.createFloatingWindow(JToolBar)

Parameters:
toolbar

createFloatingWindow

protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
Creates a window which contains the toolbar after it has been dragged out from its container

Parameters:
toolbar
Returns:
a RootPaneContainer object, containing the toolbar.

createFrameListener

protected WindowListener createFrameListener()

createNonRolloverBorder

protected Border createNonRolloverBorder()
Creates the non rollover border for toolbar components. This border will be installed as the border for components added to the toolbar if rollover borders are not enabled.

Override this method to provide an alternate rollover border.


createPropertyListener

protected PropertyChangeListener createPropertyListener()

createRolloverBorder

protected Border createRolloverBorder()
Creates a rollover border for toolbar components. The rollover border will be installed if rollover borders are enabled.

Override this method to provide an alternate rollover border.


createToolBarContListener

protected ContainerListener createToolBarContListener()

createToolBarFocusListener

protected FocusListener createToolBarFocusListener()

createUI

public static ComponentUI createUI(JComponent c)
Parameters:
c

dragTo

protected void dragTo(Point position,
                      Point origin)
Parameters:
position
origin

floatAt

protected void floatAt(Point position,
                       Point origin)
Parameters:
position
origin

getDockingColor

public Color getDockingColor()
Gets the color displayed when over a docking area


getFloatingColor

public Color getFloatingColor()
Gets the color displayed when over a floating area


getNonRolloverBorder

protected Border getNonRolloverBorder(AbstractButton b)
Returns a non-rollover border for the button.

Parameters:
b - the button to calculate the non-rollover border for
Returns:
the non-rollover border

getRolloverBorder

protected Border getRolloverBorder(AbstractButton b)
Returns a rollover border for the button.

Parameters:
b - the button to calculate the rollover border for
Returns:
the rollover border

installComponents

protected void installComponents()

installDefaults

protected void installDefaults()

installKeyboardActions

protected void installKeyboardActions()

installListeners

protected void installListeners()

installNonRolloverBorders

protected void installNonRolloverBorders(JComponent c)
Installs non-rollover borders on all the child components of the JComponent. A non-rollover border is the border that is installed on the child component while it is in the toolbar.

This is a convenience method to call setBorderToNonRollover for each child component.

Parameters:
c - container which holds the child components (usally a JToolBar)

installNormalBorders

protected void installNormalBorders(JComponent c)
Installs normal borders on all the child components of the JComponent. A normal border is the original border that was installed on the child component before it was added to the toolbar.

This is a convenience method to call setBorderNormal for each child component.

Parameters:
c - container which holds the child components (usally a JToolBar)

installRolloverBorders

protected void installRolloverBorders(JComponent c)
Installs rollover borders on all the child components of the JComponent.

This is a convenience method to call setBorderToRollover for each child component.

Parameters:
c - container which holds the child components (usally a JToolBar)

installUI

public void installUI(JComponent c)
Overrides:
installUI in class ComponentUI
Parameters:
c

isFloating

public boolean isFloating()

isRolloverBorders

public boolean isRolloverBorders()
Returns a flag to determine whether rollover button borders are enabled.

Returns:
true if rollover borders are enabled; false otherwise

navigateFocusedComp

protected void navigateFocusedComp(int direction)
Parameters:
direction

paintDragWindow

protected void paintDragWindow(Graphics g)
Paints the contents of the window used for dragging.

Parameters:
g - Graphics to paint to.

setBorderToNonRollover

protected void setBorderToNonRollover(Component c)
Sets the border of the component to have a non-rollover border which was created by createNonRolloverBorder.

Parameters:
c - component which will have a non-rollover border installed

setBorderToNormal

protected void setBorderToNormal(Component c)
Sets the border of the component to have a normal border. A normal border is the original border that was installed on the child component before it was added to the toolbar.

Parameters:
c - component which will have a normal border re-installed

setBorderToRollover

protected void setBorderToRollover(Component c)
Sets the border of the component to have a rollover border which was created by createRolloverBorder.

Parameters:
c - component which will have a rollover border installed

setDockingColor

public void setDockingColor(Color c)
Sets the color displayed when over a docking area

Parameters:
c

setFloating

public void setFloating(boolean b,
                        Point p)
Parameters:
b
p

setFloatingColor

public void setFloatingColor(Color c)
Sets the color displayed when over a floating area

Parameters:
c

setFloatingLocation

public void setFloatingLocation(int x,
                                int y)
Parameters:
x
y

setOrientation

public void setOrientation(int orientation)
Parameters:
orientation

setRolloverBorders

public void setRolloverBorders(boolean rollover)
Sets the flag for enabling rollover borders on the toolbar and it will also install the apropriate border depending on the state of the flag.

Parameters:
rollover - if true, rollover borders are installed. Otherwise non-rollover borders are installed

uninstallComponents

protected void uninstallComponents()

uninstallDefaults

protected void uninstallDefaults()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

uninstallListeners

protected void uninstallListeners()

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class ComponentUI
Parameters:
c


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.