use of org.freeplane.features.icon.IconGroup in project freeplane by freeplane.
the class MIconController method insertSubmenus.
private void insertSubmenus(final JToolBar iconToolBar) {
final JMenuBar iconMenuBar = new JMenuBar() {
private static final long serialVersionUID = 1L;
@Override
public Dimension getMaximumSize() {
final Dimension preferredSize = getPreferredSize();
return new Dimension(Short.MAX_VALUE, preferredSize.height);
}
};
iconMenuBar.setAlignmentX(JComponent.CENTER_ALIGNMENT);
iconMenuBar.setLayout(new GridLayout(0, 1));
for (final IconGroup iconGroup : STORE.getGroups()) {
iconMenuBar.add(getSubmenu(iconGroup));
}
iconToolBar.add(iconMenuBar);
}
use of org.freeplane.features.icon.IconGroup in project freeplane by freeplane.
the class IconStoreFactory method setIconGroups.
private static void setIconGroups(final IconStore iconStore) {
final String[] groupNames = RESOURCE_CONTROLLER.getProperty(GROUP_NAMES_KEY).split(SEPARATOR);
for (final String groupName : groupNames) {
final String description = TextUtils.getText(String.format(GROUP_DESC_KEY, groupName));
List<MindIcon> icons;
UIIcon groupIcon = null;
if ("user".equals(groupName)) {
icons = IconStoreFactory.getUserIcons();
groupIcon = MindIconFactory.create("user_icon");
} else {
final String groupIconName = RESOURCE_CONTROLLER.getProperty(String.format(GROUP_ICON_KEY, groupName));
final Map<String, MindIcon> iconMap = IconStoreFactory.getIcons(groupName);
groupIcon = iconMap.get(groupIconName);
icons = new ArrayList<MindIcon>(iconMap.values());
}
if (groupIcon == null) {
groupIcon = icons.size() > 0 ? icons.get(0) : IconNotFound.instance();
}
iconStore.addGroup(new IconGroup(groupName, groupIcon, description, icons));
}
}