Search in sources :

Example 1 with ObjectAndIcon

use of org.freeplane.core.ui.components.ObjectAndIcon in project freeplane by freeplane.

the class LinkTransformer method transformContent.

public Object transformContent(Object content, MapModel map) {
    if (!(content instanceof URI))
        return content;
    final String string = content.toString();
    if (!string.startsWith("#"))
        return content;
    final String nodeID = string.substring(1);
    final NodeModel target = map.getNodeForID(nodeID);
    if (target != null) {
        final String shortText = TextController.getController(modeController).getShortText(target);
        final Icon icon = FrameController.localLinkIcon;
        return new ObjectAndIcon(shortText, icon);
    } else
        return content;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ObjectAndIcon(org.freeplane.core.ui.components.ObjectAndIcon) ObjectAndIcon(org.freeplane.core.ui.components.ObjectAndIcon) Icon(javax.swing.Icon) URI(java.net.URI)

Aggregations

URI (java.net.URI)1 Icon (javax.swing.Icon)1 ObjectAndIcon (org.freeplane.core.ui.components.ObjectAndIcon)1 NodeModel (org.freeplane.features.map.NodeModel)1