@@ -22,7 +22,7 @@ public class ObjectControl {
* CpsObject to be added.
*/
public void addObject(CpsObject object) {
- String name = object.getName();
+ String name = object.getObjName();
M.getObjectsOnCanvas().add(object);
notifyObjListeners();
System.out.println("Added: " + name);
@@ -47,6 +47,18 @@ public class Model {
this.categories = categories;
}
+ public String toStringCat() {
+ String text = "";
+ for (int i = 0; i < categories.size(); i++) {
+ if (text == "") {
+ text = categories.get(i).getName();
+ } else {
+ text = text + ", " + categories.get(i).getName();
+ }
+ return text;
+
/**
* @return the objectsOnCanvas
@@ -254,7 +254,6 @@ public class GUI implements CategoryListener {
panel.add(toolBar);
toolBar.add(comboBox);
comboBox.setModel(new DefaultComboBoxModel(new String[] { "Category", "Object", "Transformer", "Switch" }));
-
// Add Button
btnAdd.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {