SwingConstants
MetalToolBarUI
, SynthToolBarUI
public class BasicToolBarUI extends ToolBarUI implements SwingConstants
Modifier and Type | Class | Description |
---|---|---|
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.
|
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.
|
Modifier and Type | Field | Description |
---|---|---|
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 . |
protected KeyStroke |
downKey |
Deprecated.
As of Java 2 platform v1.3.
|
protected BasicToolBarUI.DragWindow |
dragWindow |
The instance of
DragWindow . |
protected Color |
floatingBorderColor |
The color of the not docking border.
|
protected Color |
floatingColor |
The background color of the not docking border.
|
protected int |
focusedCompIndex |
The index of the focused component.
|
protected KeyStroke |
leftKey |
Deprecated.
As of Java 2 platform v1.3.
|
protected PropertyChangeListener |
propertyListener |
The instance of a
PropertyChangeListener . |
protected KeyStroke |
rightKey |
Deprecated.
As of Java 2 platform v1.3.
|
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.
|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor | Description |
---|---|
BasicToolBarUI() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
canDock(Component c,
Point p) |
Returns
true if the JToolBar can dock at the given position. |
protected MouseInputListener |
createDockingListener() |
Returns an instance of
MouseInputListener . |
protected BasicToolBarUI.DragWindow |
createDragWindow(JToolBar toolbar) |
Returns an instance of
DragWindow . |
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
|
protected WindowListener |
createFrameListener() |
Constructs a new instance of
WindowListener . |
protected Border |
createNonRolloverBorder() |
Creates the non rollover border for toolbar components.
|
protected PropertyChangeListener |
createPropertyListener() |
Returns an instance of
PropertyChangeListener . |
protected Border |
createRolloverBorder() |
Creates a rollover border for toolbar components.
|
protected ContainerListener |
createToolBarContListener() |
Returns an instance of
ContainerListener . |
protected FocusListener |
createToolBarFocusListener() |
Returns an instance of
FocusListener . |
static ComponentUI |
createUI(JComponent c) |
Constructs a new instance of
BasicToolBarUI . |
protected void |
dragTo(Point position,
Point origin) |
The method is used to drag
DragWindow during the JToolBar
is being dragged. |
protected void |
floatAt(Point position,
Point origin) |
The method is called at end of dragging to place the frame in either
its original place or in its floating frame.
|
Color |
getDockingColor() |
Gets the color displayed when over a docking area
|
Color |
getFloatingColor() |
Gets the color displayed when over a floating area
|
protected Border |
getNonRolloverBorder(AbstractButton b) |
Returns a non-rollover border for the button.
|
protected Border |
getRolloverBorder(AbstractButton 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 c) |
Installs non-rollover borders on all the child components of the JComponent.
|
protected void |
installNormalBorders(JComponent c) |
Installs normal borders on all the child components of the JComponent.
|
protected void |
installRolloverBorders(JComponent c) |
Installs rollover borders on all the child components of the JComponent.
|
void |
installUI(JComponent c) |
Configures the specified component appropriately for the look and feel.
|
boolean |
isFloating() |
Returns
true if the JToolBar is floating |
boolean |
isRolloverBorders() |
Returns a flag to determine whether rollover button borders
are enabled.
|
protected void |
navigateFocusedComp(int direction) |
Navigates the focused component.
|
protected void |
paintDragWindow(Graphics g) |
Paints the contents of the window used for dragging.
|
protected void |
setBorderToNonRollover(Component c) |
Sets the border of the component to have a non-rollover border which
was created by the
createNonRolloverBorder() method. |
protected void |
setBorderToNormal(Component c) |
Sets the border of the component to have a normal border.
|
protected void |
setBorderToRollover(Component c) |
Sets the border of the component to have a rollover border which
was created by the
createRolloverBorder() method. |
void |
setDockingColor(Color c) |
Sets the color displayed when over a docking area
|
void |
setFloating(boolean b,
Point p) |
Sets the floating property.
|
void |
setFloatingColor(Color c) |
Sets the color displayed when over a floating area
|
void |
setFloatingLocation(int x,
int y) |
Sets the floating location.
|
void |
setOrientation(int orientation) |
Sets the tool bar's orientation.
|
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.
|
protected void |
uninstallComponents() |
Unregisters components.
|
protected void |
uninstallDefaults() |
Uninstalls default properties.
|
protected void |
uninstallKeyboardActions() |
Unregisters keyboard actions.
|
protected void |
uninstallListeners() |
Unregisters listeners.
|
void |
uninstallUI(JComponent c) |
Reverses configuration which was done on the specified component during
installUI . |
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
protected JToolBar toolBar
JToolBar
.protected BasicToolBarUI.DragWindow dragWindow
DragWindow
.protected int focusedCompIndex
protected Color dockingColor
protected Color floatingColor
protected Color dockingBorderColor
protected Color floatingBorderColor
protected MouseInputListener dockingListener
MouseInputListener
.protected PropertyChangeListener propertyListener
PropertyChangeListener
.protected ContainerListener toolBarContListener
ContainerListener
.protected FocusListener toolBarFocusListener
FocusListener
.protected String constraintBeforeFloating
@Deprecated protected KeyStroke upKey
@Deprecated protected KeyStroke downKey
@Deprecated protected KeyStroke leftKey
@Deprecated protected KeyStroke rightKey
public static ComponentUI createUI(JComponent c)
BasicToolBarUI
.c
- a componentBasicToolBarUI
public void installUI(JComponent c)
ComponentUI
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)
ComponentUI
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)
direction
- a directionprotected Border createRolloverBorder()
Override this method to provide an alternate rollover border.
protected Border createNonRolloverBorder()
Override this method to provide an alternate rollover border.
protected JFrame createFloatingFrame(JToolBar toolbar)
toolbar
- an instance of JToolBar
JFrame
createFloatingWindow(javax.swing.JToolBar)
protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
toolbar
- an instance of JToolBar
RootPaneContainer
object, containing the toolbarprotected BasicToolBarUI.DragWindow createDragWindow(JToolBar toolbar)
DragWindow
.toolbar
- an instance of JToolBar
DragWindow
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(JComponent c)
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)
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)
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)
createRolloverBorder()
method.c
- component which will have a rollover border installedcreateRolloverBorder()
protected Border getRolloverBorder(AbstractButton b)
b
- the button to calculate the rollover border forsetBorderToRollover(java.awt.Component)
protected void setBorderToNonRollover(Component c)
createNonRolloverBorder()
method.c
- component which will have a non-rollover border installedcreateNonRolloverBorder()
protected Border getNonRolloverBorder(AbstractButton b)
b
- the button to calculate the non-rollover border forsetBorderToNonRollover(java.awt.Component)
protected void setBorderToNormal(Component c)
c
- component which will have a normal border re-installedcreateNonRolloverBorder()
public void setFloatingLocation(int x, int y)
x
- an X coordinatey
- an Y coordinatepublic boolean isFloating()
true
if the JToolBar
is floatingtrue
if the JToolBar
is floatingpublic void setFloating(boolean b, Point p)
b
- true
if the JToolBar
is floatingp
- the positionpublic void setOrientation(int orientation)
orientation
- the new orientationpublic Color getDockingColor()
public void setDockingColor(Color c)
c
- the new colorpublic Color getFloatingColor()
public void setFloatingColor(Color c)
c
- the new colorpublic boolean canDock(Component c, Point p)
true
if the JToolBar
can dock at the given position.c
- a componentp
- a positiontrue
if the JToolBar
can dock at the given positionprotected void dragTo(Point position, Point origin)
DragWindow
during the JToolBar
is being dragged.position
- the relative to the JTollBar
positionorigin
- the screen position of JToolBar
before draggingprotected void floatAt(Point position, Point origin)
position
- the relative to the JTollBar
positionorigin
- the screen position of JToolBar
before draggingprotected ContainerListener createToolBarContListener()
ContainerListener
.ContainerListener
protected FocusListener createToolBarFocusListener()
FocusListener
.FocusListener
protected PropertyChangeListener createPropertyListener()
PropertyChangeListener
.PropertyChangeListener
protected MouseInputListener createDockingListener()
MouseInputListener
.MouseInputListener
protected WindowListener createFrameListener()
WindowListener
.WindowListener
protected void paintDragWindow(Graphics g)
g
- Graphics to paint to.NullPointerException
- is g
is null Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-internal+0-adhoc.mlchung.jdk9-jdeps