org.kite9.diagram.primitives
Class AbstractBiDirectional<X>

java.lang.Object
  extended by org.kite9.diagram.primitives.AbstractBiDirectional<X>
All Implemented Interfaces:
BiDirectional<X>
Direct Known Subclasses:
AbstractConnection

public abstract class AbstractBiDirectional<X>
extends Object
implements BiDirectional<X>


Field Summary
protected  Direction drawDirection
           
protected  X from
           
protected  X to
           
 
Constructor Summary
AbstractBiDirectional()
          For serialization
AbstractBiDirectional(X from, X to, Direction drawDirection)
           
 
Method Summary
 Direction getDrawDirection()
          Indicates the layout of from/to for the bi-directional item.
 Direction getDrawDirectionFrom(X end)
           
 X getFrom()
           
 X getTo()
           
 boolean meets(BiDirectional<X> e)
           
 boolean meets(X v)
           
 X otherEnd(X end)
          Returns from, if to is the argument, or to if from is the argument.
 void setDrawDirection(Direction d)
           
 void setDrawDirectionFrom(Direction d, X end)
           
 void setFrom(X v)
           
 void setTo(X v)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

from

protected X from

to

protected X to

drawDirection

@XStreamAsAttribute
protected Direction drawDirection
Constructor Detail

AbstractBiDirectional

public AbstractBiDirectional()
For serialization


AbstractBiDirectional

public AbstractBiDirectional(X from,
                             X to,
                             Direction drawDirection)
Method Detail

getDrawDirection

public Direction getDrawDirection()
Description copied from interface: BiDirectional
Indicates the layout of from/to for the bi-directional item. If this is non-null, then it is describing the single direction it needs to flow in for the diagram.

Specified by:
getDrawDirection in interface BiDirectional<X>

getFrom

public X getFrom()
Specified by:
getFrom in interface BiDirectional<X>

getTo

public X getTo()
Specified by:
getTo in interface BiDirectional<X>

setFrom

public void setFrom(X v)
Specified by:
setFrom in interface BiDirectional<X>

setTo

public void setTo(X v)
Specified by:
setTo in interface BiDirectional<X>

toString

public String toString()
Overrides:
toString in class Object

otherEnd

public X otherEnd(X end)
Description copied from interface: BiDirectional
Returns from, if to is the argument, or to if from is the argument.

Specified by:
otherEnd in interface BiDirectional<X>
Returns:

meets

public boolean meets(BiDirectional<X> e)
Specified by:
meets in interface BiDirectional<X>

meets

public boolean meets(X v)
Specified by:
meets in interface BiDirectional<X>

getDrawDirectionFrom

public Direction getDrawDirectionFrom(X end)
Specified by:
getDrawDirectionFrom in interface BiDirectional<X>

setDrawDirection

public void setDrawDirection(Direction d)
Specified by:
setDrawDirection in interface BiDirectional<X>

setDrawDirectionFrom

public void setDrawDirectionFrom(Direction d,
                                 X end)
Specified by:
setDrawDirectionFrom in interface BiDirectional<X>


Copyright © 2011. All Rights Reserved.