git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@3821 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Denis Zgonjanin 2010-03-08 15:14:13 +00:00
parent 8ad658a6c8
commit 70bd0ca41c
7 changed files with 1 additions and 355 deletions

View File

@ -33,7 +33,6 @@ TypeError: Error #1034: Type Coercion failed: cannot convert org.bigbluebutton.m
<EventMap xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="http://mate.asfusion.com/">
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.present.events.CrossModuleSlideZoomMoveEvent;
import org.bigbluebutton.modules.present.events.PresentationEvent;
import org.bigbluebutton.modules.present.events.NavigationEvent;
import org.bigbluebutton.modules.present.events.AddPresentationToolbarEvent;
@ -59,5 +58,4 @@ TypeError: Error #1034: Type Coercion failed: cannot convert org.bigbluebutton.m
<Listener type="{AddPresentationToolbarEvent}" />
<Listener type="{NavigationEvent}" />
<Listener type="{PresentationEvent}" />
<Listener type="{CrossModuleSlideZoomMoveEvent}" />
</EventMap>

View File

@ -5,8 +5,6 @@
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.IBbbCanvas;
import mx.controls.Alert;
import org.bigbluebutton.modules.present.events.CrossModuleSlideZoomMoveEvent;
import mx.managers.CursorManager;
import org.bigbluebutton.common.Images;
import mx.collections.ArrayCollection;
@ -212,14 +210,6 @@
}
}
private function zoomAndMove(e:CrossModuleSlideZoomMoveEvent):void{
for (var i:int = 0; i<this.shapeList.length; i++){
var s:Shape = this.shapeList[i] as Shape;
//s.x = e.x * 2;
//s.y = e.y * 2;
}
}
private function modifyEnabled(e:HighlighterUpdate):void{
this.visible = e.boardEnabled;
}
@ -273,7 +263,6 @@
<mate:Listener type="{HighlighterUpdate.BOARD_UPDATED}" method="drawSegment" />
<mate:Listener type="{HighlighterUpdate.SHAPE_UNDONE}" method="undoShape" />
<mate:Listener type="{WindowResizedEvent.PRESENTATION_WINDOW_RESIZED_EVENT}" method="scaleCanvas" />
<mate:Listener type="{CrossModuleSlideZoomMoveEvent.SLIDE_MOVE}" method="zoomAndMove" />
<mate:Listener type="{PageEvent.CHANGE_PAGE}" method="changePage" />
<mate:Listener type="{HighlighterUpdate.BOARD_ENABLED}" method="modifyEnabled" />
</mx:Canvas>

View File

@ -1,99 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<MDIWindow xmlns="flexlib.mdi.containers.*"
xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:mate="http://mate.asfusion.com/"
implements="org.bigbluebutton.common.IBbbModuleWindow"
width="400" height="300" xmlns:views="org.bigbluebutton.modules.highlighter.views.*"
title="Whiteboard">
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.highlighter.events.HighlighterDrawEvent;
import org.bigbluebutton.common.Images;
import org.bigbluebutton.modules.highlighter.business.shapes.DrawObject;
private var images:Images = new Images();
[Bindable] private var square_icon:Class = images.square_icon;
[Bindable] private var pencil_icon:Class = images.pencil_icon;
[Bindable] private var undo_icon:Class = images.undo_icon;
[Bindable] private var circle_icon:Class = images.circle_icon;
[Bindable] private var delete_icon:Class = images.delete_icon;
private var _xPosition:int = 675;
private var _yPosition:int = 310;
public function get xPosition():int {
return _xPosition;
}
public function get yPosition():int {
return _yPosition;
}
public function set xPosition(x:int):void {
_xPosition = x;
}
public function set yPosition(y:int):void {
_yPosition = y;
}
public function get defaultWidth():int{
return this.width;
}
public function get defaultHeight():int{
return this.height;
}
public function set defaultHeight(height:int):void{
this.height = height;
}
public function set defaultWidth(width:int):void{
this.width = width;
}
public function resetWidthAndHeight():void{/* do nothing */}
/**
* Sets the type of shape we're drawing (pencil, rectangle, etc...)
* @param s The type
*
*/
protected function setShape(s:String):void{
canvas.setShape(s);
}
/**
* Sets the color
* @param e event containing the color (e.target.selectedColor)
*
*/
protected function changeColor(e:Event):void{
canvas.changeColor(e);
}
/**
* Sets the thickness
* @param e event containing the thickness (e.target.value)
*
*/
protected function changeThickness(e:Event):void{
canvas.changeThickness(e);
}
]]>
</mx:Script>
<views:HighlighterCanvas id="canvas" width="100%" height="100%" />
<mx:ApplicationControlBar width="100%" height="10%">
<mx:Button width="20" height="20" id="btnPenc" click="setShape(DrawObject.PENCIL)" icon="{pencil_icon}" />
<mx:Button width="20" height="20" id="btnRect" click="setShape(DrawObject.RECTANGLE)" icon="{square_icon}"/>
<mx:Button width="20" height="20" id="btnEllip" click="setShape(DrawObject.ELLIPSE)" icon="{circle_icon}"/>
<mx:Button width="20" height="20" id="btnClear" click="dispatchEvent(new HighlighterDrawEvent(HighlighterDrawEvent.CLEAR_BOARD))" icon="{delete_icon}" />
<mx:Button width="20" height="20" id="btnUndo" click="dispatchEvent(new HighlighterDrawEvent(HighlighterDrawEvent.UNDO_SHAPE))" icon="{undo_icon}" />
<mx:ColorPicker change="changeColor(event)" id="cpik"/>
<mx:HSlider width="50" id="sld" change="changeThickness(event)"/>
</mx:ApplicationControlBar>
</MDIWindow>

View File

@ -1,19 +0,0 @@
package org.bigbluebutton.modules.present.events
{
import flash.events.Event;
public class CrossModuleSlideZoomMoveEvent extends Event
{
public static const SLIDE_MOVE:String = "Slide Move";
public static const SLIDE_ZOOM:String = "Slide Zoom";
public var x:int;
public var y:int;
public function CrossModuleSlideZoomMoveEvent(type:String)
{
super(type, true, false);
}
}
}

View File

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
BigBlueButton - http://www.bigbluebutton.org
Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
BigBlueButton is free software; you can redistribute it and/or modify it under the
terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later
version.
BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
$Id: $
-->
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()" xmlns:controls="org.bigbluebutton.modules.present.views.fisheye.controls.*"
width="100%" mouseMove="displayIndex()" rollOut="onRollOut()" rollOver="onRollOver()" xmlns:mate="http://mate.asfusion.com/">
<mate:Listener type="{NavigationEvent.GOTO_PAGE}" method="highlightSlide" />
<mx:Script>
<![CDATA[
import org.bigbluebutton.modules.present.events.PresenterCommands;
import mx.controls.Alert;
import org.bigbluebutton.modules.present.events.NavigationEvent;
import mx.controls.Text;
import mx.controls.TextArea;
import mx.collections.ArrayCollection;
[Bindable] public var images:Array;
public static const SLIDE_SELECTED:String = "SLIDE_SELECTED";
public static const SLIDE_HIGHLIGHTED:String = "SLIDE_HIGHLIGHTED";
private var imgHeight1:Number = 50;
private var imgWidth1:Number = 50;
[Bindable] public var selected:Number;
[Bindable] public var slideNumber:Number;
private function init():void{
fisheye.setStyle("hilightScaleRadius",2);
fisheye.setStyle("animationSpeed",0.8);
fisheye.setStyle("defaultScale",0.2);
fisheye.setStyle("hilightMaxScale",2.0);
}
public function setDataProvider(dp:ArrayCollection):void{
this.images = dp.toArray();
//must reinitialize arrays to properly display new slides.
fisheye._pdata = new Array();
fisheye._mouseData = new Array();
//set the itemRenderer of the thumbnails
fisheye.dataProvider = this.images;
fisheye.itemRenderer = imageRenderer;
var itemCount:Number = images.length;
}
public function setThumbRatio1(ratio:Number):void{
if (ratio > 0 && ratio < 1){
fisheye.setStyle("defaultScale",ratio);
fisheye.setStyle("hilightMaxScale",ratio*2);
}
}
public function selectSlide():void{
if (images == null) return;
dispatchEvent(new PresenterCommands(PresenterCommands.GOTO_SLIDE, fisheye.selectedIndex));
}
public function displayIndex():void{
if (this.visible){
slideNumber = fisheye.getHighlightedIndex(fisheye.mouseX, fisheye.mouseY);
}
}
public function setFisheyeVisibility(visible:Boolean):void{
fisheye.visible = visible;
LogUtil.debug('FisheyeThumbnail::setVisibility()...this.visible=' + this.visible + " " + fisheye.visible);
}
private function onRollOut():void{
this.visible = false;
}
private function onRollOver():void{
this.visible = true;
}
private function highlightSlide(e:NavigationEvent):void{
fisheye.selectedIndex = e.pageNumber;
}
]]>
</mx:Script>
<mx:HBox width="100%" horizontalGap="0" height="100%" styleName="insetBox" clipContent="true" >
<controls:Fisheye id="fisheye" width="100%" height="100%" dataProvider="{images}" click="selectSlide()"
stateProperty="currentState" rolloverValue="hilighted" defaultValue="" selectedValue="selected"
verticalAlign="bottom" horizontalAlign="center" >
<controls:itemRenderer>
<mx:Component id="imageRenderer">
<controls:BitmapTile>
<controls:states>
<mx:State name="selected" id="selectedImage">
<mx:SetStyle name="borderColor" value="#E27C0E" />
<mx:SetStyle name="borderAlpha" value="1" />
<mx:SetStyle name="borderWidth" value="3" />
<mx:SetProperty name="filters" />
</mx:State>
<mx:State name="hilighted">
<mx:SetProperty name="filters" />
</mx:State>
</controls:states>
</controls:BitmapTile>
</mx:Component>
</controls:itemRenderer>
</controls:Fisheye>
</mx:HBox>
</mx:Canvas>

View File

@ -406,10 +406,6 @@
currentState = "dispUploadPresLabel";
}
}
private function enableTextSelection():void{
slideView.turnOnTextSelection();
}
private function gotoPreviousSlide():void {
if ((slideView.selectedSlide - 1) >= 0)

View File

@ -42,8 +42,6 @@
<mx:Script>
<![CDATA[
import org.bigbluebutton.common.IBbbCanvas;
import mx.controls.Alert;
import org.bigbluebutton.modules.present.events.CrossModuleSlideZoomMoveEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.events.SlideResizedEvent;
import org.bigbluebutton.modules.present.events.DisplaySlideEvent;
@ -290,12 +288,7 @@
savePresentersSettings(e.xOffset, e.yOffset, e.slideToCanvasWidthRatio, e.slideToCanvasHeightRatio);
if (participantShouldHandleMessage()) {
resizeAndMoveLoaderInRelationToCanvas();
}
/*var event:CrossModuleSlideZoomMoveEvent = new CrossModuleSlideZoomMoveEvent(CrossModuleSlideZoomMoveEvent.SLIDE_MOVE);
event.x = loaderX();
event.y = loaderY();
dispatchEvent(event);*/
}
moveCanvas(loaderX(), loaderY());
}
@ -421,92 +414,7 @@
dispEvent.slideHeight = slideRealHeight;
dispatcher.dispatchEvent(dispEvent);
}
/************************************************************
* Methods supporting text selection within the slide.
************************************************************/
public function turnOnTextSelection():void{
slideClip = swfSlideLoader.content as MovieClip;
slideText = slideClip.textSnapshot;
swfSlideLoader.addEventListener(MouseEvent.MOUSE_DOWN, onTextMouseDown);
swfSlideLoader.addEventListener(MouseEvent.MOUSE_UP, onTextMouseUp);
swfSlideLoader.addEventListener(MouseEvent.MOUSE_OUT, onTextMouseOut);
slideText.setSelectColor(0xFFFF00);
}
private function onTextMouseDown(e:MouseEvent):void{
swfSlideLoader.addEventListener(MouseEvent.MOUSE_MOVE, onTextMouseMove);
//NOTE: hitTestTextNearPos() seems to be failing me right now. Something about font metrics according to documentation. -Denis Zgonjanin, Jan 15 2010
firstChar = slideText.hitTestTextNearPos(slideClip.mouseX, slideClip.mouseY, 0);
selectText(0, slideText.charCount, false);
}
private function onTextMouseMove(e:MouseEvent):void{
if (firstChar != -1){
selectText(0, slideText.charCount, false)
lastChar = slideText.hitTestTextNearPos(slideClip.mouseX, slideClip.mouseY, 0);
if (firstChar < lastChar){
selectText(firstChar, lastChar + 1, true);
} else{
selectText(lastChar, firstChar + 1, true);
}
}
}
private function onTextMouseUp(e:MouseEvent):void{
swfSlideLoader.removeEventListener(MouseEvent.MOUSE_MOVE, onTextMouseMove);
if (firstChar >= 0){
lastChar = slideText.hitTestTextNearPos(slideClip.mouseX, slideClip.mouseY, 0);
if (firstChar != lastChar){
if (firstChar < lastChar){
selectText(firstChar, lastChar + 1, true);
} else{
selectText(lastChar, firstChar + 1, true);
}
}
firstChar = -1;
lastChar = -1;
}
swfSlideLoader.removeEventListener(MouseEvent.MOUSE_OUT, onTextMouseOut);
swfSlideLoader.removeEventListener(MouseEvent.MOUSE_MOVE, onTextMouseMove);
}
private function onTextMouseOut(e:MouseEvent):void{
swfSlideLoader.removeEventListener(MouseEvent.MOUSE_MOVE, onTextMouseMove);
selectText(0, slideText.charCount, false);
}
private function selectText(beginIndex:int, endIndex:int, select:Boolean):void{
if (!select){
//remove all highlight shapes
return;
}
//first, separate text into lines in case user selects multiple lines
var text:String = slideText.getText(beginIndex, endIndex, true);
var lines:Array = text.split("\n");
//Highlight each row independantly
var characterIndex:int = beginIndex;
for (var line:int = 0; line<lines.length; line++){
var lineLength:int = (lines[line] as String).length;
var textInfo:Array = slideText.getTextRunInfo(characterIndex, characterIndex + lineLength);
var charWidth:Number = textInfo[1].matrix_tx - textInfo[0].matrix_tx; //how wide is one character
var lineWidth:Number = textInfo[textInfo.length - 1].matrix_tx - textInfo[0].matrix_tx + charWidth; //beginning to end of line plus 1 character lenght
var charHeight:Number = charWidth * 1.5;//Totally arbitrary
var begginingX:Number = textInfo[0].matrix_tx;
var begginingY:Number = textInfo[0].matrix_ty;
var highlight:Shape = new Shape();
highlight.graphics.lineStyle(2,0xFF0000);
highlight.graphics.drawRect(0,0,lineWidth,charHeight);
slideClip.addChild(highlight);
highlight.x = Math.abs(begginingX);
highlight.y = Math.abs(begginingY);
}
}
/*****************************************
* Helper functions
*****************************************/