public class PaletteToolBarUI
extends javax.swing.plaf.ToolBarUI
implements javax.swing.SwingConstants
This UI differs from BasicToolBarUI, in that the component holding the toolbar is supposed to use BoxLayout instead of BorderLayout. This allows to have multiple toolbars in the same component. The toolbars can be reorderd in the component, but they are not allowed to float in their own floating window.
The JToolBar starts dragging only, if the drag starts over the insets of its border.
Modifier and Type | Class and Description |
---|---|
class |
PaletteToolBarUI.DockingListener
This class should be treated as a "protected" inner class.
|
protected class |
PaletteToolBarUI.DragWindow |
protected class |
PaletteToolBarUI.FrameListener |
protected class |
PaletteToolBarUI.PropertyListener |
protected class |
PaletteToolBarUI.ToolBarContListener |
protected class |
PaletteToolBarUI.ToolBarFocusListener |
Modifier and Type | Field and Description |
---|---|
protected java.lang.Integer |
constraintBeforeFloating |
protected java.awt.Color |
dockingBorderColor |
protected java.awt.Color |
dockingColor |
protected javax.swing.event.MouseInputListener |
dockingListener |
protected javax.swing.KeyStroke |
downKey
Deprecated.
As of Java 2 platform v1.3.
|
protected PaletteToolBarUI.DragWindow |
dragWindow |
protected java.awt.Color |
floatingBorderColor |
protected java.awt.Color |
floatingColor |
protected int |
focusedCompIndex |
protected javax.swing.KeyStroke |
leftKey
Deprecated.
As of Java 2 platform v1.3.
|
protected java.beans.PropertyChangeListener |
propertyListener |
protected javax.swing.KeyStroke |
rightKey
Deprecated.
As of Java 2 platform v1.3.
|
protected javax.swing.JToolBar |
toolBar |
static java.lang.String |
TOOLBAR_ICON_PROPERTY |
static java.lang.String |
TOOLBAR_INSETS_OVERRIDE_PROPERTY |
static java.lang.String |
TOOLBAR_TEXT_ICON_GAP_PROPERTY |
protected java.awt.event.ContainerListener |
toolBarContListener |
protected java.awt.event.FocusListener |
toolBarFocusListener |
protected javax.swing.KeyStroke |
upKey
Deprecated.
As of Java 2 platform v1.3.
|
Constructor and Description |
---|
PaletteToolBarUI() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDock(java.awt.Component c,
java.awt.Point p) |
protected javax.swing.event.MouseInputListener |
createDockingListener() |
protected PaletteToolBarUI.DragWindow |
createDragWindow(javax.swing.JToolBar toolbar) |
protected javax.swing.JFrame |
createFloatingFrame(javax.swing.JToolBar toolbar)
No longer used, use PaletteToolBarUI.createFloatingWindow(JToolBar)
|
protected javax.swing.RootPaneContainer |
createFloatingWindow(javax.swing.JToolBar toolbar)
Creates a window which contains the toolbar after it has been
dragged out from its container
|
protected java.awt.event.WindowListener |
createFrameListener() |
protected javax.swing.border.Border |
createNonRolloverBorder()
Creates the non rollover border for toolbar components.
|
protected java.beans.PropertyChangeListener |
createPropertyListener() |
protected javax.swing.border.Border |
createRolloverBorder()
Creates a rollover border for toolbar components.
|
protected java.awt.event.ContainerListener |
createToolBarContListener() |
protected java.awt.event.FocusListener |
createToolBarFocusListener() |
static javax.swing.plaf.ComponentUI |
createUI(javax.swing.JComponent c) |
protected void |
dragTo(java.awt.Point position,
java.awt.Point origin) |
protected void |
floatAt(java.awt.Point position,
java.awt.Point origin) |
java.awt.Color |
getDockingColor()
Gets the color displayed when over a docking area
|
java.awt.Color |
getFloatingColor()
Gets the color displayed when over a floating area
|
protected void |
installComponents() |
protected void |
installDefaults() |
protected void |
installKeyboardActions() |
protected void |
installListeners() |
protected void |
installNonRolloverBorders(javax.swing.JComponent c)
Installs non-rollover borders on all the child components of the JComponent.
|
protected void |
installNormalBorders(javax.swing.JComponent c)
Installs normal borders on all the child components of the JComponent.
|
protected void |
installRolloverBorders(javax.swing.JComponent c)
Installs rollover borders on all the child components of the JComponent.
|
void |
installUI(javax.swing.JComponent c) |
boolean |
isFloating() |
boolean |
isRolloverBorders()
Returns a flag to determine whether rollover button borders
are enabled.
|
protected void |
navigateFocusedComp(int direction) |
protected void |
paintDragWindow(java.awt.Graphics g)
Paints the contents of the window used for dragging.
|
protected void |
setBorderToNonRollover(java.awt.Component c)
Sets the border of the component to have a non-rollover border which
was created by
createNonRolloverBorder . |
protected void |
setBorderToNormal(java.awt.Component c)
Sets the border of the component to have a normal border.
|
protected void |
setBorderToRollover(java.awt.Component c)
Sets the border of the component to have a rollover border which
was created by
createRolloverBorder . |
void |
setDockingColor(java.awt.Color c)
Sets the color displayed when over a docking area
|
void |
setFloating(boolean b,
java.awt.Point p) |
void |
setFloatingColor(java.awt.Color c)
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 |
uninstallComponents() |
protected void |
uninstallDefaults() |
protected void |
uninstallKeyboardActions() |
protected void |
uninstallListeners() |
void |
uninstallUI(javax.swing.JComponent c) |
protected javax.swing.JToolBar toolBar
protected PaletteToolBarUI.DragWindow dragWindow
protected int focusedCompIndex
protected java.awt.Color dockingColor
protected java.awt.Color floatingColor
protected java.awt.Color dockingBorderColor
protected java.awt.Color floatingBorderColor
protected javax.swing.event.MouseInputListener dockingListener
protected java.beans.PropertyChangeListener propertyListener
protected java.awt.event.ContainerListener toolBarContListener
protected java.awt.event.FocusListener toolBarFocusListener
protected java.lang.Integer constraintBeforeFloating
public static final java.lang.String TOOLBAR_ICON_PROPERTY
public static final java.lang.String TOOLBAR_TEXT_ICON_GAP_PROPERTY
public static final java.lang.String TOOLBAR_INSETS_OVERRIDE_PROPERTY
@Deprecated protected javax.swing.KeyStroke upKey
@Deprecated protected javax.swing.KeyStroke downKey
@Deprecated protected javax.swing.KeyStroke leftKey
@Deprecated protected javax.swing.KeyStroke rightKey
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
public void installUI(javax.swing.JComponent c)
installUI
in class javax.swing.plaf.ComponentUI
public void uninstallUI(javax.swing.JComponent c)
uninstallUI
in class javax.swing.plaf.ComponentUI
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 javax.swing.border.Border createRolloverBorder()
Override this method to provide an alternate rollover border.
protected javax.swing.border.Border createNonRolloverBorder()
Override this method to provide an alternate rollover border.
protected javax.swing.JFrame createFloatingFrame(javax.swing.JToolBar toolbar)
protected javax.swing.RootPaneContainer createFloatingWindow(javax.swing.JToolBar toolbar)
RootPaneContainer
object, containing the toolbar.protected PaletteToolBarUI.DragWindow createDragWindow(javax.swing.JToolBar toolbar)
public boolean isRolloverBorders()
setRolloverBorders(boolean)
public void setRolloverBorders(boolean rollover)
rollover
- if true, rollover borders are installed.
Otherwise non-rollover borders are installedisRolloverBorders()
protected void installRolloverBorders(javax.swing.JComponent c)
This is a convenience method to call setBorderToRollover
for each child component.
c
- container which holds the child components (usally a JToolBar)setBorderToRollover(java.awt.Component)
protected void installNonRolloverBorders(javax.swing.JComponent c)
This is a convenience method to call setBorderToNonRollover
for each child component.
c
- container which holds the child components (usally a JToolBar)setBorderToNonRollover(java.awt.Component)
protected void installNormalBorders(javax.swing.JComponent c)
This is a convenience method to call setBorderNormal
for each child component.
c
- container which holds the child components (usally a JToolBar)setBorderToNonRollover(java.awt.Component)
protected void setBorderToRollover(java.awt.Component c)
createRolloverBorder
.c
- component which will have a rollover border installedcreateRolloverBorder()
protected void setBorderToNonRollover(java.awt.Component c)
createNonRolloverBorder
.c
- component which will have a non-rollover border installedcreateNonRolloverBorder()
protected void setBorderToNormal(java.awt.Component c)
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, java.awt.Point p)
public void setOrientation(int orientation)
public java.awt.Color getDockingColor()
public void setDockingColor(java.awt.Color c)
public java.awt.Color getFloatingColor()
public void setFloatingColor(java.awt.Color c)
public boolean canDock(java.awt.Component c, java.awt.Point p)
protected void dragTo(java.awt.Point position, java.awt.Point origin)
protected void floatAt(java.awt.Point position, java.awt.Point origin)
protected java.awt.event.ContainerListener createToolBarContListener()
protected java.awt.event.FocusListener createToolBarFocusListener()
protected java.beans.PropertyChangeListener createPropertyListener()
protected javax.swing.event.MouseInputListener createDockingListener()
protected java.awt.event.WindowListener createFrameListener()
protected void paintDragWindow(java.awt.Graphics g)
g
- Graphics to paint to.java.lang.NullPointerException
- is g
is null