<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0039)http://202.91.240.180:81/liucheng2.html -->
<HTML xmlns:v><HEAD><TITLE>流程图</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT src="流程图.files/liucheng2.js" type=text/javascript></SCRIPT>
<STYLE type=text/css>v\:* {
BEHAVIOR: url(#default#VML)
}
</STYLE>
<META content="MSHTML 6.00.2900.3395" name=GENERATOR></HEAD>
<BODY><TEXTAREA id=tt rows=20 cols=200></TEXTAREA>
<TABLE height=500 width=600 border=1>
<TBODY>
<TR>
<TD style="WIDTH: 100px" vAlign=top><INPUT id=firstNode style="WIDTH: 100px" type=button value=开始节点 name=firstNode category="1">
<INPUT id=endNode style="WIDTH: 100px" type=button value=结束节点 name=endNode category="2">
<INPUT id=status style="WIDTH: 100px" type=button value=节点 name=status category="3">
<INPUT id=route style="WIDTH: 100px" type=button value=路由 name=route category="4">
<INPUT id=control style="WIDTH: 100px" type=button value=控制 name=control category="5">
<!--<input id="polyLine" name="polyLine" type="button" value="折线" category="6" style="width:100px"/>--></TD>
<TD>
<DIV id=sharpArea
style="BORDER-RIGHT: red 1px solid; BORDER-TOP: red 1px solid; BORDER-LEFT: red 1px solid; WIDTH: 100%; BORDER-BOTTOM: red 1px solid; POSITION: relative; HEIGHT: 500px">
<SCRIPT type=text/javascript>
//alert( new gSoft.draw.oval(100,1000))
/* var demo = [
new gSoft.draw.line({x:0,y:0},{x:0,y:0})
,new gSoft.draw.polyLine([{x:0,y:0},{x:0,y:0}])
,new gSoft.draw.roundRect(0,0)
,new gSoft.draw.oval(0,0)
];
for(var i=0,l=demo.length;i<l;i++){
document.writeln(demo[i]);
}*/
</SCRIPT>
</DIV></TD></TR></TBODY></TABLE>
<DIV id=group></DIV>
<SCRIPT type=text/javascript>
gSoft.$("tt").value = "";
var selectCategory = 0;
gSoft.$("firstNode").onclick
= gSoft.$("endNode").onclick
= gSoft.$("status").onclick
= gSoft.$("route").onclick
= gSoft.$("control").onclick
//= gSoft.$("polyLine").onclick
= function(){
selectCategory = parseInt(this.category);
}
gSoft.$("sharpArea").onmousedown = function(){
event.cancelBubble = true;
if(selectCategory<=0) return;
//this.setCapture();
var getSharp = function(){
var sharp = null;
switch(selectCategory){
case 1:
//sharp= demo[3];
//sharp.index = 3;
break;
case 2:
break;
case 3:
sharp= new gSoft.flow.roundRect({left:event.x,top:event.y,name:""});
break;
case 4:
//sharp= demo[0];
//sharp.index = 0;
sharp= new gSoft.flow.line({from:{x:event.x,y:event.y},to:{x:event.x+100,y:event.y+100}});
//sharp.move([{x:event.x,y:event.y},{x:event.x,y:event.y}])
break;
case 5:
break;
case 6:
//sharp= demo[1];
//sharp.index = 1;
break;
default:
break;
}
return sharp;
}
var sharp = getSharp();
if(sharp){
//gSoft.$("tt").value = sharp;
sharp.draw();
}
/*if(sharp){
if(sharp.index==0||sharp.index==1){
sharp.move([{x:event.x,y:event.y},{x:event.x,y:event.y}])
} else if(sharp.index==2||sharp.index==3){
sharp.move({left:event.x,top:event.y});
}
gSoft.$("tt").innerHTML = [event.x,event.y].join(",");
}
//移动
this.onmousemove = function(){
var sharp = sharp || getSharp();
if(sharp.index==0){
sharp.setTo({x:event.x,y:event.y});
} else if(sharp.index==1){
sharp.move([{x:sharp.points[0].x,y:sharp.points[0].y},{x:event.x,y:event.y}])
} else if(sharp.index==2||sharp.index==3){
//gSoft.$("tt").value =event.x+":"+event.y+","+sharp.left+":"+sharp.top;
var width = Math.abs(event.x - sharp.left);
var height = Math.abs(event.y - sharp.top);
sharp.setSize({width:width,height:height});//alert(sharp.outerHTML)
}
};
//松开
this.onmouseup = function(){
this.releaseCapture();
this.onmousemove = null;
if(sharp){
var cloneSharp = sharp.clone();
//gSoft.$("tt").value =cloneSharp;
sharp.hidden();
}
};*/
}
var data =[
{
id:1,
type:1,
name:"节点1",
left:20,
top:20
},
{
id:2,
type:1,
name:"节点2",
left:50,
top:180
},
{
id:3,
type:1,
name:"节点3",
left:100,
top:300
},
{
id:4,
type:2,
name:"路由1",
from:1,
to:2
},
{
id:5,
type:2,
name:"路由2",
from:2,
to:3
},
{
id:6,
type:3,
name:"控制1",
route:4
},
{
id:7,
type:3,
name:"控制2",
route:5
},
{
id:8,
type:1,
name:"节点4",
left:50,
top:420
},
{
id:9,
type:2,
name:"路由3",
from:3,
to:8
}/*,
{
id:11,
type:1,
name:"节点5",
left:200,
top:20
},
{
id:10,
type:2,
name:"路由4",
from:1,
to:11
}*/
];
var flow = new gSoft.flow(data);
flow.draw();
</SCRIPT>
</BODY></HTML>