public class BasicToolBarUI extends javax.swing.plaf.ToolBarUI implements javax.swing.SwingConstants
| Modifier and Type | Class and Description |
|---|---|
class |
BasicToolBarUI.DockingListener
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 class |
BasicToolBarUI.DragWindow
This is the window that appears when the JToolBar is being dragged
around.
|
protected class |
BasicToolBarUI.FrameListener
This helper class listens for Window events from the floatable window and
if it is closed, returns the JToolBar to the last known good location.
|
protected class |
BasicToolBarUI.PropertyListener
This helper class listens for PropertyChangeEvents from the JToolBar.
|
protected class |
BasicToolBarUI.ToolBarContListener
This helper class listens for components added to and removed from the
JToolBar.
|
protected class |
BasicToolBarUI.ToolBarFocusListener
DOCUMENT ME!
|
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
constraintBeforeFloating
The last known BorderLayout constraint before floating.
|
protected java.awt.Color |
dockingBorderColor
The color of the border when it is dockable.
|
protected java.awt.Color |
dockingColor
The background color of the JToolBar when it is dockable.
|
protected javax.swing.event.MouseInputListener |
dockingListener
The docking listener responsible for mouse events on the JToolBar.
|
protected javax.swing.KeyStroke |
downKey
Deprecated.
since JDK1.3.
|
protected BasicToolBarUI.DragWindow |
dragWindow
The window used for dragging the JToolBar.
|
protected java.awt.Color |
floatingBorderColor
The color of the border when it is not dockable.
|
protected java.awt.Color |
floatingColor
The background color of the JToolBar when it is not dockable.
|
protected int |
focusedCompIndex
The index of the focused component.
|
protected javax.swing.KeyStroke |
leftKey
Deprecated.
since JDK1.3.
|
protected java.beans.PropertyChangeListener |
propertyListener
The PropertyChangeListener for the JToolBar.
|
protected javax.swing.KeyStroke |
rightKey
Deprecated.
since JDK1.3.
|
protected javax.swing.JToolBar |
toolBar
The JToolBar this UI delegate is responsible for.
|
protected java.awt.event.ContainerListener |
toolBarContListener
The Container listener for the JToolBar.
|
protected java.awt.event.FocusListener |
toolBarFocusListener
The Focus listener for the JToolBar.
|
protected javax.swing.KeyStroke |
upKey
Deprecated.
since JDK1.3.
|
| Constructor and Description |
|---|
BasicToolBarUI()
This method creates a new
BasicToolBarUI object for the given JToolBar. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canDock(java.awt.Component c,
java.awt.Point p)
This method returns whether the JToolBar can dock at the given position.
|
protected javax.swing.event.MouseInputListener |
createDockingListener()
This method creates a new DockingListener for the JToolBar.
|
protected BasicToolBarUI.DragWindow |
createDragWindow(javax.swing.JToolBar toolbar)
This method creates a new DragWindow for the given JToolBar.
|
protected javax.swing.JFrame |
createFloatingFrame(javax.swing.JToolBar toolbar)
This method creates a new floating frame for the JToolBar.
|
protected javax.swing.RootPaneContainer |
createFloatingWindow(javax.swing.JToolBar toolbar)
This method creates a new floating window for the JToolBar.
|
protected java.awt.event.WindowListener |
createFrameListener()
This method creates a new WindowListener for the JToolBar.
|
protected javax.swing.border.Border |
createNonRolloverBorder()
This method creates a new nonRolloverBorder for JButtons when the
JToolBar's rollover property is set to false.
|
protected java.beans.PropertyChangeListener |
createPropertyListener()
This method creates a new PropertyChangeListener for the JToolBar.
|
protected javax.swing.border.Border |
createRolloverBorder()
This method creates a new rollover border for JButtons when the
JToolBar's rollover property is set to true.
|
protected java.awt.event.ContainerListener |
createToolBarContListener()
This method creates a new Container listener for the JToolBar.
|
protected java.awt.event.FocusListener |
createToolBarFocusListener()
This method creates a new FocusListener for the JToolBar.
|
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c)
This method creates a new UI delegate for the given JComponent.
|
protected void |
dragTo(java.awt.Point position,
java.awt.Point origin)
This method is called to drag the DragWindow around when the JToolBar is
being dragged around.
|
protected void |
floatAt(java.awt.Point position,
java.awt.Point origin)
This method is used at the end of a drag session to place the frame in
either its original parent as a docked JToolBar or in its floating
frame.
|
java.awt.Color |
getDockingColor()
This method returns the docking color.
|
java.awt.Color |
getFloatingColor()
This method returns the Color which is displayed when over a floating
area.
|
java.awt.Dimension |
getMaximumSize(javax.swing.JComponent c)
This method returns the maximum size of the given JComponent for this UI.
|
java.awt.Dimension |
getMinimumSize(javax.swing.JComponent c)
This method returns the minimum size of the given JComponent for this UI.
|
protected void |
installComponents()
This method installs the needed components for the JToolBar.
|
protected void |
installDefaults()
This method installs the defaults as specified by the look and feel.
|
protected void |
installKeyboardActions()
This method installs the keyboard actions for the JToolBar as specified
by the look and feel.
|
protected void |
installListeners()
This method installs listeners for the JToolBar.
|
protected void |
installNonRolloverBorders(javax.swing.JComponent c)
This method installs non rollover borders for each component inside the
given JComponent.
|
protected void |
installNormalBorders(javax.swing.JComponent c)
This method installs normal (or their original) borders for each
component inside the given JComponent.
|
protected void |
installRolloverBorders(javax.swing.JComponent c)
This method install rollover borders for each component inside the given
JComponent.
|
void |
installUI(javax.swing.JComponent c)
This method installs the UI for the given JComponent.
|
boolean |
isFloating()
This method returns whether the JToolBar is floating.
|
boolean |
isRolloverBorders()
This method returns whether rollover borders have been set.
|
protected void |
navigateFocusedComp(int direction)
This method navigates in the given direction giving focus to the next
component in the given direction.
|
protected void |
setBorderToNonRollover(java.awt.Component c)
This method sets the border of the given component to a non rollover
border.
|
protected void |
setBorderToNormal(java.awt.Component c)
This method sets the border of the given component to its original value.
|
protected void |
setBorderToRollover(java.awt.Component c)
This method sets the border of the given component to a rollover border.
|
void |
setDockingColor(java.awt.Color c)
This method sets the docking color.
|
void |
setFloating(boolean b,
java.awt.Point p)
This method sets the floating property for the JToolBar.
|
void |
setFloatingColor(java.awt.Color c)
This method sets the color displayed when the JToolBar is not in a
dockable area.
|
void |
setFloatingLocation(int x,
int y)
This method sets the floating location of the JToolBar.
|
void |
setOrientation(int orientation)
This is a convenience method for changing the orientation of the
JToolBar.
|
void |
setRolloverBorders(boolean rollover)
This method changes the child components to have rollover borders if the
given parameter is true.
|
protected void |
uninstallComponents()
This method uninstall UI installed components from the JToolBar.
|
protected void |
uninstallDefaults()
This method removes the defaults installed by the Look and Feel.
|
protected void |
uninstallKeyboardActions()
This method uninstalls keyboard actions installed by the UI.
|
protected void |
uninstallListeners()
This method uninstalls listeners installed by the UI.
|
void |
uninstallUI(javax.swing.JComponent c)
This method uninstalls the UI.
|
protected java.lang.String constraintBeforeFloating
protected java.awt.Color dockingBorderColor
protected java.awt.Color dockingColor
protected javax.swing.event.MouseInputListener dockingListener
protected BasicToolBarUI.DragWindow dragWindow
protected java.awt.Color floatingBorderColor
protected java.awt.Color floatingColor
protected int focusedCompIndex
protected java.beans.PropertyChangeListener propertyListener
protected javax.swing.JToolBar toolBar
protected java.awt.event.ContainerListener toolBarContListener
protected java.awt.event.FocusListener toolBarFocusListener
protected javax.swing.KeyStroke leftKey
protected javax.swing.KeyStroke rightKey
protected javax.swing.KeyStroke upKey
protected javax.swing.KeyStroke downKey
public BasicToolBarUI()
BasicToolBarUI object for the given JToolBar.public boolean canDock(java.awt.Component c, java.awt.Point p)
c - The component to try to dock in.p - The position of the mouse cursor relative to the given
component.protected javax.swing.event.MouseInputListener createDockingListener()
protected BasicToolBarUI.DragWindow createDragWindow(javax.swing.JToolBar toolbar)
toolbar - The JToolBar to create a DragWindow for.protected javax.swing.JFrame createFloatingFrame(javax.swing.JToolBar toolbar)
toolbar - The JToolBar to create a floating frame for.protected javax.swing.RootPaneContainer createFloatingWindow(javax.swing.JToolBar toolbar)
toolbar - The JToolBar to create a floating window for.protected java.awt.event.WindowListener createFrameListener()
protected javax.swing.border.Border createNonRolloverBorder()
protected java.beans.PropertyChangeListener createPropertyListener()
protected javax.swing.border.Border createRolloverBorder()
protected java.awt.event.ContainerListener createToolBarContListener()
protected java.awt.event.FocusListener createToolBarFocusListener()
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
c - The JComponent to create a UI delegate for.protected void dragTo(java.awt.Point position, java.awt.Point origin)
position - The mouse cursor coordinates relative to the JToolBar.origin - The screen position of the JToolBar.protected void floatAt(java.awt.Point position, java.awt.Point origin)
position - The position of the mouse cursor relative to the
JToolBar.origin - The screen position of the JToolBar before the drag session
started.public java.awt.Color getDockingColor()
public java.awt.Color getFloatingColor()
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
getMaximumSize in class javax.swing.plaf.ComponentUIc - The JComponent to find the maximum size for.public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
getMinimumSize in class javax.swing.plaf.ComponentUIc - The JComponent to find a minimum size for.protected void installComponents()
protected void installDefaults()
protected void installKeyboardActions()
protected void installListeners()
protected void installNonRolloverBorders(javax.swing.JComponent c)
c - The JComponent whose children need to have non rollover borders
installed.protected void installNormalBorders(javax.swing.JComponent c)
c - The JComponent whose children need to have their original
borders installed.protected void installRolloverBorders(javax.swing.JComponent c)
c - The JComponent whose children need to have rollover borders
installed.public void installUI(javax.swing.JComponent c)
installUI in class javax.swing.plaf.ComponentUIc - The JComponent to install a UI for.ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()public boolean isFloating()
public boolean isRolloverBorders()
protected void navigateFocusedComp(int direction)
direction - The direction to give focus to.protected void setBorderToNonRollover(java.awt.Component c)
c - The Component whose border needs to be set.protected void setBorderToNormal(java.awt.Component c)
c - The Component whose border needs to be set.protected void setBorderToRollover(java.awt.Component c)
c - The Component whose border needs to be set.public void setDockingColor(java.awt.Color c)
c - The docking color.public void setFloating(boolean b, java.awt.Point p)
b - Whether the JToolBar is floating.p - FIXMEpublic void setFloatingColor(java.awt.Color c)
c - The floating color.public void setFloatingLocation(int x, int y)
x - The x coordinate for the floating frame.y - The y coordinate for the floating frame.public void setOrientation(int orientation)
orientation - The new orientation.public void setRolloverBorders(boolean rollover)
rollover - Whether the children will have rollover borders.protected void uninstallComponents()
protected void uninstallDefaults()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
public void uninstallUI(javax.swing.JComponent c)
uninstallUI in class javax.swing.plaf.ComponentUIc - The JComponent that is having this UI removed.ComponentUI.installUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()