From 1197d1a3addbc9dc7e278b643d8a1d39077462b2 Mon Sep 17 00:00:00 2001 From: kreismann Date: Wed, 13 Jul 2016 17:39:55 -0300 Subject: [PATCH] Added whiteboard functionality to the deskshare tab. Some pending issues: - Notes made in DeskstopPublishWindow appear a little dislocated in DesktopViewWindow. - Independence between SlideView and Deskshare notes. Deskshare and SlideView tabs share current slide notes. Perhaps make Deskshare Window be treated as a new page of the current presentation or as a new presentation. --- .../main/events/PresenterStatusEvent.as | 4 +- .../managers/PublishWindowManager.as | 6 +- .../deskshare/managers/ViewerWindowManager.as | 6 +- .../view/components/DesktopPublishWindow.mxml | 92 +++++++++++++++++-- .../view/components/DesktopViewWindow.mxml | 73 ++++++++++++++- .../present/ui/views/PresentationWindow.mxml | 60 ++++++++++-- .../modules/present/ui/views/SlideView.mxml | 10 +- .../whiteboard/views/WhiteboardCanvas.mxml | 60 +++++++----- .../whiteboard/views/WhiteboardToolbar.mxml | 16 +--- 9 files changed, 266 insertions(+), 61 deletions(-) diff --git a/bigbluebutton-client/src/org/bigbluebutton/main/events/PresenterStatusEvent.as b/bigbluebutton-client/src/org/bigbluebutton/main/events/PresenterStatusEvent.as index 7d94898fd2..b6139dc226 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/main/events/PresenterStatusEvent.as +++ b/bigbluebutton-client/src/org/bigbluebutton/main/events/PresenterStatusEvent.as @@ -25,12 +25,12 @@ package org.bigbluebutton.main.events public static const PRESENTER_NAME_CHANGE:String = "PRESENTER_NAME_CHANGE"; public static const SWITCH_TO_VIEWER_MODE:String = "VIEWER_MODE"; public static const SWITCH_TO_PRESENTER_MODE:String = "PRESENTER_MODE"; - public static const SWITCHED_TO_PRESENTATION_TAB:String = "SWITCHED TO PRESENTATION TAB"; - public static const SWITCHED_TO_DESKSHARE_TAB:String = "SWITCHED TO DESKSHARE TAB"; + public static const ANNOTATIONS_PERMISSION_CHANGE:String = "ANNOTATIONS_PERMISSION_CHANGE"; public var presenterName:String; public var assignerBy:Number; public var userID:String; + public var enableAnnotations:Boolean; public function PresenterStatusEvent(type:String) { diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/PublishWindowManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/PublishWindowManager.as index 73d9a902b0..e4c93662c2 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/PublishWindowManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/PublishWindowManager.as @@ -80,13 +80,13 @@ package org.bigbluebutton.modules.deskshare.managers closeWindow(shareWindow); } - private function openWindow(window:IBbbModuleWindow):void { + private function openWindow(window:DesktopPublishWindow):void { var e:ShareEvent = new ShareEvent(ShareEvent.CREATE_DESKTOP_PUBLISH_TAB); - e.publishTabContent = window as DesktopPublishWindow; + e.publishTabContent = window; globalDispatcher.dispatchEvent(e); } - private function closeWindow(window:IBbbModuleWindow):void { + private function closeWindow(window:DesktopPublishWindow):void { var e:ShareEvent = new ShareEvent(ShareEvent.CLEAN_DESKTOP_PUBLISH_TAB); globalDispatcher.dispatchEvent(e); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/ViewerWindowManager.as b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/ViewerWindowManager.as index b559e9e700..1ee759c484 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/ViewerWindowManager.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/managers/ViewerWindowManager.as @@ -52,9 +52,9 @@ package org.bigbluebutton.modules.deskshare.managers service.sendStartedViewingNotification(stream); } - private function openWindow(window:IBbbModuleWindow):void{ + private function openWindow(window:DesktopViewWindow):void{ var e:ShareEvent = new ShareEvent(ShareEvent.OPEN_DESKTOP_VIEW_TAB); - e.viewTabContent = window as DesktopViewWindow; + e.viewTabContent = window; globalDispatcher.dispatchEvent(e); } @@ -64,7 +64,7 @@ package org.bigbluebutton.modules.deskshare.managers isViewing = false; } - private function closeWindow(window:IBbbModuleWindow):void { + private function closeWindow(window:DesktopViewWindow):void { var e:ShareEvent = new ShareEvent(ShareEvent.CLOSE_DESKTOP_VIEW_TAB); globalDispatcher.dispatchEvent(e); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml index b17c76e215..8f471a58e1 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopPublishWindow.mxml @@ -20,9 +20,9 @@ with BigBlueButton; if not, see . --> -. import org.bigbluebutton.modules.deskshare.utils.JavaCheck; import org.bigbluebutton.modules.deskshare.utils.BrowserCheck; import org.bigbluebutton.modules.deskshare.events.ShareEvent; + import org.bigbluebutton.common.IBbbCanvas; import org.bigbluebutton.util.i18n.ResourceUtil; @@ -97,6 +98,9 @@ with BigBlueButton; if not, see . [Bindable] private var cursor:Sprite; [Bindable] private var dsOptions:DeskshareOptions; + + private var whiteboardCanvas:Canvas = null; + private var whiteboardCanvasHolder:Canvas = new Canvas(); private var calledStopApplet:Boolean = false; @@ -233,7 +237,7 @@ with BigBlueButton; if not, see . } private function startPreviewStream(nc:NetConnection, streamName:String, capWidth:Number, capHeight:Number):void{ - if(cursor == null || cursorImg == null) + if(cursor == null || cursorImg == null || video != null) return; streaming = true; @@ -255,7 +259,7 @@ with BigBlueButton; if not, see . videoHolder.addChild(cursor); videoHolder.addChild(cursorImg); cursor.visible = false; - this.addChild(videoHolder); + this.addChildAt(videoHolder,0); fitVideoToWindow(); ns = new NetStream(nc); @@ -268,7 +272,43 @@ with BigBlueButton; if not, see . video.attachNetStream(ns); ns.play(streamName); } - + + private function addWhiteboardCanvasHolder():void{ + updateWhiteboardCanvasHolder(); + if(streaming) + this.addChildAt(this.whiteboardCanvasHolder,1); + } + + private function updateWhiteboardCanvasHolder():void{ + if(video != null) { + this.whiteboardCanvasHolder.x = video.x; + this.whiteboardCanvasHolder.y = video.y; + this.whiteboardCanvasHolder.width = video.width; + this.whiteboardCanvasHolder.height = video.height; + LOGGER.debug("Whiteboard canvas holder dimensions updated"); + } + } + + public function addWhiteboardOverlay():void { + updateWhiteboardCanvasOverlay(); + if(streaming && this.whiteboardCanvas != null) { + this.addChild(this.whiteboardCanvas); + LOGGER.debug("Whiteboard Canvas OVERLAY added."); + } + else + LOGGER.debug("COULD NOT add whiteboard overlay"); + } + + private function updateWhiteboardCanvasOverlay():void{ + if(video != null && this.whiteboardCanvas != null) { + this.whiteboardCanvas.x = video.x; + this.whiteboardCanvas.y = video.y; + this.whiteboardCanvas.width = video.width; + this.whiteboardCanvas.height = video.height; + LOGGER.debug("Whiteboard canvas overlay dimensions updated"); + } + } + private function onResize(e:ResizeEvent):void { fitVideoToWindow(); } @@ -290,6 +330,10 @@ with BigBlueButton; if not, see . video.y = 0; video.x = (videoHolder.width - video.width) / 2; } + + //update the whiteboard canvas holder and overlay with new video dimensions... + updateWhiteboardCanvasHolder(); + updateWhiteboardCanvasOverlay(); } private function stopStream():void{ @@ -315,6 +359,8 @@ with BigBlueButton; if not, see . break; case "NetStream.Play.Start": LOGGER.debug("Netstatus: {0}", [e.info.code]); + addWhiteboardCanvasHolder(); + addWhiteboardOverlay(); globalDispatcher.dispatchEvent(new BBBEvent(BBBEvent.DESKSHARE_STARTED)); } } @@ -377,6 +423,40 @@ with BigBlueButton; if not, see . } } } + + /** Inherited from IBbbCanvas*/ + public function addRawChild(child:DisplayObject):void{ + this.whiteboardCanvasHolder.rawChildren.addChild(child); + } + + public function removeRawChild(child:DisplayObject):void{ + this.whiteboardCanvasHolder.rawChildren.removeChild(child); + } + + public function doesContain(child:DisplayObject):Boolean{ + return this.whiteboardCanvasHolder.rawChildren.contains(child); + } + + public function acceptOverlayCanvas(overlay:IBbbCanvas):void{ + LOGGER.debug("DesktopPublishWindow: acceptOverlayCanvas"); + whiteboardCanvas = overlay as Canvas; + } + + private function handleWhiteboardCanvasClick(e:MouseEvent):void { + LOGGER.debug("DesktopPublishWindow: handleWhiteboardCanvasClick"); + } + + public function moveCanvas(x:Number, y:Number):void{ + LOGGER.debug("DesktopPublishWindow: moveCanvas"); + } + + public function zoomCanvas(width:Number, height:Number, zoom:Number):void{ + LOGGER.debug("DesktopPublishWindow: zoomCanvas"); + } + + public function showCanvas(show:Boolean):void{ + LOGGER.debug("DesktopPublishWindow: showCanvas"); + } ]]> @@ -429,4 +509,4 @@ with BigBlueButton; if not, see . - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml index c8ac6a79ef..56b986b918 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/deskshare/view/components/DesktopViewWindow.mxml @@ -20,13 +20,13 @@ with BigBlueButton; if not, see . --> - @@ -86,6 +86,8 @@ with BigBlueButton; if not, see . private var isMaximized:Boolean = false; [Bindable] private var dsOptions:DeskshareOptions; + + private var whiteboardCanvasHolder:Canvas = new Canvas(); private function init():void{ dsOptions = new DeskshareOptions(); @@ -94,7 +96,7 @@ with BigBlueButton; if not, see . private function onCreationComplete():void{ videoHolder.addChild(video); videoHolder.addEventListener(ResizeEvent.RESIZE, onResize); - this.addChild(videoHolder); + this.addChildAt(videoHolder,0); videoHolder.percentWidth = 100; videoHolder.percentHeight = 100; fitVideoToWindow(); @@ -149,7 +151,31 @@ with BigBlueButton; if not, see . video.attachNetStream(ns); ns.play(stream); this.stream = stream; - + + } + + private function addWhiteboardCanvasHolder():void{ + if(video != null) { + cleanCanvasHolder(); + updateWhiteboardCanvasHolder(); + this.addChild(whiteboardCanvasHolder); + LOGGER.debug("Whiteboard canvas holder added"); + } + } + + private function cleanCanvasHolder():void{ + while (this.whiteboardCanvasHolder.rawChildren.numChildren > 0) + this.whiteboardCanvasHolder.rawChildren.removeChildAt(0); + } + + private function updateWhiteboardCanvasHolder():void{ + if(video != null) { + whiteboardCanvasHolder.x = video.x; + whiteboardCanvasHolder.y = video.y; + whiteboardCanvasHolder.width = video.width; + whiteboardCanvasHolder.height = video.height; + LOGGER.debug("Whiteboard canvas holder dimensions updated"); + } } protected function updateButtonsPosition():void { @@ -243,6 +269,9 @@ with BigBlueButton; if not, see . btnActualSize.toolTip = ResourceUtil.getInstance().getString('bbb.desktopView.actualSize'); btnActualSize.label = ResourceUtil.getInstance().getString('bbb.desktopView.actualSize'); } + + //update the whiteboard canvas holder with new video dimensions... + updateWhiteboardCanvasHolder(); } private function closeWindow():void { @@ -256,6 +285,40 @@ with BigBlueButton; if not, see . private function localeChanged(e:Event):void{ resourcesChanged(); } + + /** Inherited from IBbbCanvas*/ + public function addRawChild(child:DisplayObject):void{ + this.whiteboardCanvasHolder.rawChildren.addChild(child); + } + + public function removeRawChild(child:DisplayObject):void{ + this.whiteboardCanvasHolder.rawChildren.removeChild(child); + } + + public function doesContain(child:DisplayObject):Boolean{ + return this.whiteboardCanvasHolder.rawChildren.contains(child); + } + + public function acceptOverlayCanvas(overlay:IBbbCanvas):void{ + LOGGER.debug("DesktopPublishWindow: acceptOverlayCanvas"); + addWhiteboardCanvasHolder(); + } + + private function handleWhiteboardCanvasClick(e:MouseEvent):void { + LOGGER.debug("DesktopPublishWindow: handleWhiteboardCanvasClick"); + } + + public function moveCanvas(x:Number, y:Number):void{ + LOGGER.debug("DesktopPublishWindow: moveCanvas"); + } + + public function zoomCanvas(width:Number, height:Number, zoom:Number):void{ + LOGGER.debug("DesktopPublishWindow: zoomCanvas"); + } + + public function showCanvas(show:Boolean):void{ + LOGGER.debug("DesktopPublishWindow: showCanvas"); + } ]]> @@ -274,4 +337,4 @@ with BigBlueButton; if not, see . label="{btnActualSize.selected ? ResourceUtil.getInstance().getString('bbb.desktopView.fitToWindow') : ResourceUtil.getInstance().getString('bbb.desktopView.actualSize')}" toolTip="{btnActualSize.selected ? ResourceUtil.getInstance().getString('bbb.desktopView.fitToWindow') : ResourceUtil.getInstance().getString('bbb.desktopView.actualSize')}"/> - + diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml index 1c399fa573..f6c7e0d5ff 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/PresentationWindow.mxml @@ -110,6 +110,9 @@ with BigBlueButton; if not, see . import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent; import org.bigbluebutton.modules.deskshare.events.ShareEvent; import org.bigbluebutton.util.i18n.ResourceUtil; + import org.bigbluebutton.common.IBbbCanvas; + import org.bigbluebutton.modules.deskshare.view.components.DesktopPublishWindow; + import org.bigbluebutton.modules.deskshare.view.components.DesktopViewWindow; private static const LOGGER:ILogger = getClassLogger(PresentationWindow); @@ -171,6 +174,10 @@ with BigBlueButton; if not, see . [Embed(source="../../../polling/sounds/Poll.mp3")] private var noticeSoundClass:Class; private var noticeSound:Sound = new noticeSoundClass() as Sound; + + private var whiteboardOverlay:IBbbCanvas = null; + private var DSPublishCanvas:DesktopPublishWindow = null; + private var DSViewCanvas:DesktopViewWindow = null; private function init():void{ presentOptions = new PresentOptions(); @@ -532,8 +539,17 @@ with BigBlueButton; if not, see . private function addOverlayCanvas(e:AddOverlayCanvasEvent):void{ LOGGER.debug("OVERLAYING WHITEBOARD CANVAS"); + whiteboardOverlay = e.canvas; + + LOGGER.debug("addOverlayCanvas: Adding whiteboard canvas to SlideView"); e.canvas.acceptOverlayCanvas(slideView); slideView.acceptOverlayCanvas(e.canvas); + + if(currentTabIndex == DESKSHARE_VIEW_TAB_INDEX && DSViewCanvas != null) { + LOGGER.debug("addOverlayCanvas: Adding whiteboard canvas to DesktopViewWindow"); + DSViewCanvas.acceptOverlayCanvas(whiteboardOverlay); + whiteboardOverlay.acceptOverlayCanvas(DSViewCanvas); + } } override protected function resourcesChanged():void{ @@ -842,11 +858,18 @@ with BigBlueButton; if not, see . if(presenterTabs.selectedIndex == PRESENTATION_TAB_INDEX) { currentTabIndex = PRESENTATION_TAB_INDEX; LOGGER.debug("Presentation Tab selected."); + if(sharing) stopSharing(); + + if(whiteboardOverlay != null) { + slideView.acceptOverlayCanvas(whiteboardOverlay); + whiteboardOverlay.acceptOverlayCanvas(slideView); + } + if(currentControlBarState == PRESENTER_STATE) { setControlBarState("presenter"); - dispatchEvent(new PresenterStatusEvent(PresenterStatusEvent.SWITCHED_TO_PRESENTATION_TAB)); + annotationsPermissionChanged(true); } } @@ -862,13 +885,18 @@ with BigBlueButton; if not, see . deskshareControls.visible = true; deskshareControls.includeInLayout = true; } - dispatchEvent(new PresenterStatusEvent(PresenterStatusEvent.SWITCHED_TO_DESKSHARE_TAB)); + annotationsPermissionChanged(false); } } else { currentTabIndex = DESKSHARE_VIEW_TAB_INDEX; LOGGER.debug("Deskshare Viewing Tab selected."); + + if(whiteboardOverlay != null && DSViewCanvas != null) { + DSViewCanvas.acceptOverlayCanvas(whiteboardOverlay); + whiteboardOverlay.acceptOverlayCanvas(DSViewCanvas); + } else LOGGER.debug("openDesktopViewTab: whiteboard overlay or desktop view canvas is null!"); } } } @@ -884,33 +912,35 @@ with BigBlueButton; if not, see . private function createDesktopPublishTab(e:ShareEvent):void { if(e.publishTabContent != null && desksharePublishTab.numElements == 0) { - LOGGER.debug("Setting the content of dekstop share PUBLISHING tab"); - + DSPublishCanvas = e.publishTabContent; canPublish = e.publishTabContent.canPublish(); + LOGGER.debug("Setting the content of dekstop share PUBLISHING tab"); e.publishTabContent.percentHeight = 100; e.publishTabContent.percentWidth = 100; desksharePublishTab.addChild(e.publishTabContent); if(canPublish && e.publishTabContent.autoStart) handleDeskshareAutoStart(); + } else LOGGER.debug("publishTabContent is NULL."); } private function cleanDesktopPublishTab(e:ShareEvent):void { - LOGGER.debug("desksharePublishTab.numElements = " + desksharePublishTab.numElements) if(desksharePublishTab.numElements != 0) { LOGGER.debug("Removing content of dekstop share PUBLISHING tab"); desksharePublishTab.removeAllElements(); + DSPublishCanvas = null; } } private function openDesktopViewTab(e:ShareEvent):void { if(e.viewTabContent != null && presenterTabs.numElements == 2) { - LOGGER.debug("Opening a new tab for dekstop share VIEWING"); + DSViewCanvas = e.viewTabContent; + LOGGER.debug("Opening a new tab for dekstop share VIEWING"); e.viewTabContent.percentHeight = 100; e.viewTabContent.percentWidth = 100; e.viewTabContent.setStyle("horizontalAlign","center"); @@ -926,11 +956,21 @@ with BigBlueButton; if not, see . private function closeDesktopViewTab(e:ShareEvent):void { LOGGER.debug("Closing the dekstop share VIEWING tab"); selectPresentationTab(); - if(presenterTabs.numElements == 3) + if(presenterTabs.numElements == 3) { presenterTabs.removeChildAt(DESKSHARE_VIEW_TAB_INDEX); + DSViewCanvas = null; + } } private function shareScreen(fullScreen:Boolean):void { + + if(whiteboardOverlay != null && DSPublishCanvas != null) { + LOGGER.debug("Adding whiteboard layer to Deskshare Publish Canvas"); + DSPublishCanvas.acceptOverlayCanvas(whiteboardOverlay); + whiteboardOverlay.acceptOverlayCanvas(DSPublishCanvas); + annotationsPermissionChanged(true); + } else LOGGER.debug("shareScreen: whiteboard overlay or desktop publish canvas is null!"); + var e:ShareEvent = new ShareEvent(ShareEvent.SHARE_SCREEN); e.fullScreen = fullScreen; @@ -957,6 +997,12 @@ with BigBlueButton; if not, see . onSelectTab(); } + private function annotationsPermissionChanged(enableAnnotations:Boolean):void { + var event:PresenterStatusEvent = new PresenterStatusEvent(PresenterStatusEvent.ANNOTATIONS_PERMISSION_CHANGE); + event.enableAnnotations = enableAnnotations; + dispatchEvent(event); + } + private function handleDeskshareAutoStart():void { if(deskshareTimer == null) { deskshareTimer = new Timer(2000, 1); diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml index 83d36647d8..8878456197 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/ui/views/SlideView.mxml @@ -473,6 +473,9 @@ with BigBlueButton; if not, see . } public function acceptOverlayCanvas(overlay:IBbbCanvas):void{ + if(whiteboardCanvas != null) + cleanCanvasHolder(); + whiteboardCanvas = overlay; var c:Canvas = overlay as Canvas; // add the canvas below the thumbnails @@ -517,9 +520,14 @@ with BigBlueButton; if not, see . focusManager.setFocus(slideLoader); slideLoader.drawFocus(true); } + + private function cleanCanvasHolder():void{ + while (this.whiteboardCanvasHolder.rawChildren.numChildren > 0) + this.whiteboardCanvasHolder.rawChildren.removeChildAt(0); + } ]]> - + . creationComplete="init()" visible="false" mouseOver="setCursor(toolType)" mouseOut="removeCursor()" implements="org.bigbluebutton.common.IBbbCanvas"> . } public function queryForAnnotationHistory(webId:String):void { + LOGGER.debug("Query for annotation history: " + webId); var dispatcher:Dispatcher = new Dispatcher(); dispatcher.dispatchEvent(new GetWhiteboardShapesCommand(webId)); } @@ -97,10 +104,10 @@ with BigBlueButton; if not, see . stage.removeEventListener(MouseEvent.MOUSE_UP, doMouseUp); stage.removeEventListener(MouseEvent.MOUSE_MOVE, doMouseMove); - } + } private function doMouseDown(event:Event):void { - displayModel.doMouseDown(this.mouseX, this.mouseY); + displayModel.doMouseDown(this.mouseX, this.mouseY); model.doMouseDown(this.mouseX, this.mouseY); event.stopPropagation(); // we want to stop the bubbling so slide doesn't move @@ -111,7 +118,6 @@ with BigBlueButton; if not, see . private function doMouseMove(event:Event):void { model.doMouseMove(Math.min(Math.max(parent.mouseX, 0), parent.width-2) - this.x, Math.min(Math.max(parent.mouseY, 0), parent.height-2) - this.y); } - public function setShape(s:String):void { // LogUtil.debug("SET SHAPE [" + s + "]"); @@ -122,7 +128,7 @@ with BigBlueButton; if not, see . model.changeColor(e.target.selectedColor); } - + public function sendGraphicToServer(gobj:Annotation, type:String):void { // LogUtil.debug("DISPATCHING SEND sendGraphicToServer [" + type + "]"); var event:WhiteboardDrawEvent = new WhiteboardDrawEvent(type); @@ -146,7 +152,7 @@ with BigBlueButton; if not, see . // model.changeFillColor(e.target.selectedColor); } - public function changeThickness(e:Event):void { + public function changeThickness(e:Event):void { model.changeThickness(e.target.value); } @@ -244,6 +250,14 @@ with BigBlueButton; if not, see . public function acceptOverlayCanvas(overlay:IBbbCanvas):void { // LogUtil.debug("WhiteboardCanvas::acceptOverlayCanvas()"); // LogUtil.debug("OVERLAYING PRESENTATION CANVAS"); + + var changedCanvas:Boolean = false; + if( (this.bbbCanvas as DesktopPublishWindow != null || this.bbbCanvas as DesktopViewWindow != null) && + overlay as SlideView != null ) + changedCanvas = true; + else if(this.bbbCanvas as SlideView != null && + (overlay as DesktopPublishWindow != null || overlay as DesktopViewWindow != null)) + changedCanvas = true; this.bbbCanvas = overlay; //Load existing shapes onto the canvas. @@ -251,15 +265,15 @@ with BigBlueButton; if not, see . /** * Check if this is the first time we overlayed the whiteboard canvas into the - * presentation canvas. If so, query for annotations history. + * presentation canvas or the user changed tabs on Presentation Window. If so, query for annotations history. */ - if (! displayModel.canvasInited) { + if (! displayModel.canvasInited || changedCanvas) { displayModel.parentCanvasInitialized(); var webId:String = model.whiteboardModel.getCurrentWhiteboardId(); if (webId != null) { queryForAnnotationHistory(webId); } - } + } else LOGGER.debug("Not querying annotations history"); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml index 68390a3845..8ac6742ab2 100644 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/views/WhiteboardToolbar.mxml @@ -41,8 +41,7 @@ with BigBlueButton; if not, see . - - + .colorPickerStyle { @@ -118,7 +117,7 @@ with BigBlueButton; if not, see . private var mousedOver:Boolean = false; private var slideLoaded:Boolean = false; - private var presentationTabSelected:Boolean = true; + private var enableAnnotations:Boolean = true; public var canvas:WhiteboardCanvas; private var presentationWindow:PresentationWindow; @@ -254,7 +253,7 @@ with BigBlueButton; if not, see . } private function checkVisibility(e:MadePresenterEvent = null):void { - if (toolbarAllowed() && slideLoaded && presentationTabSelected && (wbOptions.keepToolbarVisible || mousedOver)) { + if (toolbarAllowed() && slideLoaded && enableAnnotations && (wbOptions.keepToolbarVisible || mousedOver)) { setPositionAndDepth(); showWhiteboardToolbar = true; } else { @@ -332,13 +331,8 @@ with BigBlueButton; if not, see . return UsersUtil.amIModerator(); } - private function handlePresentationTabSelected(e:PresenterStatusEvent):void { - presentationTabSelected = true; - checkVisibility(); - } - - private function handleDeskshareTabSelected(e:PresenterStatusEvent):void { - presentationTabSelected = false; + private function handleEnableAnnotations(e:PresenterStatusEvent):void { + enableAnnotations = e.enableAnnotations; checkVisibility(); }