Java Code Examples for android.graphics.Paint.Join

The following are Jave code examples for showing how to use Join of the android.graphics.Paint class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Raffler-Android   File: CustomTextView.java   View Source Code Vote up 6 votes
public void init(AttributeSet attrs) {

        if (attrs != null) {
            TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.CoustomTextView);

            if (a.hasValue(R.styleable.CoustomTextView_strokeColor)) {
                float strokeWidth = a.getDimensionPixelSize(R.styleable.CoustomTextView_strokeWidth, 1);
                int strokeColor = a.getColor(R.styleable.CoustomTextView_strokeColor, 0xff000000);
                float strokeMiter = a.getDimensionPixelSize(R.styleable.CoustomTextView_strokeMiter, 10);
                Paint.Join strokeJoin = null;
                switch (a.getInt(R.styleable.CoustomTextView_strokeJoinStyle, 0)) {
                    case (0):
                        strokeJoin = Paint.Join.MITER;
                        break;
                    case (1):
                        strokeJoin = Paint.Join.BEVEL;
                        break;
                    case (2):
                        strokeJoin = Paint.Join.ROUND;
                        break;
                }
                this.setStroke(strokeWidth, strokeColor, strokeJoin, strokeMiter);
            }
        }
    }
 
Example 2
Project: VectorMaster   File: Utils.java   View Source Code Vote up 5 votes
public static Paint.Join getLineJoinFromString(String value) {
    switch (value) {
        case "0":
            return Paint.Join.MITER;
        case "1":
            return Paint.Join.ROUND;
        case "2":
            return Paint.Join.BEVEL;
        default:
            return Paint.Join.MITER;
    }
}
 
Example 3
Project: atlas   File: ShapeStroke.java   View Source Code Vote up 5 votes
Paint.Join toPaintJoin() {
  switch (this) {
    case Bevel:
      return Paint.Join.BEVEL;
    case Miter:
      return Paint.Join.MITER;
    case Round:
      return Paint.Join.ROUND;
  }
  return null;
}
 
Example 4
Project: Raffler-Android   File: CustomTextView.java   View Source Code Vote up 4 votes
public void setStroke(float width, int color, Paint.Join join, float miter) {
    strokeWidth = width;
    strokeColor = color;
    strokeJoin = join;
    strokeMiter = miter;
}
 
Example 5
Project: VectorMaster   File: PathModel.java   View Source Code Vote up 4 votes
public Paint.Join getStrokeLineJoin() {
    return strokeLineJoin;
}
 
Example 6
Project: VectorMaster   File: PathModel.java   View Source Code Vote up 4 votes
public void setStrokeLineJoin(Paint.Join strokeLineJoin) {
    this.strokeLineJoin = strokeLineJoin;
    updatePaint();
}
 
Example 7
Project: CanvasScript   File: PaintScript.java   View Source Code Vote up 4 votes
public PaintScript strokeJoin(Paint.Join join) {
    paint.setStrokeJoin(join);
    return this;
}
 
Example 8
Project: CanvasScript   File: CanvasScript.java   View Source Code Vote up 4 votes
public CanvasScript strokeJoin(Paint.Join join) {
    createPaintIfNull();
    currentPaint.setStrokeJoin(join);
    return this;
}