commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbe...@apache.org
Subject svn commit: r984028 - /commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml
Date Tue, 10 Aug 2010 14:19:01 GMT
Author: jbeard
Date: Tue Aug 10 14:19:01 2010
New Revision: 984028

URL: http://svn.apache.org/viewvc?rev=984028&view=rev
Log:
Added more action code to support drawing behaviour.

Modified:
    commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml

Modified: commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml?rev=984028&r1=984027&r2=984028&view=diff
==============================================================================
--- commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml (original)
+++ commons/sandbox/gsoc/2010/scxml-js/trunk/demo/drawing-tool/behaviour/canvas.xml Tue Aug
10 14:19:01 2010
@@ -309,26 +309,54 @@ In both:
 				</onexit>
 
 				<transition target="after_mousedown_on_selected_nodes" event="mousedown" 
-					cond="selectedNodes.indexOf(_event.data.target) !== -1 && !_event.data.shiftKey"/>
+					cond="selectedNodes.indexOf(_event.data.target) !== -1 
+						&& !_event.data.shiftKey"/>
 
 				<transition target="after_mousedown_with_shift_key_on_selected_nodes" event="mousedown"

-					cond="selectedNodes.indexOf(_event.data.target) !== -1 && _event.data.shiftKey"/>
+					cond="selectedNodes.indexOf(_event.data.target) !== -1 
+						&& _event.data.shiftKey"/>
 
 				<transition target="after_mousedown_on_nonselected_nodes" event="mousedown"
-					cond="allNodes.indexOf(_event.data.target) !== -1 && !_event.data.shiftKey"/>
+					cond="allNodes.indexOf(_event.data.target) !== -1 
+						&& !_event.data.shiftKey"/>
 
 				<transition target="after_mousedown_with_shift_key_on_nonselected_nodes" event="mousedown"
-					cond="allNodes.indexOf(_event.data.target) !== -1 && _event.data.shiftKey"/>
+					cond="allNodes.indexOf(_event.data.target) !== -1 
+						&& _event.data.shiftKey"/>
 
 				<transition target="after_mousedown_on_canvas" event="mousedown" cond="_event.data.target
=== canvas"/>
+
+				<transition target="rotating" event="mousedown" 
+					cond="_event.data.target === rotationHandle 
+						&& In(ready_to_rotate)"/>
+
+				<transition target="scaling" event="mousedown" 
+					cond="_event.data.target === rotationHandle 
+						&& In(ready_to_scale)"/>
 			</state>
 
-			<state id="after_mousedown_on_selected_nodes">
-				<transition target="dragging" event="mousemove"/>
+			<!-- TODO: add rotation and scale code -->
+			<state id="rotating">
+				<transition target="ready" event="mouseup"/>
+				<transition target="rotating" event="mousemove"/>
+			</state>
 
-				<transition target="ready" event="mouseup">
-					<send event="TOGGLE_TRANSFORM"/>
+			<state id="scaling">
+				<transition target="ready" event="mouseup"/>
+				<transition target="scaling" event="mousemove"/>
+			</state>
+
+			<state id="after_mousedown_on_selected_nodes">
+				<transition target="dragging" event="mousemove" cond="In(transform_tool_selected)"/>
+				<transition target="drawing_rect" event="mousemove" cond="In(rect_tool_selected)"/>
+				<transition target="drawing_circle" event="mousemove" cond="In(circle_tool_selected)"/>
+
+				<transition target="ready" event="mouseup" >
+					<if cond="In(transform_tool_selected)">
+						<send event="TOGGLE_TRANSFORM"/>
+					</if>
 				</transition>
+
 			</state>
 
 			<state id="after_mousedown_with_shift_key_on_selected_nodes">
@@ -341,7 +369,9 @@ In both:
 				</transition>
 
 				<!-- TODO: add marquee-drawing logic -->
-				<transition target="drawing_marquee" event="mousemove"/>
+				<transition target="drawing_marquee" event="mousemove" cond="In(transform_tool_selected)"/>
+				<transition target="drawing_rect" event="mousemove" cond="In(rect_tool_selected)"/>
+				<transition target="drawing_circle" event="mousemove" cond="In(circle_tool_selected)"/>
 			</state>
 
 			<!-- TODO: add dragging behaviour with the tdeltas and stuff -->
@@ -354,11 +384,14 @@ In both:
 					<assign location="selectedNodes" expr="[clickedNode]"/>
 					<send event="NODES_SELECTED_WITH_CLICK"/>
 				</transition>
-				<transition target="dragging" event="mousemove">
+				<transition target="dragging" event="mousemove" cond="In(transform_tool_selected)">
 					<assign location="selectedNodes" expr="[clickedNode]"/>
 					<send event="NODES_SELECTED_WITH_DRAG"/>
 					<!-- TODO: add dragging logic -->
 				</transition>
+
+				<transition target="drawing_rect" event="mousemove" cond="In(rect_tool_selected)"/>
+				<transition target="drawing_circle" event="mousemove" cond="In(circle_tool_selected)"/>
 			</state>
 
 			<!-- TODO-->
@@ -371,7 +404,10 @@ In both:
 				</transition>
 
 				<!-- TODO: add marquee-drawing logic -->
-				<transition target="drawing_marquee" event="mousemove"/>
+				<transition target="drawing_marquee" event="mousemove" cond="In(transform_tool_selected)"/>
+
+				<transition target="drawing_rect" event="mousemove" cond="In(rect_tool_selected)"/>
+				<transition target="drawing_circle" event="mousemove" cond="In(circle_tool_selected)"/>
 			</state>
 
 			<state id="after_mousedown_on_canvas">
@@ -380,7 +416,10 @@ In both:
 					<send event="CHECK_NODES"/>
 				</transition>
 
-				<transition target="drawing_marquee" event="mousemove"/>
+				<transition target="drawing_marquee" event="mousemove" cond="In(transform_tool_selected)"/>
+
+				<transition target="drawing_rect" event="mousemove" cond="In(rect_tool_selected)"/>
+				<transition target="drawing_circle" event="mousemove" cond="In(circle_tool_selected)"/>
 			</state>
 
 			<!-- TODO: add marquee-drawing logic -->
@@ -394,6 +433,16 @@ In both:
 
 				<transition target="drawing_marquee" event="mousemove"/>
 			</state>
+
+			<state id="drawing_circle">
+				<transition target="drawing_circle" event="mousemove"/>
+				<transition target="ready" event="mouseup"/>
+			</state>
+
+			<state id="drawing_rect">
+				<transition target="drawing_rect" event="mousemove"/>
+				<transition target="ready" event="mouseup"/>
+			</state>
 		</state>
 	</parallel>
 



Mime
View raw message