Package org.freeplane.features.icon

Examples of org.freeplane.features.icon.MindIcon


    dialog.setLocationRelativeTo(JOptionPane.getFrameForComponent((Component) e.getSource()));
    dialog.setModal(true);
    dialog.setVisible(true);
    final int result = dialog.getResult();
    if (result >= 0) {
      final MindIcon icon = mIcons.get(result);
      setValue(icon.getName());
      firePropertyChangeEvent();
    }
  }
View Full Code Here


   * Constructs a MindIcon with the given name from the property file.
   * The name of the icon is the file name without the extension.
   */
  public static MindIcon create(final String name) {
    final String translationKeyLabel = name.indexOf('/') > 0 ? "" : String.format(DESC_KEY, name);
    return new MindIcon(name, name + ".png", translationKeyLabel);
  }
View Full Code Here

  private static Map<String, MindIcon> getIcons(final String groupName) {
    final String[] iconNames = RESOURCE_CONTROLLER.getProperty(String.format(GROUP_KEY, groupName))
        .split(SEPARATOR);
    final Map<String, MindIcon> icons = new LinkedHashMap<String, MindIcon>(iconNames.length);
    for (final String iconName : iconNames) {
      final MindIcon icon = MindIconFactory.create(iconName);
      icons.put(iconName, icon);
    }
    return icons;
  }
View Full Code Here

  public Collection<MindIcon> getMindIcons() {
    final List<MindIcon> iconInfoList = new ArrayList<MindIcon>();
    final Collection<AFreeplaneAction> iconActions = getIconActions();
    for (final Action action : iconActions) {
      final MindIcon info = ((IconAction) action).getMindIcon();
      iconInfoList.add(info);
    }
    return iconInfoList;
  }
View Full Code Here

      insertSubmenus(iconToolBar);
      return;
    }
    final String[] fpIcons = ResourceController.getResourceController().getProperty("icons.list").split(";");
    for (final String icon : fpIcons) {
      final MindIcon mindIcon = STORE.getMindIcon(icon);
      final AFreeplaneAction iconAction = iconActions.get(mindIcon);
      iconToolBar.add(iconAction).setAlignmentX(JComponent.CENTER_ALIGNMENT);
    }
    final Collection<MindIcon> userIcons = STORE.getUserIcons();
    for (final MindIcon icon : userIcons) {
View Full Code Here

    final NodeModel newNodeModel = mapController.newNode(text, nodeModel.getMap());
    if (!treeNode.isLeaf()) {
      newNodeModel.setFolded(true);
    }
    if (menuEntry.getIconKey() != null) {
      final MindIcon mindIcon = menuEntry.createMindIcon();
      if (mindIcon != null)
        newNodeModel.addIcon(mindIcon);
    }
    nodeModel.insert(newNodeModel);
    return newNodeModel;
View Full Code Here

      if (resource == null) {
        // this is the regular case: most MenuEntries (i.e. actions) will have the iconKey set
        // but only for a few of these Icons are available
        return null;
      }
      return new MindIcon(resource.replaceAll("/images/(.*).png", "../$1"));
    }
View Full Code Here

      super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
      if (leaf) {
        final DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
        final MenuEntry menuEntry = (MenuEntry) node.getUserObject();
        if (menuEntry.getIconKey() != null) {
          final MindIcon mindIcon = menuEntry.createMindIcon();
          if (mindIcon != null)
            setIcon(mindIcon.getIcon());
        }
      }
      return this;
    }
View Full Code Here

TOP

Related Classes of org.freeplane.features.icon.MindIcon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.