bibliothek.gui.dock.station.screen.magnet
Interface AttractorStrategy

All Known Implementing Classes:
MultiAttractorStrategy

public interface AttractorStrategy

The AttractorStrategy is used by the MagnetController to find out whether two ScreenDockWindows are attracting each other. More than one AttractorStrategy can be used at the same time when creating a MultiAttractorStrategy.

Author:
Benjamin Sigg

Nested Class Summary
static class AttractorStrategy.Attraction
          Tells how two Dockables interact with each other.
 
Method Summary
 AttractorStrategy.Attraction attract(ScreenDockStation parent, Dockable moved, Dockable fixed)
          Called when the Dockable moved has been moved.
 AttractorStrategy.Attraction stick(ScreenDockStation parent, Dockable moved, Dockable fixed)
          Called when the Dockable moved has been moved.
 

Method Detail

attract

AttractorStrategy.Attraction attract(ScreenDockStation parent,
                                     Dockable moved,
                                     Dockable fixed)
Called when the Dockable moved has been moved. This method tells whether the unmoved Dockable fixed can attract moved. This method does not have to check the actual position or size of any Dockable, this method only has to tell whether an attraction is theoretically possible or not.

Parameters:
parent - the parent DockStation of fixed and of moved
moved - a Dockable that did change its position or size
fixed - a Dockable that did not change its position or size
See Also:
how fixed and moved interact

stick

AttractorStrategy.Attraction stick(ScreenDockStation parent,
                                   Dockable moved,
                                   Dockable fixed)
Called when the Dockable moved has been moved. This method then tells whether the unmoved Dockable fixed can stick to moved and be moved as well. This method does not need to check the actual position or size of any Dockable, this method only has to tell whether the two items could stick together. Also stickiness does not imply attraction or the other way around.

Parameters:
parent - the parent DockStation of moved and of fixed
moved - a Dockable that did change its position or size
fixed - a Dockable that did not change its position or size
See Also:
how fixed and moved interact