/** @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 IconAction(
     MindMapController controller, MindIcon _icon, RemoveIconAction removeLastIconAction) {
   super(_icon.getDescription(), _icon.getIcon(), controller);
   this.modeController = controller;
   this.removeLastIconAction = removeLastIconAction;
   putValue(Action.SHORT_DESCRIPTION, _icon.getDescription());
   this.icon = _icon;
   controller.getActionFactory().registerActor(this, getDoActionClass());
 }
示例#3
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);
 }
 public EncryptedBrowseNode(Object userObject, FreeMindMain frame, ModeController modeController) {
   super(userObject, frame, modeController.getMap());
   this.mModeController = modeController;
   if (logger == null) logger = frame.getLogger(this.getClass().getName());
   if (encryptedIcon == null) {
     encryptedIcon = MindIcon.factory("encrypted").getIcon();
   }
   if (decryptedIcon == null) {
     decryptedIcon = MindIcon.factory("decrypted").getIcon();
   }
   updateIcon();
 }
示例#5
0
 public void setValue(Object value) {
   if (value instanceof IconsHolder) {
     IconsHolder iconsHolder = (IconsHolder) value;
     MultipleImage iconImages = new MultipleImage(1.0f);
     for (Iterator i = iconsHolder.getIcons().iterator(); i.hasNext(); ) {
       MindIcon icon = (MindIcon) i.next();
       iconImages.addImage(icon.getIcon());
     }
     if (iconImages.getImageCount() > 0) {
       setIcon(iconImages);
     } else {
       setIcon(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;
 }
示例#7
0
 private ImageIcon getFlagIcon() {
   // icon
   if (flagIcon == null) {
     flagIcon = MindIcon.factory("flag").getIcon();
   }
   return flagIcon;
 }
示例#8
0
 private ImageIcon getBellIcon() {
   // icon
   if (bellIcon == null) {
     bellIcon = MindIcon.factory("bell").getIcon();
   }
   return bellIcon;
 }
示例#9
0
 private ImageIcon getClockIcon() {
   // icon
   if (clockIcon == null) {
     clockIcon = MindIcon.factory("clock2").getIcon();
   }
   return clockIcon;
 }
 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 void act(XmlAction action) {
   if (action instanceof AddIconAction) {
     AddIconAction iconAction = (AddIconAction) action;
     MindMapNode node = modeController.getNodeFromID(iconAction.getNode());
     String iconName = iconAction.getIconName();
     int position = iconAction.getIconPosition();
     MindIcon icon = MindIcon.factory(iconName);
     node.addIcon(icon, position);
     modeController.nodeChanged(node);
   }
 }
 public String getKeystrokeResourceName() {
   return icon.getKeystrokeResourceName();
 }
 public ImageIcon getIcon() {
   return icon.getIcon();
 }
 public String getDescription() {
   return icon.getDescription();
 }
 public KeyStroke getKeyStroke() {
   final String keystrokeResourceName = icon.getKeystrokeResourceName();
   final String keyStrokeDescription =
       getMindMapController().getFrame().getAdjustableProperty(keystrokeResourceName);
   return Tools.getKeyStroke(keyStrokeDescription);
 }