Search in sources :

Example 91 with MapModel

use of org.freeplane.features.map.MapModel in project freeplane by freeplane.

the class FilterConditionEditor method mapChanged.

/**
 */
public void mapChanged(final MapModel newMap) {
    if (newMap != null) {
        if (lastMap != null && lastMap.get() == newMap) {
            return;
        }
        filteredPropertiesModel.removeAllElements();
        final Iterator<IElementaryConditionController> conditionIterator = filterController.getConditionFactory().conditionIterator();
        while (conditionIterator.hasNext()) {
            final IElementaryConditionController next = conditionIterator.next();
            filteredPropertiesModel.addExtensionList(next.getFilteredProperties());
            filteredPropertiesModel.setSelectedItem(filteredPropertiesModel.getElementAt(0));
        }
    } else {
        filteredPropertiesComponent.setSelectedIndex(-1);
        filteredPropertiesModel.setExtensionList(null);
    }
    lastMap = new WeakReference<MapModel>(newMap);
}
Also used : IElementaryConditionController(org.freeplane.features.filter.condition.IElementaryConditionController) MapModel(org.freeplane.features.map.MapModel)

Example 92 with MapModel

use of org.freeplane.features.map.MapModel in project freeplane by freeplane.

the class HierarchicalIcons2 method readingCompleted.

public void readingCompleted(final NodeModel topNode, final Map<String, String> newIds) {
    if (!topNode.containsExtension(getClass()) && !topNode.getMap().getRootNode().containsExtension(getClass())) {
        return;
    }
    final MapModel map = topNode.getMap();
    final boolean mapStylesAreAlreadyLoaded = null != MapStyleModel.getExtension(map);
    if (mapStylesAreAlreadyLoaded) {
        gatherLeavesAndSetStyle(topNode);
        gatherLeavesAndSetParentsStyle(topNode);
    } else
        LogicalStyleController.getController().refreshMap(map);
}
Also used : MapModel(org.freeplane.features.map.MapModel)

Example 93 with MapModel

use of org.freeplane.features.map.MapModel in project freeplane by freeplane.

the class HierarchicalIcons2 method mapChanged.

public void mapChanged(final MapChangeEvent event) {
    final MapModel map = event.getMap();
    if (map == null) {
        return;
    }
    final NodeModel rootNode = map.getRootNode();
    if (!isActive(rootNode)) {
        return;
    }
    final Object property = event.getProperty();
    if (!property.equals(MapStyle.MAP_STYLES)) {
        return;
    }
    gatherLeavesAndSetStyle(rootNode);
    gatherLeavesAndSetParentsStyle(rootNode);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapModel(org.freeplane.features.map.MapModel)

Example 94 with MapModel

use of org.freeplane.features.map.MapModel in project freeplane by freeplane.

the class IconController method getIconSize.

public Quantity<LengthUnits> getIconSize(NodeModel node) {
    final MapModel map = node.getMap();
    final ModeController modeController = Controller.getCurrentModeController();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> styles = styleController.getStyles(node);
    final Quantity<LengthUnits> size = getStyleIconSize(map, styles);
    return size;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) LengthUnits(org.freeplane.core.ui.LengthUnits) LogicalStyleController(org.freeplane.features.styles.LogicalStyleController) MapModel(org.freeplane.features.map.MapModel) ModeController(org.freeplane.features.mode.ModeController)

Example 95 with MapModel

use of org.freeplane.features.map.MapModel in project freeplane by freeplane.

the class FilterHistory method redo.

void redo() {
    if (!filters.hasNext()) {
        return;
    }
    Controller controller = Controller.getCurrentController();
    final MapModel map = controller.getMap();
    final Filter next = filters.next();
    next.applyFilter(this, map, true);
}
Also used : MapModel(org.freeplane.features.map.MapModel) Controller(org.freeplane.features.mode.Controller)

Aggregations

MapModel (org.freeplane.features.map.MapModel)143 NodeModel (org.freeplane.features.map.NodeModel)47 ModeController (org.freeplane.features.mode.ModeController)35 Controller (org.freeplane.features.mode.Controller)31 IActor (org.freeplane.core.undo.IActor)27 MMapModel (org.freeplane.features.map.mindmapmode.MMapModel)16 LogicalStyleController (org.freeplane.features.styles.LogicalStyleController)16 IUndoHandler (org.freeplane.core.undo.IUndoHandler)15 AttributeRegistry (org.freeplane.features.attribute.AttributeRegistry)14 IStyle (org.freeplane.features.styles.IStyle)14 File (java.io.File)13 MMapController (org.freeplane.features.map.mindmapmode.MMapController)13 URL (java.net.URL)12 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)11 MapStyleModel (org.freeplane.features.styles.MapStyleModel)10 IMapViewManager (org.freeplane.features.ui.IMapViewManager)10 MapController (org.freeplane.features.map.MapController)9 URI (java.net.URI)8 ResourceController (org.freeplane.core.resources.ResourceController)8 IOException (java.io.IOException)7