Revision: 3720
Author: seba.wagner
Date: Tue Apr 19 02:32:52 2011
Log: [No log message]
http://code.google.com/p/openmeetings/source/detail?r=3720
Added:
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteboardObjectList.java
Deleted:
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteBoardObject.java
Modified:
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteboardManagement.java
=======================================
--- /dev/null
+++
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteboardObjectList.java
Tue Apr 19 02:32:52 2011
@@ -0,0 +1,24 @@
+package org.openmeetings.app.conference.whiteboard;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class WhiteboardObjectList {
+
+ private Long room_id;
+ private Map<Long,WhiteboardObject> whiteboardObjects = new
HashMap<Long,WhiteboardObject>();
+
+ public Long getRoom_id() {
+ return room_id;
+ }
+ public void setRoom_id(Long roomId) {
+ room_id = roomId;
+ }
+ public Map<Long, WhiteboardObject> getWhiteboardObjects() {
+ return whiteboardObjects;
+ }
+ public void setWhiteboardObjects(Map<Long, WhiteboardObject>
whiteboardObjects) {
+ this.whiteboardObjects = whiteboardObjects;
+ }
+
+}
=======================================
---
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteBoardObject.java
Mon Oct 11 08:09:56 2010
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.openmeetings.app.conference.whiteboard;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-public class WhiteBoardObject {
-
- private Date created = new Date();
- private Integer x = 0;
- private Integer y = 0;
- private Integer zoom = 100;
- private Boolean fullFit = true;
- private HashMap<String,List> objList = new HashMap<String,List>();
-
- public Integer getX() {
- return x;
- }
- public void setX(Integer x) {
- this.x = x;
- }
- public Integer getY() {
- return y;
- }
- public void setY(Integer y) {
- this.y = y;
- }
- public Date getCreated() {
- return created;
- }
- public void setCreated(Date created) {
- this.created = created;
- }
- public Integer getZoom() {
- return zoom;
- }
- public void setZoom(Integer zoom) {
- this.zoom = zoom;
- }
- public Boolean getFullFit() {
- return fullFit;
- }
- public void setFullFit(Boolean fullFit) {
- this.fullFit = fullFit;
- }
- public HashMap<String, List> getObjList() {
- return objList;
- }
- public void setObjList(HashMap<String, List> objList) {
- this.objList = objList;
- }
-
-}
=======================================
---
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteboardManagement.java
Mon Oct 11 08:09:56 2010
+++
/trunk/singlewebapp/src/app/org/openmeetings/app/conference/whiteboard/WhiteboardManagement.java
Tue Apr 19 02:32:52 2011
@@ -8,6 +8,7 @@
import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
import org.openmeetings.app.remote.red5.WhiteBoardObjectListManager;
+import org.openmeetings.app.remote.red5.WhiteBoardObjectListManagerById;
import org.slf4j.Logger;
import org.red5.logging.Red5LoggerFactory;
@@ -58,7 +59,7 @@
}
} else if (action.equals("clear")) {
- WhiteBoardObjectListManager.getInstance().setWhiteBoardObject(room_id,
new WhiteBoardObject());
+ WhiteBoardObjectListManager.getInstance().setWhiteBoardObject(room_id,
new WhiteboardObject());
} else if (action.equals("delete") ||
action.equals("undo")) {
HashMap<String,List> roomList =
WhiteBoardObjectListManager.getInstance().getWhiteBoardObjectListByRoomId(room_id);
@@ -212,7 +213,7 @@
public void updateWhiteboardObject(Long room_id, List actionObject) {
try {
- WhiteBoardObject whiteBoardObject =
WhiteBoardObjectListManager.getInstance().getWhiteBoardObjectRoomId(room_id);
+ WhiteboardObject whiteBoardObject =
WhiteBoardObjectListManager.getInstance().getWhiteBoardObjectRoomId(room_id);
whiteBoardObject.setFullFit((Boolean)
actionObject.get(1));
whiteBoardObject.setZoom((Integer) actionObject.get(2));
@@ -227,7 +228,7 @@
public void updateWhiteboardObjectPos(Long room_id, List actionObject) {
try {
- WhiteBoardObject whiteBoardObject =
WhiteBoardObjectListManager.getInstance().getWhiteBoardObjectRoomId(room_id);
+ WhiteboardObject whiteBoardObject =
WhiteBoardObjectListManager.getInstance().getWhiteBoardObjectRoomId(room_id);
whiteBoardObject.setX((Integer) actionObject.get(1));
whiteBoardObject.setY((Integer) actionObject.get(2));
@@ -238,5 +239,210 @@
log.error("[updateWhiteboardObjectPos]",err);
}
}
+
+
+ public void addWhiteBoardObjectById(Long room_id, Map whiteboardObj, Long
whiteBoardId) {
+ try {
+ log.debug("addWhiteBoardObject: ",whiteboardObj);
+
+ //log.debug("whiteboardObj 0: Event:
"+whiteboardObj.get(0));
+ //log.debug("whiteboardObj 1: Event:
"+whiteboardObj.get(1));
+ //log.debug("whiteboardObj 2: Event:
"+whiteboardObj.get(2));
+ //log.debug("whiteboardObj 3: Event:
"+whiteboardObj.get(3));
+
+ //log.debug("whiteboardObj NUMB3:
Event: "+whiteboardObj.get(3).getClass().getName());
+
+ //Date dateOfEvent = (Date) whiteboardObj.get(1);
+ String action = whiteboardObj.get(2).toString();
+ List actionObject = (List) whiteboardObj.get(3);
+
+ log.debug("action: "+action);
+
+ if (action.equals("moveMap")){
+ WhiteboardObject whiteboardObject =
WhiteBoardObjectListManagerById.getInstance().getWhiteBoardObjectListByRoomIdAndWhiteboard(room_id,
whiteBoardId);
+
+
whiteboardObject.setX(Integer.valueOf(actionObject.get(1).toString()).intValue());
+
whiteboardObject.setY(Integer.valueOf(actionObject.get(2).toString()).intValue());
+
+
WhiteBoardObjectListManagerById.getInstance().setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id,
whiteboardObject, whiteBoardId);
+ } else if (action.equals("draw") ||
action.equals("redo")){
+ WhiteboardObject whiteboardObject =
WhiteBoardObjectListManagerById.getInstance().getWhiteBoardObjectListByRoomIdAndWhiteboard(room_id,
whiteBoardId);
+
+ //log.debug(actionObject);
+ //log.debug(actionObject.size()-1);
+
//log.debug(actionObject.get(actionObject.size()-1));
+ String objectType =
actionObject.get(0).toString();
+ if (!objectType.equals("pointerWhiteBoard")){
+ String objectOID =
actionObject.get(actionObject.size()-1).toString();
+ log.debug("objectOID: "+objectOID);
+
whiteboardObject.getRoomItems().put(objectOID, actionObject);
+
WhiteBoardObjectListManagerById.getInstance().setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id,
whiteboardObject, whiteBoardId);
+ }
+ } else if (action.equals("clear")) {
+ WhiteboardObject whiteboardObject =
WhiteBoardObjectListManagerById.getInstance().getWhiteBoardObjectListByRoomIdAndWhiteboard(room_id,
whiteBoardId);
+ whiteboardObject.setRoomItems(new
HashMap<String,List>());
+
WhiteBoardObjectListManagerById.getInstance().setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id,
whiteboardObject, whiteBoardId);
+ } else if (action.equals("delete") ||
action.equals("undo")) {
+ WhiteboardObject whiteboardObject =
WhiteBoardObjectListManagerById.getInstance().getWhiteBoardObjectListByRoomIdAndWhiteboard(room_id,
whiteBoardId);
+ String objectOID =
actionObject.get(actionObject.size()-1).toString();
+ String objectType =
actionObject.get(0).toString();
+ log.debug("removal of objectOID: "+objectOID);
+
+ log.debug("removal of objectOID: "+objectOID);
+
+// "ellipse"
+// || this.baseactionobjectList[i][0] == "drawarrow"
+// || this.baseactionobjectList[i][0] == "line"
+// || this.baseactionobjectList[i][0] == "paint"
+// || this.baseactionobjectList[i][0] == "rectangle"
+// || this.baseactionobjectList[i][0] == "uline"
+// || this.baseactionobjectList[i][0] == "image"
+// || this.baseactionobjectList[i][0] == "letter"
+
+ //Re-Index all items in its zIndex
+ if (objectType.equals("ellipse")
+ ||
objectType.equals("drawarrow")
+ || objectType.equals("line")
+ || objectType.equals("paint")
+ ||
objectType.equals("rectangle")
+ || objectType.equals("uline")
+ || objectType.equals("image")
+ || objectType.equals("letter")
+ || objectType.equals("clipart")
+ || objectType.equals("swf")
+ ||
objectType.equals("mindmapnode")
+ || objectType.equals("flv")) {
+
+ Integer zIndex =
Integer.valueOf(actionObject.get(actionObject.size()-8).toString()).intValue();
+
+ log.debug("1|zIndex "+zIndex);
+ log.debug("2|
zIndex "+actionObject.get(actionObject.size()-8).toString());
+ log.debug("3|zIndex
"+actionObject.get(actionObject.size()-8));
+
+ int l = 0;
+ for (Iterator debugIter =
actionObject.iterator();debugIter.hasNext();) {
+ log.debug("4|zIndex "+l+" --
"+debugIter.next());
+ l++;
+ }
+
+ for (Iterator<String>
iter=whiteboardObject.getRoomItems().keySet().iterator();iter.hasNext();) {
+ String whiteboardObjKey =
iter.next();
+ List actionObjectStored =
whiteboardObject.getRoomItems().get(whiteboardObjKey);
+
+ Integer zIndexStored =
Integer.valueOf(actionObjectStored.get(actionObjectStored.size()-8).toString()).intValue();
+
+ log.debug("zIndexStored|zIndex
"+zIndexStored+"|"+zIndex);
+
+ if (zIndexStored >= zIndex) {
+ zIndexStored-=1;
+ log.debug("new-zIndex
"+zIndexStored);
+ }
+
actionObjectStored.set(actionObjectStored.size()-8, zIndexStored);
+
+ whiteboardObject.getRoomItems().put(whiteboardObjKey,
actionObjectStored);
+ }
+
+ }
+
+
whiteboardObject.getRoomItems().remove(objectOID);
+
+
WhiteBoardObjectListManagerById.getInstance().setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id,
whiteboardObject, whiteBoardId);
+ } else if (action.equals("size") || action.equals("editProp") ||
action.equals("editTextMindMapNode")
+ || action.equals("editText") || action.equals("swf") ||
action.equals("flv")
+ || action.equals("editTextMindMapColor") ||
action.equals("editTextMindMapFontColor")) {
+ WhiteboardObject whiteboardObject =
WhiteBoardObjectListManagerById.getInstance().getWhiteBoardObjectListByRoomIdAndWhiteboard(room_id,
whiteBoardId);
+ String objectOID =
actionObject.get(actionObject.size()-1).toString();
+ //List roomItem = roomList.get(objectOID);
+ List currentObject = (List)
whiteboardObject.getRoomItems().get(objectOID);
+ whiteboardObject.getRoomItems().put(objectOID,
actionObject);
+
+ Map roomList = whiteboardObject.getRoomItems();
+
+ if (action.equals("swf")) {
+
+ log.debug("actionObject "+actionObject);
+
+ if (actionObject.get(0).equals("swf")) {
+
+ if (actionObject.get(8) != currentObject.get(8)) {
+
+
+ String baseObjectName =
actionObject.get(actionObject.size()-1).toString();
+ Integer slidesNumber =
Integer.valueOf(actionObject.get(8).toString()).intValue();
+
+
log.debug("updateObjectsToSlideNumber :: "+baseObjectName+","+slidesNumber);
+
+ for (Iterator<String>
iter=roomList.keySet().iterator();iter.hasNext();) {
+ String whiteboardObjKey
= iter.next();
+ List actionObjectStored
= (List) roomList.get(whiteboardObjKey);
+
+ if
(actionObjectStored.get(0).equals("ellipse")
+ ||
actionObjectStored.get(0).equals("drawarrow")
+ ||
actionObjectStored.get(0).equals("line")
+ ||
actionObjectStored.get(0).equals("clipart")
+ ||
actionObjectStored.get(0).equals("paint")
+ ||
actionObjectStored.get(0).equals("rectangle")
+ ||
actionObjectStored.get(0).equals("uline")
+ ||
actionObjectStored.get(0).equals("image")
+ ||
actionObjectStored.get(0).equals("letter")) {
+
+ Map swfObj = (Map)
actionObjectStored.get(actionObjectStored.size()-7);
+ log.debug("swfObj :1: "+swfObj);
+
+ if (swfObj != null) {
+
+ if
(swfObj.get("name").equals(baseObjectName)) {
+
+ if
(Integer.valueOf(swfObj.get("slide").toString()).intValue() ==
slidesNumber) {
+
+
swfObj.put("isVisible",true);
+
+
actionObjectStored.set(actionObjectStored.size()-7,swfObj);
+
+ } else {
+
+
swfObj.put("isVisible",false);
+
+
actionObjectStored.set(actionObjectStored.size()-7,swfObj);
+
+ }
+
+ }
+
+ }
+
+ log.debug("swfObj :1: "+swfObj);
+
+ }
+
+ }
+
+ }
+
+ }
+ }
+
+
WhiteBoardObjectListManagerById.getInstance().setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id,
whiteboardObject, whiteBoardId);
+ } else if (action.equals("clearSlide")) {
+
+ WhiteboardObject whiteboardObject =
WhiteBoardObjectListManagerById.getInstance().getWhiteBoardObjectListByRoomIdAndWhiteboard(room_id,
whiteBoardId);
+
+ Map roomList = whiteboardObject.getRoomItems();
+
+ for (String objectName : (List<String>)
actionObject) {
+
+ roomList.remove(objectName);
+
+ }
+
+
WhiteBoardObjectListManagerById.getInstance().setWhiteBoardObjectListRoomObjAndWhiteboardId(room_id,
whiteboardObject, whiteBoardId);
+ } else {
+ log.warn("Unkown Type: "+action+" actionObject:
"+actionObject);
+ }
+
+ } catch (Exception err) {
+ log.error("[addWhiteBoardObject]",err);
+ }
+ }
}
--
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en.