/** @param removeFirst */ private ActionPair getRemoveIconActionPair(MindMapNode node, MindIcon icon, boolean removeFirst) { int iconIndex = removeFirst ? IconContainedCondition.iconFirstIndex(node, icon.getName()) : IconContainedCondition.iconLastIndex(node, icon.getName()); return iconIndex >= 0 ? getRemoveIconActionPair(node, icon, iconIndex) : null; }
public AddIconAction createAddIconAction(MindMapNode node, MindIcon icon, int iconPosition) { AddIconAction action = new AddIconAction(); action.setNode(node.getObjectId(modeController)); action.setIconName(icon.getName()); action.setIconPosition(iconPosition); return action; }
private ActionPair getToggleIconActionPair(MindMapNode node, MindIcon icon) { int iconIndex = IconContainedCondition.iconFirstIndex(node, icon.getName()); if (iconIndex == -1) { return getAddLastIconActionPair(node, icon); } else { return getRemoveIconActionPair(node, icon, iconIndex); } }
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); }