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;
}
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;
}
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);
}
}
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);
}
}
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);
}
}
Aggregations