bibliothek.gui.dock.accept
Class AbstractAcceptance

java.lang.Object
  extended by bibliothek.gui.dock.accept.AbstractAcceptance
All Implemented Interfaces:
DockAcceptance
Direct Known Subclasses:
CombinatoryAcceptance, NoStackAcceptance

public abstract class AbstractAcceptance
extends Object
implements DockAcceptance

A DockAcceptance that returns true for all cases.

Author:
Benjamin Sigg

Constructor Summary
AbstractAcceptance()
           
 
Method Summary
 boolean accept(DockStation parent, Dockable child)
          Tells whether or not child is allowed to become a real child of parent.
 boolean accept(DockStation parent, Dockable child, Dockable next)
          Tells whether child, which may be already a child of parent, and next are allowed to be combined.
 DockAcceptance andAccept(DockAcceptance other)
          Combines this acceptance with the other acceptance.
 DockAcceptance equalAccept(DockAcceptance other)
          Combines this acceptance with the other acceptance in a logical "<->" operation.
 DockAcceptance impliedAccept(DockAcceptance other)
          Combines this acceptance with the other acceptance such that the result is a logical implication of the form "other -> this".
 DockAcceptance impliesAccept(DockAcceptance other)
          Combines this acceptance with the other acceptance such that the result is a logical implication of the form "this -> other"
 DockAcceptance orAccept(DockAcceptance other)
          Combines this acceptance with the other acceptance in a logical "OR" operation.
 DockAcceptance xorAccept(DockAcceptance other)
          Combines this acceptance with the other acceptance in a logical "XOR" relation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAcceptance

public AbstractAcceptance()
Method Detail

accept

public boolean accept(DockStation parent,
                      Dockable child)
Description copied from interface: DockAcceptance
Tells whether or not child is allowed to become a real child of parent.

Specified by:
accept in interface DockAcceptance
Parameters:
parent - the future parent
child - the future child
Returns:
whether or not child and parent are allowed to be combined

accept

public boolean accept(DockStation parent,
                      Dockable child,
                      Dockable next)
Description copied from interface: DockAcceptance
Tells whether child, which may be already a child of parent, and next are allowed to be combined. The result of this combination would replace child on parent.

Specified by:
accept in interface DockAcceptance
Parameters:
parent - the future parent of the combination
child - a Dockable which may be a child of parent
next - a new Dockable
Returns:
whether the combination is allowed or not

andAccept

public DockAcceptance andAccept(DockAcceptance other)
Combines this acceptance with the other acceptance. The new acceptance returns true only if this and the other acceptance return true

Parameters:
other - A second acceptance
Returns:
An acceptance that represents a logical AND.

orAccept

public DockAcceptance orAccept(DockAcceptance other)
Combines this acceptance with the other acceptance in a logical "OR" operation.

Parameters:
other - The other acceptance
Returns:
An acceptance that returns true if this or the other acceptance returns true

xorAccept

public DockAcceptance xorAccept(DockAcceptance other)
Combines this acceptance with the other acceptance in a logical "XOR" relation.

Parameters:
other - The other acceptance
Returns:
An acceptance that returns true only if one of this and other returned true, and the other one returned false

equalAccept

public DockAcceptance equalAccept(DockAcceptance other)
Combines this acceptance with the other acceptance in a logical "<->" operation.

Parameters:
other - The other acceptance
Returns:
An acceptance that returns true if this and the other acceptance returned the same value.

impliesAccept

public DockAcceptance impliesAccept(DockAcceptance other)
Combines this acceptance with the other acceptance such that the result is a logical implication of the form "this -> other"

Parameters:
other - The other acceptance
Returns:
An acceptance that returns true if this acceptance returned false or if the other acceptance returned true

impliedAccept

public DockAcceptance impliedAccept(DockAcceptance other)
Combines this acceptance with the other acceptance such that the result is a logical implication of the form "other -> this".

Parameters:
other - The other acceptance
Returns:
An acceptance that returns true if this acceptance returned true or if the other acceptance returned false