|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.PathSegment
public class PathSegment
路径片段,用于描述路径,包含类型和坐标信息 路径有三种类型:moveTo, lineTo, quadTo,分别对应2D绘制的三种画法:移动画笔,绘制线条,绘制曲线 该类可用于连线的走向,多边形的定义
Link.addPathSegement(PathSegment)
,
ShapeNode.addPathSegement(PathSegment)
Nested Class Summary | |
---|---|
static class |
PathSegment.LineSegment
路径片段,对应路径绘制的 Path#lineTo(float, float) 方法 |
static class |
PathSegment.MoveSegment
路径片段,对应路径绘制的 Path#moveTo(float, float) 方法 |
static class |
PathSegment.QuadSegment
路径片段,对应路径绘制的 Path#quadTo(float, float, float, float) 方法 |
Field Summary | |
---|---|
Point[] |
points
坐标点 |
int |
type
路径片段类型 |
Constructor Summary | |
---|---|
PathSegment()
路径片段,用于描述路径,包含类型和坐标信息 路径有三种类型:moveTo, lineTo, quadTo,分别对应2D绘制的三种画法:移动画笔,绘制线条,绘制曲线 该类可用于连线的走向,多边形的定义 |
|
PathSegment(Point[] points,
int type)
构造函数,设置路径坐标点和,片段类型 |
|
PathSegment(Point point,
int type)
构造函数 |
Method Summary | |
---|---|
PathSegment |
clone()
拷贝一份新的数据,避免对原始数据的更改 |
void |
deserialize(java.lang.String s)
反序列化属性,根据字符串生成对象的属性 |
void |
draw(Path g,
Matrix m)
绘制路径 |
boolean |
equals(java.lang.Object o)
|
Point |
getControlPoint()
|
Point |
getFirstPoint()
|
double |
getLength(Point prev)
路径长度 |
Point |
getPoint()
|
PathSegment |
getReversePath(PathSegment prev)
获取反向路径 |
boolean |
isCurve()
|
PathSegment |
scale(float xScale,
float yScale)
缩放路径 |
java.lang.String |
serialize()
序列化该对象 |
void |
set(PathSegment path)
从指定路径片段拷贝路径参数 |
PathSegment |
translate(float dx,
float dy)
偏移路径 |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int type
public Point[] points
Constructor Detail |
---|
public PathSegment()
Link.addPathSegement(PathSegment)
,
ShapeNode.addPathSegement(PathSegment)
public PathSegment(Point point, int type)
point
- 路径点坐标type
- 路径类型
Consts.SEGMENT_MOVETO
Consts.SEGMENT_LINETO
Consts.SEGMENT_QUADTO
public PathSegment(Point[] points, int type)
points
- 坐标点type
- 类型Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public Point getPoint()
public Point getFirstPoint()
public Point getControlPoint()
public void draw(Path g, Matrix m)
g
- 路径m
- 变换矩阵public double getLength(Point prev)
prev
- 上一个路径片段点
public boolean isCurve()
public PathSegment getReversePath(PathSegment prev)
prev
- 上一个路径片段
public PathSegment translate(float dx, float dy)
dx
- x偏移量dy
- y偏移量
public PathSegment scale(float xScale, float yScale)
xScale
- x缩放比例yScale
- y方向缩放比例
public void set(PathSegment path)
path
- 路径片段public PathSegment clone()
IStruct
clone
in interface IStruct
clone
in class java.lang.Object
public java.lang.String serialize()
ISerializable
serialize
in interface ISerializable
public void deserialize(java.lang.String s)
ISerializable
deserialize
in interface ISerializable
s
- 字符串
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |