|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.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)
MagnetStrategy
MagnetStrategy
that it will be used by controller
.
install
in interface MagnetStrategy
controller
- the controller using this strategy, not null
public void uninstall(MagnetController controller)
MagnetStrategy
MagnetStrategy
that it is no longer used by controller
.
uninstall
in interface MagnetStrategy
controller
- the controller which no longer uses this strategypublic MagnetOperation start(MagnetController controller, MagnetRequest request)
MagnetStrategy
controller
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 MagnetStrategy
controller
- the caller of this method, may be used to find other ScreenDockWindow
srequest
- detailed information about the event
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |