From 772e03bca7a0eb9c15da47d32ec2de2162aba27d Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Thu, 2 Jul 2015 18:38:20 -0400 Subject: [PATCH 1/2] added a new shape for poll results --- .../whiteboard/business/shapes/DrawObject.as | 1 + .../whiteboard/business/shapes/PollResult.as | 31 +++++++++++++++++++ .../business/shapes/ShapeFactory.as | 2 ++ 3 files changed, 34 insertions(+) create mode 100755 bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as 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..28ac829eb8 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as @@ -0,0 +1,31 @@ +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(); + } + + 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; From 8abe9e04a5dfa36ba289fc802b8227a6e919ae5e Mon Sep 17 00:00:00 2001 From: Chad Pilkey Date: Thu, 2 Jul 2015 18:42:51 -0400 Subject: [PATCH 2/2] add the PollGraphic to the shape --- .../modules/whiteboard/business/shapes/PollResult.as | 1 + 1 file changed, 1 insertion(+) 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 index 28ac829eb8..81d976db59 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/whiteboard/business/shapes/PollResult.as @@ -11,6 +11,7 @@ package org.bigbluebutton.modules.whiteboard.business.shapes super(id, type, status); _pollGraphic = new PollGraphic(); + this.addChild(_pollGraphic); } override public function draw(a:Annotation, parentWidth:Number, parentHeight:Number, zoom:Number):void {