本文整理汇总了Java中android.graphics.Paint.Join类的典型用法代码示例。如果您正苦于以下问题:Java Join类的具体用法?Java Join怎么用?Java Join使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Join类属于android.graphics.Paint包,在下文中一共展示了Join类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MultiBoxTracker
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例2: SimpleGraph
import android.graphics.Paint.Join; //导入依赖的package包/类
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();
}
示例3: StaticGraph
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例4: SmoothGraph
import android.graphics.Paint.Join; //导入依赖的package包/类
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();
}
示例5: UpdateCanvas
import android.graphics.Paint.Join; //导入依赖的package包/类
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();
}
示例6: Graphics
import android.graphics.Paint.Join; //导入依赖的package包/类
/**
* 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);
}
示例7: DrawerArrowDrawable
import android.graphics.Paint.Join; //导入依赖的package包/类
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();
}
示例8: onDraw
import android.graphics.Paint.Join; //导入依赖的package包/类
@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);
}
示例9: BookmarkDrawable
import android.graphics.Paint.Join; //导入依赖的package包/类
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 );
}
示例10: drawPolyline
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例11: drawPolygon
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例12: MultiBoxTracker
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例13: drawPointerArrow
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例14: setStroke
import android.graphics.Paint.Join; //导入依赖的package包/类
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);
}
示例15: drawOnTouchMove
import android.graphics.Paint.Join; //导入依赖的package包/类
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();
}