/// <summary> /// Creates a new instance for the given model graph and the given <see cref="MultiPageLayout"/>. /// </summary> /// <param name="result">The <see cref="MultiPageLayout"/>: a holder for the pages created by the <see cref="MultiPageLayout"/>.</param> public MultiPageIGraphBuilder(MultiPageLayoutResult result) { // initialize the graph item defaults with the null styles NormalEdgeDefaults = new EdgeDefaults { Style = NullEdgeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; ConnectorEdgeDefaults = new EdgeDefaults { Style = NullEdgeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; ProxyEdgeDefaults = new EdgeDefaults { Style = NullEdgeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; ProxyReferenceEdgeDefaults = new EdgeDefaults { Style = NullEdgeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; NormalNodeDefaults = new NodeDefaults { Style = NullNodeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; GroupNodeDefaults = new NodeDefaults { Style = NullNodeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; ConnectorNodeDefaults = new NodeDefaults { Style = NullNodeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; ProxyNodeDefaults = new NodeDefaults { Style = NullNodeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; ProxyReferenceNodeDefaults = new NodeDefaults { Style = NullNodeStyle, Labels = { Style = NullLabelStyle, LayoutParameter = NullLabelModelParameter } }; this.result = result; }
public string GetProperty(string key, string defValue = null) { if (Attributes.ContainsKey(key)) { return(Attributes[key]); } else if (NodeDefaults.ContainsKey(key)) { return(NodeDefaults[key]); } else { return(defValue); } }
public double ParseSpace(string spaceattr, double unitlessScale = 0.75) { spaceattr = spaceattr.Trim(); if (spaceattr.EndsWith("mathspace")) { if (spaceattr.StartsWith("negative")) { spaceattr = spaceattr.Substring(8); } string realspaceattr = "0em"; if (NodeDefaults.ContainsKey(spaceattr)) { realspaceattr = NodeDefaults[spaceattr]; //throw new InvalidOperationException(string.Format("Bad space token: '{0}'", spaceattr)); } return(ParseLength(realspaceattr, unitlessScale)); } return(ParseLength(spaceattr, unitlessScale)); }