changed the layout module to use custom names instead of the class name

This commit is contained in:
Chad Pilkey 2017-10-27 18:30:23 -04:00
parent 00c5a31ffb
commit 15a495f931
17 changed files with 87 additions and 29 deletions

View File

@ -37,5 +37,10 @@ package org.bigbluebutton.common
*
*/
function getPrefferedPosition():String;
/**
* Returns an indentifier to be used by the LayoutModule to position the window.
*/
function getName():String;
}
}

View File

@ -76,6 +76,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.ABSOLUTE;
}
public function getName():String {
return "NetworkStatsWindow";
}
private function onResize():void {}
private function runBandwidthMeasurement():void {

View File

@ -120,6 +120,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return options.position;
}
public function getName():String {
return "BroadcastWindow";
}
private function onResize():void {
if (curStream != null && createComplete) {
curStream.onResize();

View File

@ -126,6 +126,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.POPUP;
}
public function getName():String {
return "CaptionWindow";
}
private function optionChange(type:int, val:Object):void {
switch (type) {
case OptionENUM.LOCALE:

View File

@ -75,6 +75,14 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return _windowId;
}
public function getPrefferedPosition():String {
return MainCanvas.TOP_RIGHT;
}
public function getName():String {
return _windowId;
}
public function setMainChatId(chatId: String):void {
_mainChatId = chatId;
}
@ -83,10 +91,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
_openAddTabBox = open;
}
public function getPrefferedPosition():String{
return MainCanvas.TOP_RIGHT;
}
private function onCreationComplete():void {
hotkeyCapture();
titleBarOverlay.tabIndex = chatOptions.baseTabIndex;

View File

@ -55,6 +55,10 @@ Notes.mxml is the main view of the SharedNotes application
return MainCanvas.POPUP;
}
public function getName():String {
return "ExampleChatWindow";
}
]]>
</fx:Script>

View File

@ -20,16 +20,17 @@ package org.bigbluebutton.modules.layout.model {
import flash.geom.Rectangle;
import flash.utils.getQualifiedClassName;
import flexlib.mdi.containers.MDICanvas;
import flexlib.mdi.containers.MDIWindow;
import mx.effects.Move;
import mx.effects.Parallel;
import mx.effects.Resize;
import mx.events.EffectEvent;
import flexlib.mdi.containers.MDICanvas;
import flexlib.mdi.containers.MDIWindow;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
import org.bigbluebutton.common.IBbbModuleWindow;
import org.bigbluebutton.modules.layout.managers.OrderManager;
public class WindowLayout {
@ -139,7 +140,6 @@ package org.bigbluebutton.modules.layout.model {
var newX:int = Math.floor(this.x * canvas.width);
var newY:int = Math.floor(this.y * canvas.height);
var newWindowRect:Rectangle = new Rectangle(newX, newY, newWidth, newHeight);
var type:String = getType(window);
window.visible = !this.hidden;
@ -229,8 +229,8 @@ package org.bigbluebutton.modules.layout.model {
}
static public function getType(obj:Object):String {
if (obj.hasOwnProperty("windowName")) {
return obj.windowName;
if (obj is IBbbModuleWindow) {
return (obj as IBbbModuleWindow).getName();
} else {
var qualifiedClass:String = String(getQualifiedClassName(obj));
var pattern:RegExp = /(\w+)::(\w+)/g;

View File

@ -40,6 +40,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return options.position;
}
public function getName():String {
return "NotesWindow";
}
private function onCreationComplete():void {
this.title = ResourceUtil.getInstance().getString("bbb.notes.title");
}

View File

@ -71,16 +71,16 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
<![CDATA[
import flash.geom.Point;
import flashx.textLayout.formats.Direction;
import flexlib.mdi.events.MDIWindowEvent;
import mx.collections.ArrayCollection;
import mx.collections.ArrayList;
import mx.controls.Menu;
import mx.events.MenuEvent;
import mx.managers.PopUpManager;
import flashx.textLayout.formats.Direction;
import flexlib.mdi.events.MDIWindowEvent;
import org.as3commons.lang.StringUtils;
import org.as3commons.logging.api.ILogger;
import org.as3commons.logging.api.getClassLogger;
@ -91,8 +91,11 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.core.Options;
import org.bigbluebutton.core.PopUpUtil;
import org.bigbluebutton.core.UsersUtil;
import org.bigbluebutton.main.api.JSLog;
import org.bigbluebutton.main.events.MadePresenterEvent;
import org.bigbluebutton.main.events.ShortcutEvent;
import org.bigbluebutton.main.model.users.events.UserAddedToPresenterGroupEvent;
import org.bigbluebutton.main.model.users.events.UserRemovedFromPresenterGroupEvent;
import org.bigbluebutton.main.views.MainCanvas;
import org.bigbluebutton.modules.polling.events.PollShowResultEvent;
import org.bigbluebutton.modules.polling.events.PollStartedEvent;
@ -102,22 +105,20 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.polling.views.PollChoicesModal;
import org.bigbluebutton.modules.polling.views.PollResultsModal;
import org.bigbluebutton.modules.present.commands.GoToNextPageCommand;
import org.bigbluebutton.modules.present.commands.GoToPrevPageCommand;
import org.bigbluebutton.modules.present.commands.GoToPageLocalCommand;
import org.bigbluebutton.modules.present.commands.GoToPageCommand;
import org.bigbluebutton.modules.present.commands.GoToPageLocalCommand;
import org.bigbluebutton.modules.present.commands.GoToPrevPageCommand;
import org.bigbluebutton.modules.present.events.DisplaySlideEvent;
import org.bigbluebutton.modules.present.events.DownloadEvent;
import org.bigbluebutton.modules.present.events.ExportEvent;
import org.bigbluebutton.modules.present.events.PresentationChangedEvent;
import org.bigbluebutton.modules.present.events.PresenterCommands;
import org.bigbluebutton.modules.present.events.RemovePresentationEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent;
import org.bigbluebutton.modules.present.events.RequestClosePresentationPodEvent;
import org.bigbluebutton.modules.present.events.SetPresenterInPodRespEvent;
import org.bigbluebutton.modules.present.events.RequestNewPresentationPodEvent;
import org.bigbluebutton.modules.present.events.SetPresenterInPodReqEvent;
import org.bigbluebutton.main.model.users.events.UserAddedToPresenterGroupEvent;
import org.bigbluebutton.main.model.users.events.UserRemovedFromPresenterGroupEvent;
import org.bigbluebutton.modules.present.events.SetPresenterInPodRespEvent;
import org.bigbluebutton.modules.present.events.UploadEvent;
import org.bigbluebutton.modules.present.model.Page;
import org.bigbluebutton.modules.present.model.PresentOptions;
import org.bigbluebutton.modules.present.model.PresentationModel;
@ -127,7 +128,6 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
import org.bigbluebutton.modules.whiteboard.views.WhiteboardTextToolbar;
import org.bigbluebutton.modules.whiteboard.views.WhiteboardToolbar;
import org.bigbluebutton.util.i18n.ResourceUtil;
import org.bigbluebutton.main.api.JSLog;
private static const LOGGER:ILogger = getClassLogger(PresentationWindow);
@ -422,6 +422,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.MIDDLE;
}
public function getName():String {
return podId;
}
private function onSliderZoom():void {
slideView.onZoomSlide(zoomSlider.value);
}

View File

@ -173,6 +173,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.DESKTOP_SHARING_PUBLISH;
}
public function getName():String {
return "ScreensharePublishWindow";
}
public function handleDisconnectedEvent(event:BBBEvent):void {
if (event.payload.type == ReconnectionManager.DESKSHARE_CONNECTION) {
closeWindow();

View File

@ -217,6 +217,10 @@
return MainCanvas.DESKTOP_SHARING_VIEW;
}
public function getName():String {
return "ScreenshareViewWindow";
}
/**
* Resizes the desktop sharing video to fit to this window
*/

View File

@ -189,6 +189,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.DESKTOP_SHARING_PUBLISH;
}
public function getName():String {
return "ScreensharePublishWindow";
}
/*
* Implement resizeable interface.
*/

View File

@ -266,6 +266,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.DESKTOP_SHARING_VIEW;
}
public function getName():String {
return "ScreenshareViewWindow";
}
/**
* resizes the desktop sharing video to fit to this window
*/

View File

@ -18,14 +18,11 @@ package org.bigbluebutton.modules.sharednotes.views
{
private static const LOGGER:ILogger = getClassLogger(AdditionalSharedNotesWindow);
private var _windowName:String;
public function AdditionalSharedNotesWindow(n:String) {
super();
LOGGER.debug("AdditionalSharedNotesWindow: in-constructor additional notes " + n);
_noteId = n;
_windowName = "AdditionalSharedNotesWindow_" + noteId;
options = Options.getOptions(SharedNotesOptions) as SharedNotesOptions;
@ -34,8 +31,8 @@ package org.bigbluebutton.modules.sharednotes.views
height = 240;
}
public function get windowName():String {
return this._windowName;
override public function getName():String {
return "AdditionalSharedNotesWindow_" + noteId;
}
public function set noteName(name:String):void {

View File

@ -536,6 +536,10 @@
return MainCanvas.POPUP;
}
public function getName():String {
return "SharedNotesWindow";
}
override protected function resourcesChanged():void {
super.resourcesChanged();

View File

@ -307,6 +307,10 @@ $Id: $
return MainCanvas.TOP_LEFT;
}
public function getName():String {
return "UsersWindow";
}
private function addContextMenuItems():void {
var contextMenuItems:Array = new Array();

View File

@ -74,6 +74,10 @@ with BigBlueButton; if not, see <http://www.gnu.org/licenses/>.
return MainCanvas.BOTTOM_LEFT;
}
public function getName():String {
return "VideoDock";
}
private function hotkeyCapture():void {
this.addEventListener(KeyboardEvent.KEY_DOWN, handleKeyDown);
ResourceUtil.getInstance().addEventListener(Event.CHANGE, localeChanged); // Listen for locale changing