twaver
Class RoundRect

java.lang.Object
  extended by twaver.Size
      extended by twaver.Rect
          extended by twaver.RoundRect
All Implemented Interfaces:
twaver.core.topo.IShape, IStruct, ISerializable

public class RoundRect
extends Rect

圆角矩形,继承于Rect,增加了radius参数,用来表示圆角半径


Field Summary
 float radius
          圆角半径
 
Fields inherited from class twaver.Rect
x, y
 
Fields inherited from class twaver.Size
height, width
 
Constructor Summary
RoundRect()
          圆角矩形,继承于Rect,增加了radius参数,用来表示圆角半径
RoundRect(float x, float y, float width, float height, float radius)
          圆角矩形,继承于Rect,增加了radius参数,用来表示圆角半径
RoundRect(RoundRect roundRect)
          构造函数,从指定圆角矩形中获取参数信息
 
Method Summary
 RoundRect clone()
          拷贝一份新的数据,避免对原始数据的更改
 void deserialize(java.lang.String string)
          反序列化属性,根据字符串生成对象的属性
 boolean intersects(double x2, double y2)
          是否包含坐标点
 boolean intersects(double x2, double y2, double w2, double h2)
          矩形是否相交
 java.lang.String serialize()
          序列化该对象
 
Methods inherited from class twaver.Rect
add, add, add, contains, equals, equals, getBottom, getCenter, getCenterX, getCenterY, getLeft, getLocation, getRight, getTop, getX, getY, grow, grow, grow, intersection, intersects, intersects, intersects, isEmpty, offset, offset, reset, set, set, set, toGraphicRect, toGraphicRectF, toString, translate, union
 
Methods inherited from class twaver.Size
setHeight, setWidth
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

radius

public float radius
圆角半径

Constructor Detail

RoundRect

public RoundRect()
圆角矩形,继承于Rect,增加了radius参数,用来表示圆角半径


RoundRect

public RoundRect(float x,
                 float y,
                 float width,
                 float height,
                 float radius)
圆角矩形,继承于Rect,增加了radius参数,用来表示圆角半径

Parameters:
x - x坐标
y - y坐标
width - 宽度
height - 高度
radius - 圆角半径

RoundRect

public RoundRect(RoundRect roundRect)
构造函数,从指定圆角矩形中获取参数信息

Parameters:
roundRect - 圆角矩形
Method Detail

intersects

public boolean intersects(double x2,
                          double y2,
                          double w2,
                          double h2)
Description copied from class: Rect
矩形是否相交

Specified by:
intersects in interface twaver.core.topo.IShape
Overrides:
intersects in class Rect
Parameters:
x2 - 矩形x坐标
y2 - 矩形y坐标
w2 - 矩形宽度
h2 - 矩形高度
Returns:
矩形是否相交

intersects

public boolean intersects(double x2,
                          double y2)
Description copied from class: Rect
是否包含坐标点

Specified by:
intersects in interface twaver.core.topo.IShape
Overrides:
intersects in class Rect
Parameters:
x2 - x坐标
y2 - y坐标
Returns:
矩形是否包含坐标点

clone

public RoundRect clone()
Description copied from interface: IStruct
拷贝一份新的数据,避免对原始数据的更改

Specified by:
clone in interface IStruct
Overrides:
clone in class Rect
Returns:
新拷贝的数据

serialize

public java.lang.String serialize()
Description copied from interface: ISerializable
序列化该对象

Specified by:
serialize in interface ISerializable
Overrides:
serialize in class Rect
Returns:
字符串

deserialize

public void deserialize(java.lang.String string)
Description copied from interface: ISerializable
反序列化属性,根据字符串生成对象的属性

Specified by:
deserialize in interface ISerializable
Overrides:
deserialize in class Rect
Parameters:
string - 字符串