Browse Source

toString for Categories

Edgardo Palza 8 years ago
parent
commit
47a35fc0b5

BIN
bin/ui/controller/ObjectControl.class


BIN
bin/ui/model/Model.class


BIN
bin/ui/view/GUI$3.class


BIN
bin/ui/view/GUI$4.class


BIN
bin/ui/view/GUI$5.class


BIN
bin/ui/view/GUI$6.class


BIN
bin/ui/view/GUI.class


+ 1 - 1
src/ui/controller/ObjectControl.java

@@ -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);

+ 12 - 0
src/ui/model/Model.java

@@ -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
 	 */

+ 0 - 1
src/ui/view/GUI.java

@@ -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) {