REVO2700 BezierCurves R \on openstack palette this stack --set the style of this stack to palette end openstack f _ W Geneva W Times U Times U Geneva U Times cREVGeneral scriptChecksum L}tҪO debugObjects 6button id 1003 of card id 1002 of stack "BezierCurves" bookmarks handlerList openstacktempScript prevHandler preopenstackscriptSelection char 39 to 38script
on openstack
palette this stack
--set the style of this stack to palette
end openstack
P 5on preopencard palette this stack end preopenCard ``ʎ _ cREVGeneral scriptChecksum t Pqw bookmarks handlerList preopencardtempScript prevHandler preopencardscriptSelection char 25 to 24scripton preopencard
palette this stack
end preopenCard
Field 1 )` cyan ( cREVGeneral revUniqueID 1083840426573 Instructions @ @ You may paste a bezier curve onto any line graphic on another card of another stack as outlined below. (You can't paste it onto this plug-in stack.) @ @ The line controls (to be distinguished from the tangent controls) will appear initially as corner points--black. Double click on a a black point and it will become a continuous tangent point and turn red. @ @ =You may also reposition the entire bezier curve by dragging. @ < @ oWhen you are finished, double click the line and the controls disappear. Double click again and they reappear. @ n @ To generate a bezier line: @ @ 1) Select a line graphic on the card. Use the polygon tool and double click to complete. (You may also want to set the style to "line" rather than polygon.) @ @ <2) Next click on the Paste the bezier line button above. @ ; @ 3) Give the line a unique name. (The bezier curve is placed on the card--the original line remains intact, but is hidden. It may be deleted.) @ @ Each segment of the line graphic becomes a bezier line segment. They work as a unit because there is a vocabulary built into the controls which allows nearest neighbors to talk to one another (gossip). @ @ 1There is a fair bit of overhead associated with the bezier line. The burden to your stack size can be reduced by using the "Replace bezier line with a line graphic" button below. Click on it, click on the bezier line, and it will put the graphic points on the bezier line segments into a variable and then set the points of the original line to those points, so that you wind up with a simple graphic line in the shape of the bezier line sans all the bezier controls and their scripts. Of course you will no longer be able to use the bezier tools on this line. @ 0 ` ) (Replace bezier line with a line graphic Ex =on mouseup answer "Click on the bezier line to be replaced." with "OK" or "Cancel" if it is not "OK" then exit mouseUP wait until the mouseclick put the clickstack into tStackName put the clickLoc into tClickPoint go stack tStackName repeat with i = 1 to the number of graphics in stack tStackName if tClickPoint is within the rect of graphic i then put the name of graphic i into tGraphicName if "bezier" is in the owner of tGraphicName then exit repeat end if end repeat if tGraphicName is "" then Answer "Couldn't find the graphic. Try again." with "OK" exit mouseUP end if if "Bezier" is in the short name of tStackName then beep answer "Can't add bezier line to this stack." with "OK" exit mouseUP end if put the owner of tGraphicName into theGroup put the short name of the owner of tGraphicName into theGroupName repeat if the last char of theGroupName is "a" then delete the last char of theGroupName else exit repeat end repeat put theGroupName into theGraphicName delete char -6 to -1 of theGraphicName set the visible of grc theGraphicName to true repeat if there is a group theGroupName then put the points in grc "bezierLine" of group theGroupName & return after tPoints delete group theGroupName else exit repeat put theGroupName & "A" into theGroupName end repeat answer "Open line or closed polygon?" with "Closed" and "Open" if it is "closed" then set the style of grc theGraphicName to polygon put line 1 of tPoints after tPoints end if set the points of grc theGraphicName to tPoints end mouseUP > V cREVGeneral scriptChecksum V`#;'X25/_handlerList mouseupbreakPoints 10 17 26scriptSelection char 619 to 618 bookmarks revUniqueID 1083840426574prevHandler mouseuptempScript scripton mouseup
answer "Click on the bezier line to be replaced." with "OK" or "Cancel"
if it is not "OK" then exit mouseUP
wait until the mouseclick
put the clickstack into tStackName
put the clickLoc into tClickPoint
go stack tStackName
repeat with i = 1 to the number of graphics in stack tStackName
if tClickPoint is within the rect of graphic i then
put the name of graphic i into tGraphicName
if "bezier" is in the owner of tGraphicName then exit repeat
end if
end repeat
if tGraphicName is "" then
Answer "Couldn't find the graphic. Try again." with "OK"
exit mouseUP
end if
if "Bezier" is in the short name of tStackName then
beep
answer "Can't add bezier line to this stack." with "OK"
exit mouseUP
end if
put the owner of tGraphicName into theGroup
put the short name of the owner of tGraphicName into theGroupName
repeat
if the last char of theGroupName is "a" then
delete the last char of theGroupName
else exit repeat
end repeat
put theGroupName into theGraphicName
delete char -6 to -1 of theGraphicName
set the visible of grc theGraphicName to true
repeat
if there is a group theGroupName then
put the points in grc "bezierLine" of group theGroupName & return after tPoints
delete group theGroupName
else exit repeat
put theGroupName & "A" into theGroupName
end repeat
answer "Open line or closed polygon?" with "Closed" and "Open"
if it is "closed" then
set the style of grc theGraphicName to polygon
put line 1 of tPoints after tPoints
end if
set the points of grc theGraphicName to tPoints
end mouseUP
Foo CF Q ' p $ R J ( cREVGeneral revUniqueID 1083840440200 %Paste bezier curve onto card grahic. Ex on mouseup copy group "GroupBezier" put the topstack into tStackName go to stack tStackName put the selectedObject into tGraphicName if word 1 of tGraphicName is not "graphic" then--tGraphicName is "" then answer "You must first select a line graphic." with "OK" exit mouseUP end if Ask "Assign a unique name to the bezier group." with "Foo" if it is "" then exit mouseUP set the cursor to hand repeat with i = 1 to the number of groups if it is in the short name of group i then beep answer "There is already a graphic of this name. Change the name." with "OK" exit mouseUp end if end repeat set the name of tGraphicName to it set the style of tGraphicName to "line" put it & "Bezier" into tGroupName put tGroupName into tBaseGroupName put the points of tGraphicName into tGraphicPoints if the last line of tGraphicPoints = the first line of tGraphicPoints then \ delete the last line of tGraphicPoints put the number of lines in tGraphicPoints -1 into tNumberOfBezierGroups repeat with i = 1 to tNumberOfBezierGroups put i,i+1 into line i of tPairList end repeat repeat with i =1 to tNumberOfBezierGroups put line (item 1 of line i of tPairList)of tGraphicPoints into line 1 of tPairPoints[i] put line (item 2 of line i of tPairList) of tGraphicPoints into line 2 of tPairPoints[i] end repeat paste set the name of the last group to tGroupName setTheHandleLocs tGroupName,tPairPoints[1] setGraphicProperties tGroupName repeat with i = 2 to tNumberOfBezierGroups clone group tGroupName put tGroupName &"A" into tGroupName set the name of the last group to tGroupName --set the loc of group tGroupName to 300,300 setTheHandleLocs tGroupName,tPairPoints[i] setGraphicProperties tGroupName setCustomCoordinates tGroupName end repeat setTheLayersOfR4 tBaseGroupName hide tGraphicName choose the browse tool end mouseUP on setTheHandleLocs tGroup,tPointList put line 1 of tPointList into r1 put line 2 of tPointList into r4 put item 1 of r1 into x1 put item 2 of r1 into y1 put item 1 of r4 into x4 put item 2 of r4 into y4 put (3*x1+x4)div 4, (3*y1+y4)div 4 into r2 put (x1+3*x4)div 4, (y1+3*y4)div 4 into r3 set the loc of grc "r1" of group tGroup to r1 set the loc of grc "r2" of group tGroup to r2 set the loc of grc "r3" of group tGroup to r3 set the loc of grc "r4" of group tGroup to r4 set the points of grc "tangentStartLine" of group tGroup to r1 & return &r2 set the points of grc "tangentEndLine" of group tGroup to r3 & return & r4 set the points of grc "bezierLine" of group tGroup to r1 & return & r4 end setTheHandleLocs on setCustomCoordinates theOwner put the loc of grc "r2" of group theOwner into tR2Loc put the loc of grc "r1" of group theOwner into tR1Loc put item 1 of tR2Loc - item 1 of tR1Loc into dx2 put item 2 of tR2Loc - item 2 of tR1Loc into dy2 set the dx of grc "r2" of group theOwner to dx2 set the dy of grc "r2" of group theOwner to dy2 put the loc of grc "r3" of group theOwner into tR3Loc put the loc of grc "r4" of group theOwner into tR4Loc put item 1 of tR4loc - item 1 of tR3Loc into dx3 put item 2 of tR4Loc - item 2 of tR3Loc into dy3 set the dx of grc "r3" of group theOwner to dx3 set the dy of grc "r3" of group theOwner to dy3 end setCustomCoordinates on setGraphicProperties tGroup set the r1 of grc "BezierLine" of group tGroup to the loc of grc "r1" of group tGroup set the r2 of grc "BezierLine" of group tGroup to the loc of grc "r2" of group tGroup set the r3 of grc "BezierLine" of group tGroup to the loc of grc "r3" of group tGroup set the r4 of grc "BezierLine" of group tGroup to the loc of grc "r4" of group tGroup send "mouseUP" to grc "r2" of group tGroup send "mouseUP" to grc "r3" of group tGroup end setGraphicProperties on setTheLayersOfR4 tName set the layer of group tName to top repeat put tName & "A" into tName if there is group tName then set the layer of group tName to bottom else exit repeat end repeat end setTheLayersOfR4 --function characterMax tList -- put 0,0 into theMax -- repeat with i = 1 to the number of items in tList -- put the number of chars in item i of tList into theNum -- if theNum> item 2 of theMax then put i,theNum into theMax -- end repeat -- return item (item 1 of theMax) of tList --end characterMax ?? $ R cREVGeneral scriptChecksum <(9$handlerList Smouseup setTheHandleLocs setCustomCoordinates setGraphicProperties setTheLayersOfR4breakPoints 6scriptSelection char 193 to 192 bookmarks revUniqueID 1083840392137prevHandler mouseuptempScript script "
on mouseup
copy group "GroupBezier"
put the topstack into tStackName
go to stack tStackName
put the selectedObject into tGraphicName
if word 1 of tGraphicName is not "graphic" then--tGraphicName is "" then
answer "You must first select a line graphic." with "OK"
exit mouseUP
end if
Ask "Assign a unique name to the bezier group." with "Foo"
if it is "" then exit mouseUP
set the cursor to hand
repeat with i = 1 to the number of groups
if it is in the short name of group i then
beep
answer "There is already a graphic of this name. Change the name." with "OK"
exit mouseUp
end if
end repeat
set the name of tGraphicName to it
set the style of tGraphicName to "line"
put it & "Bezier" into tGroupName
put tGroupName into tBaseGroupName
put the points of tGraphicName into tGraphicPoints
if the last line of tGraphicPoints = the first line of tGraphicPoints then \
delete the last line of tGraphicPoints
put the number of lines in tGraphicPoints -1 into tNumberOfBezierGroups
repeat with i = 1 to tNumberOfBezierGroups
put i,i+1 into line i of tPairList
end repeat
repeat with i =1 to tNumberOfBezierGroups
put line (item 1 of line i of tPairList)of tGraphicPoints into line 1 of tPairPoints[i]
put line (item 2 of line i of tPairList) of tGraphicPoints into line 2 of tPairPoints[i]
end repeat
paste
set the name of the last group to tGroupName
setTheHandleLocs tGroupName,tPairPoints[1]
setGraphicProperties tGroupName
repeat with i = 2 to tNumberOfBezierGroups
clone group tGroupName
put tGroupName &"A" into tGroupName
set the name of the last group to tGroupName
--set the loc of group tGroupName to 300,300
setTheHandleLocs tGroupName,tPairPoints[i]
setGraphicProperties tGroupName
setCustomCoordinates tGroupName
end repeat
setTheLayersOfR4 tBaseGroupName
hide tGraphicName
choose the browse tool
end mouseUP
on setTheHandleLocs tGroup,tPointList
put line 1 of tPointList into r1
put line 2 of tPointList into r4
put item 1 of r1 into x1
put item 2 of r1 into y1
put item 1 of r4 into x4
put item 2 of r4 into y4
put (3*x1+x4)div 4, (3*y1+y4)div 4 into r2
put (x1+3*x4)div 4, (y1+3*y4)div 4 into r3
set the loc of grc "r1" of group tGroup to r1
set the loc of grc "r2" of group tGroup to r2
set the loc of grc "r3" of group tGroup to r3
set the loc of grc "r4" of group tGroup to r4
set the points of grc "tangentStartLine" of group tGroup to r1 & return &r2
set the points of grc "tangentEndLine" of group tGroup to r3 & return & r4
set the points of grc "bezierLine" of group tGroup to r1 & return & r4
end setTheHandleLocs
on setCustomCoordinates theOwner
put the loc of grc "r2" of group theOwner into tR2Loc
put the loc of grc "r1" of group theOwner into tR1Loc
put item 1 of tR2Loc - item 1 of tR1Loc into dx2
put item 2 of tR2Loc - item 2 of tR1Loc into dy2
set the dx of grc "r2" of group theOwner to dx2
set the dy of grc "r2" of group theOwner to dy2
put the loc of grc "r3" of group theOwner into tR3Loc
put the loc of grc "r4" of group theOwner into tR4Loc
put item 1 of tR4loc - item 1 of tR3Loc into dx3
put item 2 of tR4Loc - item 2 of tR3Loc into dy3
set the dx of grc "r3" of group theOwner to dx3
set the dy of grc "r3" of group theOwner to dy3
end setCustomCoordinates
on setGraphicProperties tGroup
set the r1 of grc "BezierLine" of group tGroup to the loc of grc "r1" of group tGroup
set the r2 of grc "BezierLine" of group tGroup to the loc of grc "r2" of group tGroup
set the r3 of grc "BezierLine" of group tGroup to the loc of grc "r3" of group tGroup
set the r4 of grc "BezierLine" of group tGroup to the loc of grc "r4" of group tGroup
send "mouseUP" to grc "r2" of group tGroup
send "mouseUP" to grc "r3" of group tGroup
end setGraphicProperties
on setTheLayersOfR4 tName
set the layer of group tName to top
repeat
put tName & "A" into tName
if there is group tName then
set the layer of group tName to bottom
else exit repeat
end repeat
end setTheLayersOfR4
--function characterMax tList
-- put 0,0 into theMax
-- repeat with i = 1 to the number of items in tList
-- put the number of chars in item i of tList into theNum
-- if theNum> item 2 of theMax then put i,theNum into theMax
-- end repeat
-- return item (item 1 of theMax) of tList
--end characterMax
GroupBezier i@on resetLayers put the short name of me into tName put offset("bezier",tName)+5 into tNum put char 1 to tNum of tName into tBaseName repeat if there is a group tBaseName then set the layer of group tBaseName to bottom put tBaseName & "A" into tBaseName else exit repeat end repeat end resetLayers on resetProperties tGroup put theBaseName(tGroup) into tBaseName repeat if there is a group tBaseName then put the name of group tBaseName into tOwner set the r1 of grc "BezierLine" of tOwner to the loc of grc "r1" of tOwner set the r2 of grc "BezierLine" of tOwner to the loc of grc "r2" of tOwner set the r3 of grc "BezierLine" of tOwner to the loc of grc "r3" of tOwner set the r4 of grc "BezierLine" of tOwner to the loc of grc "r4" of tOwner put tBaseName & "A" into tBaseName else exit repeat end repeat end resetProperties function theBaseName tGroupName put offset("bezier",tGroupName)+5 into tNum put char 1 to tNum of tGroupName into theBaseName return theBaseName end theBaseName ? } % dx 23r3 138,146dy 16 cREVGeneral revUniqueID 1083840453597breakPoints 2 15 BezierLine KVlocal myName, tOwner, dx, dy,theGroupNames,theGroupDisplacement,theBaseGroupName on mouseDown put the name of me into myName put the owner of me into tOwner put the short name of the owner of me into tGroupName repeat if the last char of tGroupName is "A" then delete the last char of tGroupName else exit repeat end repeat put tGroupName into theBaseGroupName repeat if there is a group tGroupName then put the loc of group tGroupName into tGroupLoc put mouseH() -item 1 of tGroupLoc into dx put mouseV() - item 2 of tGroupLoc into dy put dx,dy into theGroupDisplacement[tGroupName] put tGroupName & "A" into tGroupName else exit repeat end repeat end mouseDown on mouseMove x,y if myName is "" then exit mouseMove put theBaseGroupName into tGroupName repeat --with i = 1 to the number of lines in the keys of theGroupNames if there is a group tGroupName then put theGroupDisplacement[tGroupName] into tGroupDisplacement --put theGroupNames[i] into tGroupName set the loc of group tGroupName to x- item 1 of tGroupDisplacement,y- item 2 of tGroupDisplacement put tGroupName & "A" into tGroupName else exit repeat end repeat end mouseMove on mouseUP put "" into myName if the shiftKey is down then put "" into myName end if resetProperties the short name of the owner of me resetLayers end mouseUP on mouseDoubleUP put the the short name of owner of me into tGroupName repeat if the last char of tGroupName is "A" then delete the last char of tGroupName else exit repeat end repeat repeat if there is a group tGroupName then hideControls tGroupName put tGroupName & "A" into tGroupName else exit repeat end repeat end mouseDoubleUp on hideControls theOwnerName put "r1","r2","r3","r4","tangentStartLine","tangentEndLine" into tGraphicList if the visible of grc "r1" of group theOwnerName is true then repeat with i = 1 to 6 set the visible of grc item i of tGraphicList of group theOwnerName to false end repeat else repeat with i = 1 to 6 set the visible of grc item i of tGraphicList of group theOwnerName to true end repeat end if end hideControls on mouseEnter put "" into myName end mouseEnter on doMove put the r1 of me into pt1 put the r2 of me into pt2 put the r3 of me into pt3 put the r4 of me into pt4 repeat with i = 0 to 50 put i/50 into t put 1-t into s repeat with j = 1 to 2 put round(s*s*s*item j of pt1 + 3*s*s*t*item j of pt2 + \ 3*s*t*t*item j of pt3 + t*t*t*item j of pt4) into item j of thePt end repeat put thePt & return after tPoints end repeat set the points of grc "BezierLine" of the owner of me to tPoints end doMove on mouseRelease put "" into myName end mouseRelease on setGraphicProperties tOwner set the r1 of grc "BezierLine" of tOwner to the loc of grc "r1" of tOwner set the r2 of grc "BezierLine" of tOwner to the loc of grc "r2" of tOwner set the r3 of grc "BezierLine" of tOwner to the loc of grc "r3" of tOwner set the r4 of grc "BezierLine" of tOwner to the loc of grc "r4" of tOwner end setGraphicProperties F o r1 71,22r2 85,6r3 152,27r4 180,19 3 G H I J K M N P Q S U W Y [ ] _ b d f i k n p s v x { ~ cREVGeneral revUniqueID 1082203845787breakPoints 24 tangentStartLine KF F G U cREVGeneral revUniqueID 1082206014867 tangentEndLine KF cREVGeneral revUniqueID 1082206014881 r1 KTlocal myName,dx2,dy2 on mouseDown put the name of me into myName put the owner of me into tOwner getCustomCoordinates end mouseDown on setCustomCoordinates put the owner of me into tOwner put the loc of grc "r2" of tOwner into tR2Loc put the loc of me into tLoc put item 1 of tloc - item 1 of tR2Loc into dx2 put item 2 of tLoc - item 2 of tR2Loc into dy2 set the dx of grc "r2" of tOwner to -dx2 set the dy of grc "r2" of tOwner to -dy2 end setCustomCoordinates on getCustomCoordinates put the owner of me into tOwner put the dx of grc "r2" of tOwner into dx2 put the dy of grc "r2" of tOwner into dy2 end getCustomCoordinates on mouseUP put "" into myName end mouseUP on mousemove u,v if myName is "" then exit mouseMove doMouseMove u,v end mouseMove on doMouseMove u,v set loc of me to u,v put the owner of me into tOwner set the r1 of grc "BezierLine" of tOwner to u,v getCustomCoordinates send "doMouseMove u+dx2,v+dy2" to grc "r2" of tOwner setCustomCoordinates put u,v & return & the loc of grc "r2" of tOwner after tTangentStartPoints set the points of grc "TangentStartLine" of tOwner to tTangentStartPoints send "doMove" to grc "bezierLine" of tOwner end doMouseMove on mouseRelease mouseUp end mouseRelease "" C h cREVGeneral revUniqueID 1082200959159breakPoints 36 r2 KPlocal myName,tOwner,tPreviousOwnerName,dx2,dy2,dx3,dy3 on mouseDown put the name of me into myName put the owner of me into tOwner put the short name of tOwner into tOwnerName put tOwnerName into tPreviousOwnerName delete last char of tPreviousOwnerName end mouseDown on mouseUP put "" into myName end mouseUP on mouseEnter put "" into myName end mouseEnter on getCustomCoordinates put the owner of me into tOwner put the dx of grc "r2" of tOwner into dx2 put the dy of grc "r2" of tOwner into dy2 if there is a group tPreviousOwnerName then put the dx of grc "r3" of group tPreviousOwnerName into dx3 put the dy of grc "r3" of group tPreviousOwnerName into dy3 end if end getCustomCoordinates on setCustomCoordinates put the loc of grc "r1" of tOwner into tR1Loc put the loc of me into tLoc put item 1 of tloc - item 1 of tR1Loc into ddx put item 2 of tLoc - item 2 of tR1Loc into ddy set the dx of me to ddx set the dy of me to ddy end setCustomCoordinates on mousemove u,v if myName is "" then exit mouseMove doMouseMove u,v end mouseMove on moveMe u,v if the shiftkey is down then exit to top set loc of me to u,v put the owner of me into tOwner set the r2 of grc "BezierLine" of tOwner to u,v setcustomCoordinates if there is a group tPreviousOwnerName then getCustomCoordinates put (sqrt((dx2^2 + dy2^2)/ (dx3^2+dy3^2))) into temp put 1/temp into temp put the loc of grc "r1" of tOwner into tRedLoc put round(item 1 of tRedLoc - temp*dx2) into x2 put round(item 2 of tRedLoc - temp * dy2) into y2 setCustomCoordinates end if put u,v & return & the loc of grc "r1" of tOwner after tTangentStartPoints set the points of grc "TangentStartLine" of tOwner to tTangentStartPoints send "doMove" to grc "bezierLine" of tOwner end moveMe on doMouseMove u,v moveMe u,v if there is a group tPreviousOwnerName then put the backgroundColor of grc "r4" of group tPreviousOwnerName into tColor end if switch tColor case red if there is a group tPreviousOwnerName then getCustomCoordinates put (sqrt((dx2^2 + dy2^2)/ (dx3^2+dy3^2))) into temp put 1/temp into temp put the loc of grc "r1" of tOwner into tRedLoc put round(item 1 of tRedLoc - temp*dx2) into x2 put round(item 2 of tRedLoc - temp * dy2) into y2 setCustomCoordinates end if put u,v & return & the loc of grc "r1" of tOwner after tTangentStartPoints set the points of grc "TangentStartLine" of tOwner to tTangentStartPoints send "moveMe x2,y2" to grc "r3" of group tPreviousOwnerName send "doMove" to grc "bezierLine" of tOwner break end switch end doMouseMove put u,v & return & the loc of grc "r1" of tOwner after tTangentStartPoints set the points of grc "TangentStartLine" of tOwner to tTangentStartPoints send "doMove" to grc "bezierLine" of tOwner setCustomCoordinates end doMouseMove on mouseRelease mouseUp end mouseRelease Q dx 14dy -16 cREVGeneral revUniqueID 1082201057991breakPoints r3 KPlocal myName,tNextOwnerName,dx2,dy2,dx3,dy3,tOwner on mouseDown put the name of me into myName put the owner of me into tOwner put the short name of tOwner into tOwnerName put tOwnerName & "A" into tNextOwnerName --getCustomCoordinates end mouseDown on setMeStraight mouseDown getCustomCoordinates doMouseMove mouseH() -dx3,mouseV() - dy3 put "" into myName end setMeStraight on getCustomCoordinates put the owner of me into tOwner put the dx of grc "r3" of tOwner into dx3 put the dy of grc "r3" of tOwner into dy3 put the short name of tOwner&"A" into tNextOwnerName if there is a group tNextOwnerName then put the dx of grc "r2" of group tNextOwnerName into dx2 put the dy of grc "r2" of group tNextOwnerName into dy2 end if end getCustomCoordinates on mouseEnter put "" into myName end mouseEnter on mouseUP put "" into myName setCustomCoordinates end mouseUP on setCustomCoordinates put the owner of me into tOwner put the loc of grc "r4" of tOwner into tR4Loc put the loc of me into tR3Loc put item 1 of tR4Loc - item 1 of tR3Loc into ddx put item 2 of tR4Loc - item 2 of tR3Loc into ddy set the dx of me to ddx set the dy of me to ddy end setCustomCoordinates on mousemove u,v if myName is "" then exit mouseMove doMouseMove u,v end mouseMove on moveMe u,v set loc of me to u,v put the owner of me into tOwner set the r3 of grc "BezierLine" of tOwner to u,v put u,v & return & the loc of grc "r4" of tOwner after tTangentEndPoints set the points of grc "TangentEndLine" of tOwner to tTangentEndPoints if there is a group tNextOwnerName then getCustomCoordinates put the loc of grc "r4" of tOwner into tRedLoc put (sqrt((dx2^2 + dy2^2)/ (dx3^2+dy3^2))) into temp put round(item 1 of tRedLoc + temp*dx3) into x2 put round(item 2 of tRedLoc + temp * dy3) into y2 setCustomCoordinates end if send "doMove" to grc "bezierLine" of tOwner end moveMe on doMouseMove u,v if the shiftKey is down then exit to top moveMe u,v put the backgroundColor of grc "r4" of tOwner into tColor switch tColor case red if there is a group tNextOwnerName then getCustomCoordinates put (sqrt((dx2^2 + dy2^2)/ (dx3^2+dy3^2))) into temp put the loc of grc "r4" of tOwner into tRedLoc put round(item 1 of tRedLoc + temp*dx3) into x2 put round(item 2 of tRedLoc + temp * dy3) into y2 setCustomCoordinates end if put u,v & return & the loc of grc "r4" of tOwner after tTangentEndPoints set the points of grc "TangentEndLine" of tOwner to tTangentEndPoints if there is a group tNextOwnerName then send "moveMe x2,y2" to grc "r2" of group tNextOwnerName end if break case black put u,v & return & the loc of grc "r4" of tOwner after tTangentEndPoints set the points of grc "TangentEndLine" of tOwner to tTangentEndPoints send "doMove" to grc "bezierLine" of tOwner break end switch end doMouseMove on mouseRelease mouseUp end mouseRelease // 28 28dx 28dy -8-8 -8 cREVGeneral revUniqueID 1082201058379breakPoints 1 15 49 r4 KTlocal myName,tOwner,dx3,dy3 on mouseDown put the name of me into myName put the owner of me into theOwner put theOwner into tOwner getCustomCoordinates theOwner setCustomCoordinates theOwner end mouseDown on setCustomCoordinates theOwner put the loc of grc "r3" of theOwner into tR3Loc put the loc of me into tLoc put item 1 of tloc - item 1 of tR3Loc into dx3 put item 2 of tLoc - item 2 of tR3Loc into dy3 set the dx3 of grc "r3" of theOwner to dx3 set the dy3 of grc "r3" of theOwner to dy3 end setCustomCoordinates function theNextOwner thisOwner put the short name of thisOwner into tOwnerName put tOwnerName & "A" into tNewOwnerName if there is a group tNewOwnerName then put the long name of group tNewOwnerName into tNextGroup else put thisOwner into tNextGroup return tNextGroup end theNextOwner on getCustomCoordinates theOwner --put the owner of me into tOwner put the dx of grc "r3" of theOwner into dx3 put the dy of grc "r3" of theOwner into dy3 end getCustomCoordinates on mouseUP put "" into myName end mouseUP on mousemove u,v if myName is "" then exit mouseMove doMouseMove u,v end mouseMove on doMouseMove u,v put the owner of me into tOwner set loc of me to u,v set the r4 of grc "BezierLine" of tOwner to u,v set the loc of grc "r3" of tOwner to u-dx3,v-dy3 set the r3 of of grc "BezierLine" of tOwner to u-dx3,v-dy3 put u,v & return & the loc of grc "r3" of tOwner after tTangentEndPoints set the points of grc "TangentEndLine" of tOwner to tTangentEndPoints send "doMove" to grc "bezierLine" of tOwner put the short name of the owner of me into tOwnerName put tOwnerName & "A" into tNextGroupName if there is a group tNextGroupName then send "doMouseMove u,v" to grc "r1" of group tNextGroupName end if end doMouseMove on mouseEnter put "" into myName end mouseEnter on mouseRelease mouseUp end mouseRelease on mouseDoubleUp if the backgroundcolor of me is red then set the backgroundcolor of me to black else set the backgroundcolor of me to red send "setMeStraight" to grc "r3" of group the owner of me end if resetLayers doMouseMove mouseh(),mouseV() end mouseDoubleUp black h cREVGeneral revUniqueID 1082201059002breakPoints 17 40