bibliothek.gui.dock.station.screen
Class AbstractBoundaryRestriction

java.lang.Object
  extended by bibliothek.gui.dock.station.screen.AbstractBoundaryRestriction
All Implemented Interfaces:
BoundaryRestriction
Direct Known Subclasses:
HardBoundaryRestriction, MediumBoundaryRestriction

public abstract class AbstractBoundaryRestriction
extends Object
implements BoundaryRestriction

This abstract class offers methods to ensure a reasonable maximum size for ScreenDockWindows.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.station.screen.BoundaryRestriction
FREE, HARD, MEDIUM
 
Constructor Summary
AbstractBoundaryRestriction()
           
 
Method Summary
 Rectangle check(ScreenDockWindow window)
          Calculates the bounds which window can have.
 Rectangle check(ScreenDockWindow window, Rectangle target)
          Calculates the bounds which window can have.
protected abstract  Rectangle checkSize(ScreenDockWindow window)
          Checks the size and location of window
protected abstract  Rectangle checkSize(ScreenDockWindow window, Rectangle target)
          Checks the size and location of window assuming that window will be give the boundaries target.
protected  Dimension getMaximumSize(ScreenDockWindow window)
          Finds the maximum size that window is allowed to have.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBoundaryRestriction

public AbstractBoundaryRestriction()
Method Detail

check

public Rectangle check(ScreenDockWindow window)
Description copied from interface: BoundaryRestriction
Calculates the bounds which window can have.

Specified by:
check in interface BoundaryRestriction
Parameters:
window - the window whose bounds should be checked.
Returns:
the new boundaries of window, can be null to indicate that the current boundaries are valid.

check

public Rectangle check(ScreenDockWindow window,
                       Rectangle target)
Description copied from interface: BoundaryRestriction
Calculates the bounds which window can have.

Specified by:
check in interface BoundaryRestriction
Parameters:
window - the window whose future bounds should be checked.
target - the bounds window should have, this method should not write into target.
Returns:
the new boundaries, null to indicate that target is valid.

checkSize

protected abstract Rectangle checkSize(ScreenDockWindow window)
Checks the size and location of window

Parameters:
window - the window whose boundaries are checked
Returns:
the new boundaries or null if the current boundaries of window are valid

checkSize

protected abstract Rectangle checkSize(ScreenDockWindow window,
                                       Rectangle target)
Checks the size and location of window assuming that window will be give the boundaries target.

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

getMaximumSize

protected Dimension getMaximumSize(ScreenDockWindow window)
Finds the maximum size that window is allowed to have.

Parameters:
window - the window whose maximum size is searched
Returns:
the maximum size