From 0c92d76d9913ef43000d0e6582468eebb76551d3 Mon Sep 17 00:00:00 2001 From: bancika Date: Thu, 20 Jan 2011 21:24:07 +0000 Subject: [PATCH] changed status text formatting --- .../diylc/plugins/statusbar/StatusBar.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/plugins/statusbar/StatusBar.java b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/plugins/statusbar/StatusBar.java index 2c4ad1ff..367e269b 100644 --- a/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/plugins/statusbar/StatusBar.java +++ b/ diy-layout-creator --username bancika@gmail.com/DIYLC/src/org/diylc/plugins/statusbar/StatusBar.java @@ -31,7 +31,6 @@ import org.diylc.common.EventType; import org.diylc.common.IPlugIn; import org.diylc.common.IPlugInPort; import org.diylc.core.IDIYComponent; -import org.diylc.presenter.ComparatorFactory; import org.diylc.presenter.Presenter; import com.diyfever.gui.MemoryBar; @@ -58,7 +57,7 @@ public class StatusBar extends JPanel implements IPlugIn { // State variables private ComponentType componentSlot; private Point controlPointSlot; - private List> componentsUnderCursor; + private List componentNamesUnderCursor; private List selectedComponentNames; private List stuckComponentNames; @@ -233,10 +232,12 @@ public class StatusBar extends JPanel implements IPlugIn { refreshStatusText(); break; case AVAILABLE_CTRL_POINTS_CHANGED: - componentsUnderCursor = new ArrayList>( - ((Map, Integer>) params[0]).keySet()); - Collections.sort(componentsUnderCursor, ComparatorFactory.getInstance() - .getComponentNameComparator()); + componentNamesUnderCursor = new ArrayList(); + for (IDIYComponent component : ((Map, Integer>) params[0]).keySet()) { + componentNamesUnderCursor.add("" + component.getName() + + ""); + } + Collections.sort(componentNamesUnderCursor); refreshStatusText(); break; } @@ -245,9 +246,9 @@ public class StatusBar extends JPanel implements IPlugIn { private void refreshStatusText() { String statusText = ""; if (componentSlot == null) { - if (componentsUnderCursor != null && !componentsUnderCursor.isEmpty()) { - String formattedNames = Utils.toCommaString(componentsUnderCursor); - statusText = "Drag control point(s) of " + formattedNames; + if (componentNamesUnderCursor != null && !componentNamesUnderCursor.isEmpty()) { + String formattedNames = Utils.toCommaString(componentNamesUnderCursor); + statusText = "Drag control point(s) of " + formattedNames + ""; } else if (selectedComponentNames != null && !selectedComponentNames.isEmpty()) { StringBuilder builder = new StringBuilder(); builder.append(Utils.toCommaString(selectedComponentNames));