1 package org.kite9.diagram.adl;
2
3 import org.kite9.diagram.position.Direction;
4 import org.kite9.diagram.primitives.AbstractConnection;
5 import org.kite9.diagram.primitives.Connected;
6 import org.kite9.diagram.primitives.Label;
7
8 import com.thoughtworks.xstream.annotations.XStreamAlias;
9
10
11 /***
12 * Joins glyphs and arrows to one another.
13 * Can have text attached to the 'to' end, and decoration at the 'to' end
14 *
15 * Set the drawDirection if the rendering system should draw the link in a particular orientation on the
16 * diagram.
17 *
18 * @author robmoffat
19 *
20 */
21 @XStreamAlias("link")
22 public class Link extends AbstractConnection {
23
24 private static final long serialVersionUID = -5950978530304852748L;
25
26 public Link() {
27 }
28
29 public Link(Connected from, Connected to) {
30 super(from, to, null, null, null, null, null);
31 }
32
33 public Link(Connected from, Connected to, LinkEndStyle fromStyle, Label fromLabel, LinkEndStyle toEndStyle, Label toLabel) {
34 this(from, to, fromStyle, fromLabel, toEndStyle, toLabel, null);
35 }
36
37 @Deprecated
38 public Link(Connected from, Connected to, LinkEndStyle toEndStyle, String toTextStr, Direction drawDirection) {
39 this(from, to, null, null, toEndStyle, null, drawDirection);
40 if (toTextStr!=null) {
41 TextLine tl = new TextLine(toTextStr);
42 tl.setParent(this);
43 this.toLabel = tl;
44 }
45 this.drawDirection = drawDirection;
46 }
47
48 public Link(Connected from, Connected to, LinkEndStyle fromStyle, Label fromLabel, LinkEndStyle toEndStyle, Label toLabel, Direction drawDirection) {
49 super(from, to, drawDirection, fromStyle, fromLabel, toEndStyle, toLabel);
50 }
51
52 }