bibliothek.gui.dock.station.screen.magnet
Class MultiAttractorStrategy

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

public class MultiAttractorStrategy
extends Object
implements AttractorStrategy

A combination of several AttractorStrategys into one strategy.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from interface bibliothek.gui.dock.station.screen.magnet.AttractorStrategy
AttractorStrategy.Attraction
 
Constructor Summary
MultiAttractorStrategy()
           
 
Method Summary
 void add(AttractorStrategy strategy)
          Adds strategy to the list of strategies that are used.
 AttractorStrategy.Attraction attract(ScreenDockStation parent, Dockable moved, Dockable fixed)
          Called when the Dockable moved has been moved.
 void remove(AttractorStrategy strategy)
          Removes strategy from the list of strategies that are used.
 AttractorStrategy.Attraction stick(ScreenDockStation parent, Dockable moved, Dockable fixed)
          Called when the Dockable moved has been moved.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiAttractorStrategy

public MultiAttractorStrategy()
Method Detail

add

public void add(AttractorStrategy strategy)
Adds strategy to the list of strategies that are used.

Parameters:
strategy - a new strategy, must not be null

remove

public void remove(AttractorStrategy strategy)
Removes strategy from the list of strategies that are used.

Parameters:
strategy - the strategy to remove

attract

public AttractorStrategy.Attraction attract(ScreenDockStation parent,
                                            Dockable moved,
                                            Dockable fixed)
Description copied from interface: AttractorStrategy
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.

Specified by:
attract in interface AttractorStrategy
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

public AttractorStrategy.Attraction stick(ScreenDockStation parent,
                                          Dockable moved,
                                          Dockable fixed)
Description copied from interface: AttractorStrategy
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.

Specified by:
stick in interface AttractorStrategy
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