画线条的箭头要根据线条的开始坐标和结束坐标来确定角度
代码:
public function drawArrow(ui:Sprite,fromPoint:Point,toPoint:Point,color:uint):void
{
ui.graphics.lineTo(toPoint.x,toPoint.y);
var vDistance:Number= toPoint.y-fromPoint.y;//起始点垂直距离
var sDistance:Number=Point.distance(fromPoint,toPoint);//起始点直线距离
var sinValue:Number=vDistance/sDistance;//起始点间的夹角的sin值
/**两点间直线与水平线的角度(弧度)*/
var radian:Number=Math.asin(sinValue);
this.radian = radian;
/**用于计算三角形顶点与目标点水平距离的夹角(弧度)*/
var hRadian:Number=Math.PI/6-radian;
/**用于计算三角形顶点与目标点垂直距离的夹角(弧度)*/
var vRadian:Number=radian+Math.PI/6;
/**上顶点与目标点的垂直距离*/
var topYDis:Number=13*Math.sin(vRadian);
/**上顶点与目标点的水平距离*/
var topXDis:Number=13*Math.cos(vRadian);
/**下顶点与目标点的垂直距离*/
var botYDis:Number=13*Math.sin(hRadian);
/**下顶点与目标点的水平距离*/
var botXDis:Number=13*Math.cos(hRadian);
/**计算三角形上下顶点坐标*/
var topPointX:Number=toPoint.x-topXDis;
var topPointY:Number=toPoint.y-topYDis;
var botPointX:Number=toPoint.x-botXDis;
var botPointY:Number=toPoint.y+botYDis;
if(toPoint.x<fromPoint.x)
{
topPointX=toPoint.x+topXDis;
botPointX=toPoint.x+botXDis;
}
ui.graphics.beginFill(0xFECff0);
ui.graphics.moveTo(topPointX,topPointY);
ui.graphics.lineTo(toPoint.x,toPoint.y);
ui.graphics.lineTo(botPointX,botPointY);
ui.graphics.lineTo(topPointX,topPointY);
}
分享到:
相关推荐
Activiti流程设计器--actiBPM使用经验 Activiti流程设计器是一种流程设计工具,用于设计和实现业务流程。actiBPM是Activiti流程设计器的插件,提供了更加强大的流程设计功能。然而,在使用actiBPM时,经常遇到中文...
赠送jar包:activiti-engine-5.21.0.jar; 赠送原API文档:activiti-engine-5.21.0-javadoc.jar; 赠送源代码:activiti-engine-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-engine-5.21.0.pom; 包含...
赠送jar包:activiti-bpmn-model-5.21.0.jar; 赠送原API文档:activiti-bpmn-model-5.21.0-javadoc.jar; 赠送源代码:activiti-bpmn-model-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-bpmn-model-...
activiti-spring-boot-starter-7.1.0.M1
idea可扩展的activiti流程设计器camunda-modeler-3.0.0-win-x64.zip,可代替actiBPM插件,使用介绍https://blog.csdn.net/Arsenalzjx/article/details/96288482
activiti-spring-boot-starter-basic-6.0.0适配springboot2.1.2
赠送jar包:activiti-json-converter-5.21.0.jar; 赠送原API文档:activiti-json-converter-5.21.0-javadoc.jar; 赠送源代码:activiti-json-converter-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
activiti-bpmn-converter-5.18.0-sources.jar
actiBPM 是一个基于 IntelliJ IDEA 的 Activiti 流程设计器插件,它扩展了 IDEA 的功能,为开发者提供了在 IDE 内直接编辑 BPMN2.0 流程图的能力。 在使用 actiBPM 插件时,可能会遇到一个常见的问题,即中文乱码。...
赠送jar包:activiti-common-rest-5.21.0.jar; 赠送原API文档:activiti-common-rest-5.21.0-javadoc.jar; 赠送源代码:activiti-common-rest-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-common-rest-...
赠送jar包:activiti-json-converter-5.21.0.jar; 赠送原API文档:activiti-json-converter-5.21.0-javadoc.jar; 赠送源代码:activiti-json-converter-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
赠送jar包:activiti-image-generator-5.21.0.jar; 赠送原API文档:activiti-image-generator-5.21.0-javadoc.jar; 赠送源代码:activiti-image-generator-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
activiti-bpmn-converter-5.16.4.jar
NULL 博文链接:https://cooperay.iteye.com/blog/1409863
赠送jar包:activiti-image-generator-5.21.0.jar; 赠送原API文档:activiti-image-generator-5.21.0-javadoc.jar; 赠送源代码:activiti-image-generator-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...
Activiti的Eclipse插件activiti-designer安装资料包,包含activiti-designer-5.18.0.zip、org.eclipse.emf.transaction_1.4.0.201306111400.jar、org.eclipse.emf.validation.ui_1.7.0.201403111711.jar、org....
赠送jar包:activiti-process-validation-5.21.0.jar; 赠送原API文档:activiti-process-validation-5.21.0-javadoc.jar; 赠送源代码:activiti-process-validation-5.21.0-sources.jar; 赠送Maven依赖信息文件:...
忙活了一个星期左右,查找各种资料,终于将Activiti的流程设计器分离出来,与SpringMVC,spring整合了起来,先把工程分享出来,等有时间了在慢慢讲解具体的整合步骤。工程下载之后直接可以运行,只需要改一下数据库...
赠送jar包:activiti-bpmn-converter-5.21.0.jar; 赠送原API文档:activiti-bpmn-converter-5.21.0-javadoc.jar; 赠送源代码:activiti-bpmn-converter-5.21.0-sources.jar; 赠送Maven依赖信息文件:activiti-...