bibliothek.gui.dock.dockable
Class DockableStateEvent

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

public class DockableStateEvent
extends Object

An event sent to the DockableStateListener.
Note: if the hierarchy changed, the flag FLAG_SHOWING 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_SHOWING
          Indicates that the Dockable was either made visible or invisible to the user
static int FLAG_VISIBILITY
          Deprecated. use FLAG_SHOWING instead of this flag. This flag will be removed in a future version.
 
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 didShowingChange()
          Tells whether the visibility of the dockable changed (whether the user can now see the docable or not).
 boolean didVisibilityChange()
          Deprecated. use didShowingChange() instead, this method will be removed in a future version
 Dockable getDockable()
          Gets the element which is affected
 int getFlags()
          Gets all the changes composed into one bit-array.
 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

@Deprecated
@Todo(compatibility=BREAK_MAJOR,
      priority=ENHANCEMENT,
      target=VERSION_1_1_3,
      description="remove this method")
public static final int FLAG_VISIBILITY
Deprecated. use FLAG_SHOWING instead of this flag. This flag will be removed in a future version.
Indicates that the Dockable was either made visible or invisible to the user

See Also:
Constant Field Values

FLAG_SHOWING

public static final int FLAG_SHOWING
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

@Deprecated
@Todo(compatibility=BREAK_MAJOR,
      priority=ENHANCEMENT,
      target=VERSION_1_1_3,
      description="remove this method")
public boolean didVisibilityChange()
Deprecated. use didShowingChange() instead, this method will be removed in a future version

Tells whether the visibility of the dockable changed.

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

didShowingChange

public boolean didShowingChange()
Tells whether the visibility of the dockable changed (whether the user can now see the docable or not).

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

didHierarchyChange

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

Returns:
whether the hierarchy changed

toString

public String toString()
Overrides:
toString in class Object