mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-10 17:22:09 +10:00
z-order of building blocks
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user