01: /*
02: * @(#)Edge.java 1.0 03-JUL-04
03: *
04: * Copyright (c) 2001-2004 Gaudenz Alder
05: *
06: */
07: package org.jgraph.graph;
08:
09: import java.io.Serializable;
10: import java.util.List;
11:
12: /**
13: * Defines the requirements for an object that represents an Edge in a
14: * GraphModel.
15: *
16: * @version 1.0 1/1/02
17: * @author Gaudenz Alder
18: */
19:
20: public interface Edge extends GraphCell {
21:
22: /**
23: * Returns the source of the edge.
24: */
25: Object getSource();
26:
27: /**
28: * Returns the target of the edge.
29: */
30: Object getTarget();
31:
32: /**
33: * Sets the source of the edge.
34: */
35: void setSource(Object port);
36:
37: /**
38: * Returns the target of <code>edge</code>.
39: */
40: void setTarget(Object port);
41:
42: //
43: // Routing
44: //
45:
46: public static interface Routing extends Serializable {
47:
48: public static final int NO_PREFERENCE = -1;
49:
50: /**
51: * Returns the points to be used for the edge.
52: * @param cache TODO
53: * @param edge
54: * The edge view to route the points for.
55: */
56: public List route(GraphLayoutCache cache, EdgeView edge);
57:
58: /**
59: * Returns the preferred line style for this routing. A return value of
60: * {@link #NO_PREFERENCE} means no preference.
61: */
62: public int getPreferredLineStyle(EdgeView edge);
63:
64: }
65:
66: }
|