mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-12 02:02:16 +10:00
Select all within a layer
This commit is contained in:
Binary file not shown.
+4
-1
@@ -43,8 +43,11 @@ public interface ISelectionProcessor {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects all components in the project.
|
* 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.
|
* Rotates selection for 90 degrees.
|
||||||
|
|||||||
+14
-2
@@ -616,7 +616,7 @@ public class Presenter implements IPlugInPort {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
LOG.debug(String.format("keyPressed(%s, %s, %s, %s)", key, ctrlDown,
|
LOG.debug(String.format("keyPressed(%s, %s, %s, %s)", key, ctrlDown,
|
||||||
shiftDown, altDown));
|
shiftDown, altDown));
|
||||||
Map<IDIYComponent<?>, Set<Integer>> controlPointMap = new HashMap<IDIYComponent<?>, Set<Integer>>();
|
Map<IDIYComponent<?>, Set<Integer>> controlPointMap = new HashMap<IDIYComponent<?>, Set<Integer>>();
|
||||||
// If there aren't any control points, try to add all the selected
|
// If there aren't any control points, try to add all the selected
|
||||||
// components with all their control points. That will allow the
|
// components with all their control points. That will allow the
|
||||||
@@ -818,11 +818,23 @@ public class Presenter implements IPlugInPort {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void selectAll() {
|
public void selectAll(int layer) {
|
||||||
LOG.info("selectAll()");
|
LOG.info("selectAll()");
|
||||||
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>(
|
List<IDIYComponent<?>> newSelection = new ArrayList<IDIYComponent<?>>(
|
||||||
currentProject.getComponents());
|
currentProject.getComponents());
|
||||||
newSelection.removeAll(getLockedComponents());
|
newSelection.removeAll(getLockedComponents());
|
||||||
|
if (layer > 0) {
|
||||||
|
Iterator<IDIYComponent<?>> i = newSelection.iterator();
|
||||||
|
while (i.hasNext()) {
|
||||||
|
IDIYComponent<?> c = i.next();
|
||||||
|
ComponentType type = ComponentProcessor.getInstance()
|
||||||
|
.extractComponentTypeFrom(
|
||||||
|
(Class<? extends IDIYComponent<?>>) c
|
||||||
|
.getClass());
|
||||||
|
if ((int) type.getZOrder() != layer)
|
||||||
|
i.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
updateSelection(newSelection);
|
updateSelection(newSelection);
|
||||||
// messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED,
|
// messageDispatcher.dispatchMessage(EventType.SELECTION_CHANGED,
|
||||||
// selectedComponents);
|
// selectedComponents);
|
||||||
|
|||||||
Reference in New Issue
Block a user