mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
improve duplication
This commit is contained in:
@@ -1410,6 +1410,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
instantiationManager.getFirstControlPoint());
|
instantiationManager.getFirstControlPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public void duplicateSelection() {
|
public void duplicateSelection() {
|
||||||
LOG.info("duplicateSelection()");
|
LOG.info("duplicateSelection()");
|
||||||
@@ -1424,6 +1425,10 @@ public class Presenter implements IPlugInPort {
|
|||||||
for (IDIYComponent<?> component : this.selectedComponents) {
|
for (IDIYComponent<?> component : this.selectedComponents) {
|
||||||
try {
|
try {
|
||||||
IDIYComponent<?> cloned = component.clone();
|
IDIYComponent<?> cloned = component.clone();
|
||||||
|
ComponentType componentType =
|
||||||
|
ComponentProcessor.getInstance().extractComponentTypeFrom(
|
||||||
|
(Class<? extends IDIYComponent<?>>) cloned.getClass());
|
||||||
|
cloned.setName(instantiationManager.createUniqueName(componentType, currentProject.getComponents()));
|
||||||
newSelection.add(cloned);
|
newSelection.add(cloned);
|
||||||
for (int i = 0; i < component.getControlPointCount(); i++) {
|
for (int i = 0; i < component.getControlPointCount(); i++) {
|
||||||
Point p = component.getControlPoint(i);
|
Point p = component.getControlPoint(i);
|
||||||
|
|||||||
Reference in New Issue
Block a user