Exemplo n.º 1
0
 /** @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;
 }
Exemplo n.º 2
0
 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;
 }
Exemplo n.º 3
0
 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);
   }
 }
Exemplo n.º 4
0
 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);
 }