Search in sources :

Example 41 with NodeModel

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

the class NodeStyleController method getBorderDashMatchesEdgeDash.

private Boolean getBorderDashMatchesEdgeDash(final MapModel map, final Collection<IStyle> styleKeys) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : styleKeys) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeBorderModel borderModel = NodeBorderModel.getModel(styleNode);
        if (borderModel == null) {
            continue;
        }
        final Boolean borderDashMatchesEdgeDash = borderModel.getBorderDashMatchesEdgeDash();
        if (borderDashMatchesEdgeDash == null) {
            continue;
        }
        return borderDashMatchesEdgeDash;
    }
    return false;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 42 with NodeModel

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

the class NodeStyleController method getBorderColorMatchesEdgeColor.

private Boolean getBorderColorMatchesEdgeColor(final MapModel map, final Collection<IStyle> styleKeys) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : styleKeys) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeBorderModel borderModel = NodeBorderModel.getModel(styleNode);
        if (borderModel == null) {
            continue;
        }
        final Boolean borderColorMatchesEdgeColor = borderModel.getBorderColorMatchesEdgeColor();
        if (borderColorMatchesEdgeColor == null) {
            continue;
        }
        return borderColorMatchesEdgeColor;
    }
    return true;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 43 with NodeModel

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

the class NodeStyleController method getStyleMinWidth.

private Quantity<LengthUnits> getStyleMinWidth(final MapModel map, final Collection<IStyle> styleKeys) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : styleKeys) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeSizeModel sizeModel = NodeSizeModel.getModel(styleNode);
        if (sizeModel == null) {
            continue;
        }
        final Quantity<LengthUnits> minWidth = sizeModel.getMinNodeWidth();
        if (minWidth == null) {
            continue;
        }
        return minWidth;
    }
    return DEFAULT_MINIMUM_WIDTH;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) LengthUnits(org.freeplane.core.ui.LengthUnits) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 44 with NodeModel

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

the class NodeStyleController method getDefaultFont.

public Font getDefaultFont(final MapModel map, final IStyle style) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    final NodeModel styleNode = model.getStyleNodeSafe(style);
    return getFont(styleNode);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel)

Example 45 with NodeModel

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

the class NodeStyleController method getStyleBackgroundColor.

private Color getStyleBackgroundColor(final MapModel map, final Collection<IStyle> styleKeys) {
    final MapStyleModel model = MapStyleModel.getExtension(map);
    for (IStyle styleKey : styleKeys) {
        final NodeModel styleNode = model.getStyleNode(styleKey);
        if (styleNode == null) {
            continue;
        }
        final NodeStyleModel styleModel = NodeStyleModel.getModel(styleNode);
        if (styleModel == null) {
            continue;
        }
        final Color styleColor = styleModel.getBackgroundColor();
        if (styleColor == null) {
            continue;
        }
        return styleColor;
    }
    return null;
}
Also used : IStyle(org.freeplane.features.styles.IStyle) NodeModel(org.freeplane.features.map.NodeModel) MapStyleModel(org.freeplane.features.styles.MapStyleModel) Color(java.awt.Color)

Aggregations

NodeModel (org.freeplane.features.map.NodeModel)408 ModeController (org.freeplane.features.mode.ModeController)89 MapModel (org.freeplane.features.map.MapModel)47 Controller (org.freeplane.features.mode.Controller)44 MapStyleModel (org.freeplane.features.styles.MapStyleModel)39 IMapSelection (org.freeplane.features.map.IMapSelection)34 MapController (org.freeplane.features.map.MapController)33 Point (java.awt.Point)32 MMapController (org.freeplane.features.map.mindmapmode.MMapController)31 IStyle (org.freeplane.features.styles.IStyle)31 IActor (org.freeplane.core.undo.IActor)30 NodeView (org.freeplane.view.swing.map.NodeView)22 ArrayList (java.util.ArrayList)20 Color (java.awt.Color)16 URI (java.net.URI)16 ResourceController (org.freeplane.core.resources.ResourceController)16 Component (java.awt.Component)15 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)15 File (java.io.File)14