34 |
to any source code in the Content. |
to any source code in the Content. |
35 |
|
|
36 |
*/ |
*/ |
37 |
|
/** |
38 |
|
* |
39 |
|
* @author Xianfeng Liu <acp04xfl@shef.ac.uk> |
40 |
|
* |
41 |
|
* |
42 |
|
*/ |
43 |
package nongnu.cashews.eclipse.composer.model; |
package nongnu.cashews.eclipse.composer.model; |
44 |
|
|
45 |
import java.util.ArrayList; |
import java.util.ArrayList; |
75 |
NAME, |
NAME, |
76 |
"Name") }; |
"Name") }; |
77 |
} |
} |
|
|
|
78 |
// actual fields |
// actual fields |
79 |
protected Point location = new Point(0, 0); |
protected Point location = new Point(0, 0); |
80 |
|
|
81 |
protected String name = "Node"; |
protected String name = "Node"; |
82 |
|
|
83 |
protected List<Connection> outputs = new ArrayList<Connection>(5); |
protected List<ConnectionElement> outputs = new ArrayList<ConnectionElement>(5); |
84 |
|
|
85 |
protected List<Connection> inputs = new ArrayList<Connection>(5); |
protected List<ConnectionElement> inputs = new ArrayList<ConnectionElement>(5); |
86 |
|
|
87 |
public abstract String toXML(); |
public abstract String toXML(); |
88 |
|
|
112 |
return name; |
return name; |
113 |
} |
} |
114 |
|
|
115 |
public void addInput(Connection connection) |
public void addInput(ConnectionElement connection) |
116 |
{ |
{ |
117 |
inputs.add(connection); |
inputs.add(connection); |
118 |
fireStructureChange(INPUTS, connection); |
fireStructureChange(INPUTS, connection); |
119 |
} |
} |
120 |
|
|
121 |
public void addOutput(Connection connection) |
public void addOutput(ConnectionElement connection) |
122 |
{ |
{ |
123 |
outputs.add(connection); |
outputs.add(connection); |
124 |
fireStructureChange(OUTPUTS, connection); |
fireStructureChange(OUTPUTS, connection); |
134 |
return this.outputs; |
return this.outputs; |
135 |
} |
} |
136 |
|
|
137 |
public void removeInput(Connection connection) |
public void removeInput(ConnectionElement connection) |
138 |
{ |
{ |
139 |
this.inputs.remove(connection); |
this.inputs.remove(connection); |
140 |
fireStructureChange(INPUTS, connection); |
fireStructureChange(INPUTS, connection); |
141 |
} |
} |
142 |
|
|
143 |
public void removeOutput(Connection connection) |
public void removeOutput(ConnectionElement connection) |
144 |
{ |
{ |
145 |
this.outputs.remove(connection); |
this.outputs.remove(connection); |
146 |
fireStructureChange(OUTPUTS, connection); |
fireStructureChange(OUTPUTS, connection); |