View Javadoc

1   package org.kite9.diagram.adl;
2   
3   import java.util.ArrayList;
4   import java.util.List;
5   
6   import org.kite9.diagram.position.RectangleRenderingInformation;
7   import org.kite9.diagram.position.RenderingInformation;
8   import org.kite9.diagram.primitives.AbstractLabel;
9   import org.kite9.diagram.primitives.Label;
10  
11  import com.thoughtworks.xstream.annotations.XStreamAlias;
12  import com.thoughtworks.xstream.annotations.XStreamOmitField;
13  
14  @XStreamAlias("text-line")
15  public class TextLine extends AbstractLabel implements Label {
16  
17  	private static final long serialVersionUID = -1917135065467101779L;
18  	
19  	String text;
20  
21  	public String getText() {
22  		return text;
23  	}
24  
25  	List<Symbol> symbols = new ArrayList<Symbol>();
26  
27  	public TextLine(String text) {
28  		this.text = text;
29  	}
30  	
31  	public TextLine() {
32  	}
33  	
34  	public TextLine(String text, List<Symbol> symbols) {
35  		this(text);
36  		this.symbols = symbols;
37  	}
38  
39  	public List<Symbol> getSymbols() {
40  		return symbols;
41  	}
42  
43  	public void setSymbols(List<Symbol> symbols) {
44  		this.symbols = symbols;
45  	}
46  
47  	public RenderingInformation getRenderingInformation() {
48  		if (renderingInformation == null) {
49  			renderingInformation = new RectangleRenderingInformation();
50  		}
51  		
52  		return renderingInformation;
53  	}
54  
55  	@XStreamOmitField
56  	Object parent;
57  	
58  	public void setParent(Object el) {
59  		this.parent = el;
60  	}
61  
62  	public Object getParent() {
63  		return parent;
64  	}
65  	
66  	public String toString() {
67  		return "[TL:"+text+"]";
68  	}
69  
70  	public void setText(String text) {
71  	    this.text = text;
72  	}
73  }