private void setLineDash(java.awt.BasicStroke s) { float[] dash = J2C.ConvertDashArray(s.getDashArray(), s.getLineWidth()); if (dash != null) { pen.DashPattern = dash; } }
private void setLineJoin(java.awt.BasicStroke s) { pen.MiterLimit = s.getMiterLimit(); try { pen.LineJoin = J2C.ConvertLineJoin(s.getLineJoin()); } catch (ArgumentException aex) { Console.WriteLine(aex.StackTrace); } }
private void setLineCap(java.awt.BasicStroke s) { try { LineCap plc = J2C.ConvertLineCap(s.getEndCap()); pen.SetLineCap(plc, plc, pen.DashCap); } catch (ArgumentException aex) { Console.WriteLine(aex.StackTrace); } }
public override void setStroke(java.awt.Stroke stroke) { if (this.stroke != null && this.stroke.Equals(stroke)) { return; } this.stroke = stroke; if (stroke is java.awt.BasicStroke) { java.awt.BasicStroke s = (java.awt.BasicStroke)stroke; pen = new Pen(pen.Brush, s.getLineWidth()); setLineJoin(s); setLineCap(s); setLineDash(s); } }