protected void applyStroke(SimpleShape<?,?> shape) { if (_stroke instanceof BasicStroke){ BasicStroke bs = (BasicStroke)_stroke; shape.setStrokeStyle((double)bs.getLineWidth()); float[] dash = bs.getDashArray(); if (dash != null) { //TODO: implement more dashing styles shape.setStrokeStyle(StrokeStyle.LineDash.DASH); } } }
Shape dashShape(Shape shape, Stroke stroke) { if (!(stroke instanceof BasicStroke)) { return shape; } BasicStroke bs = (BasicStroke) stroke; if (bs.getDashArray() == null || bs.getDashArray().length == 0) { return shape; } return new DashedShape(shape, bs.getDashArray(), bs.getDashPhase()); }
/** * Set the line style of the series * * @param basicStroke */ public DialSeries setLineStyle(BasicStroke basicStroke) { stroke = basicStroke; if (this.lineWidth > 0.0f) { stroke = new BasicStroke( lineWidth, this.stroke.getEndCap(), this.stroke.getLineJoin(), this.stroke.getMiterLimit(), this.stroke.getDashArray(), this.stroke.getDashPhase()); } return this; }
/** * Set the line style of the series * * @param basicStroke */ public AxesChartSeries setLineStyle(BasicStroke basicStroke) { stroke = basicStroke; if (this.lineWidth > 0.0f) { stroke = new BasicStroke( lineWidth, this.stroke.getEndCap(), this.stroke.getLineJoin(), this.stroke.getMiterLimit(), this.stroke.getDashArray(), this.stroke.getDashPhase()); } return this; }
/** * Set the line style of the series * * @param basicStroke */ public RadarSeries setLineStyle(BasicStroke basicStroke) { stroke = basicStroke; if (this.lineWidth > 0.0f) { stroke = new BasicStroke( lineWidth, this.stroke.getEndCap(), this.stroke.getLineJoin(), this.stroke.getMiterLimit(), this.stroke.getDashArray(), this.stroke.getDashPhase()); } return this; }
if (basic.getDashArray() != null) { return false;
bs.getLineJoin(), bs.getMiterLimit(), bs.getDashArray(), bs.getDashPhase());
Shape dashShape(Shape shape, Stroke stroke) { if (!(stroke instanceof BasicStroke)) { return shape; } BasicStroke bs = (BasicStroke) stroke; if (bs.getDashArray() == null || bs.getDashArray().length == 0) { return shape; } return new DashedShape(shape, bs.getDashArray(), bs.getDashPhase()); }
Shape dashShape(Shape shape, Stroke stroke) { if(!(stroke instanceof BasicStroke)) { return shape; } BasicStroke bs = (BasicStroke) stroke; if(bs.getDashArray() == null || bs.getDashArray().length == 0) { return shape; } return new DashedShape(shape, bs.getDashArray(), bs.getDashPhase()); }
existingLineStyle.getLineJoin(), existingLineStyle.getMiterLimit(), existingLineStyle.getDashArray(), existingLineStyle.getDashPhase());
private Stroke copyOf(Stroke s) { if (s == null) { return null; } if (s instanceof BasicStroke) { BasicStroke bs = (BasicStroke) s; return new BasicStroke(bs.getLineWidth(), bs.getEndCap(), bs.getLineJoin(), bs.getMiterLimit(), bs.getDashArray(), bs.getDashPhase()); } throw new UnsupportedOperationException("The Stroke type '" + s.getClass().getName() + "' is not supported"); }
private Stroke transformStroke(Stroke stroke) { if (!(stroke instanceof BasicStroke)) return stroke; BasicStroke st = (BasicStroke)stroke; float scale = (float)Math.sqrt(Math.abs(transform.getDeterminant())); float dash[] = st.getDashArray(); if (dash != null) { for (int k = 0; k < dash.length; ++k) dash[k] *= scale; } return new BasicStroke(st.getLineWidth() * scale, st.getEndCap(), st.getLineJoin(), st.getMiterLimit(), dash, st.getDashPhase() * scale); }
private Stroke transformStroke(Stroke stroke) { if (!(stroke instanceof BasicStroke)) return stroke; BasicStroke st = (BasicStroke)stroke; float scale = (float)Math.sqrt(Math.abs(transform.getDeterminant())); float[] dash = st.getDashArray(); if (dash != null) { for (int k = 0; k < dash.length; ++k) dash[k] *= scale; } return new BasicStroke(st.getLineWidth() * scale, st.getEndCap(), st.getLineJoin(), st.getMiterLimit(), dash, st.getDashPhase() * scale); }
protected void applyStroke(SimpleShape<?,?> shape) { if (_stroke instanceof BasicStroke){ BasicStroke bs = (BasicStroke)_stroke; shape.setStrokeStyle((double)bs.getLineWidth()); float[] dash = bs.getDashArray(); if (dash != null) { //TODO: implement more dashing styles shape.setStrokeStyle(StrokeStyle.LineDash.DASH); } } }
private Stroke transformStroke(Stroke stroke) { if (!(stroke instanceof BasicStroke)) return stroke; BasicStroke st = (BasicStroke)stroke; float scale = (float)Math.sqrt(Math.abs(_transform.getDeterminant())); float dash[] = st.getDashArray(); if (dash != null) { for (int k = 0; k < dash.length; ++k) dash[k] *= scale; } return new BasicStroke(st.getLineWidth() * scale, st.getEndCap(), st.getLineJoin(), st.getMiterLimit(), dash, st.getDashPhase() * scale); }
private Stroke transformStroke(Stroke stroke) { if (!(stroke instanceof BasicStroke)) return stroke; BasicStroke st = (BasicStroke) stroke; float scale = (float) Math.sqrt(Math.abs(_transform.getDeterminant())); float dash[] = st.getDashArray(); if (dash != null) { for (int k = 0; k < dash.length; ++k) dash[k] *= scale; } return new BasicStroke(st.getLineWidth() * scale, st.getEndCap(), st.getLineJoin(), st.getMiterLimit(), dash, st.getDashPhase() * scale); }
static BasicStroke resizedBasicStroke(BasicStroke a, float multFactorSize) { if (multFactorSize == 1) return a; return new BasicStroke(a.getLineWidth() * multFactorSize, a.getEndCap(), a.getLineJoin(), a.getMiterLimit(), a.getDashArray(), a.getDashPhase()); } }
protected BasicStroke getScaledStroke() { if (ic==null) return stroke; double mag = ic.getMagnification(); if (mag!=1.0) { float width = (float)(stroke.getLineWidth()*mag); //return new BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL); return new BasicStroke(width, stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(), stroke.getDashArray(), stroke.getDashPhase()); } else return stroke; }
public void changelineThickness(float width) { if (!fixedLineWidth && stroke instanceof BasicStroke) { BasicStroke s = (BasicStroke) stroke; if (MathUtil.isDifferent(s.getLineWidth(), width)) { stroke = new BasicStroke(width, s.getEndCap(), s.getLineJoin(), s.getMiterLimit(), s.getDashArray(), s.getDashPhase()); } } }
public void setStroke(Stroke s) { this.stroke = s; if(s instanceof BasicStroke) { BasicStroke bs = (BasicStroke)s; psAppend(bs.getLineWidth()+" sw"+NEWLINE); psAppend(Math.max(1, bs.getMiterLimit())+" sm"+NEWLINE); psAppend(bs.getLineJoin()+" sj"+NEWLINE); psAppend(bs.getEndCap()+" slc"+NEWLINE); psAppend("["+arrayToString(bs.getDashArray())+"] "+bs.getDashPhase()+" sd"+NEWLINE); } }