diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/DrawObject.as b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/DrawObject.as index 216b0c3dc2..c0cc6cdee0 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/DrawObject.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/DrawObject.as @@ -43,6 +43,7 @@ package org.bigbluebutton.modules.whiteboard.business.shapes public static const TEXT:String = "text"; public static const TRIANGLE:String = "triangle"; public static const LINE:String = "line"; + public static const POLL:String = "poll_result"; /** * Status = [START, UPDATE, END] diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as new file mode 100755 index 0000000000..81d976db59 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as @@ -0,0 +1,32 @@ +package org.bigbluebutton.modules.whiteboard.business.shapes +{ + import org.bigbluebutton.modules.polling.views.PollGraphic; + import org.bigbluebutton.modules.whiteboard.models.Annotation; + + public class PollResult extends DrawObject + { + var _pollGraphic:PollGraphic; + + public function PollResult(id:String, type:String, status:String) { + super(id, type, status); + + _pollGraphic = new PollGraphic(); + this.addChild(_pollGraphic); + } + + override public function draw(a:Annotation, parentWidth:Number, parentHeight:Number, zoom:Number):void { + var ao:Object = a.annotation; + + _pollGraphic.x = denormalize((ao.points as Array)[0], parentWidth); + _pollGraphic.y = denormalize((ao.points as Array)[1], parentHeight); + _pollGraphic.width = denormalize((ao.points as Array)[2], parentWidth); + _pollGraphic.height = denormalize((ao.points as Array)[3], parentHeight); + + _pollGraphic.data = ao.results; + } + + override public function redraw(a:Annotation, parentWidth:Number, parentHeight:Number, zoom:Number):void { + draw(a, parentWidth, parentHeight, zoom); + } + } +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/ShapeFactory.as b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/ShapeFactory.as index 5d51c767ba..6746dbc338 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/ShapeFactory.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/ShapeFactory.as @@ -64,6 +64,8 @@ package org.bigbluebutton.modules.whiteboard.business.shapes return new Line(a.id, a.type, a.status); } else if (a.type == DrawObject.TRIANGLE) { return new Triangle(a.id, a.type, a.status); + } else if (a.type == DrawObject.POLL) { + return new PollResult(a.id, a.type, a.status); } return null;