public DashVariant getBorderDash(NodeModel node) { final MapModel map = node.getMap(); final LogicalStyleController styleController = LogicalStyleController.getController(modeController); final Collection<IStyle> style = styleController.getStyles(node); final DashVariant borderDash = getBorderDash(map, style); return borderDash; }
public void updateBorder(NodeView nodeView) { final NodeStyleController controller = NodeStyleController.getController(nodeView.getMap().getModeController()); final NodeModel node = nodeView.getModel(); final Boolean borderWidthMatchesEdgeWidth = controller.getBorderWidthMatchesEdgeWidth(node); if(borderWidthMatchesEdgeWidth) unzoomedBorderWidth = getUnzoomedEdgeWidth(); else unzoomedBorderWidth = (float) controller.getBorderWidth(node).toBaseUnits(); final Boolean borderDashMatchesEdgeDash = controller.getBorderDashMatchesEdgeDash(node); if(borderDashMatchesEdgeDash) dash = nodeView.getEdgeDash(); else dash = controller.getBorderDash(node); borderColorMatchesEdgeColor = controller.getBorderColorMatchesEdgeColor(node); if(borderColorMatchesEdgeColor) borderColor = null; else borderColor = controller.getBorderColor(node); } }
private void writeAttributes(final ITreeWriter writer, final NodeModel node, final NodeBorderModel border, final boolean forceFormatting) { final Boolean borderWidthMatchesEdgeWidth = forceFormatting ? nsc.getBorderWidthMatchesEdgeWidth(node) : border.getBorderWidthMatchesEdgeWidth(); if (borderWidthMatchesEdgeWidth != null) { writer.addAttribute("BORDER_WIDTH_LIKE_EDGE", borderWidthMatchesEdgeWidth.toString()); } final Quantity<LengthUnits> borderWidth = forceFormatting ? nsc.getBorderWidth(node) : border.getBorderWidth(); if (borderWidth != null) { writer.addAttribute("BORDER_WIDTH", borderWidth.toString()); } final Boolean borderColorMatchesEdgeColor = forceFormatting ? nsc.getBorderColorMatchesEdgeColor(node) : border.getBorderColorMatchesEdgeColor(); if (borderColorMatchesEdgeColor != null) { writer.addAttribute("BORDER_COLOR_LIKE_EDGE", borderColorMatchesEdgeColor.toString()); } final Color borderColor = forceFormatting ? nsc.getBorderColor(node) : border.getBorderColor(); if (borderColor != null) { ColorUtils.addColorAttributes(writer, "BORDER_COLOR", "BORDER_COLOR_ALPHA", borderColor); } final Boolean borderDashMatchesEdgeDash = forceFormatting ? nsc.getBorderDashMatchesEdgeDash(node) : border.getBorderDashMatchesEdgeDash(); if (borderDashMatchesEdgeDash != null) { writer.addAttribute("BORDER_DASH_LIKE_EDGE", borderDashMatchesEdgeDash.toString()); } DashVariant borderDash = forceFormatting ? nsc.getBorderDash(node) : border.getBorderDash(); if (borderDash != null) { writer.addAttribute("BORDER_DASH", borderDash.name()); } }
@Override void setStyleOnExternalChange(NodeModel node) { final NodeBorderModel nodeBorderModel = NodeBorderModel.getModel(node); final NodeStyleController styleController = NodeStyleController.getController(); final DashVariant dash = nodeBorderModel != null ? nodeBorderModel.getBorderDash() : null; final DashVariant viewDash = styleController.getBorderDash(node); mSetBorderDash.setValue(dash != null); mBorderDash.setValue(viewDash.name()); enableOrDisableBorderDashControls(); } }