z-order of building blocks

This commit is contained in:
Branislav Stojkovic
2019-03-04 10:34:53 +01:00
parent 04418f8101
commit 2553ffbba7
9 changed files with 51 additions and 28 deletions
@@ -893,11 +893,11 @@ public class ActionFactory {
public void actionPerformed(ActionEvent e) {
LOG.info("ExportBuildingBlocksAction triggered");
Map<String, Collection<IDIYComponent<?>>> selectedBlocks;
Map<String, List<IDIYComponent<?>>> selectedBlocks;
try {
Map<String, Collection<IDIYComponent<?>>> blocks =
(Map<String, Collection<IDIYComponent<?>>>) ConfigurationManager.getInstance().readObject(IPlugInPort.BLOCKS_KEY, null);
Map<String, List<IDIYComponent<?>>> blocks =
(Map<String, List<IDIYComponent<?>>>) ConfigurationManager.getInstance().readObject(IPlugInPort.BLOCKS_KEY, null);
if (blocks == null || blocks.isEmpty()) {
swingUI.showMessage("No building blocks found to export.", "Error", IView.ERROR_MESSAGE);
return;
@@ -926,7 +926,7 @@ public class ActionFactory {
return;
}
selectedBlocks = new HashMap<String, Collection<IDIYComponent<?>>>();
selectedBlocks = new HashMap<String, List<IDIYComponent<?>>>();
for (Object key : selected) {
selectedBlocks.put(key.toString(), blocks.get(key));
}
@@ -152,7 +152,7 @@ public class TreePanel extends JPanel {
@SuppressWarnings("unchecked")
@Override
public void valueChanged(String key, Object value) {
Map<String, Collection<IDIYComponent<?>>> newBlocks = (Map<String, Collection<IDIYComponent<?>>>) value;
Map<String, List<IDIYComponent<?>>> newBlocks = (Map<String, List<IDIYComponent<?>>>) value;
if (newBlocks != null) {
List<String> blockNames = new ArrayList<String>(newBlocks.keySet());
Collections.sort(blockNames);
@@ -216,8 +216,8 @@ public class TreePanel extends JPanel {
if (this.blocksNode == null) {
this.blocksNode = new DefaultMutableTreeNode(new Payload("(Building Blocks)", null), true);
@SuppressWarnings("unchecked")
Map<String, Collection<IDIYComponent<?>>> newBlocks =
(Map<String, Collection<IDIYComponent<?>>>) ConfigurationManager.getInstance().readObject(
Map<String, List<IDIYComponent<?>>> newBlocks =
(Map<String, List<IDIYComponent<?>>>) ConfigurationManager.getInstance().readObject(
IPlugInPort.BLOCKS_KEY, null);
if (newBlocks != null) {
List<String> blockNames = new ArrayList<String>(newBlocks.keySet());