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.
This commit is contained in:
parent
90c1c84771
commit
1197d1a3ad
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -20,9 +20,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-->
|
||||
|
||||
<mx:VBox
|
||||
<mx:Canvas
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow"
|
||||
implements="org.bigbluebutton.common.IBbbCanvas"
|
||||
xmlns:mate="http://mate.asfusion.com/"
|
||||
xmlns:dspub="org.bigbluebutton.common.*"
|
||||
initialize="init()"
|
||||
@ -63,6 +63,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
[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 <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** 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");
|
||||
}
|
||||
]]>
|
||||
</mx:Script>
|
||||
|
||||
@ -429,4 +509,4 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
</mx:states>
|
||||
<mx:Image id="cursorImg" visible="false" source="@Embed('../../assets/images/cursor4.png')"/>
|
||||
|
||||
</mx:VBox>
|
||||
</mx:Canvas>
|
||||
|
@ -20,13 +20,13 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
-->
|
||||
|
||||
<mx:VBox xmlns="org.bigbluebutton.common.*"
|
||||
<mx:Canvas xmlns="org.bigbluebutton.common.*"
|
||||
xmlns:mx="http://www.adobe.com/2006/mxml"
|
||||
xmlns:common="org.bigbluebutton.common.*"
|
||||
width="600" height="400"
|
||||
initialize="init()"
|
||||
creationComplete="onCreationComplete()"
|
||||
implements="org.bigbluebutton.common.IBbbModuleWindow"
|
||||
implements="org.bigbluebutton.common.IBbbCanvas"
|
||||
xmlns:mate="http://mate.asfusion.com/"
|
||||
backgroundColor="#C0C0C0">
|
||||
|
||||
@ -86,6 +86,8 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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");
|
||||
}
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
@ -274,4 +337,4 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
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')}"/>
|
||||
</mx:HBox>
|
||||
</mx:VBox>
|
||||
</mx:Canvas>
|
||||
|
@ -110,6 +110,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
[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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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);
|
||||
|
@ -473,6 +473,9 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
focusManager.setFocus(slideLoader);
|
||||
slideLoader.drawFocus(true);
|
||||
}
|
||||
|
||||
private function cleanCanvasHolder():void{
|
||||
while (this.whiteboardCanvasHolder.rawChildren.numChildren > 0)
|
||||
this.whiteboardCanvasHolder.rawChildren.removeChildAt(0);
|
||||
}
|
||||
|
||||
]]>
|
||||
</mx:Script>
|
||||
</mx:Script>
|
||||
<fimage:FocusableImage id="slideLoader" width="{slideModel.loaderW}" height="{slideModel.loaderH}"
|
||||
x="{slideModel.loaderX}" y="{slideModel.loaderY}" useHandCursor="true" buttonMode="false"
|
||||
creationComplete="listenForSlideLoadedCompleteEvent()"
|
||||
|
@ -24,23 +24,29 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
creationComplete="init()" visible="false" mouseOver="setCursor(toolType)" mouseOut="removeCursor()" implements="org.bigbluebutton.common.IBbbCanvas">
|
||||
<mx:Script>
|
||||
<![CDATA[
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import mx.managers.CursorManager;
|
||||
|
||||
import org.bigbluebutton.common.IBbbCanvas;
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.WhiteboardCanvasDisplayModel;
|
||||
import org.bigbluebutton.modules.whiteboard.WhiteboardCanvasModel;
|
||||
import org.bigbluebutton.modules.whiteboard.business.shapes.DrawObject;
|
||||
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
|
||||
import org.bigbluebutton.modules.whiteboard.commands.GetWhiteboardShapesCommand;
|
||||
import org.bigbluebutton.modules.whiteboard.events.PageEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.events.WhiteboardDrawEvent;
|
||||
import com.asfusion.mate.events.Dispatcher;
|
||||
|
||||
import mx.managers.CursorManager;
|
||||
|
||||
import org.bigbluebutton.common.IBbbCanvas;
|
||||
import org.bigbluebutton.common.Images;
|
||||
import org.bigbluebutton.main.events.MadePresenterEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.WhiteboardCanvasDisplayModel;
|
||||
import org.bigbluebutton.modules.whiteboard.WhiteboardCanvasModel;
|
||||
import org.bigbluebutton.modules.whiteboard.business.shapes.DrawObject;
|
||||
import org.bigbluebutton.modules.whiteboard.business.shapes.TextObject;
|
||||
import org.bigbluebutton.modules.whiteboard.commands.GetWhiteboardShapesCommand;
|
||||
import org.bigbluebutton.modules.whiteboard.events.PageEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.events.WhiteboardButtonEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.events.WhiteboardDrawEvent;
|
||||
import org.bigbluebutton.modules.whiteboard.models.Annotation;
|
||||
import org.bigbluebutton.modules.present.ui.views.SlideView;
|
||||
import org.bigbluebutton.modules.deskshare.view.components.DesktopPublishWindow;
|
||||
import org.bigbluebutton.modules.deskshare.view.components.DesktopViewWindow;
|
||||
import org.as3commons.logging.api.ILogger;
|
||||
import org.as3commons.logging.api.getClassLogger;
|
||||
|
||||
private static const LOGGER:ILogger = getClassLogger(WhiteboardCanvas);
|
||||
public var model:WhiteboardCanvasModel;
|
||||
public var displayModel:WhiteboardCanvasDisplayModel;
|
||||
|
||||
@ -68,6 +74,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
// 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 <http://www.gnu.org/licenses/>.
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* 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");
|
||||
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
<mate:Listener type="{NavigationEvent.GOTO_PAGE}" method="handleSlideChange" />
|
||||
<mate:Listener type="{DisplaySlideEvent.DISPLAY_SLIDE_EVENT}" method="handleSlideLoaded" />
|
||||
<mate:Listener type="{UploadEvent.PRESENTATION_READY}" method="handlePresentationSwitch" />
|
||||
<mate:Listener type="{PresenterStatusEvent.SWITCHED_TO_PRESENTATION_TAB}" method="handlePresentationTabSelected" />
|
||||
<mate:Listener type="{PresenterStatusEvent.SWITCHED_TO_DESKSHARE_TAB}" method="handleDeskshareTabSelected" />
|
||||
<mate:Listener type="{PresenterStatusEvent.ANNOTATIONS_PERMISSION_CHANGE}" method="handleEnableAnnotations" />
|
||||
|
||||
<mx:Style>
|
||||
.colorPickerStyle {
|
||||
@ -118,7 +117,7 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
}
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user