added send to back/bring to front

This commit is contained in:
bancika
2011-01-27 19:49:33 +00:00
parent 94f769f785
commit 9161182924
@@ -908,6 +908,7 @@ public class Presenter implements IPlugInPort {
@Override @Override
public void sendSelectionToBack() { public void sendSelectionToBack() {
LOG.info("sendSelectionToBack()"); LOG.info("sendSelectionToBack()");
Project oldProject = cloner.deepClone(currentProject);
for (IDIYComponent<?> component : selectedComponents) { for (IDIYComponent<?> component : selectedComponents) {
ComponentType componentType = ComponentProcessor.getInstance() ComponentType componentType = ComponentProcessor.getInstance()
.extractComponentTypeFrom( .extractComponentTypeFrom(
@@ -925,12 +926,18 @@ public class Presenter implements IPlugInPort {
} }
} }
} }
if (!oldProject.equals(currentProject)) {
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner
.deepClone(currentProject), "Send to Back");
projectFileManager.notifyFileChange();
messageDispatcher.dispatchMessage(EventType.REPAINT); messageDispatcher.dispatchMessage(EventType.REPAINT);
} }
}
@Override @Override
public void bringSelectionToFront() { public void bringSelectionToFront() {
LOG.info("bringSelectionToFront()"); LOG.info("bringSelectionToFront()");
Project oldProject = cloner.deepClone(currentProject);
for (IDIYComponent<?> component : selectedComponents) { for (IDIYComponent<?> component : selectedComponents) {
ComponentType componentType = ComponentProcessor.getInstance() ComponentType componentType = ComponentProcessor.getInstance()
.extractComponentTypeFrom( .extractComponentTypeFrom(
@@ -948,8 +955,13 @@ public class Presenter implements IPlugInPort {
} }
} }
} }
if (!oldProject.equals(currentProject)) {
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner
.deepClone(currentProject), "Bring to Front");
projectFileManager.notifyFileChange();
messageDispatcher.dispatchMessage(EventType.REPAINT); messageDispatcher.dispatchMessage(EventType.REPAINT);
} }
}
/** /**
* Updates the selection with the specified {@link ComponentTransferable}. * Updates the selection with the specified {@link ComponentTransferable}.