diff --git a/ diy-layout-creator --username bancika@gmail.com/diylc-core/library/main.jar b/ diy-layout-creator --username bancika@gmail.com/diylc-core/library/main.jar index 270329fb..ad37f99a 100644 Binary files a/ diy-layout-creator --username bancika@gmail.com/diylc-core/library/main.jar and b/ diy-layout-creator --username bancika@gmail.com/diylc-core/library/main.jar differ diff --git a/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/common/ISelectionProcessor.java b/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/common/ISelectionProcessor.java index 5a332b2e..1659e873 100644 --- a/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/common/ISelectionProcessor.java +++ b/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/common/ISelectionProcessor.java @@ -43,8 +43,11 @@ public interface ISelectionProcessor { /** * Selects all components in the project. + * + * @param int layer if > 0, designates which layer to select. If <= 0 we + * should select all regardless of layer */ - void selectAll(); + void selectAll(int layer); /** * Rotates selection for 90 degrees. diff --git a/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/presenter/Presenter.java b/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/presenter/Presenter.java index 8a494d18..28811558 100644 --- a/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/presenter/Presenter.java +++ b/ diy-layout-creator --username bancika@gmail.com/diylc-core/src/org/diylc/presenter/Presenter.java @@ -616,7 +616,7 @@ public class Presenter implements IPlugInPort { return false; } LOG.debug(String.format("keyPressed(%s, %s, %s, %s)", key, ctrlDown, - shiftDown, altDown)); + shiftDown, altDown)); Map, Set> controlPointMap = new HashMap, Set>(); // If there aren't any control points, try to add all the selected // components with all their control points. That will allow the @@ -818,11 +818,23 @@ public class Presenter implements IPlugInPort { } @Override - public void selectAll() { + public void selectAll(int layer) { LOG.info("selectAll()"); List> newSelection = new ArrayList>( currentProject.getComponents()); newSelection.removeAll(getLockedComponents()); + if (layer > 0) { + Iterator> i = newSelection.iterator(); + while (i.hasNext()) { + IDIYComponent c = i.next(); + ComponentType type = ComponentProcessor.getInstance() + .extractComponentTypeFrom( + (Class>) c + .getClass()); + if ((int) type.getZOrder() != layer) + i.remove(); + } + } updateSelection(newSelection); // messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED, // selectedComponents);