|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.ToolBarUI javax.swing.plaf.basic.BasicToolBarUI
A Basic L&F implementation of ToolBarUI. This implementation is a "combined" view/controller.
Nested Class Summary | |
class |
BasicToolBarUI.DockingListener
This inner class is marked "public" due to a compiler bug. |
private static class |
BasicToolBarUI.DownAction
|
protected class |
BasicToolBarUI.DragWindow
|
protected class |
BasicToolBarUI.FrameListener
|
private static class |
BasicToolBarUI.KeyAction
|
private static class |
BasicToolBarUI.LeftAction
|
protected class |
BasicToolBarUI.PropertyListener
|
private static class |
BasicToolBarUI.RightAction
|
protected class |
BasicToolBarUI.ToolBarContListener
|
protected class |
BasicToolBarUI.ToolBarFocusListener
|
private static class |
BasicToolBarUI.UpAction
|
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
BasicToolBarUI()
|
Method Summary | |
private String |
calculateConstraint(Component c,
Point p)
|
boolean |
canDock(Component c,
Point p)
|
(package private) ActionMap |
createActionMap()
|
protected MouseInputListener |
createDockingListener()
|
protected BasicToolBarUI.DragWindow |
createDragWindow(JToolBar toolbar)
|
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()
|
protected Border |
createNonRolloverBorder()
Creates the non rollover border for toolbar components. |
private Border |
createNonRolloverToggleBorder()
Creates a non rollover border for Toggle buttons in the toolbar. |
protected java.beans.PropertyChangeListener |
createPropertyListener()
|
protected Border |
createRolloverBorder()
Creates a rollover border for toolbar components. |
protected ContainerListener |
createToolBarContListener()
|
protected FocusListener |
createToolBarFocusListener()
|
static ComponentUI |
createUI(JComponent c)
Returns an instance of the UI delegate for the specified component. |
protected void |
dragTo(Point position,
Point origin)
|
protected void |
floatAt(Point position,
Point origin)
|
(package private) ActionMap |
getActionMap()
|
Color |
getDockingColor()
Gets the color displayed when over a docking area |
private String |
getDockingConstraint(Component c,
Point p)
|
Color |
getFloatingColor()
Gets the color displayed when over a floating area |
(package private) InputMap |
getInputMap(int condition)
|
Dimension |
getMaximumSize(JComponent c)
Returns the specified component's maximum size appropriate for the look and feel. |
Dimension |
getMinimumSize(JComponent c)
Returns the specified component's minimum size appropriate for the look and feel. |
Dimension |
getPreferredSize(JComponent c)
Returns the specified component's preferred size appropriate for the look and feel. |
protected void |
installComponents()
|
protected void |
installDefaults()
|
protected void |
installKeyboardActions()
|
protected void |
installListeners()
|
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 appropriate for the look and feel. |
boolean |
isFloating()
|
boolean |
isRolloverBorders()
Returns a flag to determine whether rollover button borders are enabled. |
private int |
mapConstraintToOrientation(String constraint)
|
protected void |
navigateFocusedComp(int direction)
|
protected void |
setBorderToNonRollover(Component c)
Sets the border of the component to have a non-rollover border which was created by createNonRolloverBorder . |
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 createRolloverBorder . |
void |
setDockingColor(Color c)
Sets the color displayed when over a docking area |
void |
setFloating(boolean b,
Point p)
|
void |
setFloatingColor(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(JComponent c)
Reverses configuration which was done on the specified component during installUI . |
Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected JToolBar toolBar
private boolean floating
private int floatingX
private int floatingY
private JFrame floatingFrame
private RootPaneContainer floatingToolBar
protected BasicToolBarUI.DragWindow dragWindow
private Container dockingSource
private int dockingSensitivity
protected int focusedCompIndex
protected Color dockingColor
protected Color floatingColor
protected Color dockingBorderColor
protected Color floatingBorderColor
protected MouseInputListener dockingListener
protected java.beans.PropertyChangeListener propertyListener
protected ContainerListener toolBarContListener
protected FocusListener toolBarFocusListener
protected String constraintBeforeFloating
private static String IS_ROLLOVER
private static Border rolloverBorder
private static Border nonRolloverBorder
private static Border nonRolloverToggleBorder
private boolean rolloverBorders
private HashMap borderTable
private Hashtable rolloverTable
protected KeyStroke upKey
protected KeyStroke downKey
protected KeyStroke leftKey
protected KeyStroke rightKey
private static String FOCUSED_COMP_INDEX
Constructor Detail |
public BasicToolBarUI()
Method Detail |
public static ComponentUI createUI(JComponent c)
ComponentUI
createUI
method that returns an instance of that UI delegate subclass.
If the UI delegate subclass is stateless, it may return an instance
that is shared by multiple components. If the UI delegate is
stateful, then it should return a new instance per component.
The default implementation of this method throws an error, as it
should never be invoked.
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()
InputMap getInputMap(int condition)
ActionMap getActionMap()
ActionMap createActionMap()
protected void uninstallKeyboardActions()
protected void navigateFocusedComp(int direction)
protected Border createRolloverBorder()
Override this method to provide an alternate rollover border.
protected Border createNonRolloverBorder()
Override this method to provide an alternate rollover border.
private Border createNonRolloverToggleBorder()
protected JFrame createFloatingFrame(JToolBar toolbar)
createFloatingWindow(javax.swing.JToolBar)
protected RootPaneContainer createFloatingWindow(JToolBar toolbar)
RootPaneContainer
object, containing the toolbar.protected BasicToolBarUI.DragWindow createDragWindow(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(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(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(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(Component c)
createRolloverBorder
.
c
- component which will have a rollover border installedcreateRolloverBorder()
protected void setBorderToNonRollover(Component c)
createNonRolloverBorder
.
c
- component which will have a non-rollover border installedcreateNonRolloverBorder()
protected void setBorderToNormal(Component c)
c
- component which will have a normal border re-installedcreateNonRolloverBorder()
public Dimension getMinimumSize(JComponent c)
ComponentUI
null
is returned, the minimum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize
and returns that value.
getMinimumSize
in class ComponentUI
c
- the component whose minimum size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
Dimension
object or null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getPreferredSize(JComponent c)
ComponentUI
null
is returned, the preferred
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method returns null
.
getPreferredSize
in class ComponentUI
c
- the component whose preferred size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple componentsJComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMaximumSize(JComponent c)
ComponentUI
null
is returned, the maximum
size will be calculated by the component's layout manager instead
(this is the preferred approach for any component with a specific
layout manager installed). The default implementation of this
method invokes getPreferredSize
and returns that value.
getMaximumSize
in class ComponentUI
c
- the component whose maximum size is being queried;
this argument is often ignored,
but might be used if the UI object is stateless
and shared by multiple components
Dimension
object or null
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
public void setFloatingLocation(int x, int y)
public boolean isFloating()
public void setFloating(boolean b, Point p)
private int mapConstraintToOrientation(String constraint)
public void setOrientation(int orientation)
public Color getDockingColor()
public void setDockingColor(Color c)
public Color getFloatingColor()
public void setFloatingColor(Color c)
public boolean canDock(Component c, Point p)
private String calculateConstraint(Component c, Point p)
private String getDockingConstraint(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 java.beans.PropertyChangeListener createPropertyListener()
protected MouseInputListener createDockingListener()
protected WindowListener createFrameListener()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |