public class SimpleBend extends Object implements IBend
IBend
interface that can be used stand-alone.
Note that this class is not the one used as the default implementation of a DefaultGraph
's IBend
s and
casting them to SimpleBend
will fail. Instances of this class can be used without an accompanying graph
instance. All of the properties are mutable. An example of a possible use case would be the rendering of a SimpleEdge
with bends into a graphics context: Simply create two SimpleNode
s, a SimpleEdge
to connect the two nodes
and add instances of this class to the edge's Bends
model. Then render the edge.
Constructor and Description |
---|
SimpleBend(IEdge owner,
IPoint location)
Initializes a new instance of the
SimpleBend class using the given owner and location. |
Modifier and Type | Method and Description |
---|---|
IPoint |
getLocation()
Gets the location of this bend.
|
ILookup |
getLookupImplementation()
Gets the
ILookup implementation used for calls to lookup(Class) on this instance. |
IEdge |
getOwner()
Returns the edge this bend instance belongs to.
|
Object |
getTag()
Gets the tag associated with this instance.
|
double |
getX()
Gets the current x coordinate of this bend.
|
double |
getY()
Gets the current y coordinate of this bend.
|
<TLookup> TLookup |
lookup(Class<TLookup> type)
Returns an instance that implements the given type or
null . |
void |
setLocation(IPoint value)
Sets the location of this bend.
|
void |
setLookupImplementation(ILookup value)
Sets the
ILookup implementation used for calls to lookup(Class) on this instance. |
void |
setOwner(IEdge value)
Returns the edge this bend instance belongs to.
|
void |
setTag(Object value)
Sets the tag associated with this instance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookup
public SimpleBend(IEdge owner, IPoint location)
SimpleBend
class using the given owner and location.owner
- The owner of the bend.location
- The bend's location.public final IPoint getLocation()
getLocation
in interface IBend
getX()
,
getY()
,
setLocation(IPoint)
public final ILookup getLookupImplementation()
ILookup
implementation used for calls to lookup(Class)
on this instance.setLookupImplementation(ILookup)
public final IEdge getOwner()
IBend
This implies that Owner.Bends
contains this instance.
public final Object getTag()
ITagOwner
The implementation itself does not normally depend on the tag associated with it. It serves as storage for the object only.
getTag
in interface ITagOwner
ITagOwner.setTag(Object)
public final double getX()
This delegates to the Location
instance.
Location
.Xpublic final double getY()
This delegates to the Location
instance.
Location
.Ypublic <TLookup> TLookup lookup(Class<TLookup> type)
ILookup
null
.
Typically, this method will be called in order to obtain a different view or
aspect of the current instance. This is quite similar to casting or using
a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. An instance implementing this method is not
required to return non-null
implementations for the types, nor does it
have to return the same instance any time. Also it depends on the
type and context whether the instance returned stays up to date or needs to
be reobtained for subsequent use.public final void setLocation(IPoint value)
value
- The Location to set.getX()
,
getY()
,
getLocation()
public final void setLookupImplementation(ILookup value)
ILookup
implementation used for calls to lookup(Class)
on this instance.value
- The LookupImplementation to set.getLookupImplementation()
public final void setOwner(IEdge value)
This implies that Owner.Bends
contains this instance.
value
- The Owner to set.getOwner()
public final void setTag(Object value)
ITagOwner
The implementation itself does not normally depend on the tag associated with it. It serves as storage for the object only.
setTag
in interface ITagOwner
value
- The user object associated with this instance.ITagOwner.getTag()