|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.station.screen.magnet.DefaultMagnetStrategy
public class DefaultMagnetStrategy
The DefaultMagnetStrategy is based on the DefaultMagnetOperation. It searches the nearest
attracted ScreenDockWindow to a moved side and if that other window is nearer than a given threshold
then the moved window is attracted.
| Constructor Summary | |
|---|---|
DefaultMagnetStrategy()
|
|
| Method Summary | |
|---|---|
int |
getThreshold()
Tells how many pixels two sides can be appart and still attract each other. |
void |
install(MagnetController controller)
Informs this MagnetStrategy that it will be used by controller. |
void |
setThreshold(int threshold)
Sets how many pixels two sides can be appart and still attract each other. |
MagnetOperation |
start(MagnetController controller,
MagnetRequest request)
Called by controller after a ScreenDockWindow moved or changed
its size (or both). |
void |
uninstall(MagnetController controller)
Informs this MagnetStrategy that it is no longer used by controller. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultMagnetStrategy()
| Method Detail |
|---|
public void setThreshold(int threshold)
threshold - the maximal distance, at least 1public int getThreshold()
public void install(MagnetController controller)
MagnetStrategyMagnetStrategy that it will be used by controller.
install in interface MagnetStrategycontroller - the controller using this strategy, not nullpublic void uninstall(MagnetController controller)
MagnetStrategyMagnetStrategy that it is no longer used by controller.
uninstall in interface MagnetStrategycontroller - the controller which no longer uses this strategy
public MagnetOperation start(MagnetController controller,
MagnetRequest request)
MagnetStrategycontroller after a ScreenDockWindow moved or changed
its size (or both). This method creates a new MagnetOperation which is tied to
request. The MagnetOperation will then find out which Dockable
is attracted to which other Dockable.
start in interface MagnetStrategycontroller - the caller of this method, may be used to find other ScreenDockWindowsrequest - detailed information about the event
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||