bibliothek.gui.dock.station.screen
Class MediumBoundaryRestriction

java.lang.Object
  extended by bibliothek.gui.dock.station.screen.AbstractBoundaryRestriction
      extended by 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

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.station.screen.BoundaryRestriction
FREE, HARD, MEDIUM
 
Constructor Summary
MediumBoundaryRestriction()
           
 
Method Summary
 Rectangle checkSize(ScreenDockWindow window)
          Checks the size and location of window
 Rectangle checkSize(ScreenDockWindow window, Rectangle target)
          Checks the size and location of window assuming that window will be give the boundaries target.
protected  Rectangle findDevice(int x, int y)
          Finds and returns the boundaries of the screen in which x/y are.
protected  Dimension getMinimumSize(ScreenDockWindow window)
          Gets the minimum size of window, the default implementation just calls ScreenDockWindow.getMinimumWindowSize(), but subclasses may override this method to use another algorithm for finding the minimum window size.
protected  Rectangle validate(ScreenDockWindow window, Rectangle target, Point center, Point search)
          Ensures that center will be in a visible part of the screen.
 
Methods inherited from class bibliothek.gui.dock.station.screen.AbstractBoundaryRestriction
check, check, getMaximumSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediumBoundaryRestriction

public MediumBoundaryRestriction()
Method Detail

checkSize

public 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 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 checked
target - the boundaries that are requested
Returns:
the boundaries to use or null if target is valid

validate

protected Rectangle validate(ScreenDockWindow window,
                             Rectangle target,
                             Point center,
                             Point search)
Ensures that center will be in a visible part of the screen.

Parameters:
window - the window whose boundaries are checked
target - the next boundaries for a window
center - the point that should remain visible
search - the point used to find the best matching screen device
Returns:
a set of boundaries that is as close to target as possible

getMinimumSize

protected Dimension getMinimumSize(ScreenDockWindow window)
Gets the minimum size of window, the default implementation just calls ScreenDockWindow.getMinimumWindowSize(), but subclasses may override this method to use another algorithm for finding the minimum window size.

Parameters:
window - the window whose minimum size is required
Returns:
the minimum size, must not be null

findDevice

protected Rectangle findDevice(int x,
                               int y)
Finds and returns the boundaries of the screen in which x/y are.

Parameters:
x - some x coordinate
y - some y coordinate
Returns:
the boundaries of the nearest screen containing x/y or null