bibliothek.gui.dock.station.screen.window
Class WindowConfiguration

java.lang.Object
  extended by bibliothek.gui.dock.station.screen.window.WindowConfiguration

public class WindowConfiguration
extends Object

A WindowConfiguration describes some general aspects of a ScreenDockWindow. It is used during creation of a window (ScreenDockWindowFactory.createWindow(bibliothek.gui.dock.ScreenDockStation, WindowConfiguration)), and by the ScreenDockStation itself during drag and drop operations.

Author:
Benjamin Sigg

Constructor Summary
WindowConfiguration()
           
 
Method Summary
 ScreenDockWindowBorderFactory getBorderFactory()
          Gets the current factory for creating the border of the window.
 ScreenWindowShape getShape()
          Tells which parts of the ScreenDockWindow are visible.
 boolean isAllowDragAndDropOnTitle()
          Tells whether a drag and drop operation starts whenever possible, only has an effect if isMoveOnTitleGrab() is true.
 boolean isMoveOnBorder()
          Tells whether moving the window is possible by grabbing the border.
 boolean isMoveOnTitleGrab()
          Tells whether the window should move if the title is dragged by the mouse.
 boolean isResetOnDropable()
          Tells whether a window jumps back to its starting position.
 boolean isResizeable()
          Tells whether the user can resize the window.
 boolean isTransparent()
          Tells whether the window is transparent.
 void setAllowDragAndDropOnTitle(boolean allowDragAndDropOnTitle)
          Sets whether a drag and drop operation starts if the mouse is over an area where drag and drop would be possible.
 void setBorderFactory(ScreenDockWindowBorderFactory borderFactory)
          Sets a factory which might be used to create a border for the new window.
 void setMoveOnBorder(boolean moveOnBorder)
          Sets whether moving the window is possible by grabbing the border.
 void setMoveOnTitleGrab(boolean moveOnTitleGrab)
          Sets whether the window should move if the title is dragged by the mouse.
 void setResetOnDropable(boolean resetOnDropable)
          Sets whether a window jumps back into its starting position if dropping is possible, only has an effect if isMoveOnTitleGrab() and isAllowDragAndDropOnTitle() return true.
 void setResizeable(boolean resizeable)
          Sets whether the user can resize the window.
 void setShape(ScreenWindowShape shape)
          Tells which parts of the window are visible.
 void setTransparent(boolean transparent)
          Tells whether the window is transparent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowConfiguration

public WindowConfiguration()
Method Detail

setMoveOnTitleGrab

public void setMoveOnTitleGrab(boolean moveOnTitleGrab)
Sets whether the window should move if the title is dragged by the mouse.

Parameters:
moveOnTitleGrab - whether the window should move

isMoveOnTitleGrab

public boolean isMoveOnTitleGrab()
Tells whether the window should move if the title is dragged by the mouse.

Returns:
true if the entire window should move

setMoveOnBorder

public void setMoveOnBorder(boolean moveOnBorder)
Sets whether moving the window is possible by grabbing the border.

Parameters:
moveOnBorder - whether moving the window is possible

isMoveOnBorder

public boolean isMoveOnBorder()
Tells whether moving the window is possible by grabbing the border.

Returns:
whether the border can be grabbed

setAllowDragAndDropOnTitle

public void setAllowDragAndDropOnTitle(boolean allowDragAndDropOnTitle)
Sets whether a drag and drop operation starts if the mouse is over an area where drag and drop would be possible. This setting only has an effect if isMoveOnTitleGrab() returns true.

Parameters:
allowDragAndDropOnTitle - whether drag and drop should be possible even if the window is already moved around

isAllowDragAndDropOnTitle

public boolean isAllowDragAndDropOnTitle()
Tells whether a drag and drop operation starts whenever possible, only has an effect if isMoveOnTitleGrab() is true.

Returns:
whether the operation starts
See Also:
setAllowDragAndDropOnTitle(boolean)

setResetOnDropable

public void setResetOnDropable(boolean resetOnDropable)
Sets whether a window jumps back into its starting position if dropping is possible, only has an effect if isMoveOnTitleGrab() and isAllowDragAndDropOnTitle() return true.

Parameters:
resetOnDropable - whether the window jumps back to its original position

isResetOnDropable

public boolean isResetOnDropable()
Tells whether a window jumps back to its starting position.

Returns:
whether the window jumps back
See Also:
setResetOnDropable(boolean)

setResizeable

public void setResizeable(boolean resizeable)
Sets whether the user can resize the window. Otherwise the window will always have the preferred size of its children Components.

Parameters:
resizeable - whether the user can resize the window

isResizeable

public boolean isResizeable()
Tells whether the user can resize the window.

Returns:
whether the window is resizeable
See Also:
setResizeable(boolean)

setTransparent

public void setTransparent(boolean transparent)
Tells whether the window is transparent. Whether transparency affects decorations such as a Border depends on the ScreenDockWindow itself.
Note that either transparency or shape of a window can be set, but not both at the same time. If both are set, then transparency is considered to be more important, and the shape is used as fallback.

Parameters:
transparent - whether the window is transparent

isTransparent

public boolean isTransparent()
Tells whether the window is transparent.

Returns:
whether the window is transparent
See Also:
setTransparent(boolean)

setShape

public void setShape(ScreenWindowShape shape)
Tells which parts of the window are visible. A value of null indicates that the entire window should be visible. Note that either transparency or shape of a window can be set, but not both at the same time. If both are set, then transparency is considered to be more important, and the shape is used as fallback.

Parameters:
shape - the shape of the window, or null

getShape

public ScreenWindowShape getShape()
Tells which parts of the ScreenDockWindow are visible.

Returns:
the visible part of the window, can be null

setBorderFactory

public void setBorderFactory(ScreenDockWindowBorderFactory borderFactory)
Sets a factory which might be used to create a border for the new window. There is no guarantee that the border is actually created, most windows will not create a window if isResizeable() returns false.

Parameters:
borderFactory - the factory or null if no border should be created

getBorderFactory

public ScreenDockWindowBorderFactory getBorderFactory()
Gets the current factory for creating the border of the window.

Returns:
the current factory, can be null
See Also:
setBorderFactory(ScreenDockWindowBorderFactory)