improve bring to front/send to back

This commit is contained in:
bancika
2011-02-18 13:16:58 +00:00
parent d810096030
commit ac4496040f
@@ -950,9 +950,7 @@ public class Presenter implements IPlugInPort {
ComponentType componentBeforeType = ComponentProcessor.getInstance() ComponentType componentBeforeType = ComponentProcessor.getInstance()
.extractComponentTypeFrom( .extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) componentBefore.getClass()); (Class<? extends IDIYComponent<?>>) componentBefore.getClass());
if (componentType.getZOrder() == componentBeforeType.getZOrder()) { Collections.swap(currentProject.getComponents(), index, index - 1);
Collections.swap(currentProject.getComponents(), index, index - 1);
}
} }
} }
if (!oldProject.equals(currentProject)) { if (!oldProject.equals(currentProject)) {
@@ -979,9 +977,7 @@ public class Presenter implements IPlugInPort {
ComponentType componentAfterType = ComponentProcessor.getInstance() ComponentType componentAfterType = ComponentProcessor.getInstance()
.extractComponentTypeFrom( .extractComponentTypeFrom(
(Class<? extends IDIYComponent<?>>) componentAfter.getClass()); (Class<? extends IDIYComponent<?>>) componentAfter.getClass());
if (componentType.getZOrder() == componentAfterType.getZOrder()) { Collections.swap(currentProject.getComponents(), index, index + 1);
Collections.swap(currentProject.getComponents(), index, index + 1);
}
} }
} }
if (!oldProject.equals(currentProject)) { if (!oldProject.equals(currentProject)) {