public class MultiAttractorStrategy extends Object implements AttractorStrategy
AttractorStrategys into one strategy.AttractorStrategy.Attraction| Constructor and Description |
|---|
MultiAttractorStrategy() |
| Modifier and Type | Method and Description |
|---|---|
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. |
public void add(AttractorStrategy strategy)
strategy to the list of strategies that are used.strategy - a new strategy, must not be nullpublic void remove(AttractorStrategy strategy)
strategy from the list of strategies that are used.strategy - the strategy to removepublic AttractorStrategy.Attraction attract(ScreenDockStation parent, Dockable moved, Dockable fixed)
AttractorStrategyDockable 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.attract in interface AttractorStrategyparent - the parent DockStation of fixed and of movedmoved - a Dockable that did change its position or sizefixed - a Dockable that did not change its position or sizehow fixed and moved interactpublic AttractorStrategy.Attraction stick(ScreenDockStation parent, Dockable moved, Dockable fixed)
AttractorStrategyDockable 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.stick in interface AttractorStrategyparent - the parent DockStation of moved and of fixedmoved - a Dockable that did change its position or sizefixed - a Dockable that did not change its position or sizehow fixed and moved interactCopyright © 2017 Docking Frames. All rights reserved.