1 package org.kite9.diagram.adl; 2 3 import org.kite9.diagram.position.RectangleRenderingInformation; 4 import org.kite9.diagram.position.RenderingInformation; 5 import org.kite9.diagram.primitives.AbstractConnectedContained; 6 import org.kite9.diagram.primitives.Leaf; 7 import org.kite9.diagram.primitives.VertexOnEdge; 8 9 import com.thoughtworks.xstream.annotations.XStreamAlias; 10 import com.thoughtworks.xstream.annotations.XStreamAsAttribute; 11 12 /*** 13 * This class models the black body of the arrow, which will have links 14 * entering and leaving it. 15 * 16 * @author moffatr 17 * 18 */ 19 @XStreamAlias("arrow") 20 public class Arrow extends AbstractConnectedContained implements VertexOnEdge, Leaf { 21 22 private static final long serialVersionUID = 5054715961820271315L; 23 24 public Arrow() { 25 } 26 27 @XStreamAsAttribute 28 private String label; 29 30 public String getLabel() { 31 return label; 32 } 33 34 public void setLabel(String name) { 35 this.label = name; 36 } 37 38 39 public Arrow(String id, String label) { 40 super(id); 41 this.label = label; 42 } 43 44 public Arrow(String label) { 45 this(label, label); 46 } 47 48 public boolean hasDimension() { 49 return true; 50 } 51 52 public String toString() { 53 return "[A:"+getID()+"]"; 54 } 55 56 public RenderingInformation getRenderingInformation() { 57 if (renderingInformation==null) 58 renderingInformation = new RectangleRenderingInformation(); 59 60 return renderingInformation; 61 } 62 63 }