예제 #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;
 }
예제 #2
0
 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);
     }
   }
 }
예제 #6
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;
 }
예제 #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;
 }
예제 #10
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);
   }
 }
예제 #11
0
 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);
   }
 }
예제 #12
0
 public String getKeystrokeResourceName() {
   return icon.getKeystrokeResourceName();
 }
예제 #13
0
 public ImageIcon getIcon() {
   return icon.getIcon();
 }
예제 #14
0
 public String getDescription() {
   return icon.getDescription();
 }
예제 #15
0
 public KeyStroke getKeyStroke() {
   final String keystrokeResourceName = icon.getKeystrokeResourceName();
   final String keyStrokeDescription =
       getMindMapController().getFrame().getAdjustableProperty(keystrokeResourceName);
   return Tools.getKeyStroke(keyStrokeDescription);
 }