public ActionPair apply(MindMap model, MindMapNode selected) { List icons = selected.getIcons(); if (icons.size() == 0) return null; AddIconAction undoAction = iconAction.createAddIconAction( selected, (MindIcon) icons.get(icons.size() - 1), MindIcon.LAST); return new ActionPair(createRemoveIconXmlAction(selected, MindIcon.LAST), undoAction); }
public IconsHolder(MindMapNode node) { icons.addAll(node.getIcons()); // sorting the output. iconNames = new Vector(); for (Iterator i = icons.iterator(); i.hasNext(); ) { MindIcon icon = (MindIcon) i.next(); iconNames.add(icon.getName()); } Collections.sort(iconNames); }
public int removeLastIcon(MindMapNode node) { modeController.getActionFactory().startTransaction((String) getValue(NAME)); modeController.getActionFactory().executeAction(apply(modeController.getMap(), node)); modeController.getActionFactory().endTransaction((String) getValue(NAME)); return node.getIcons().size(); }