public class GestureStroke
extends Object
| java.lang.Object | |
| android.gesture.GestureStroke | |
一个手势中风从一个触摸开始,然后触摸结束。 中风由一系列定时点组成。 一个或多个笔画形成一个手势。
Fields |
|
|---|---|
public final RectF |
boundingBox |
public final float |
length |
public final float[] |
points |
Public constructors |
|
|---|---|
GestureStroke(ArrayList<GesturePoint> points) 一个构造函数,用于从手势点列表构造手势描边。 |
|
公共方法(Public methods) |
|
|---|---|
void |
clearPath() 使用于渲染笔画的缓存路径无效。 |
Object |
clone() 创建并返回此对象的副本。 |
OrientedBoundingBox |
computeOrientedBoundingBox() 计算笔画的定向边界框。 |
Path |
getPath() |
Path |
toPath(float width, float height, int numSample) 将笔画转换为给定数量的点的路径。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
GestureStroke (ArrayList<GesturePoint> points)
一个构造函数,用于从手势点列表构造手势描边。
Object clone ()
创建并返回此对象的副本。 “复制”的确切含义可能取决于对象的类别。 一般意图是,对于任何对象x ,表达式:
will be true, and that the expression:x.clone() != x
will bex.clone().getClass() == x.getClass()
true, but these are not absolute requirements. While it is typically the case that:
will bex.clone().equals(x)
true, this is not an absolute requirement.
按照惯例,返回的对象应该通过调用super.clone来获得。 如果一个类和它的所有超类( Object除外)都服从这个约定,那么情况就是x.clone().getClass() == x.getClass() 。
按照惯例,这个方法返回的对象应该独立于这个对象(被克隆)。 要实现这种独立性,可能需要在返回super.clone之前修改返回的对象的一个或多个字段。 通常,这意味着复制包含被克隆对象的内部“深层结构”的任何可变对象,并将这些对象的引用替换为对这些副本的引用。 如果一个类仅包含原始字段或对不可变对象的引用,那么通常情况下,不需要修改由super.clone返回的对象中的字段。
类Object的方法clone执行特定的克隆操作。 首先,如果该对象的类没有实现接口Cloneable ,则引发CloneNotSupportedException 。 请注意,所有数组都被视为实现接口Cloneable并且数组类型T[]的clone方法的返回类型为T[] ,其中T是任何引用或原始类型。 否则,此方法创建该对象的类的新实例,并使用该对象的相应字段的内容来初始化其所有字段,就像通过赋值一样; 这些字段的内容本身并不克隆。 因此,此方法执行此对象的“浅拷贝”,而不是“深拷贝”操作。
类 Object本身并不实现接口 Cloneable ,所以在类为 Object的对象上调用 clone方法将导致在运行时抛出异常。
| 返回(Returns) | |
|---|---|
Object |
a clone of this instance. |
OrientedBoundingBox computeOrientedBoundingBox ()
计算笔画的定向边界框。
| 返回(Returns) | |
|---|---|
OrientedBoundingBox |
OrientedBoundingBox |
Path toPath (float width, float height, int numSample)
将笔画转换为给定数量的点的路径。
| 参数(Parameters) | |
|---|---|
width |
float: the width of the bounding box of the target path |
height |
float: the height of the bounding box of the target path |
numSample |
int: the number of points needed |
| 返回(Returns) | |
|---|---|
Path |
the path |