bibliothek.gui.dock.station.toolbar
Class ToolbarAttractorStrategy

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.ToolbarAttractorStrategy
All Implemented Interfaces:
bibliothek.gui.dock.station.screen.magnet.AttractorStrategy

public class ToolbarAttractorStrategy
extends Object
implements bibliothek.gui.dock.station.screen.magnet.AttractorStrategy

This implementation of an AttractorStrategy reads the current ToolbarStrategy.STRATEGY and assumes that two Dockables which both are toolbar parts attract each other.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from interface bibliothek.gui.dock.station.screen.magnet.AttractorStrategy
bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction
 
Constructor Summary
ToolbarAttractorStrategy()
           
 
Method Summary
 bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction attract(bibliothek.gui.dock.ScreenDockStation parent, bibliothek.gui.Dockable moved, bibliothek.gui.Dockable fixed)
           
protected  bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction attraction(bibliothek.gui.dock.ScreenDockStation parent, bibliothek.gui.Dockable moved, bibliothek.gui.Dockable fixed)
          Calculates the result of attract(ScreenDockStation, Dockable, Dockable).
 bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction stick(bibliothek.gui.dock.ScreenDockStation parent, bibliothek.gui.Dockable moved, bibliothek.gui.Dockable fixed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolbarAttractorStrategy

public ToolbarAttractorStrategy()
Method Detail

attract

public bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction attract(bibliothek.gui.dock.ScreenDockStation parent,
                                                                                      bibliothek.gui.Dockable moved,
                                                                                      bibliothek.gui.Dockable fixed)
Specified by:
attract in interface bibliothek.gui.dock.station.screen.magnet.AttractorStrategy

stick

public bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction stick(bibliothek.gui.dock.ScreenDockStation parent,
                                                                                    bibliothek.gui.Dockable moved,
                                                                                    bibliothek.gui.Dockable fixed)
Specified by:
stick in interface bibliothek.gui.dock.station.screen.magnet.AttractorStrategy

attraction

protected bibliothek.gui.dock.station.screen.magnet.AttractorStrategy.Attraction attraction(bibliothek.gui.dock.ScreenDockStation parent,
                                                                                            bibliothek.gui.Dockable moved,
                                                                                            bibliothek.gui.Dockable fixed)
Calculates the result of attract(ScreenDockStation, Dockable, Dockable). Subclasses may use this method to calculate stick(ScreenDockStation, Dockable, Dockable) as well.

Parameters:
parent - the parent of moved and fixed
moved - the Dockable that was moved
fixed - the Dockable that was not moved
Returns:
whether the two items attract each other