mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Select all within a layer
This commit is contained in:
Binary file not shown.
Binary file not shown.
+2
-2
@@ -340,7 +340,7 @@ public class ActionFactory {
|
|||||||
.getCurrentProject().getComponents());
|
.getCurrentProject().getComponents());
|
||||||
// Cleanup components in the temp presenter, don't need
|
// Cleanup components in the temp presenter, don't need
|
||||||
// them anymore
|
// them anymore
|
||||||
presenter.selectAll();
|
presenter.selectAll(0);
|
||||||
presenter.deleteSelectedComponents();
|
presenter.deleteSelectedComponents();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -776,7 +776,7 @@ public class ActionFactory {
|
|||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
LOG.info("Select All triggered");
|
LOG.info("Select All triggered");
|
||||||
plugInPort.selectAll();
|
plugInPort.selectAll(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+27
-8
@@ -18,16 +18,18 @@ import org.diylc.swing.ISwingUI;
|
|||||||
|
|
||||||
public class LayersMenuPlugin implements IPlugIn {
|
public class LayersMenuPlugin implements IPlugIn {
|
||||||
|
|
||||||
private static final String LOCK_LAYERS_TITLE = "Lock Layers";
|
private static final String LOCK_LAYERS_TITLE = "Layers";
|
||||||
|
|
||||||
private IPlugInPort plugInPort;
|
private IPlugInPort plugInPort;
|
||||||
private Map<Layer, Action> lockActionMap;
|
private Map<Layer, Action> lockActionMap;
|
||||||
|
private Map<Integer, Action> selectAllActionMap;
|
||||||
|
|
||||||
public LayersMenuPlugin(ISwingUI swingUI) {
|
public LayersMenuPlugin(ISwingUI swingUI) {
|
||||||
lockActionMap = new HashMap<Layer, Action>();
|
lockActionMap = new HashMap<Layer, Action>();
|
||||||
|
selectAllActionMap = new HashMap<Integer, Action>();
|
||||||
for (Layer layer : Layer.values()) {
|
for (Layer layer : Layer.values()) {
|
||||||
final int zOrder = layer.getZOrder();
|
final int zOrder = layer.getZOrder();
|
||||||
AbstractAction action = new AbstractAction(layer.getTitle()) {
|
AbstractAction lockAction = new AbstractAction("Lock") {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@@ -35,11 +37,27 @@ public class LayersMenuPlugin implements IPlugIn {
|
|||||||
public void actionPerformed(ActionEvent e) {
|
public void actionPerformed(ActionEvent e) {
|
||||||
LayersMenuPlugin.this.plugInPort.setLayerLocked(zOrder,
|
LayersMenuPlugin.this.plugInPort.setLayerLocked(zOrder,
|
||||||
(Boolean) getValue(Action.SELECTED_KEY));
|
(Boolean) getValue(Action.SELECTED_KEY));
|
||||||
|
selectAllActionMap.get(zOrder).setEnabled(
|
||||||
|
!(Boolean) getValue(Action.SELECTED_KEY));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
action.putValue(IView.CHECK_BOX_MENU_ITEM, true);
|
lockAction.putValue(IView.CHECK_BOX_MENU_ITEM, true);
|
||||||
lockActionMap.put(layer, action);
|
lockActionMap.put(layer, lockAction);
|
||||||
swingUI.injectMenuAction(action, LOCK_LAYERS_TITLE);
|
|
||||||
|
AbstractAction selectAllAction = new AbstractAction("Select All") {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(ActionEvent e) {
|
||||||
|
LayersMenuPlugin.this.plugInPort.selectAll(zOrder);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
selectAllActionMap.put(zOrder, selectAllAction);
|
||||||
|
|
||||||
|
swingUI.injectSubmenu(layer.title, null, LOCK_LAYERS_TITLE);
|
||||||
|
swingUI.injectMenuAction(lockAction, layer.title);
|
||||||
|
swingUI.injectMenuAction(selectAllAction, layer.title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,9 +84,10 @@ public class LayersMenuPlugin implements IPlugIn {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static enum Layer {
|
static enum Layer {
|
||||||
CHASSIS("Chassis", IDIYComponent.CHASSIS), BOARD("Board", IDIYComponent.BOARD), TRACE(
|
CHASSIS("Chassis", IDIYComponent.CHASSIS), BOARD("Board",
|
||||||
"Trace", IDIYComponent.TRACE), COMPONENT("Component", IDIYComponent.COMPONENT), TEXT(
|
IDIYComponent.BOARD), TRACE("Trace", IDIYComponent.TRACE), COMPONENT(
|
||||||
"Text", IDIYComponent.TEXT);
|
"Component", IDIYComponent.COMPONENT), TEXT("Text",
|
||||||
|
IDIYComponent.TEXT);
|
||||||
|
|
||||||
String title;
|
String title;
|
||||||
int zOrder;
|
int zOrder;
|
||||||
|
|||||||
@@ -1233,5 +1233,21 @@
|
|||||||
</changes>
|
</changes>
|
||||||
<url>http://code.google.com/p/diy-layout-creator/downloads/list</url>
|
<url>http://code.google.com/p/diy-layout-creator/downloads/list</url>
|
||||||
</org.diylc.appframework.update.Version>
|
</org.diylc.appframework.update.Version>
|
||||||
|
<org.diylc.appframework.update.Version>
|
||||||
|
<versionNumber>
|
||||||
|
<major>3</major>
|
||||||
|
<minor>28</minor>
|
||||||
|
<build>0</build>
|
||||||
|
</versionNumber>
|
||||||
|
<releaseDate>2013-04-30 20:00:00.000 CET</releaseDate>
|
||||||
|
<name></name>
|
||||||
|
<changes>
|
||||||
|
<org.diylc.appframework.update.Change>
|
||||||
|
<changeType>NEW_FEATURE</changeType>
|
||||||
|
<description>Select all within a layer</description>
|
||||||
|
</org.diylc.appframework.update.Change>
|
||||||
|
</changes>
|
||||||
|
<url>http://code.google.com/p/diy-layout-creator/downloads/list</url>
|
||||||
|
</org.diylc.appframework.update.Version>
|
||||||
</a>
|
</a>
|
||||||
</java.util.Arrays_-ArrayList>
|
</java.util.Arrays_-ArrayList>
|
||||||
Reference in New Issue
Block a user