Search in sources :

Example 16 with MindIcon

use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.

the class MIconController method getMindIcons.

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;
}
Also used : AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) Action(javax.swing.Action) AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) ArrayList(java.util.ArrayList) MindIcon(org.freeplane.features.icon.MindIcon)

Example 17 with MindIcon

use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.

the class MIconController method getSubmenu.

private JMenu getSubmenu(final IconGroup group) {
    final JMenu menu = new JMenu("\u25ba") {

        private static final long serialVersionUID = 1L;

        @Override
        protected Point getPopupMenuOrigin() {
            return new Point(getWidth(), 0);
        }
    };
    menu.setFont(menu.getFont().deriveFont(8F));
    menu.setMargin(new Insets(0, 0, 0, 0));
    menu.setIcon(group.getGroupIcon().getIcon());
    for (final MindIcon icon : group.getIcons()) {
        addActionToIconSubmenu(menu, icon, icon.getFileName());
    }
    menu.setToolTipText(group.getDescription());
    return menu;
}
Also used : Insets(java.awt.Insets) MindIcon(org.freeplane.features.icon.MindIcon) Point(java.awt.Point) JMenu(javax.swing.JMenu)

Example 18 with MindIcon

use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.

the class MIconController method createIconActions.

private void createIconActions(final ModeController modeController) {
    modeController.addAction(new RemoveIconAction(0));
    modeController.addAction(new RemoveIconAction(-1));
    modeController.addAction(new RemoveAllIconsAction());
    for (final MindIcon icon : STORE.getMindIcons()) {
        final IconAction myAction = new IconAction(icon);
        iconActions.put(icon, myAction);
    }
}
Also used : MindIcon(org.freeplane.features.icon.MindIcon)

Example 19 with MindIcon

use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.

the class MIconController method updateIconToolbar.

private void updateIconToolbar(ModeController modeController) {
    iconToolBar.removeAll();
    iconToolBar.add(modeController.getAction("RemoveIcon_0_Action")).setAlignmentX(JComponent.CENTER_ALIGNMENT);
    iconToolBar.add(modeController.getAction("RemoveIconAction")).setAlignmentX(JComponent.CENTER_ALIGNMENT);
    iconToolBar.add(modeController.getAction("RemoveAllIconsAction")).setAlignmentX(JComponent.CENTER_ALIGNMENT);
    iconToolBar.addSeparator();
    if (ResourceController.getResourceController().getBooleanProperty("structured_icon_toolbar")) {
        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) {
        final AFreeplaneAction iconAction = iconActions.get(icon);
        iconToolBar.add(iconAction).setAlignmentX(JComponent.CENTER_ALIGNMENT);
    }
}
Also used : AFreeplaneAction(org.freeplane.core.ui.AFreeplaneAction) MindIcon(org.freeplane.features.icon.MindIcon)

Example 20 with MindIcon

use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.

the class MIconController method addIconGroupToMenu.

private void addIconGroupToMenu(final MenuBuilder builder, final String category, final IconGroup group) {
    if (group.getIcons().size() < 1) {
        return;
    }
    final JMenuItem item = new JMenu();
    item.setIcon(group.getGroupIcon().getIcon());
    item.setText(group.getDescription());
    final String itemKey = category + "/" + group;
    builder.addMenuItem(category, item, itemKey, MenuBuilder.AS_CHILD);
    for (final MindIcon icon : group.getIcons()) {
        final String fileName = icon.getFileName();
        addAction(builder, itemKey, icon, fileName);
    }
}
Also used : MindIcon(org.freeplane.features.icon.MindIcon) JMenuItem(javax.swing.JMenuItem) JMenu(javax.swing.JMenu)

Aggregations

MindIcon (org.freeplane.features.icon.MindIcon)24 ArrayList (java.util.ArrayList)8 MIconController (org.freeplane.features.icon.mindmapmode.MIconController)5 NodeModel (org.freeplane.features.map.NodeModel)5 ModeController (org.freeplane.features.mode.ModeController)4 AFreeplaneAction (org.freeplane.core.ui.AFreeplaneAction)3 IconController (org.freeplane.features.icon.IconController)3 Controller (org.freeplane.features.mode.Controller)3 ViewController (org.freeplane.features.ui.ViewController)3 Point (java.awt.Point)2 LinkedHashSet (java.util.LinkedHashSet)2 Action (javax.swing.Action)2 JMenu (javax.swing.JMenu)2 ResourceController (org.freeplane.core.resources.ResourceController)2 IconSelectionPopupDialog (org.freeplane.core.ui.components.IconSelectionPopupDialog)2 MultipleImage (org.freeplane.core.ui.components.MultipleImage)2 FormatController (org.freeplane.features.format.FormatController)2 ScannerController (org.freeplane.features.format.ScannerController)2 UIIcon (org.freeplane.features.icon.UIIcon)2 LinkController (org.freeplane.features.link.LinkController)2