public class WindowFollowBehavior extends java.awt.event.ComponentAdapter implements Behavior
It is not recommended to use this behavior to completely lock two windows to each other as it will cause issues. Another behavior will be available later-on to provide that kind of functionality.
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Window |
attachedWindow
Window that follows another one it is attached to.
|
protected boolean |
enabled
Whether or not this behavior is enabled.
|
protected java.awt.Window |
followedWindow
Followed window.
|
protected java.awt.Point |
lastLocation
Last spotted location of the followed window.
|
| Constructor and Description |
|---|
WindowFollowBehavior(java.awt.Window attachedWindow,
java.awt.Window followedWindow) |
| Modifier and Type | Method and Description |
|---|---|
void |
componentMoved(java.awt.event.ComponentEvent e) |
void |
componentResized(java.awt.event.ComponentEvent e) |
java.awt.Window |
getAttachedWindow() |
java.awt.Window |
getFollowedWindow() |
static WindowFollowBehavior |
install(java.awt.Window attachedWindow,
java.awt.Window followedWindow)
Installs behavior to the specified component.
|
boolean |
isEnabled() |
void |
setEnabled(boolean enabled) |
static void |
uninstall(java.awt.Window attachedWindow,
java.awt.Window followedWindow)
Uninstalls behavior from the specified followed window.
|
void |
updateLastLocation() |
protected final java.awt.Window attachedWindow
protected final java.awt.Window followedWindow
protected boolean enabled
protected java.awt.Point lastLocation
public WindowFollowBehavior(java.awt.Window attachedWindow,
java.awt.Window followedWindow)
public boolean isEnabled()
public void setEnabled(boolean enabled)
public void updateLastLocation()
public java.awt.Window getAttachedWindow()
public java.awt.Window getFollowedWindow()
public void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenercomponentResized in class java.awt.event.ComponentAdapterpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenercomponentMoved in class java.awt.event.ComponentAdapterpublic static WindowFollowBehavior install(java.awt.Window attachedWindow, java.awt.Window followedWindow)
attachedWindow - window that follows another one it is attached tofollowedWindow - followed window to uninstall behavior frompublic static void uninstall(java.awt.Window attachedWindow,
java.awt.Window followedWindow)
attachedWindow - window that follows another one it is attached tofollowedWindow - followed window to uninstall behavior from