1 package org.ufcspa.simdecs.diagram.elements;
\r
3 import java.util.ArrayList;
\r
4 import java.util.Collection;
\r
5 import java.util.LinkedList;
\r
6 import java.util.ListIterator;
\r
7 import java.util.Locale;
\r
10 public abstract class SwimLane extends Element {
\r
12 private String name;
\r
13 private Integer age;
\r
15 private Float weight;
\r
16 private Float height;
\r
17 private LinkedList<Node> nodes;
\r
19 public SwimLane(String messageBundle, Locale locale) {
\r
20 super(messageBundle, locale);
\r
21 nodes = new LinkedList<Node>();
\r
24 public Node getNode(String id) {
\r
25 for(Node node : nodes) {
\r
26 if (node.equals(node))
\r
32 public Integer getAge() {
\r
36 public void setAge(Integer age) {
\r
40 public Float getHeight() {
\r
44 public void setHeight(Float height) {
\r
45 this.height = height;
\r
48 public String getName() {
\r
52 public void setName(String name) {
\r
56 public String getSex() {
\r
60 public void setSex(String sex) {
\r
64 public Float getWeight() {
\r
68 public void setWeight(Float weight) {
\r
69 this.weight = weight;
\r
73 private void updateImages() {
\r
74 ListIterator it = nodes.listIterator();
\r
75 while(it.hasNext()) {
\r
76 Node node = (Node) it.next();
\r
78 node.setCurrentImage(node.getImageWithLink());
\r
82 node.setCurrentImage(node.getImage());
\r
87 public void addNode(Node node) {
\r
88 if (!nodes.contains(node)) {
\r
89 node.setPosition(nodes.size()+1);
\r
90 nodes.addLast(node);
\r
96 public LinkedList<Node> getNodes() {
\r
100 public abstract String getImage();
\r
101 public abstract String getType();
\r
103 public Collection<Node> getGrantedNextNodes() {
\r
104 Collection<Node> list = new ArrayList<Node>();
\r
106 if (nodes.size()==0) {
\r
107 list.add(new Begin(getMessageBundle(), getLocale()));
\r