use of org.freeplane.core.ui.components.MultipleImage in project freeplane by freeplane.
the class MainView method updateIcons.
void updateIcons(final NodeView node) {
if (!node.getMap().showsIcons()) {
setIcon(null);
return;
}
// setHorizontalTextPosition(node.isLeft() ? SwingConstants.LEADING : SwingConstants.TRAILING);
final MultipleImage iconImages = new MultipleImage();
/* fc, 06.10.2003: images? */
final NodeModel model = node.getModel();
for (final UIIcon icon : IconController.getController().getStateIcons(model)) {
iconImages.addIcon(icon, model);
}
final ModeController modeController = getNodeView().getMap().getModeController();
final Collection<MindIcon> icons = IconController.getController(modeController).getIcons(model);
for (final MindIcon myIcon : icons) {
iconImages.addIcon(myIcon, model);
}
addOwnIcons(iconImages, model);
setIcon((iconImages.getImageCount() > 0 ? iconImages : null));
}
use of org.freeplane.core.ui.components.MultipleImage 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.addIcon(icon);
}
if (iconImages.getImageCount() > 0) {
setIcon(iconImages);
} else {
setIcon(null);
}
}
}
use of org.freeplane.core.ui.components.MultipleImage in project freeplane by freeplane.
the class MainView method getUIIconAt.
public UIIcon getUIIconAt(Point coordinate) {
Icon icon = getIcon();
if (icon instanceof MultipleImage) {
Rectangle iconRectangle = getIconRectangle();
Point transformedToIconCoordinate = new Point(coordinate);
transformedToIconCoordinate.translate(-iconRectangle.x, -iconRectangle.y);
return ((MultipleImage) icon).getUIIconAt(transformedToIconCoordinate);
} else
return null;
}
Aggregations