Index: lams_flex/LamsAuthor/src/LamsAuthor.mxml =================================================================== diff -u -r35d182812770922955a51ce25d364fb2b0d8d033 -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/LamsAuthor.mxml (.../LamsAuthor.mxml) (revision 35d182812770922955a51ce25d364fb2b0d8d033) +++ lams_flex/LamsAuthor/src/LamsAuthor.mxml (.../LamsAuthor.mxml) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -3,6 +3,7 @@ layout="absolute" verticalAlign="left" xmlns:components="org.lamsfoundation.lams.author.components.*" + xmlns:toolbar="org.lamsfoundation.lams.author.components.toolbar.*" xmlns:maps="org.lamsfoundation.lams.author.maps.*" xmlns:flexlib="http://code.google.com/p/flexlib/" preinitialize="preInit()" @@ -79,19 +80,8 @@ - + + - - - - - - - - Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml =================================================================== diff -u -r35d182812770922955a51ce25d364fb2b0d8d033 -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml (.../CanvasBox.mxml) (revision 35d182812770922955a51ce25d364fb2b0d8d033) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/CanvasBox.mxml (.../CanvasBox.mxml) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -4,14 +4,14 @@ dragEnter="dragEnterHandler(event);" dragDrop="dragDropHandler(event);" xmlns:mate="http://mate.asfusion.com/" - click="doZoom(event)" borderStyle="solid" width="4000" height="3000" x="0" y="0" > @@ -32,8 +33,6 @@ title.text = learningLibraryEntry.title; this.addChild(title); - // Adding event listener for drag - addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler); } Fisheye: Tag 2ceaea37dd2a14f76d28626f47274d188a4863f7 refers to a dead (removed) revision in file `lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/ToolBar.mxml'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 2ceaea37dd2a14f76d28626f47274d188a4863f7 refers to a dead (removed) revision in file `lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/ToolBarDropDown.mxml'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml =================================================================== diff -u -raf5f3cc7b21dbdc9b69d6df126409c75f4e64633 -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml (.../ActivityComponent.mxml) (revision af5f3cc7b21dbdc9b69d6df126409c75f4e64633) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ActivityComponent.mxml (.../ActivityComponent.mxml) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -31,27 +31,39 @@ private var transitionIn:TransitionComponent private var transitionOut:TransitionComponent; + // Activity states + public var isDragable:Boolean = true; + public var isTransitionable:Boolean = true; + private var state:int = Constants.ACTIVITY_STATE_NORMAL; // Function used to load a new activity public function load():void { } + + public function disableTitle():void { + toolTip = title.text; + title.visible = false; + title.height = 0; + } + - // The mouseMove event handler for the Image control // initiates the drag-and-drop operation. protected function mouseMove(event:MouseEvent):void { switch (Application.application.cursorState) { case Constants.CURSOR_STATE_NORMAL: + var activityComponent:ActivityComponent = event.currentTarget as ActivityComponent; - var ds:DragSource = new DragSource(); - ds.addData(activityComponent, "img"); - DragManager.doDrag(activityComponent, ds, event); - setCenter(); - + if (activityComponent.isDragable) { + var ds:DragSource = new DragSource(); + ds.addData(activityComponent, "img"); + DragManager.doDrag(activityComponent, ds, event); + setCenter(); + } break; } } @@ -60,13 +72,16 @@ switch (Application.application.cursorState) { case Constants.CURSOR_STATE_TRANSITION: - var transitionEvent:TransitionEvent = new TransitionEvent(TransitionEvent.TRANSITION_EVENT); - transitionEvent.sourceAcivityComponent = this; - transitionEvent.localX = event.localX; - transitionEvent.localY = event.localY; - //Application.application.dispatchEvent(transitionEvent); - startDragging(transitionEvent) - break; + if (this.isTransitionable) { + var transitionEvent:TransitionEvent = new TransitionEvent(TransitionEvent.TRANSITION_EVENT); + transitionEvent.sourceAcivityComponent = this; + transitionEvent.localX = event.localX; + transitionEvent.localY = event.localY; + //Application.application.dispatchEvent(transitionEvent); + startDragging(transitionEvent); + } + + break; } } @@ -133,7 +148,7 @@ if (parent.getChildAt(i) is ActivityComponent) { var activityComponent:ActivityComponent = parent.getChildAt(i) as ActivityComponent; - if (activityComponent.state == Constants.ACTIVITY_STATE_MOUSE_OVER) { + if (activityComponent.state == Constants.ACTIVITY_STATE_MOUSE_OVER && activityComponent.isTransitionable) { activityComponent.transitionIn = transitionOut; validTransition = true; } @@ -162,7 +177,7 @@ private function mouseOver(event:MouseEvent):void { - if (Application.application.uiState == Constants.UI_STATE_DRAWING && this.state != Constants.ACTIVITY_STATE_DRAWING) { + if (Application.application.uiState == Constants.UI_STATE_DRAWING && this.state != Constants.ACTIVITY_STATE_DRAWING && isTransitionable) { this.setStyle('borderStyle', 'solid'); this.setStyle('borderColor', '#66CCFF'); this.state = Constants.ACTIVITY_STATE_MOUSE_OVER; Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml =================================================================== diff -u -r3fb93ca162c53177b3ddfdf836c47bf868e144ff -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml (.../CombinedActivityComponent.mxml) (revision 3fb93ca162c53177b3ddfdf836c47bf868e144ff) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/CombinedActivityComponent.mxml (.../CombinedActivityComponent.mxml) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -42,19 +42,19 @@ toolActivityComponent1 = new ToolActivityComponent(); toolActivityComponent1.tool = learningLibraryEntry.toolTemplates[1]; toolActivityComponent1.load(); - toolActivityComponent1.toolTip = toolActivityComponent1.title.text; - toolActivityComponent1.title.visible = false; - toolActivityComponent1.title.height = 0; + toolActivityComponent1.isDragable = false; + toolActivityComponent1.isTransitionable = false; + toolActivityComponent1.disableTitle() vbox.addChild(toolActivityComponent1); } if (tool1 != null) { toolActivityComponent2 = new ToolActivityComponent(); toolActivityComponent2.tool = learningLibraryEntry.toolTemplates[2]; toolActivityComponent2.load(); - toolActivityComponent2.toolTip = toolActivityComponent2.title.text; - toolActivityComponent2.title.visible = false; - toolActivityComponent2.title.height = 0; + toolActivityComponent2.isDragable = false; + toolActivityComponent2.isTransitionable = false; + toolActivityComponent2.disableTitle() vbox.addChild(toolActivityComponent2); } Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml =================================================================== diff -u --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml (revision 0) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/OptionalActivityComponent.mxml (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml =================================================================== diff -u -r3fb93ca162c53177b3ddfdf836c47bf868e144ff -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml (.../ToolActivityComponent.mxml) (revision 3fb93ca162c53177b3ddfdf836c47bf868e144ff) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/activity/ToolActivityComponent.mxml (.../ToolActivityComponent.mxml) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -20,9 +20,8 @@ public var iconImage:Image; public var tool:Tool; - - override public function load():void { + override public function load():void { var vbox:VBox = new VBox(); vbox.setConstraintValue("verticalAlign", "middle"); Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/SystemActivityComponent.mxml =================================================================== diff -u --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/SystemActivityComponent.mxml (revision 0) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/SystemActivityComponent.mxml (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -0,0 +1,11 @@ + + + + + + + Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/ToolBar.mxml =================================================================== diff -u --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/ToolBar.mxml (revision 0) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/ToolBar.mxml (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -0,0 +1,150 @@ + + + + + + + canvasBox.MIN_ZOOM; + } + + private function mouseClick(event:MouseEvent):void + { + var dragInitiator:SystemActivityComponent = event.currentTarget as SystemActivityComponent; + + var ds:DragSource = new DragSource(); + var optionalActivity:OptionalActivityComponent = new OptionalActivityComponent(); + + + //dragInitiator.x = UIComponent(event.currentTarget).mouseX; + //dragInitiator.y = UIComponent(event.currentTarget).mouseY; + //Application.application.addChild(dragInitiator); + ds.addData(optionalActivity, "img"); + DragManager.doDrag(dragInitiator, ds, event, optionalActivity, 25, 15, 1.00, false); + } + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/ToolBarDropDown.mxml =================================================================== diff -u --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/ToolBarDropDown.mxml (revision 0) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/toolbar/ToolBarDropDown.mxml (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -0,0 +1,30 @@ + + + + + + Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/transition/TransitionComponent.as =================================================================== diff -u -r0ecb7cb6cb1caf3300646c6211d23f9026d28c75 -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/transition/TransitionComponent.as (.../TransitionComponent.as) (revision 0ecb7cb6cb1caf3300646c6211d23f9026d28c75) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/components/transition/TransitionComponent.as (.../TransitionComponent.as) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -24,8 +24,8 @@ var lineAlpha:Number = 1; // Find the middle point to draw the arrow - var middle:Point = Point.interpolate(origin, destination, 0.4); - var middle1:Point = Point.interpolate(origin, destination, 0.41); + var middle:Point = Point.interpolate(origin, destination, 0.5); + var middle1:Point = Point.interpolate(origin, destination, 0.51); // Draw an arrow to half-way graphics.beginFill(lineColor,lineAlpha); Index: lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as =================================================================== diff -u -r35d182812770922955a51ce25d364fb2b0d8d033 -r2ceaea37dd2a14f76d28626f47274d188a4863f7 --- lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as (.../Constants.as) (revision 35d182812770922955a51ce25d364fb2b0d8d033) +++ lams_flex/LamsAuthor/src/org/lamsfoundation/lams/author/util/Constants.as (.../Constants.as) (revision 2ceaea37dd2a14f76d28626f47274d188a4863f7) @@ -25,5 +25,18 @@ public static const ACTIVITY_STATE_NORMAL:int = 1; public static const ACTIVITY_STATE_DRAWING:int = 2; public static const ACTIVITY_STATE_MOUSE_OVER:int = 3; + + + public static const SYTEM_ACTIVITY_TYPE_OPTIONAL:int = 1; + public static const SYTEM_ACTIVITY_TYPE_OPTIONAL_SEQUENCE:int = 2; + public static const SYTEM_ACTIVITY_TYPE_SUPPORT:int = 3; + public static const SYTEM_ACTIVITY_TYPE_GATE:int = 4; + public static const SYTEM_ACTIVITY_TYPE_BRANCH:int = 5; + public static const SYTEM_ACTIVITY_TYPE_CONVERGE:int = 6; + public static const SYTEM_ACTIVITY_TYPE_GROUP_RANDOM:int = 7; + public static const SYTEM_ACTIVITY_TYPE_GROUP_MONITOR:int = 8; + public static const SYTEM_ACTIVITY_TYPE_GROUP_LEARNER:int = 9; + + } } \ No newline at end of file