public class RectBoundaryShape extends Shape
限定符和类型 | 字段和说明 |
---|---|
static int |
MINI_SCALE_TO |
static int |
ROTATE_OPERATOR |
static int |
SCALE_OPERATOR_LEFT_BOTTOM |
static int |
SCALE_OPERATOR_LEFT_MIDDLE |
static int |
SCALE_OPERATOR_LEFT_TOP |
static int |
SCALE_OPERATOR_MIDDLE_BOTTOM |
static int |
SCALE_OPERATOR_MIDDLE_TOP |
static int |
SCALE_OPERATOR_RIGHT_BOTTOM |
static int |
SCALE_OPERATOR_RIGHT_MIDDLE |
static int |
SCALE_OPERATOR_RIGHT_TOP |
dashType, hasAddedToPaintList, id, isHoverTrace, mPaint, number, rotateAngle, sendByUserName, sendByUserNumber, userRole
构造器和说明 |
---|
RectBoundaryShape(Paint paint,
Context context) |
限定符和类型 | 方法和说明 |
---|---|
void |
appendPoint(LPPointF point) |
void |
copyShape(Shape shape) |
RectF |
getBoundary()
获取shape 范围参数
|
float |
getHeight() |
java.util.ArrayList<LPPointF> |
getPoints()
发送用点集
|
int |
getScaleOperatorDir() |
float[] |
getScaleParams(float x,
float y) |
float |
getWidth() |
boolean |
isBoundaryOverlap(RectF rect)
判断边界是否相交
|
boolean |
isInBoundary(float x,
float y)
判断点击事件 是否位于shape 范围
|
int |
isInScaleRect(float x,
float y) |
boolean |
isScaleEnable() |
boolean |
isTouchShape(float x,
float y)
判断是否点击到shape
|
boolean |
isValid()
图形是否有效.
|
void |
moveShapeBy(float dx,
float dy)
move shape by
|
void |
onDraw(Canvas canvas,
Matrix matrix)
绘制图形 在onDraw里调用 避免复杂的计算和内存分配
param canvas
|
void |
onDraw(Canvas canvas,
Matrix matrix,
ShapeRegionInfo regionInfo)
绘制图形
|
void |
scaleShapeBy(int scaleDir,
float scaleX,
float scaleY,
float offsetX,
float offsetY,
RectF boundaryRect,
boolean isMoreSelect)
scale shape to sourcePoint
|
void |
setAngle(float rotateAngle)
设置旋转角度
|
void |
setBoundaryRect(RectF rect) |
void |
setHeight(int height) |
void |
setOwnerList(java.util.List<java.lang.String> ownerList) |
void |
setRatioScaleEnable(boolean isRatioScale)
设置是否支持多选等比缩放
|
void |
setRotateEnable(boolean isRotate)
是否支持旋转
|
void |
setScaleEnable(boolean scaleEnable) |
void |
setScaleOperatorDir(int scaleOperatorDir) |
void |
setSelectedEndPoint(int x,
int y) |
void |
setSelectedStartPoint(int x,
int y) |
void |
setShowPaintOwnerEnable(boolean isShowPaintOwnerEnable)
设置是否显示画笔归属信息
|
void |
setWidth(int width) |
calcRotatePoint, copy, equals, getIn_angle, getPaint, getSourcePoint, setPaint, setSourcePoint
public static final int SCALE_OPERATOR_LEFT_TOP
public static final int SCALE_OPERATOR_LEFT_MIDDLE
public static final int SCALE_OPERATOR_LEFT_BOTTOM
public static final int SCALE_OPERATOR_MIDDLE_BOTTOM
public static final int SCALE_OPERATOR_RIGHT_BOTTOM
public static final int SCALE_OPERATOR_RIGHT_MIDDLE
public static final int SCALE_OPERATOR_RIGHT_TOP
public static final int SCALE_OPERATOR_MIDDLE_TOP
public static final int ROTATE_OPERATOR
public static final int MINI_SCALE_TO
public float getWidth()
public float getHeight()
public void setHeight(int height)
public void setWidth(int width)
public void setScaleOperatorDir(int scaleOperatorDir)
public void setScaleEnable(boolean scaleEnable)
public boolean isScaleEnable()
public int getScaleOperatorDir()
public void setOwnerList(java.util.List<java.lang.String> ownerList)
public void onDraw(Canvas canvas, Matrix matrix)
Shape
public void onDraw(Canvas canvas, Matrix matrix, ShapeRegionInfo regionInfo)
Shape
public int isInScaleRect(float x, float y)
public float[] getScaleParams(float x, float y)
public boolean isInBoundary(float x, float y)
Shape
isInBoundary
在类中 Shape
x
- rawXy
- rawYpublic boolean isTouchShape(float x, float y)
Shape
isTouchShape
在类中 Shape
x
- rawXy
- rawYpublic RectF getBoundary()
Shape
getBoundary
在类中 Shape
public void moveShapeBy(float dx, float dy)
Shape
moveShapeBy
在类中 Shape
dx
- distance by xdy
- distance by ypublic void scaleShapeBy(int scaleDir, float scaleX, float scaleY, float offsetX, float offsetY, RectF boundaryRect, boolean isMoreSelect)
Shape
scaleShapeBy
在类中 Shape
scaleDir
- scale directionscaleX
- X xiascaleY
- Y xiaoffsetX
- 缩放X轴相对原来中心点偏移量offsetY
- 缩放Y轴相对原来中心点偏移量boundaryRect
- 外接框范围isMoreSelect
- 是否多选缩放,需要处理旋转角度在90 ~ 270scaleDir置相反public void setBoundaryRect(RectF rect)
public boolean isBoundaryOverlap(RectF rect)
Shape
isBoundaryOverlap
在类中 Shape
public void appendPoint(LPPointF point)
appendPoint
在类中 Shape
public void setSelectedStartPoint(int x, int y)
public void setSelectedEndPoint(int x, int y)
public void setShowPaintOwnerEnable(boolean isShowPaintOwnerEnable)
isShowPaintOwnerEnable
- true 显示
false 不显示public void setAngle(float rotateAngle)
public void setRotateEnable(boolean isRotate)
isRotate
- 是否支持旋转public void setRatioScaleEnable(boolean isRatioScale)