use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.
the class MIconController method listStandardIconKeys.
/**
* lists all icons that are available in the icon selection dialog. This may include user icons
* if there are some installed.
*/
public static List<String> listStandardIconKeys() {
// the source of this list is the property "icons.list" in freeplane.properties
ArrayList<String> result = new ArrayList<String>();
final MIconController mIconController = (MIconController) IconController.getController();
for (MindIcon mindIcon : mIconController.getMindIcons()) result.add(mindIcon.getName());
return result;
}
use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.
the class MTextController method joinNodes.
public void joinNodes(final List<NodeModel> selectedNodes, final String separator) {
if (selectedNodes.isEmpty())
return;
final NodeModel selectedNode = selectedNodes.get(0);
for (final NodeModel node : selectedNodes) {
if (node != selectedNode && node.subtreeContainsCloneOf(selectedNode)) {
UITools.errorMessage(TextUtils.getText("cannot_move_into_child_node"));
return;
}
}
String joinedContent = "";
final Controller controller = Controller.getCurrentController();
boolean isHtml = false;
final LinkedHashSet<MindIcon> icons = new LinkedHashSet<MindIcon>();
for (final NodeModel node : selectedNodes) {
final String nodeContent = node.getText();
icons.addAll(node.getIcons());
final boolean isHtmlNode = HtmlUtils.isHtmlNode(nodeContent);
joinedContent = addContent(joinedContent, isHtml, nodeContent, isHtmlNode, separator);
if (node != selectedNode) {
final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
mapController.moveNodes(node.getChildren(), selectedNode, selectedNode.getChildCount());
mapController.deleteNode(node);
}
isHtml = isHtml || isHtmlNode;
}
controller.getSelection().selectAsTheOnlyOneSelected(selectedNode);
setNodeText(selectedNode, joinedContent);
final MIconController iconController = (MIconController) IconController.getController();
iconController.removeAllIcons(selectedNode);
for (final MindIcon icon : icons) {
iconController.addIcon(selectedNode, icon);
}
}
use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.
the class IconsRenderer method setValue.
@Override
public void setValue(final Object value) {
if (value instanceof IconsHolder) {
final IconsHolder iconsHolder = (IconsHolder) value;
final MultipleImage iconImages = new MultipleImage();
for (final MindIcon icon : iconsHolder.getIcons()) {
iconImages.addImage(icon.getIcon());
}
if (iconImages.getImageCount() > 0) {
setIcon(iconImages);
} else {
setIcon(null);
}
}
}
use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.
the class IconProperty method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final List<MindIcon> icons = new ArrayList<MindIcon>();
final List<String> descriptions = new ArrayList<String>();
for (final MindIcon icon : mIcons) {
icons.add(icon);
descriptions.add(icon.getTranslationValueLabel());
}
final IconSelectionPopupDialog dialog = new IconSelectionPopupDialog(JOptionPane.getFrameForComponent((Component) e.getSource()), icons);
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();
}
}
use of org.freeplane.features.icon.MindIcon in project freeplane by freeplane.
the class IconProperty method setValue.
@Override
public void setValue(final String value) {
for (final MindIcon icon : mIcons) {
if (icon.getName().equals(value)) {
mActualIcon = icon;
setIcon(mActualIcon);
return;
}
}
throw new NoSuchElementException();
}
Aggregations