/*************************************************************************************************************************/ // SETERS AND GETERS public void set(ColorType colorType) { this.color = colorType.color; }
public ColorType(ColorType colorType) { this.color = colorType.color; }
/*************************************************************************************************************************/ // NODES CREATE // NODE Create Rectangle on point public Node createNode( Position position, string name = "", int layer = 0, ColorType color = null, Font font = null ) { if (this.options.readOnly) { return null; } var rec = new Node(); if (font == null) { rec.font = this.FontDefault; } else { rec.font = font; } rec.layer = layer; rec.setName(name); rec.note = ""; rec.link = ""; rec.position.set(position); if (color != null) { rec.color.set(color); } else { rec.color.set(Media.getColor(this.options.colorNode)); } return this.layers.createNode(rec); }
public void changeColor(ColorType color) { if (!this.diagram.options.readOnly) { if (selectedNodes.Count() > 0) { if (!this.diagram.undoOperations.isSame("changeNodeColor", this.selectedNodes, null)) { this.diagram.unsave("changeNodeColor", this.selectedNodes, null, this.shift, this.currentLayer.id); } foreach (Node rec in this.selectedNodes) { rec.color.set(color); } this.Invalidate(); } } }
// LINE CONNECT connect two nodes and add arrow or set color public Line Connect(Node a, Node b, bool arrow = false, ColorType color = null, int width = 1) { Line line = this.Connect(a, b); if (line != null) { line.arrow = arrow; if (color != null) { line.color.set(color); } line.width = width; } return line; }