uic.themes
Class UICToolBarUI

java.lang.Object
  extended byjavax.swing.plaf.ComponentUI
      extended byjavax.swing.plaf.ToolBarUI
          extended byjavax.swing.plaf.basic.BasicToolBarUI
              extended byjavax.swing.plaf.metal.MetalToolBarUI
                  extended byuic.themes.UICToolBarUI
All Implemented Interfaces:
SwingConstants

public class UICToolBarUI
extends MetalToolBarUI


Nested Class Summary
static class UICToolBarUI.Border
           
protected  class UICToolBarUI.UICDocingListener
           
 
Nested classes inherited from class javax.swing.plaf.metal.MetalToolBarUI
MetalToolBarUI.MetalContainerListener, MetalToolBarUI.MetalDockingListener, MetalToolBarUI.MetalRolloverListener
 
Nested classes inherited from class javax.swing.plaf.basic.BasicToolBarUI
BasicToolBarUI.DockingListener, BasicToolBarUI.DragWindow, BasicToolBarUI.FrameListener, BasicToolBarUI.PropertyListener, BasicToolBarUI.ToolBarContListener, BasicToolBarUI.ToolBarFocusListener
 
Field Summary
protected  AncestorListener ancestorListener
           
protected static int dockedLength
           
protected static int dockedWidth
           
protected  ToolBarContainer toolBarContainer
           
protected  WindowDroppedListener windowMovedListener
           
protected  WindowRepresenter windowRepresenter
           
 
Fields inherited from class javax.swing.plaf.metal.MetalToolBarUI
contListener, rolloverListener
 
Fields inherited from class javax.swing.plaf.basic.BasicToolBarUI
constraintBeforeFloating, dockingBorderColor, dockingColor, dockingListener, downKey, dragWindow, floatingBorderColor, floatingColor, focusedCompIndex, leftKey, propertyListener, rightKey, toolBar, toolBarContListener, toolBarFocusListener, upKey
 
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
UICToolBarUI()
           
 
Method Summary
protected  MouseInputListener createDockingListener()
           
static ComponentUI createUI(JComponent c)
           
protected  void dragTo(Point position, Point origin)
          Called to move the window and update possible feedback.
protected  void floatAt(Point position, Point origin)
          Called when the toolbar is moved to a certain location.
protected  void floatedWindowSlot()
          Called when the toolbar was 'floated'.
protected  Point getDragWindowLocation(ToolBarContainer tbc, Point screenPoint)
          Check if toolbar can be docked.
protected  void installDefaults()
           
protected  void tryToDropFloatingToolbar(WindowDroppedEvent e)
          Try to drop the floating toolbar in an existing ToolBarContainer.
protected  void uninstallDefaults()
           
 
Methods inherited from class javax.swing.plaf.metal.MetalToolBarUI
createContainerListener, createNonRolloverBorder, createRolloverBorder, createRolloverListener, installListeners, installUI, setBorderToNonRollover, setDragOffset, uninstallListeners, uninstallUI
 
Methods inherited from class javax.swing.plaf.basic.BasicToolBarUI
canDock, createDragWindow, createFloatingFrame, createFloatingWindow, createFrameListener, createPropertyListener, createToolBarContListener, createToolBarFocusListener, getDockingColor, getFloatingColor, getMaximumSize, getMinimumSize, getPreferredSize, installComponents, installKeyboardActions, installNonRolloverBorders, installNormalBorders, installRolloverBorders, isFloating, isRolloverBorders, navigateFocusedComp, setBorderToNormal, setBorderToRollover, setDockingColor, setFloating, setFloatingColor, setFloatingLocation, setOrientation, setRolloverBorders, uninstallComponents, uninstallKeyboardActions
 
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

toolBarContainer

protected ToolBarContainer toolBarContainer

windowRepresenter

protected WindowRepresenter windowRepresenter

dockedLength

protected static final int dockedLength
See Also:
Constant Field Values

dockedWidth

protected static final int dockedWidth
See Also:
Constant Field Values

ancestorListener

protected AncestorListener ancestorListener

windowMovedListener

protected WindowDroppedListener windowMovedListener
Constructor Detail

UICToolBarUI

public UICToolBarUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)

installDefaults

protected void installDefaults()

uninstallDefaults

protected void uninstallDefaults()

dragTo

protected void dragTo(Point position,
                      Point origin)
Called to move the window and update possible feedback. This method will move the 'preview' version of the toolbar.

Parameters:
position - offset from origin
origin - the origin of the current position of the toolbar.

floatAt

protected void floatAt(Point position,
                       Point origin)
Called when the toolbar is moved to a certain location. This method will move the toolbar itself, and decide where to dock; if possible.


getDragWindowLocation

protected Point getDragWindowLocation(ToolBarContainer tbc,
                                      Point screenPoint)
Check if toolbar can be docked. Given a toolbarContainer and a point on screen; will the toolbar at that point dock? If so then return a preview location.

Parameters:
tbc - the toolbar container where the toolbar might dock.
screenPoint - a point relative to the screen where the mouse is.
Returns:
a location for the preview screen, or null when the screenpoint is outside the tbc

createDockingListener

protected MouseInputListener createDockingListener()

floatedWindowSlot

protected void floatedWindowSlot()
Called when the toolbar was 'floated'. What is done here is that the toolbar, in an ExtraWindow, gets a listener that fires at every move. The code calls tryToDropFloatingToolbar which checks if the ExtraWindow is moved into a position where it can be dropped onto an open container.


tryToDropFloatingToolbar

protected void tryToDropFloatingToolbar(WindowDroppedEvent e)
Try to drop the floating toolbar in an existing ToolBarContainer.



Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence