public Color getBorderColor(NodeModel node) { final MapModel map = node.getMap(); final LogicalStyleController styleController = LogicalStyleController.getController(modeController); final Collection<IStyle> style = styleController.getStyles(node); final Color borderColor = getBorderColor(map, style); return borderColor; }
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 NodeStyleController styleController = NodeStyleController.getController(); final NodeBorderModel nodeBorderModel = NodeBorderModel.getModel(node); final Color color = nodeBorderModel != null ? nodeBorderModel.getBorderColor() : null; final Color viewColor = styleController.getBorderColor(node); mSetBorderColor.setValue(color != null); mBorderColor.setColorValue(viewColor); enableOrDisableBorderColorControls(); } }