bibliothek.gui.dock.station.screen
Class MediumBoundaryRestriction
java.lang.Object
bibliothek.gui.dock.station.screen.AbstractBoundaryRestriction
bibliothek.gui.dock.station.screen.MediumBoundaryRestriction
- All Implemented Interfaces:
- BoundaryRestriction
public class MediumBoundaryRestriction
- extends AbstractBoundaryRestriction
A restriction that ensures that the title of each dialog is always visible.
- Author:
- Benjamin Sigg
Method Summary |
java.awt.Rectangle |
checkSize(ScreenDockWindow window)
Checks the size and location of window |
java.awt.Rectangle |
checkSize(ScreenDockWindow window,
java.awt.Rectangle target)
Checks the size and location of window assuming that window will
be give the boundaries target . |
protected java.awt.Rectangle |
findDevice(int x,
int y)
Finds and returns the boundaries of the screen in which x/y are. |
protected java.awt.Rectangle |
validate(java.awt.Rectangle target,
java.awt.Point center,
java.awt.Point search)
Ensures that center will be in a visible part of the screen. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MediumBoundaryRestriction
public MediumBoundaryRestriction()
checkSize
public java.awt.Rectangle checkSize(ScreenDockWindow window)
- Description copied from class:
AbstractBoundaryRestriction
- Checks the size and location of
window
- Specified by:
checkSize
in class AbstractBoundaryRestriction
- Parameters:
window
- the window whose boundaries are checked
- Returns:
- the new boundaries or
null
if the current boundaries of window
are valid
checkSize
public java.awt.Rectangle checkSize(ScreenDockWindow window,
java.awt.Rectangle target)
- Description copied from class:
AbstractBoundaryRestriction
- Checks the size and location of
window
assuming that window
will
be give the boundaries target
.
- Specified by:
checkSize
in class AbstractBoundaryRestriction
- Parameters:
window
- the window whose boundaries are checkedtarget
- the boundaries that are requested
- Returns:
- the boundaries to use or
null
if target
is valid
validate
protected java.awt.Rectangle validate(java.awt.Rectangle target,
java.awt.Point center,
java.awt.Point search)
- Ensures that
center
will be in a visible part of the screen.
- Parameters:
target
- the next boundaries for a windowcenter
- the point that should remain visiblesearch
- the point used to find the best matching screen device
- Returns:
- a set of boundaries that is as close to
target
as possible
findDevice
protected java.awt.Rectangle findDevice(int x,
int y)
- Finds and returns the boundaries of the screen in which
x/y
are.
- Parameters:
x
- some x coordinatey
- some y coordinate
- Returns:
- the boundaries of the nearest screen containing
x/y
or null