bibliothek.gui.dock.station.screen
Class HardBoundaryRestriction
java.lang.Object
bibliothek.gui.dock.station.screen.AbstractBoundaryRestriction
bibliothek.gui.dock.station.screen.HardBoundaryRestriction
- All Implemented Interfaces:
- BoundaryRestriction
public class HardBoundaryRestriction
- extends AbstractBoundaryRestriction
A restriction that ensures that each dialog is always visible on exactly one
screen.
- Author:
- Benjamin Sigg
Method Summary |
protected Rectangle |
boundsInDevice(ScreenDockWindow window,
int x,
int y,
int width,
int height,
GraphicsDevice device)
Calculates size and location of dialog such that it is
in device . |
protected Rectangle |
checkSize(ScreenDockWindow window)
Checks the size and location of window |
protected Rectangle |
checkSize(ScreenDockWindow window,
Rectangle target)
Checks the size and location of window assuming that window will
be give the boundaries target . |
protected double |
measureBounds(ScreenDockWindow window,
int x,
int y,
int width,
int height,
GraphicsDevice device)
Checks how good window fits into the screen device |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HardBoundaryRestriction
public HardBoundaryRestriction()
checkSize
protected 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
protected Rectangle checkSize(ScreenDockWindow window,
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
measureBounds
protected double measureBounds(ScreenDockWindow window,
int x,
int y,
int width,
int height,
GraphicsDevice device)
- Checks how good
window
fits into the screen device
- Parameters:
window
- the window that is checkedx
- the desired x-coordinatey
- the desired y-coordinatewidth
- the desired widthheight
- the desired heightdevice
- the targeted screen
- Returns:
- a value between 0 and 1, where 0 means "does not fit" and
1 means "perfect".
boundsInDevice
protected Rectangle boundsInDevice(ScreenDockWindow window,
int x,
int y,
int width,
int height,
GraphicsDevice device)
- Calculates size and location of
dialog
such that it is
in device
.
- Parameters:
window
- the window to checkx
- the desired x-coordinatey
- the desired y-coordinatewidth
- the desired widthheight
- the desired heightdevice
- the screen in which to show this dialog
- Returns:
- the new bounds, can be
null