public MultiBoxTracker(final Context context) { this.context = context; for (final int color : COLORS) { availableColors.add(color); } boxPaint.setColor(Color.RED); boxPaint.setStyle(Style.STROKE); boxPaint.setStrokeWidth(12.0f); boxPaint.setStrokeCap(Cap.ROUND); boxPaint.setStrokeJoin(Join.ROUND); boxPaint.setStrokeMiter(100); textSizePx = TypedValue.applyDimension( TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DIP, context.getResources().getDisplayMetrics()); borderedText = new BorderedText(textSizePx); }
private SimpleGraph(final int color, final long maxNsecs, final float width, final float height, final float strokeWidth) { this.maxNsecs = maxNsecs; // this.width = width; this.height = height; nsecWidth = width / maxNsecs; paintStroke = new Paint(); paintStroke.setColor(color); paintStroke.setAlpha(204); // 80% paintStroke.setStyle(Style.STROKE); paintStroke.setStrokeWidth(strokeWidth); paintStroke.setStrokeCap(Cap.ROUND); paintStroke.setStrokeJoin(Join.ROUND); paintStroke.setAntiAlias(true); paintFill = new Paint(); paintFill.setColor(color); paintFill.setAlpha(51); // 20% paintFill.setStyle(Style.FILL); paintFill.setAntiAlias(true); pathStroke = new Path(); pathFill = new Path(); }
private StaticGraph(final int color, final float width, final float height, final float strokeWidth) { this.height = height; this.width = width; pathStroke = new Path(); pathFill = new Path(); paintStroke = new Paint(); paintFill = new Paint(); paintStroke.setColor(color); paintStroke.setAlpha(204); // 80% paintStroke.setStyle(Style.STROKE); paintStroke.setStrokeWidth(strokeWidth); paintStroke.setStrokeCap(Cap.ROUND); paintStroke.setStrokeJoin(Join.ROUND); paintStroke.setAntiAlias(true); paintFill.setColor(color); paintFill.setAlpha(51); // 20% paintFill.setStyle(Style.FILL); paintFill.setAntiAlias(true); }
private SmoothGraph(final int color, final float width, final float height, final float strokeWidth) { this.height = height; this.width = width; paintStroke = new Paint(); paintStroke.setColor(color); paintStroke.setAlpha(204); // 80% paintStroke.setStyle(Style.STROKE); paintStroke.setStrokeWidth(strokeWidth); paintStroke.setStrokeCap(Cap.ROUND); paintStroke.setStrokeJoin(Join.ROUND); paintStroke.setAntiAlias(true); paintFill = new Paint(); paintFill.setColor(color); paintFill.setAlpha(51); // 20% paintFill.setStyle(Style.FILL); paintFill.setAntiAlias(true); pathStroke = new Path(); pathFill = new Path(); }
public void UpdateCanvas() { canvasMaster.drawColor(0, Mode.CLEAR); canvasMaster.drawBitmap(lastEditedBitmap, 0.0f, 0.0f, null); int i = 0; while (true) { if (i >= paths.size()) { break; } int brushSize = brushSizes.get(i); Paint paint = new Paint(); paint.setColor(0); paint.setStyle(Style.STROKE); paint.setAntiAlias(true); paint.setStrokeJoin(Join.ROUND); paint.setStrokeCap(Cap.ROUND); paint.setXfermode(new PorterDuffXfermode(Mode.SRC)); paint.setStrokeWidth((float) brushSize); canvasMaster.drawPath(paths.get(i), paint); i += 1; } touchImageView.invalidate(); }
/** * Construct * * @param canvas0 canvas */ public Graphics(final Canvas canvas0) { super(); this.canvas = canvas0; // if (theScale != 1F) // this.canvas.scale(theScale, theScale, this.canvas.getWidth() / 2F, this.canvas.getHeight() / 2F); // if (Graphics.scale != 1F) // this.theCanvas.scale(Graphics.scale, Graphics.scale, this.theCanvas.getWidth() / 2F, this.theCanvas.getHeight() / 2F); this.paint = new Paint(); this.paint.setAntiAlias(true); this.paint.setHinting(Paint.HINTING_ON); // font this.paint.setStrokeWidth(2); this.paint.setStrokeCap(Cap.BUTT); this.paint.setStrokeJoin(Join.BEVEL); this.paint.setStrokeMiter(1); this.paint.setColor(android.graphics.Color.WHITE); }
public DrawerArrowDrawable(Context context) { this.mPaint.setStyle(Style.STROKE); this.mPaint.setStrokeJoin(Join.MITER); this.mPaint.setStrokeCap(Cap.BUTT); this.mPaint.setAntiAlias(true); TypedArray a = context.getTheme().obtainStyledAttributes(null, R.styleable.DrawerArrowToggle, R.attr.drawerArrowStyle, R.style.Base_Widget_AppCompat_DrawerArrowToggle); setColor(a.getColor(R.styleable.DrawerArrowToggle_color, 0)); setBarThickness(a.getDimension(R.styleable.DrawerArrowToggle_thickness, 0.0f)); setSpinEnabled(a.getBoolean(R.styleable.DrawerArrowToggle_spinBars, true)); setGapSize((float) Math.round(a.getDimension(R.styleable.DrawerArrowToggle_gapBetweenBars, 0.0f))); this.mSize = a.getDimensionPixelSize(R.styleable.DrawerArrowToggle_drawableSize, 0); this.mBarLength = (float) Math.round(a.getDimension(R.styleable.DrawerArrowToggle_barLength, 0.0f)); this.mArrowHeadLength = (float) Math.round(a.getDimension(R.styleable.DrawerArrowToggle_arrowHeadLength, 0.0f)); this.mArrowShaftLength = a.getDimension(R.styleable.DrawerArrowToggle_arrowShaftLength, 0.0f); a.recycle(); }
@SuppressLint("DrawAllocation") @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setColor(lineColor); paint.setStrokeWidth(lineWidth); paint.setStrokeCap(Cap.ROUND); paint.setStrokeJoin(Join.ROUND); paint.setStyle(Style.STROKE); Path path = new Path(); path.moveTo(startPoint.x, startPoint.y); path.lineTo(endPoint.x, endPoint.y); canvas.setMatrix(mMatrix); canvas.drawPath(path, paint); }
public BookmarkDrawable() { FILL_PAINT = new Paint(); STROKE_PAINT = new Paint(); SHADOW_PAINT = new Paint(); TEXT_PAINT = new Paint(); FILL_PAINT.setStyle( Paint.Style.FILL ); STROKE_PAINT.setStyle( Paint.Style.STROKE ); STROKE_PAINT.setStrokeWidth( 2 ); STROKE_PAINT.setStrokeJoin( Join.ROUND ); STROKE_PAINT.setAntiAlias( true ); SHADOW_PAINT.setStyle( Paint.Style.FILL_AND_STROKE ); SHADOW_PAINT.setStrokeWidth( 2 ); SHADOW_PAINT.setStrokeJoin( Join.ROUND ); SHADOW_PAINT.setAntiAlias( true ); SHADOW_PAINT.setARGB( 48, 0, 0, 0 ); TEXT_PAINT.setStyle( Paint.Style.FILL ); TEXT_PAINT.setTypeface( Typeface .DEFAULT_BOLD ); TEXT_PAINT.setTextAlign( Align .CENTER ); TEXT_PAINT.setAntiAlias( true ); }
private void drawPolyline(Canvas canvas, MapView mapView) { Point ptLine1=mapView.getProjection().toPixels(geoPolyLine1, null); Point ptLine2=mapView.getProjection().toPixels(geoPolyLine2, null); Point ptLine3=mapView.getProjection().toPixels(geoPolyLine3, null); Point ptLine4=mapView.getProjection().toPixels(geoPolyLine4, null); Path pathLine=new Path(); pathLine.moveTo(ptLine1.x, ptLine1.y); pathLine.lineTo(ptLine2.x, ptLine2.y); pathLine.lineTo(ptLine3.x, ptLine3.y); pathLine.lineTo(ptLine4.x, ptLine4.y); Paint paintLine=new Paint(); paintLine.setStyle(Style.STROKE); paintLine.setStrokeWidth(10); paintLine.setColor(Color.BLUE); paintLine.setAntiAlias(true); paintLine.setStrokeCap(Cap.ROUND); paintLine.setStrokeJoin(Join.ROUND); canvas.drawPath(pathLine, paintLine); }
private void drawPolygon(Canvas canvas, MapView mapView) { Point ptpolygon1=mapView.getProjection().toPixels(geoPolygon1, null); Point ptpolygon2=mapView.getProjection().toPixels(geoPolygon2, null); Point ptpolygon3=mapView.getProjection().toPixels(geoPolygon3, null); Point ptpolygon4=mapView.getProjection().toPixels(geoPolygon4, null); Path pathpolygon=new Path(); pathpolygon.moveTo(ptpolygon1.x, ptpolygon1.y); pathpolygon.lineTo(ptpolygon2.x, ptpolygon2.y); pathpolygon.lineTo(ptpolygon3.x, ptpolygon3.y); pathpolygon.lineTo(ptpolygon4.x, ptpolygon4.y); Paint paintpolygon=new Paint(); paintpolygon.setStyle(Style.FILL); paintpolygon.setStrokeWidth(10); paintpolygon.setColor(Color.BLUE); paintpolygon.setAntiAlias(true); paintpolygon.setStrokeCap(Cap.ROUND); paintpolygon.setStrokeJoin(Join.ROUND); canvas.drawPath(pathpolygon, paintpolygon); }
public MultiBoxTracker(final DisplayMetrics metrics) { for (final int color : COLORS) { availableColors.add(color); } boxPaint.setColor(Color.RED); boxPaint.setStyle(Style.STROKE); boxPaint.setStrokeWidth(12.0f); boxPaint.setStrokeCap(Cap.ROUND); boxPaint.setStrokeJoin(Join.ROUND); boxPaint.setStrokeMiter(100); textSizePx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, TEXT_SIZE_DIP, metrics); borderedText = new BorderedText(textSizePx); }
private void drawPointerArrow(Canvas canvas) { int centerX = getWidth() / 2; int centerY = getHeight() / 2; double tipAngle = (colorHSV[2] - 0.5f) * Math.PI; double leftAngle = tipAngle + Math.PI / 96; double rightAngle = tipAngle - Math.PI / 96; double tipAngleX = Math.cos(tipAngle) * outerWheelRadius; double tipAngleY = Math.sin(tipAngle) * outerWheelRadius; double leftAngleX = Math.cos(leftAngle) * (outerWheelRadius + arrowPointerSize); double leftAngleY = Math.sin(leftAngle) * (outerWheelRadius + arrowPointerSize); double rightAngleX = Math.cos(rightAngle) * (outerWheelRadius + arrowPointerSize); double rightAngleY = Math.sin(rightAngle) * (outerWheelRadius + arrowPointerSize); arrowPointerPath.reset(); arrowPointerPath.moveTo((float) tipAngleX + centerX, (float) tipAngleY + centerY); arrowPointerPath.lineTo((float) leftAngleX + centerX, (float) leftAngleY + centerY); arrowPointerPath.lineTo((float) rightAngleX + centerX, (float) rightAngleY + centerY); arrowPointerPath.lineTo((float) tipAngleX + centerX, (float) tipAngleY + centerY); valuePointerArrowPaint.setColor(Color.HSVToColor(colorHSV)); valuePointerArrowPaint.setStyle(Style.FILL); canvas.drawPath(arrowPointerPath, valuePointerArrowPaint); valuePointerArrowPaint.setStyle(Style.STROKE); valuePointerArrowPaint.setStrokeJoin(Join.ROUND); valuePointerArrowPaint.setColor(Color.BLACK); canvas.drawPath(arrowPointerPath, valuePointerArrowPaint); }
private void setStroke(Cap cap, Join join, float miter, Style style, PathEffect pathEffect, Paint paint) { paint.setStrokeCap(cap); paint.setStrokeJoin(join); paint.setStrokeMiter(miter); paint.setPathEffect(pathEffect); paint.setStyle(style); }
private void drawOnTouchMove() { Paint paint = new Paint(); paint.setStrokeWidth((float) updatedBrushSize); paint.setColor(0); paint.setStyle(Style.STROKE); paint.setAntiAlias(true); paint.setStrokeJoin(Join.ROUND); paint.setStrokeCap(Cap.ROUND); paint.setXfermode(new PorterDuffXfermode(Mode.SRC)); canvasMaster.drawPath(drawingPath, paint); touchImageView.invalidate(); }
public void UpdateLastEiditedBitmapForUndoLimit() { Canvas canvas = new Canvas(lastEditedBitmap); for (int i = 0; i < 1; i += 1) { int brushSize = brushSizes.get(i); Paint paint = new Paint(); paint.setColor(0); paint.setStyle(Style.STROKE); paint.setAntiAlias(true); paint.setStrokeJoin(Join.ROUND); paint.setStrokeCap(Cap.ROUND); paint.setXfermode(new PorterDuffXfermode(Mode.SRC)); paint.setStrokeWidth((float) brushSize); canvas.drawPath(paths.get(i), paint); } }
private void setupPaints() { this.circlePaint.setAntiAlias(true); this.circlePaint.setStrokeWidth((float) this.mStrokeWidth); this.circlePaint.setStyle(Style.STROKE); this.circlePaint.setColor(this.mBackgroundColor); this.fillPaint.setAntiAlias(true); this.fillPaint.setStrokeWidth((float) this.mStrokeWidth); this.fillPaint.setStyle(Style.STROKE); this.fillPaint.setStrokeJoin(Join.ROUND); this.fillPaint.setColor(this.mProgressColor); if (this.mIsCapRound) { this.circlePaint.setStrokeCap(Cap.ROUND); this.fillPaint.setStrokeCap(Cap.ROUND); } }
private Join getStrokeLineJoin(int id, Join defValue) { switch (id) { case 0: return Join.MITER; case 1: return Join.ROUND; case 2: return Join.BEVEL; default: return defValue; } }
public C0015o() { this.f34a = 0; this.f35b = 0.0f; this.f36c = 0; this.f37d = 1.0f; this.f39f = 1.0f; this.f40g = 0.0f; this.f41h = 1.0f; this.f42i = 0.0f; this.f43j = Cap.BUTT; this.f44k = Join.MITER; this.f45l = 4.0f; }
public C0015o(C0015o c0015o) { super(c0015o); this.f34a = 0; this.f35b = 0.0f; this.f36c = 0; this.f37d = 1.0f; this.f39f = 1.0f; this.f40g = 0.0f; this.f41h = 1.0f; this.f42i = 0.0f; this.f43j = Cap.BUTT; this.f44k = Join.MITER; this.f45l = 4.0f; this.f46p = c0015o.f46p; this.f34a = c0015o.f34a; this.f35b = c0015o.f35b; this.f37d = c0015o.f37d; this.f36c = c0015o.f36c; this.f38e = c0015o.f38e; this.f39f = c0015o.f39f; this.f40g = c0015o.f40g; this.f41h = c0015o.f41h; this.f42i = c0015o.f42i; this.f43j = c0015o.f43j; this.f44k = c0015o.f44k; this.f45l = c0015o.f45l; }
private Join m42a(int i, Join join) { switch (i) { case C0243l.View_android_theme /*0*/: return Join.MITER; case C0243l.View_android_focusable /*1*/: return Join.ROUND; case C0243l.View_paddingStart /*2*/: return Join.BEVEL; default: return join; } }
private Paint getStrokePaint(int color) { Paint p = new Paint(); p.setColor(color); p.setStyle(Style.STROKE); p.setStrokeJoin(Join.ROUND); p.setStrokeMiter(10); p.setStrokeWidth(3.0f); p.setAntiAlias(true); return p; }
public DrawerArrowDrawable(Context paramContext) { this.mPaint.setStyle(Paint.Style.STROKE); this.mPaint.setStrokeJoin(Paint.Join.MITER); this.mPaint.setStrokeCap(Paint.Cap.BUTT); this.mPaint.setAntiAlias(true); TypedArray localTypedArray = paramContext.getTheme().obtainStyledAttributes(null, R.styleable.DrawerArrowToggle, R.attr.drawerArrowStyle, R.style.Base_Widget_AppCompat_DrawerArrowToggle); int i = localTypedArray.getColor(R.styleable.DrawerArrowToggle_color, 0); if (i != this.mPaint.getColor()) { this.mPaint.setColor(i); invalidateSelf(); } float f1 = localTypedArray.getDimension(R.styleable.DrawerArrowToggle_thickness, 0.0F); if (this.mPaint.getStrokeWidth() != f1) { this.mPaint.setStrokeWidth(f1); this.mMaxCutForBarSize = ((float)(f1 / 2.0F * Math.cos(ARROW_HEAD_ANGLE))); invalidateSelf(); } boolean bool = localTypedArray.getBoolean(R.styleable.DrawerArrowToggle_spinBars, true); if (this.mSpin != bool) { this.mSpin = bool; invalidateSelf(); } float f2 = Math.round(localTypedArray.getDimension(R.styleable.DrawerArrowToggle_gapBetweenBars, 0.0F)); if (f2 != this.mBarGap) { this.mBarGap = f2; invalidateSelf(); } this.mSize = localTypedArray.getDimensionPixelSize(R.styleable.DrawerArrowToggle_drawableSize, 0); this.mBarLength = Math.round(localTypedArray.getDimension(R.styleable.DrawerArrowToggle_barLength, 0.0F)); this.mArrowHeadLength = Math.round(localTypedArray.getDimension(R.styleable.DrawerArrowToggle_arrowHeadLength, 0.0F)); this.mArrowShaftLength = localTypedArray.getDimension(R.styleable.DrawerArrowToggle_arrowShaftLength, 0.0F); localTypedArray.recycle(); }
public gfv(Context paramContext, int paramInt) { gge localgge = new gge(paramContext, gft.a, paramInt, e); int i1 = gft.i; this.f = localgge.a(i1).getInt(i1, -1); int i2 = gft.g; ColorStateList localColorStateList = localgge.a(i2).getColorStateList(i2); int i3 = gft.h; float f1 = localgge.a(i3).getDimensionPixelSize(i3, 0); int i4 = gft.c; this.g = localgge.a(i4).getColorStateList(i4); int i5 = gft.f; this.h = localgge.a(i5).getDimensionPixelSize(i5, 0); int i6 = gft.d; this.i = localgge.a(i6).getColorStateList(i6); int i7 = gft.e; this.j = localgge.a(i7).getDimensionPixelSize(i7, 0); int i8 = gft.b; this.b = localgge.a(i8).getColorStateList(i8).getDefaultColor(); localgge.a(); this.m = new Paint(); this.m.setAntiAlias(true); this.m.setStyle(Paint.Style.STROKE); this.m.setStrokeWidth(this.h); this.m.setStrokeJoin(Paint.Join.MITER); this.n = new Paint(this.m); this.k = new Paint(this.m); this.k.setStrokeWidth(f1); this.k.setColor(localColorStateList.getDefaultColor()); this.l = new Paint(); this.l.setStyle(Paint.Style.STROKE); this.l.setStrokeWidth(f1 * 2.0F); this.l.setColor(1325400064); this.c = ((int)Math.ceil(Math.max(this.h, f1) / 2.0F)); this.o = new Paint(); this.o.setColor(this.b); }