1 package de.fzi.wim.guibase.graphview.graph;
2
3 /***
4 * The default implementation of the edge.
5 */
6 public class DefaultEdge implements Edge {
7 /*** The node from the edge. */
8 protected Node m_from;
9 /*** The node to the edge. */
10 protected Node m_to;
11
12 /***
13 * Creates an instance of this class.
14 *
15 * @param from the node from
16 * @param to the node to
17 */
18 public DefaultEdge(Node from,Node to) {
19 m_from=from;
20 m_to=to;
21 }
22 /***
23 * Returns the node from which this edge points.
24 *
25 * @return the node from which this edge points
26 */
27 public Node getFrom() {
28 return m_from;
29 }
30 /***
31 * Returns the node from which to edge points.
32 *
33 * @return the node to which this edge points
34 */
35 public Node getTo() {
36 return m_to;
37 }
38 /***
39 * Returns the label of this node.
40 *
41 * @return the label of the node
42 */
43 public String getLabels() {
44 return toString();
45 }
46 /***
47 * Returns the length of this edge.
48 *
49 * @return the ledge of the edge
50 */
51 public double getLength() {
52 return 40;
53 }
54 }