public class BasicToolBarUI extends ToolBarUI implements SwingConstants
A Basic L&F implementation of ToolBarUI. This implementation is a "combined" view/controller.
Modifier and Type | Class and Description |
---|---|
class |
BasicToolBarUI.DockingListener This class should be treated as a "protected" inner class. |
protected class |
BasicToolBarUI.DragWindow |
protected class |
BasicToolBarUI.FrameListener |
protected class |
BasicToolBarUI.PropertyListener |
protected class |
BasicToolBarUI.ToolBarContListener |
protected class |
BasicToolBarUI.ToolBarFocusListener |
protected JToolBar toolBar
protected BasicToolBarUI.DragWindow dragWindow
protected int focusedCompIndex
protected Color dockingColor
protected Color floatingColor
protected Color dockingBorderColor
protected Color floatingBorderColor
protected MouseInputListener dockingListener
protected PropertyChangeListener propertyListener
protected ContainerListener toolBarContListener
protected FocusListener toolBarFocusListener
protected String constraintBeforeFloating
@Deprecated 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. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
@Deprecated 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. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
@Deprecated 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. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
@Deprecated 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. Key bindings are now defined by the LookAndFeel, please refer to the key bindings specification for further details.
public BasicToolBarUI()
public static ComponentUI createUI(JComponent c)
public void installUI(JComponent c)
Description copied from class: ComponentUI
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:
LayoutManager
on the component if necessary. PropertyChangeListener
on the component in order to detect and respond to component property changes appropriately. installUI
in class ComponentUI
c
- the component where this UI delegate is being installedComponentUI.uninstallUI(javax.swing.JComponent)
, JComponent.setUI(javax.swing.plaf.ComponentUI)
, JComponent.updateUI()
public void uninstallUI(JComponent c)
Description copied from class: ComponentUI
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:
uninstallUI
in class ComponentUI
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 componentsComponentUI.installUI(javax.swing.JComponent)
, JComponent.updateUI()
protected void installDefaults()
protected void uninstallDefaults()
protected void installComponents()
protected void uninstallComponents()
protected void installListeners()
protected void uninstallListeners()
protected void installKeyboardActions()
protected void uninstallKeyboardActions()
protected void navigateFocusedComp(int direction)
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.
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.
protected JFrame createFloatingFrame(JToolBar toolbar)
No longer used, use BasicToolBarUI.createFloatingWindow(JToolBar)
protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
Creates a window which contains the toolbar after it has been dragged out from its container
RootPaneContainer
object, containing the toolbar.protected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
public boolean isRolloverBorders()
Returns a flag to determine whether rollover button borders are enabled.
setRolloverBorders(boolean)
public void setRolloverBorders(boolean 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.
rollover
- if true, rollover borders are installed. Otherwise non-rollover borders are installedisRolloverBorders()
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.
c
- container which holds the child components (usually a JToolBar)setBorderToRollover(java.awt.Component)
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.
c
- container which holds the child components (usually a JToolBar)setBorderToNonRollover(java.awt.Component)
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.
c
- container which holds the child components (usually a JToolBar)setBorderToNonRollover(java.awt.Component)
protected void setBorderToRollover(Component c)
Sets the border of the component to have a rollover border which was created by the createRolloverBorder()
method.
c
- component which will have a rollover border installedcreateRolloverBorder()
protected Border getRolloverBorder(AbstractButton b)
Returns a rollover border for the button.
b
- the button to calculate the rollover border forsetBorderToRollover(java.awt.Component)
protected void setBorderToNonRollover(Component c)
Sets the border of the component to have a non-rollover border which was created by the createNonRolloverBorder()
method.
c
- component which will have a non-rollover border installedcreateNonRolloverBorder()
protected Border getNonRolloverBorder(AbstractButton b)
Returns a non-rollover border for the button.
b
- the button to calculate the non-rollover border forsetBorderToNonRollover(java.awt.Component)
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.
c
- component which will have a normal border re-installedcreateNonRolloverBorder()
public void setFloatingLocation(int x, int y)
public boolean isFloating()
public void setFloating(boolean b, Point p)
public void setOrientation(int orientation)
public Color getDockingColor()
Gets the color displayed when over a docking area
public void setDockingColor(Color c)
Sets the color displayed when over a docking area
public Color getFloatingColor()
Gets the color displayed when over a floating area
public void setFloatingColor(Color c)
Sets the color displayed when over a floating area
public boolean canDock(Component c, Point p)
protected void dragTo(Point position, Point origin)
protected void floatAt(Point position, Point origin)
protected ContainerListener createToolBarContListener()
protected FocusListener createToolBarFocusListener()
protected PropertyChangeListener createPropertyListener()
protected MouseInputListener createDockingListener()
protected WindowListener createFrameListener()
protected void paintDragWindow(Graphics g)
Paints the contents of the window used for dragging.
g
- Graphics to paint to.NullPointerException
- is g
is null
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.