mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 09:12:09 +10:00
improve bring to front/back
This commit is contained in:
@@ -1536,18 +1536,20 @@ public class Presenter implements IPlugInPort {
|
|||||||
} else
|
} else
|
||||||
while (index > 0) {
|
while (index > 0) {
|
||||||
IDIYComponent<?> componentBefore = currentProject.getComponents().get(index - 1);
|
IDIYComponent<?> componentBefore = currentProject.getComponents().get(index - 1);
|
||||||
ComponentType componentBeforeType =
|
if (!selectedComponents.contains(componentBefore)) {
|
||||||
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
ComponentType componentBeforeType =
|
||||||
(Class<? extends IDIYComponent<?>>) componentBefore.getClass());
|
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
||||||
if (!componentType.isFlexibleZOrder()
|
(Class<? extends IDIYComponent<?>>) componentBefore.getClass());
|
||||||
&& Math.round(componentBeforeType.getZOrder()) < Math.round(componentType.getZOrder())
|
if (!componentType.isFlexibleZOrder()
|
||||||
&& forceConfirmation != IView.YES_OPTION
|
&& Math.round(componentBeforeType.getZOrder()) < Math.round(componentType.getZOrder())
|
||||||
&& (forceConfirmation =
|
&& forceConfirmation != IView.YES_OPTION
|
||||||
this.view
|
&& (forceConfirmation =
|
||||||
.showConfirmDialog(
|
this.view
|
||||||
"Selected component(s) have reached the bottom of their layer. Do you want to force the selection to the back?",
|
.showConfirmDialog(
|
||||||
"Send Selection to Back", IView.YES_NO_OPTION, IView.QUESTION_MESSAGE)) != IView.YES_OPTION)
|
"Selected component(s) have reached the bottom of their layer. Do you want to force the selection to the back?",
|
||||||
break;
|
"Send Selection to Back", IView.YES_NO_OPTION, IView.QUESTION_MESSAGE)) != IView.YES_OPTION)
|
||||||
|
break;
|
||||||
|
}
|
||||||
Collections.swap(currentProject.getComponents(), index, index - 1);
|
Collections.swap(currentProject.getComponents(), index, index - 1);
|
||||||
index--;
|
index--;
|
||||||
}
|
}
|
||||||
@@ -1587,18 +1589,20 @@ public class Presenter implements IPlugInPort {
|
|||||||
} else
|
} else
|
||||||
while (index < currentProject.getComponents().size() - 1) {
|
while (index < currentProject.getComponents().size() - 1) {
|
||||||
IDIYComponent<?> componentAfter = currentProject.getComponents().get(index + 1);
|
IDIYComponent<?> componentAfter = currentProject.getComponents().get(index + 1);
|
||||||
ComponentType componentAfterType =
|
if (!selectedComponents.contains(componentAfter)) {
|
||||||
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
ComponentType componentAfterType =
|
||||||
(Class<? extends IDIYComponent<?>>) componentAfter.getClass());
|
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
||||||
if (!componentType.isFlexibleZOrder()
|
(Class<? extends IDIYComponent<?>>) componentAfter.getClass());
|
||||||
&& Math.round(componentAfterType.getZOrder()) > Math.round(componentType.getZOrder())
|
if (!componentType.isFlexibleZOrder()
|
||||||
&& forceConfirmation != IView.YES_OPTION
|
&& Math.round(componentAfterType.getZOrder()) > Math.round(componentType.getZOrder())
|
||||||
&& (forceConfirmation =
|
&& forceConfirmation != IView.YES_OPTION
|
||||||
this.view
|
&& (forceConfirmation =
|
||||||
.showConfirmDialog(
|
this.view
|
||||||
"Selected component(s) have reached the bottom of their layer. Do you want to force the selection to the back?",
|
.showConfirmDialog(
|
||||||
"Send Selection to Back", IView.YES_NO_OPTION, IView.QUESTION_MESSAGE)) != IView.YES_OPTION)
|
"Selected component(s) have reached the bottom of their layer. Do you want to force the selection to the back?",
|
||||||
break;
|
"Send Selection to Back", IView.YES_NO_OPTION, IView.QUESTION_MESSAGE)) != IView.YES_OPTION)
|
||||||
|
break;
|
||||||
|
}
|
||||||
Collections.swap(currentProject.getComponents(), index, index + 1);
|
Collections.swap(currentProject.getComponents(), index, index + 1);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1768,7 +1768,7 @@
|
|||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>NEW_FEATURE</changeType>
|
<changeType>NEW_FEATURE</changeType>
|
||||||
<description>Ability to force components to the front or back of other components even outisde their designated layer</description>
|
<description>Ability to force components to the front or back of other components even outisde their designated layers, allowing placing components or jumpers below boards, etc.</description>
|
||||||
</org.diylc.appframework.update.Change>
|
</org.diylc.appframework.update.Change>
|
||||||
<org.diylc.appframework.update.Change>
|
<org.diylc.appframework.update.Change>
|
||||||
<changeType>IMPROVEMENT</changeType>
|
<changeType>IMPROVEMENT</changeType>
|
||||||
|
|||||||
Reference in New Issue
Block a user