bibliothek.gui.dock.dockable
Class DockableStateEvent

java.lang.Object
  extended by bibliothek.gui.dock.dockable.DockableStateEvent

public class DockableStateEvent
extends java.lang.Object

An event sent to the DockableStateListener.
Note: if the hierarchy changed, the flag FLAG_VISIBILITY will be set correctly. All the other flags are not set.

Author:
Benjamin Sigg

Field Summary
static int FLAG_HIERARCHY
          Indicates that the parent of the Dockable has changed
static int FLAG_LOCATION_CHANGED
          Indicates that the internal location of the Dockable on its DockStation changed.
static int FLAG_PARENT_LOCATION_CHANGED
          Indicates that the internal location of one of the anchestors of the Dockable changed
static int FLAG_PARENT_SELECTION
          Indicates that the selection state of a parent of the Dockable changed
static int FLAG_SELECTION
          Indicates that the Dockable is or was selected on its parent
static int FLAG_VISIBILITY
          Indicates that the Dockable was either made visible or invisible to the user
 
Constructor Summary
DockableStateEvent(Dockable dockable, int flags)
          Creates a new event.
 
Method Summary
 boolean didHierarchyChange()
          Tells that the parent of the dockable has changed.
 boolean didLocationChange()
          Tells whether the position of the dockable on its parent changed.
 boolean didParentLocationChange()
          Tells whether the position of one of the anchestors of dockable changed.
 boolean didParentSelectionChange()
          Tells whether the selection state of a parent of the dockable changed.
 boolean didSelectionChange()
          Tells whether the selection state of the dockable on its parent changed.
 boolean didVisibilityChange()
          Tells whether the visibility of the dockable changed.
 Dockable getDockable()
          Gets the element which is affected
 int getFlags()
          Gets all the changes composed into one bit-array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FLAG_LOCATION_CHANGED

public static final int FLAG_LOCATION_CHANGED
Indicates that the internal location of the Dockable on its DockStation changed.

See Also:
Constant Field Values

FLAG_PARENT_LOCATION_CHANGED

public static final int FLAG_PARENT_LOCATION_CHANGED
Indicates that the internal location of one of the anchestors of the Dockable changed

See Also:
Constant Field Values

FLAG_VISIBILITY

public static final int FLAG_VISIBILITY
Indicates that the Dockable was either made visible or invisible to the user

See Also:
Constant Field Values

FLAG_SELECTION

public static final int FLAG_SELECTION
Indicates that the Dockable is or was selected on its parent

See Also:
Constant Field Values

FLAG_PARENT_SELECTION

public static final int FLAG_PARENT_SELECTION
Indicates that the selection state of a parent of the Dockable changed

See Also:
Constant Field Values

FLAG_HIERARCHY

public static final int FLAG_HIERARCHY
Indicates that the parent of the Dockable has changed

See Also:
Constant Field Values
Constructor Detail

DockableStateEvent

public DockableStateEvent(Dockable dockable,
                          int flags)
Creates a new event.

Parameters:
dockable - the dockables that is affected
flags - all the details about the changes
Method Detail

getDockable

public Dockable getDockable()
Gets the element which is affected

Returns:
the element, not null

getFlags

public int getFlags()
Gets all the changes composed into one bit-array.

Returns:
all the changes

didSelectionChange

public boolean didSelectionChange()
Tells whether the selection state of the dockable on its parent changed.

Returns:
whether the selection state changed

didParentSelectionChange

public boolean didParentSelectionChange()
Tells whether the selection state of a parent of the dockable changed.

Returns:
whether the selection state changed

didLocationChange

public boolean didLocationChange()
Tells whether the position of the dockable on its parent changed. This means that DockStation.getDockableProperty(Dockable, Dockable) would return another result than before.

Returns:
whether the position changed

didParentLocationChange

public boolean didParentLocationChange()
Tells whether the position of one of the anchestors of dockable changed. This event is cased if an event with didLocationChange() was found for one of the anchestors.

Returns:
whether an anchestor changed its position

didVisibilityChange

public boolean didVisibilityChange()
Tells whether the visibility of the dockable changed.

Returns:
whether the visibility changed
See Also:
Dockable.isDockableVisible()

didHierarchyChange

public boolean didHierarchyChange()
Tells that the parent of the dockable has changed.

Returns:
whether the hierarchy changed

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object