@Override public void run() { Command actualCommand = null; for (ProcessNode node : editor.getModel().getChildren()) { boolean minimize = type == MINIMIZE; if (node.isMinimized() == minimize) continue; ChangeStateCommand newCommand = new ChangeStateCommand(node); actualCommand = CommandUtil.chain(newCommand, actualCommand); } if (actualCommand == null) return; editor.getCommandStack().execute(actualCommand); }
@Override public void execute() { ProcessNode node = model.getProcessNode(process.getId()); if (type == SHOW && node == null) { node = new ProcessNode(process); model.add(node); model.editor.createNecessaryLinks(node); } if (type == HIDE) for (Link link : node.links) link.setVisible(false); node.setVisible(type == SHOW); if (type == SHOW) node.showLinks(); node.layout(); node.parent().editor.setDirty(true); }