本文整理了Java中com.zone.lib.utils.view.graphics.basic.ZPointF
类的一些代码示例,展示了ZPointF
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZPointF
类的具体详情如下:
包路径:com.zone.lib.utils.view.graphics.basic.ZPointF
类名称:ZPointF
[英]Created by fuzhipeng on 16/8/4. 有父子关系;注意:但是构造器的x,y不是 相对的; 在offset的时候对 children进行offset ;
[中]福志鹏于2004年8月16日创作。有父子关系;注意:但是构造器的x、 y不是 相对的; 在抵消的时候对 儿童进行抵消
代码示例来源:origin: luhaoaimama1/zone-sdk
private void initControlPoint() {
float controlLength = r * c;
topLeftContrl = new ZPointF(-controlLength, 0, top);
topRightContrl = new ZPointF(controlLength, 0, top);
bottomLeftContrl = new ZPointF(-controlLength, 0, bottom);
bottomRightContrl = new ZPointF(controlLength, 0, bottom);
leftTopContrl = new ZPointF(0, controlLength, left);
leftBottomContrl = new ZPointF(0, -controlLength, left);
rightTopContrl = new ZPointF(0, controlLength, right);
rightBottomContrl = new ZPointF(0, -controlLength, right);
}
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void setParent(ZPointF parent) {
//防止绑定多次
if (this.parent == parent)
return;
this.parent = parent;
this.parent.addChild(this);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
/**
* Set the point's x and y coordinates
*/
public final void set(float x, float y) {
if (this.x == x && this.y == y)
return;
this.x = x;
this.y = y;
calculateRposition();
calculateChildsPosition();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public void bindParent(ZPointF parent) {
unBindParent();
setParent(parent);
calculateRposition();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public final void rSet(float rx, float ry) {
if (this.rx == rx && this.ry == ry)
return;
this.rx = rx;
this.ry = ry;
calculatePositionByParent();
calculateChildsPosition();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus3() {
if (!status2Commit) {
status2Commit = true;
//动画状态1 把这个位置真正的记录下来;
commit();
rightStart3 = new ZPointF(circle.right);//必须新建对象来 记录值 不能用等于
centerStart3 = new ZPointF(circle.top);
}
float percent = (float) ((mAnimPercent - 0.5) * (10f / 3));
circle.right.offsetReplace((endCircle.right.x - rightStart3.x) * percent, 0);
circle.left.offsetReplace((endCircle.top.x - centerStart3.x) * percent, 0);
circle.top.offsetReplace((endCircle.top.x - centerStart3.x) * percent, 0);
circle.bottom.offsetReplace((endCircle.top.x - centerStart3.x) * percent, 0);
//控制点 在反向回去
topLeftContrl.offsetReplace((c2 - c) * percent, 0);
topRightContrl.offsetReplace(-(c2 - c) * percent, 0);
bottomLeftContrl.offsetReplace((c2 - c) * percent, 0);
bottomRightContrl.offsetReplace(-(c2 - c) * percent, 0);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
pA = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pA.offset(c1.center);
pD = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pD.offset(c1.center);
pApDControl = new ZPointF((float) (c1.r / Math.cos(Math.toRadians(expandAngel / 2))), 0);
pApDControl.offset(c1.center);
pB = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pB.offset(dst[0], dst[1]);
pC = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pC.offset(dst[0], dst[1]);
pBpCControl = new ZPointF(-(float) (c2.r / Math.cos(Math.toRadians(expandAngel / 2))), 0);
pBpCControl.offset(dst[0], dst[1]);
代码示例来源:origin: luhaoaimama1/zone-sdk
public ZPointF(float rx, float ry, ZPointF parent) {
this.rx = rx;
this.ry = ry;
setParent(parent);
calculatePositionByParent();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public void offsetReplaceCommitAllUpdateChilds() {
offsetReplaceCommitAll();
if (childs != null && childs.size() > 0)
for (ZPointF child : childs)
child.offsetReplaceCommitAllUpdateChilds();
}
public final void offsetReplace(float dx, float dy){
代码示例来源:origin: luhaoaimama1/zone-sdk
public void offsetReplaceCommitUpdateChilds(String tag) {
offsetReplaceCommit(tag);
if (childs != null && childs.size() > 0)
for (ZPointF child : childs)
child.offsetReplaceCommitUpdateChilds(tag);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public final void offsetReplace(float dx, float dy){
offsetReplace(dx,dy,TAG);
}
public final void offsetReplace(ZPointF pointF){
代码示例来源:origin: luhaoaimama1/zone-sdk
private void commit() {
circle.right.offsetReplaceCommitAllUpdateChilds();//1
circle.left.offsetReplaceCommitAllUpdateChilds();
circle.top.offsetReplaceCommitAllUpdateChilds();
circle.bottom.offsetReplaceCommitAllUpdateChilds();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public final void offset(ZPointF pointF) {
offset(pointF.x, pointF.y);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void calculateChildsPosition() {
if (childs != null && childs.size() > 0)
for (ZPointF child : childs)
child.calculatePositionByParent();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus5() {
float percent = (float) (mAnimPercent - 0.9) * 10;
if (!status4Commit) {
status4Commit = true;
commit();
leftStart5 = new ZPointF(circle.left);
}
circle.left.offsetReplace((endCircle.left.x - leftStart5.x) * percent, 0);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
pA = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pA.offset(c1.center);
pD = new ZPointF((float) Math.cos(Math.toRadians(expandAngel / 2)) * c1.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c1.r);
pD.offset(c1.center);
pB = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, -(float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pB.offset(dst[0], dst[1]);
pC = new ZPointF(-(float) Math.cos(Math.toRadians(expandAngel / 2)) * c2.r, (float) Math.sin(Math.toRadians(expandAngel / 2)) * c2.r);
pC.offset(dst[0], dst[1]);
pControl = GeometryUtils.getMidPoint(c1.center, new ZPointF(dst[0], dst[1]));
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus1() {
float percent = mAnimPercent * 5F;//为了变成1
circle.right.offsetReplace(percent * mElasticDistance, 0);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void initContrlPoint(Circle circle1) {
topLeftContrl = new ZPointF(-controlLength, 0, circle1.top);
topRightContrl = new ZPointF(controlLength, 0, circle1.top);
bottomLeftContrl = new ZPointF(-controlLength, 0, circle1.bottom);
bottomRightContrl = new ZPointF(controlLength, 0, circle1.bottom);
leftTopContrl = new ZPointF(0, controlLength, circle1.left);
leftBottomContrl = new ZPointF(0, -controlLength, circle1.left);
rightTopContrl = new ZPointF(0, controlLength, circle1.right);
rightBottomContrl = new ZPointF(0, -controlLength, circle1.right);
}
代码示例来源:origin: luhaoaimama1/zone-sdk
private void animStatus4() {
if (!status3Commit) {
status3Commit = true;
commit();
leftStart4 = new ZPointF(circle.left);
topRightBottomFix();
}
float percent = (float) (mAnimPercent - 0.8) * 10;
circle.left.offsetReplace((endCircle.left.x - leftStart4.x + mElasticDistance / 2) * percent, 0, "parent");
}
代码示例来源:origin: luhaoaimama1/zone-sdk
public FlexibleBallAnimation(Circle circle_, ZPointF end, Listener listener){
this.mListener = listener;
this.circle = new Circle(circle_);
// this.circle = ReflectCloneUtils.clone(circle_,true);//clone 好使!!!
//初始化一些值
controlLength = circle.r * c;
mElasticDistance = circle.r * mElasticPercent;
mMoveDistance = GeometryUtils.getLength(circle.center, end);
ZPointF tempPonit = new ZPointF(mMoveDistance, 0);
tempPonit.offset(circle.center);
endCircle = new Circle(tempPonit, circle.r);
//仅仅考虑右边既可以了嘎嘎!先把end点 按照 start点旋转成右边 --->最后按照start点把画布反旋转过来 来适应所有角度
startAngel = GeometryUtils.getP2AngleByX(end, circle.center);
//计算 8个控制点 动画状态0 (初始状态:圆形)
initContrlPoint(circle);
}
public void setProgress(float percent){
内容来源于网络,如有侵权,请联系作者删除!