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 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());
 }
Exemplo n.º 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();
 }
Exemplo n.º 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);
     }
   }
 }
Exemplo n.º 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;
 }
Exemplo n.º 7
0
 private ImageIcon getFlagIcon() {
   // icon
   if (flagIcon == null) {
     flagIcon = MindIcon.factory("flag").getIcon();
   }
   return flagIcon;
 }
Exemplo n.º 8
0
 private ImageIcon getBellIcon() {
   // icon
   if (bellIcon == null) {
     bellIcon = MindIcon.factory("bell").getIcon();
   }
   return bellIcon;
 }
Exemplo n.º 9
0
 private ImageIcon getClockIcon() {
   // icon
   if (clockIcon == null) {
     clockIcon = MindIcon.factory("clock2").getIcon();
   }
   return clockIcon;
 }
Exemplo n.º 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);
   }
 }
Exemplo n.º 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);
   }
 }
Exemplo n.º 12
0
 public String getKeystrokeResourceName() {
   return icon.getKeystrokeResourceName();
 }
Exemplo n.º 13
0
 public ImageIcon getIcon() {
   return icon.getIcon();
 }
Exemplo n.º 14
0
 public String getDescription() {
   return icon.getDescription();
 }
Exemplo n.º 15
0
 public KeyStroke getKeyStroke() {
   final String keystrokeResourceName = icon.getKeystrokeResourceName();
   final String keyStrokeDescription =
       getMindMapController().getFrame().getAdjustableProperty(keystrokeResourceName);
   return Tools.getKeyStroke(keyStrokeDescription);
 }