public class BaseShape
extends android.graphics.drawable.shapes.Shape
| Modifier and Type | Field and Description |
|---|---|
protected android.graphics.RectF |
mBoundsRect |
protected float |
mPivotX
回転・拡大縮小をShapeの中心位置で行うための変数
Shape座標系(Shape内描画座標系ではない素のShape座標系)
#onResizeで設定する
|
protected float |
mPivotY
回転・拡大縮小をShapeの中心位置で行うための変数
Shape座標系(Shape内描画座標系ではない素のShape座標系)
#onResizeで設定する
|
protected float |
mRotation
表示時の回転角度
|
protected float |
mScaleX
素のShape座標系をShape内描画座標系に変換する係数
(設定用のサイズと実際の描画時のサイズ変換用変数)
#onResizeで更新される
|
protected float |
mScaleY
素のShape座標系をShape内描画座標系に変換する係数
(設定用のサイズと実際の描画時のサイズ変換用変数)
#onResizeで更新される
|
protected float |
mStdHeight
このShapeの描画内容の位置関係を設定する際のサイズ(任意)
Shape内描画座標系の右下座標と同じ
|
protected float |
mStdHeight2
Shape内描画座標系の中央座標(mStdWidth/mStdHeightのそれぞれ1/2の値)
|
protected float |
mStdWidth
このShapeの描画内容の位置関係を設定する際のサイズ(任意)
Shape内描画座標系の右下座標と同じ
|
protected float |
mStdWidth2
Shape内描画座標系の中央座標(mStdWidth/mStdHeightのそれぞれ1/2の値)
|
protected java.lang.String |
TAG |
| Constructor and Description |
|---|
BaseShape(float std_width,
float std_height)
標準サイズを指定して生成する
描画の際には実際のサイズに合うように拡大縮小してから描画されるので、
このShapeの描画内容の位置関係を設定するのに都合の良いサイズをしてすれば良い。
|
| Modifier and Type | Method and Description |
|---|---|
protected android.graphics.RectF |
boundsRect()
外形矩形を取得
|
BaseShape |
clone() |
protected void |
doDraw(android.graphics.Canvas canvas,
android.graphics.Paint paint)
Shapeの実際の描画処理 BaseShapeでは四角を描画する。
|
void |
draw(android.graphics.Canvas canvas,
android.graphics.Paint paint)
Shapeの描画処理
ここではcanvasの状態保存&復帰、回転・拡大縮小を適用してから#doDrawを呼び出す
|
void |
getOutline(android.graphics.Outline outline) |
float |
getRotation() |
float |
getScaleX() |
float |
getScaleY() |
protected void |
onResize(float width,
float height) |
void |
setRotation(float rotation) |
protected final java.lang.String TAG
protected final android.graphics.RectF mBoundsRect
protected final float mStdWidth
protected final float mStdHeight
protected final float mStdWidth2
protected final float mStdHeight2
protected float mScaleX
protected float mScaleY
protected float mRotation
protected float mPivotX
protected float mPivotY
public BaseShape(float std_width,
float std_height)
std_width - std_height - public void getOutline(android.graphics.Outline outline)
getOutline in class android.graphics.drawable.shapes.Shapeprotected void onResize(float width,
float height)
onResize in class android.graphics.drawable.shapes.Shapeprotected final android.graphics.RectF boundsRect()
public BaseShape clone() throws java.lang.CloneNotSupportedException
clone in class android.graphics.drawable.shapes.Shapejava.lang.CloneNotSupportedExceptionpublic float getScaleX()
public float getScaleY()
public void setRotation(float rotation)
public float getRotation()
public void draw(android.graphics.Canvas canvas,
android.graphics.Paint paint)
draw in class android.graphics.drawable.shapes.Shapeprotected void doDraw(android.graphics.Canvas canvas,
android.graphics.Paint paint)
canvas - paint -