Skip to content

Commit

Permalink
规范命名,移除废弃方法
Browse files Browse the repository at this point in the history
  • Loading branch information
GcsSloop committed Sep 4, 2016
1 parent 084eef4 commit 07de1c1
Showing 1 changed file with 26 additions and 63 deletions.
89 changes: 26 additions & 63 deletions Library/src/main/java/com/gcssloop/view/utils/CanvasAidUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,55 +63,46 @@ public static void setDrawAid(boolean isDraw) {


/**
* 标注为废弃
* 设置2D坐标系坐标轴长度(正负轴等长)
*
* @param lenX x坐标轴长度
* @param lenY y坐标轴长度
* @param lineWidth 坐标轴宽度
* @param lineColor 坐标轴颜色
* @deprecated 标注为废弃, 后续版本中可能移除该方法, 请使用 {@link #setCoordinateLen(int, int, int, int)}. {@link #setLineWidth(int)} 和 {@link #setLineColor(int)} 来代替.
* @param lenX
* @param lenY
*/
@Deprecated
public static void setStyle(int lenX, int lenY, int lineWidth, int lineColor) {
LEN_X = lenX;
LEN_Y = lenY;
LEN_NX = lenX;
LEN_NY = lenY;
LINE_WIDTH = lineWidth;
LINE_COLOR = lineColor;
public static void set2DCoordinateLen(int lenX, int lenY) {
LEN_X = LEN_NX = lenX;
LEN_Y = LEN_NY = lenY;
}

/**
* 设置坐标轴长度
* 设置2D坐标系坐标轴长度(正负轴分别设置)
*
* @param lenX x坐标轴长度
* @param lenY y坐标轴长度
* @deprecated 被标记为删除, 后续版本中可能移除该方法, 请使用 {@link #setCoordinateLen(int, int, int, int)}代替
* @param lenX x正坐标轴长度.
* @param lenNX x负坐标轴长度.
* @param lenY y正坐标轴长度.
* @param lenNY y负坐标轴长度.
*/
public static void setLen(int lenX, int lenY) {
public static void set2DCoordinateLen(int lenX, int lenNX, int lenY, int lenNY) {
LEN_X = lenX;
LEN_Y = lenY;
LEN_NX = lenX;
LEN_NY = lenY;
LEN_NX = lenNX;
LEN_NY = lenNY;
}

/**
* 设置坐标轴长度
* 设置3D坐标系坐标轴长度(正负轴等长)
*
* @param lenX x正坐标轴长度.
* @param lenNX x负坐标轴长度.
* @param lenY y正坐标轴长度.
* @param lenNY y负坐标轴长度.
* @param lenZ z正坐标轴长度.
*/
public static void setCoordinateLen(int lenX, int lenNX, int lenY, int lenNY) {
LEN_X = lenX;
LEN_Y = lenY;
LEN_NX = lenNX;
LEN_NY = lenNY;
public static void set3DCoordinateLen(int lenX, int lenY, int lenZ) {
LEN_X = LEN_NX = lenX;
LEN_Y = LEN_NY = lenY;
LEN_Z = LEN_NZ = lenZ;
}

/**
* 设置3D坐标轴长度
* 设置3D坐标系坐标轴长度(正负轴分别设置)
*
* @param lenX x正坐标轴长度.
* @param lenNX x负坐标轴长度.
Expand All @@ -138,41 +129,12 @@ public static void setLineColor(int lineColor) {
}

/**
* 绘制坐标系.
* 修复名称,标记为删除,可能在几个版本后移除该方法.
*
* @param canvas 画布
* @deprecated 被标记为删除, 后续版本中可能移除该方法, 请使用 {@link #drawCoordinateSpace(Canvas)}代替
*/
@Deprecated
public static void drawCoordinateSystem(Canvas canvas) {
if (!isDrawAid) {
return;
}

initPaint();
initPoint();

canvas.save();

CanvasUtils.drawLine(XHead, XTail, canvas, mPaint);
CanvasUtils.drawLine(XHead, XCap1, canvas, mPaint);
CanvasUtils.drawLine(XHead, XCap2, canvas, mPaint);

CanvasUtils.drawLine(YHead, YTail, canvas, mPaint);
CanvasUtils.drawLine(YHead, YCap1, canvas, mPaint);
CanvasUtils.drawLine(YHead, YCap2, canvas, mPaint);

canvas.restore();
}


/**
* 绘制坐标空间.
* 绘制2D坐标空间.
*
* @param canvas 画布
*/
public static void drawCoordinateSpace(Canvas canvas) {
public static void draw2DCoordinateSpace(Canvas canvas) {
if (!isDrawAid) return;

initPaint();
initPoint();
Expand All @@ -196,8 +158,9 @@ public static void drawCoordinateSpace(Canvas canvas) {
* @param canvas 画布
*/
public static void draw3DCoordinateSpace(Canvas canvas) {
if (!isDrawAid) return;

drawCoordinateSpace(canvas);
draw2DCoordinateSpace(canvas);

canvas.save();

Expand Down

0 comments on commit 07de1c1

Please sign in to comment.