mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
improve bring to front/send to back
This commit is contained in:
-4
@@ -950,11 +950,9 @@ 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)) {
|
||||||
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner
|
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner
|
||||||
.deepClone(currentProject), "Send to Back");
|
.deepClone(currentProject), "Send to Back");
|
||||||
@@ -979,11 +977,9 @@ 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)) {
|
||||||
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner
|
messageDispatcher.dispatchMessage(EventType.PROJECT_MODIFIED, oldProject, cloner
|
||||||
.deepClone(currentProject), "Bring to Front");
|
.deepClone(currentProject), "Bring to Front");
|
||||||
|
|||||||
Reference in New Issue
Block a user