org.jgraph.graph

Class DefaultEdge

Implemented Interfaces:
Cloneable, Edge, GraphCell

public class DefaultEdge
extends DefaultGraphCell
implements Edge

A simple implementation for an edge.

Nested Class Summary

static class
DefaultEdge.DefaultRouting
static class
DefaultEdge.LoopRouting

Field Summary

protected Object
source
Source and target of the edge.
protected Object
target
Source and target of the edge.

Fields inherited from class org.jgraph.graph.DefaultGraphCell

attributes

Constructor Summary

DefaultEdge()
Constructs an empty edge.
DefaultEdge(Object userObject)
Constructs an edge that holds a reference to the specified user object.
DefaultEdge(Object userObject, AttributeMap storageMap)
Constructs an edge that holds a reference to the specified user object and sets default values for points and the label position.

Method Summary

Object
clone()
Create a clone of the cell.
Object
getSource()
Returns the source of the edge.
Object
getTarget()
Returns the target of the edge.
void
setSource(Object port)
Sets the source of the edge.
void
setTarget(Object port)
Returns the target of edge.

Methods inherited from class org.jgraph.graph.DefaultGraphCell

addPort, addPort, addPort, changeAttributes, clone, getAttributes, getChildren, setAttributes

Field Details

source

protected Object source
Source and target of the edge.

target

protected Object target
Source and target of the edge.

Constructor Details

DefaultEdge

public DefaultEdge()
Constructs an empty edge.

DefaultEdge

public DefaultEdge(Object userObject)
Constructs an edge that holds a reference to the specified user object.
Parameters:
userObject - reference to the user object

DefaultEdge

public DefaultEdge(Object userObject,
                   AttributeMap storageMap)
Constructs an edge that holds a reference to the specified user object and sets default values for points and the label position.
Parameters:
userObject - reference to the user object

Method Details

clone

public Object clone()
Create a clone of the cell. The cloning of the user object is deferred to the cloneUserObject() method. The source and target references are set to null.
Overrides:
clone in interface DefaultGraphCell
Returns:
Object a clone of this object.

getSource

public Object getSource()
Returns the source of the edge.
Specified by:
getSource in interface Edge

getTarget

public Object getTarget()
Returns the target of the edge.
Specified by:
getTarget in interface Edge

setSource

public void setSource(Object port)
Sets the source of the edge.
Specified by:
setSource in interface Edge

setTarget

public void setTarget(Object port)
Returns the target of edge.
Specified by:
setTarget in interface Edge

Copyright (C) 2001-2006 Gaudenz Alder. All rights reserved.