virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 48)
Status: Beta
Brought to you by:
alllee
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(21) |
Aug
(31) |
Sep
(6) |
Oct
(15) |
Nov
(2) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(4) |
Feb
(6) |
Mar
(12) |
Apr
(52) |
May
(14) |
Jun
(19) |
Jul
(81) |
Aug
(115) |
Sep
(36) |
Oct
(88) |
Nov
(46) |
Dec
(58) |
2010 |
Jan
(52) |
Feb
(55) |
Mar
(48) |
Apr
(15) |
May
(5) |
Jun
(38) |
Jul
(27) |
Aug
(24) |
Sep
(28) |
Oct
(1) |
Nov
(2) |
Dec
(29) |
2011 |
Jan
(87) |
Feb
(39) |
Mar
(63) |
Apr
(42) |
May
(26) |
Jun
(53) |
Jul
(23) |
Aug
(43) |
Sep
(37) |
Oct
(25) |
Nov
(4) |
Dec
(7) |
2012 |
Jan
(73) |
Feb
(79) |
Mar
(62) |
Apr
(28) |
May
(12) |
Jun
(2) |
Jul
(9) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
(3) |
Dec
(3) |
2013 |
Jan
(8) |
Feb
(16) |
Mar
(38) |
Apr
(74) |
May
(62) |
Jun
(15) |
Jul
(49) |
Aug
(19) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(25) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: seema t. <see...@gm...> - 2010-06-16 01:47:29
|
Hello Checked out at 6:45pm. Tried to set up Game Web - 1) Installed it successfully 2) Unable to create game Structure -- getting error. 3) Tried to play a game with Allen - Participants are able to start the game but not able to start the game at all Worked on Stage Configuration component 1) Created states for each stage custom component, so that dynamically voting, survey components can be embedded into the stage configuration Seema On Tue, Jun 15, 2010 at 3:54 PM, seema talele <see...@gm...>wrote: > Hello, > > Started work at 3:45pm. > > Working with Allen for the setup issues of the web based framework. > > Seema > > |
From: seema t. <see...@gm...> - 2010-06-15 23:13:37
|
Hello, The following link contains information about flexmojos, using which you can build, compile, and test flex application using maven. http://flexmojos.sonatype.org/ Seema |
From: <al...@us...> - 2010-06-15 22:57:36
|
Revision: 520 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=520&view=rev Author: alllee Date: 2010-06-15 22:57:30 +0000 (Tue, 15 Jun 2010) Log Message: ----------- Seema's initial Flex front-end for the web-based field experiments, focused on game configuration. Added Paths: ----------- web/trunk/src/ web/trunk/src/main/ web/trunk/src/main/flex/ web/trunk/src/main/flex/edu/ web/trunk/src/main/flex/edu/asu/ web/trunk/src/main/flex/edu/asu/commons/ web/trunk/src/main/flex/edu/asu/commons/flex/ web/trunk/src/main/flex/edu/asu/commons/flex/config/ web/trunk/src/main/flex/edu/asu/commons/flex/config/Forestree.mxml web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/GameConfiguration.mxml web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/ResourceConfiguration.mxml web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/StageConfiguration.mxml web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/WizardStep.mxml web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/stageConfig/ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/stageConfig/Voting.mxml web/trunk/src/main/flex/edu/asu/commons/flex/config/wizard/ web/trunk/src/main/flex/edu/asu/commons/flex/config/wizard/Wizard.mxml web/trunk/src/main/java/ web/trunk/src/main/resources/ web/trunk/src/main/resources/images/ web/trunk/src/main/resources/images/Picture10.jpg web/trunk/src/main/resources/images/TreeLess.jpg web/trunk/src/main/resources/images/ViewResult.png web/trunk/src/main/resources/images/bg-header.png web/trunk/src/main/resources/images/bg-main-corner-sprite.png web/trunk/src/main/resources/images/bg-main.png web/trunk/src/main/resources/images/body.jpg web/trunk/src/main/resources/images/livesearchbghilight.jpg web/trunk/src/main/resources/images/loading.gif web/trunk/src/main/resources/images/tree3.jpg web/trunk/src/main/resources/images/tree4.jpg Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/Forestree.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/Forestree.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/Forestree.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" + xmlns:commons="edu.asu.commons.flex.config.wizard.*" + xmlns:wizardStep="edu.asu.commons.flex.config.steps.*" + width="100%" height="100%"> + + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + </fx:Declarations> + <fx:Script> + <![CDATA[ + + ]]> + </fx:Script> + + + <commons:Wizard id="wizExperimentConfiguration"> + <commons:layout> + <s:BasicLayout/> + </commons:layout> + <wizardStep:WizardStep title="Stage Configuration"> + <wizardStep:StageConfiguration id="wizStepStageConfiguration1"> + + </wizardStep:StageConfiguration> + + </wizardStep:WizardStep> + <!-- <wizardStep:WizardStep title="Resource Configuration"> + <wizardStep:ResourceConfiguration id="wizStepresourceConfiguraiton"> + </wizardStep:ResourceConfiguration> + </wizardStep:WizardStep> --> + + </commons:Wizard> + + +</s:Application> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/Forestree.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/GameConfiguration.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/GameConfiguration.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/GameConfiguration.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"> + <s:layout> + <s:BasicLayout/> + </s:layout> + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + </fx:Declarations> + <s:VGroup left="50" right="50" top="20" bottom="50"> + <s:Label text="Game Configuration" horizontalCenter="-92" verticalCenter="-117" textAlign="center" verticalAlign="middle" fontWeight="bold" width="243" height="18" fontSize="14" paddingLeft="50"/> + + <mx:Form paddingTop="5" paddingLeft="5" borderVisible="false" paddingRight="0" paddingBottom="0"> + <mx:FormItem label="Title" borderVisible="false"> + <s:TextInput/> + </mx:FormItem> + <mx:FormItem label="Select the Game" borderVisible="false"> + <s:DropDownList width="127"></s:DropDownList> + </mx:FormItem> + <mx:FormItem label="Money" borderVisible="false"> + <s:TextInput/> + </mx:FormItem> + </mx:Form> + + + </s:VGroup> + +</s:Group> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/GameConfiguration.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/ResourceConfiguration.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/ResourceConfiguration.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/ResourceConfiguration.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" + width="100%" height="100%" x="54" y="0" horizontalAlign="center" verticalAlign="middle" gap="5"> + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + + </fx:Declarations> + <fx:Script> + <![CDATA[ + import mx.collections.ArrayList; + import mx.events.FlexEvent; + /*[Bindable] + private var groupVariables:ArrayList = new ArrayList(null); + + public function set GroupVaribles():void + { + groupVariables.addItem(new String("n")); + groupVariables.addItem(new String("h")); + } + + public function get GroupVariables():ArrayList + { + return groupVariables; + }*/ + + protected function vgroup1_initializeHandler(event:FlexEvent):void + { + // TODO Auto-generated method stub + } + /*public function assignImage(imgUrl:String):void + { + imgA.source = imgUrl; + imgA.visible = true; + } + + override protected function updateDisplayList(w:Number,h:Number):void + { + imgA.width = w; + imgA.height = h; + super.updateDisplayList(w,h); + } */ + + ]]> + </fx:Script> + <mx:Label text="Resource Configuration" fontSize="14" fontStyle="normal" fontWeight="bold"/> + <s:HGroup width="75%" height="20%"> + <mx:Form id="frmResource" paddingTop="10" paddingLeft="10" borderVisible="false" width="50%"> + <mx:FormItem label="Resource Type" borderVisible="false"> + <s:TextInput id="txtResourceType"/> + </mx:FormItem> + <mx:FormItem label="Resource Unit" borderVisible="false"> + <s:TextInput id="txtResourceUnit"/> + </mx:FormItem> + + </mx:Form> + <mx:Panel width="50%" height="100%" dropShadowVisible="false" title="Select the Image" horizontalAlign="left" verticalAlign="middle"> + <s:HGroup width="100%" height="100%" verticalAlign="middle" requestedColumnCount="4" paddingLeft="10" paddingTop="0" gap="20"> + <s:Graphic buttonMode="true" + mouseEnabledWhereTransparent="false" + useHandCursor="true"> + <s:Rect id="rectPlain" + width="30" height="30" + x="0" y="0"> + <s:fill> + <s:SolidColor color="green" /> + + </s:fill> + </s:Rect> + </s:Graphic> + <mx:Image source="@Embed(source='../images/tree4.JPG')" buttonMode="true" useHandCursor="true" maintainAspectRatio="true" width="30" height="30"/> + <mx:Image source="@Embed(source='../images/Picture10.jpg')" buttonMode="true" useHandCursor="true" maintainAspectRatio="true" width="30" height="30"/> + <mx:Image source="@Embed(source='../images/tree3.jpg')" buttonMode="true" useHandCursor="true" maintainAspectRatio="true" width="30" height="30"/> + + </s:HGroup> + + </mx:Panel> + </s:HGroup> + + <s:HGroup verticalAlign="middle" horizontalAlign="center" requestedColumnCount="2" height="30%" width="75%"> + <s:List id="lstGroupVariables" borderVisible="true" fontSize="12" height="59" fontWeight="bold" textAlign="center"> + <s:layout> + <s:VerticalLayout horizontalAlign="center" requestedRowCount="1"/> + </s:layout> + <s:dataProvider> + <mx:ArrayCollection> + <fx:String>n</fx:String> + <fx:String>h</fx:String> + </mx:ArrayCollection> + </s:dataProvider> + </s:List> + <s:List id="lstGlobalVariables"> + <s:layout> + <s:HorizontalLayout verticalAlign="middle" requestedColumnCount="1"/> + </s:layout> + </s:List> + + </s:HGroup> + + <s:VGroup horizontalAlign="center" verticalAlign="middle" gap="5" paddingTop="20" paddingBottom="20" requestedRowCount="2" height="30%" width="75%"> + <s:Button id="btnNewGlobalVariable" label="New Global Variable" click="{frmNewGloblVariable.visible=true}" > + </s:Button> + <mx:Form id="frmNewGloblVariable" visible="true" borderVisible="false" paddingLeft="10"> + <mx:FormItem label="Global Variable Name"> + <s:TextInput id="txtGlobalVarName"/> + </mx:FormItem> + <mx:FormItem label="Global Variable Description"> + <s:TextInput id="txtGlobalVarDescription"/> + </mx:FormItem> + <mx:FormItem label="Global Variable Value"> + <s:TextInput id="txtGlobalVarValue"/> + </mx:FormItem> + </mx:Form> + <s:HGroup verticalAlign="middle" horizontalAlign="center" bottom="20" left="20"> + <s:Button id="btnAddGlobalVariable" label="Add" > + </s:Button> + <s:Button id="btnCancel" label="Cancel" > + </s:Button> + </s:HGroup> + + </s:VGroup> + <s:VGroup horizontalAlign="center" requestedRowCount="5" paddingBottom="10" paddingTop="10" height="20%" width="75%" gap="10"> + <s:HGroup> + <s:Button id="btnEqual" label="=" > + </s:Button> + <s:Button id="btnPlus" label="+" > + </s:Button> + <s:Button id="btnMinus" label="-" > + </s:Button> + <s:Button id="btnMultiply" label="*" > + </s:Button> + <s:Button id="btnDivide" label="/" > + </s:Button> + + </s:HGroup> + <s:TextInput id="txtEquation" paddingLeft="5" paddingRight="5" paddingBottom="5" width="350" x="64"/> + <s:Button label="Reset" id="btnReset"/> + + </s:VGroup> + + +</s:VGroup> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/ResourceConfiguration.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/StageConfiguration.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/StageConfiguration.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/StageConfiguration.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" + horizontalAlign="center" + creationComplete="vgroup1_creationCompleteHandler(event)"> + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + </fx:Declarations> + <fx:Script> + <![CDATA[ + import mx.collections.ArrayCollection; + import mx.events.FlexEvent; + import mx.controls.Alert; + + import spark.events.IndexChangeEvent; + + + [Bindable] + protected var stageNames:ArrayCollection = new ArrayCollection(); + + public function getDays():Number + { + return days.value; + + } + public function getHours():Number + { + return hours.value; + + } + public function getMinutes():Number + { + return minutes.value; + + } + public function getSeconds():Number + { + return seconds.value; + + } + + //get from server + + public function get StageNames():ArrayCollection + { + + return stageNames; + } + + public function set StageNames(stgNames:ArrayCollection):void + { + stageNames = stgNames; + } + + + + protected function vgroup1_creationCompleteHandler(event:FlexEvent):void + { + stageNames.addItem("-Select-"); + stageNames.addItem("Pre-experiment"); + stageNames.addItem("Simple"); + stageNames.addItem("Practice"); + stageNames.addItem("Voting"); + stageNames.addItem("Survey"); + stageNames.addItem("Debriefing"); + + //drpdwnStageNames.dataProvider = stageNames; + + } + + + protected function drpdwnStageNames_changeHandler(event:IndexChangeEvent):void + { + // TODO Auto-generated method stub + Alert.show(drpdwnStageNames.selectedItem); + switch(drpdwnStageNames.selectedItem) + { + case "Simple": + frmItemNumberOfRounds.visible=true; + break; + + case "Practice": + frmItemNumberOfRounds.visible=true; + break; + + case "Voting": + frmItemNumberOfRounds.visible=false; + break; + + case "Survey": + frmItemNumberOfRounds.visible=false; + break; + + case "Debriefing": + frmItemNumberOfRounds.visible=false; + break; + + } + } + + ]]> + </fx:Script> + <s:Label text="Stage Configuration" id="lblStageConfiguration" fontWeight="bold" fontSize="14" paddingTop="10"/> + + + <s:HGroup width="100%" requestedColumnCount="2" paddingTop="10" verticalAlign="middle"> + + <mx:Form label="Stage Configuration" width="80%" height="100%" paddingTop="16" borderVisible="true"> + <mx:FormItem label="Select the Stage" fontWeight="bold"> + <s:DropDownList id="drpdwnStageNames" fontWeight="normal" dataProvider="{stageNames}" change="drpdwnStageNames_changeHandler(event)"></s:DropDownList> + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Sequence Number" fontWeight="bold"> + <s:TextInput fontWeight="normal"/> + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Stage Description" width="90%" height="30%" fontWeight="bold"> + <mx:RichTextEditor id="rchtxtStageDescription" title="Stage Description" width="100%" height="300" fontWeight="normal" dropShadowVisible="false" borderVisible="true"/> + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Duration(hr:min:sec)" fontWeight="bold" width="100%"> + <mx:HBox> + <mx:NumericStepper id="days" minimum="0" maximum="10" stepSize="1" change="{getDays()}" paddingLeft="0" paddingRight="0" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="hours" minimum="0" maximum="12" stepSize="1" change="{getHours()}" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="minutes" minimum="0" maximum="60" stepSize="1" change="{getMinutes()}" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="seconds" minimum="0" maximum="60" stepSize="1" change="{getSeconds()}" width="45" fontWeight="normal"/> + </mx:HBox> + + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem id="frmItemNumberOfRounds" label="Number of Rounds" fontWeight="bold" visible="false"> + <s:NumericStepper fontWeight="normal" width="45" minimum="0" maximum="20" stepSize="1"/> + </mx:FormItem> + </mx:Form> + <mx:Spacer width="2%"/> + <s:Group id="grpCustomComponents"> + + </s:Group> + <s:List height="50%" width="15%"> + <s:layout> + <s:VerticalLayout horizontalAlign="center" paddingTop="20"/> + </s:layout> + + </s:List> + + </s:HGroup> + +</s:VGroup> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/StageConfiguration.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/WizardStep.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/WizardStep.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/WizardStep.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"> + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + </fx:Declarations> + <fx:Script> + <![CDATA[ + + private var _title:String; + + public function set title(title:String):void + { + this._title = title; + } + + public function get title():String + { + return this._title; + } + + ]]> + </fx:Script> +</s:Group> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/WizardStep.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/stageConfig/Voting.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/stageConfig/Voting.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/stageConfig/Voting.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,50 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:VGroup xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" horizontalAlign="center" paddingTop="10"> + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + </fx:Declarations> + <s:Label text="Voting" id="lblVoting" fontWeight="bold" fontSize="14" width="50" x="269"/> + <mx:Form width="100%"> + <mx:FormItem label="Enable Communication" fontWeight="bold"> + <s:CheckBox fontWeight="normal"/> + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Communication Duration(hr:min:sec)" fontWeight="bold" width="100%"> + <mx:HBox> + <mx:NumericStepper id="numstepComDays" minimum="0" maximum="10" stepSize="1" change="{getDays()}" paddingLeft="0" paddingRight="0" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="numstepComHours" minimum="0" maximum="12" stepSize="1" change="{getHours()}" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="numstepComMinutes" minimum="0" maximum="60" stepSize="1" change="{getMinutes()}" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="numstepComSeconds" minimum="0" maximum="60" stepSize="1" change="{getSeconds()}" width="45" fontWeight="normal"/> + </mx:HBox> + + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Rule" fontWeight="bold"> + <s:DropDownList fontWeight="normal"></s:DropDownList> + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Rule Description" width="90%" height="30%" fontWeight="bold"> + <mx:RichTextEditor id="rchtxtRuleDescription" title="Rule Description" width="100%" height="300" fontWeight="normal" dropShadowVisible="false" borderVisible="true" enabled="false"/> + </mx:FormItem> + <mx:Spacer height="5"/> + <mx:FormItem label="Voting Duration(hr:min:sec)" fontWeight="bold" width="100%"> + <mx:HBox> + <mx:NumericStepper id="numstepVotingDays" minimum="0" maximum="10" stepSize="1" change="{getDays()}" paddingLeft="0" paddingRight="0" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="numstepVotingHours" minimum="0" maximum="12" stepSize="1" change="{getHours()}" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="numstepVotingMinutes" minimum="0" maximum="60" stepSize="1" change="{getMinutes()}" width="45" fontWeight="normal"/> + <mx:Label text=":" textAlign="center"/> + <mx:NumericStepper id="numstepVotingSeconds" minimum="0" maximum="60" stepSize="1" change="{getSeconds()}" width="45" fontWeight="normal"/> + </mx:HBox> + + </mx:FormItem> + + </mx:Form> + +</s:VGroup> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/steps/stageConfig/Voting.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/flex/edu/asu/commons/flex/config/wizard/Wizard.mxml =================================================================== --- web/trunk/src/main/flex/edu/asu/commons/flex/config/wizard/Wizard.mxml (rev 0) +++ web/trunk/src/main/flex/edu/asu/commons/flex/config/wizard/Wizard.mxml 2010-06-15 22:57:30 UTC (rev 520) @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="utf-8"?> +<s:Panel xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:s="library://ns.adobe.com/flex/spark" + xmlns:mx="library://ns.adobe.com/flex/mx" enabled="true" + borderVisible="false" creationComplete="pnlConfiguration_creationCompleteHandler(event)" + width="100%" height="100%" title="{currentStepTitle}"> + <s:layout> + <s:VerticalLayout horizontalAlign="center"/> + </s:layout> + + <fx:Declarations> + <!-- Place non-visual elements (e.g., services, value objects) here --> + </fx:Declarations> + <fx:Script> + <![CDATA[ + import mx.collections.ArrayCollection; + import mx.events.FlexEvent; + + [Bindable] + private var _wizardSteps:ArrayCollection; + + [Bindable] + public var steps:uint = 0; + + [Bindable] + public var currentStepTitle:String = ""; + + [Bindable] + private var totalSteps:uint = 0; + + + private var wizardChildren:ArrayCollection; + + public function nextStep():void + { + if ( steps + 1 <= totalSteps ) + { + steps++; + checkTitle(); + changeView(); + + } + } + + public function checkTitle():void + { + if ( _wizardSteps && _wizardSteps.length > 0 && steps <= totalSteps ) + { + if ( steps < totalSteps ) + { + /*var wvo:WizardStepVO = _wizardViews.getItemAt(steps) as WizardStepVO; + if ( wvo ) + { + currentStepTitle = wvo.name; + }*/ + } + else + { + currentStepTitle = "FINISH"; + } + } + else + { + currentStepTitle = ""; + } + } + + private function changeView(next:Boolean=true):void + { + var vstr:String = "view"; + var pstr:String = "view"; + + var thestep:uint = 0; + + + if ( next ) + { + thestep = steps; + } + else + { + thestep = steps + 1 ; + } + + if ( thestep >= wizardChildrenGroup.numElements ) + { + throw Error("Data in wizardViews does not match amount of children in WizardPanel (There is no child " + vstr + ")"); + return; + } + if ( steps >= 0 ) + { + var prevobj:Object = wizardChildrenGroup.getElementAt(thestep - 1); + + // playStepMoveEffect(next, thestep - 1, prevobj, false); + + prevobj.visible = true; + } + + var nextobj:Object = wizardChildrenGroup.getElementAt(thestep ); + nextobj.visible = true; + + // playStepMoveEffect(next, thestep, nextobj, true); + } + + protected function pnlConfiguration_creationCompleteHandler(event:FlexEvent):void + { + // TODO Auto-generated method stub + + } + [Bindable] + public function get wizardSteps():ArrayCollection + { + return wizardSteps; + } + + public function set wizardSteps(arr:ArrayCollection):void + { + wizardSteps = arr; + if ( wizardSteps ) + totalSteps = _wizardSteps.length; + checkTitle(); + } + + ]]> + </fx:Script> + <s:controlBarContent> + <!--<s:HGroup> + <s:Label text="Experiment Configuration" id="lblCurrentStepTitle" fontWeight="bold" fontSize="12" fontFamily="Georgia" verticalAlign="middle" color="#500918" paddingLeft="30"/> + <mx:Spacer width="96" /> + <s:Label text="Steps: 1 2 3" id="lblSteps" fontWeight="bold" fontSize="12" fontFamily="Georgia" verticalAlign="middle" color="#500918" paddingLeft="50"/> + </s:HGroup> --> + <s:HGroup height="10%" width="100%" gap="20" requestedColumnCount="3" paddingLeft="30" paddingTop="10" paddingRight="30" paddingBottom="10" verticalAlign="middle"> + <s:Button label="Previous" enabled="{steps > 0}"/> + <mx:Spacer width="65%"/> + <s:Button label="Next" enabled="={steps < totalSteps}"/> + </s:HGroup> + + </s:controlBarContent> +<!-- add wizard steps here --> + <s:VGroup> + + <s:Group id="wizardChildrenGroup" left="40" right="40" top="40" bottom="60"> + + </s:Group> + + + + </s:VGroup> + +</s:Panel> Property changes on: web/trunk/src/main/flex/edu/asu/commons/flex/config/wizard/Wizard.mxml ___________________________________________________________________ Added: svn:executable + * Added: web/trunk/src/main/resources/images/Picture10.jpg =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/Picture10.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/TreeLess.jpg =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/TreeLess.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/ViewResult.png =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/ViewResult.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/bg-header.png =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/bg-header.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/bg-main-corner-sprite.png =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/bg-main-corner-sprite.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/bg-main.png =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/bg-main.png ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/body.jpg =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/body.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/livesearchbghilight.jpg =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/livesearchbghilight.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/loading.gif =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/loading.gif ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/tree3.jpg =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/tree3.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream Added: web/trunk/src/main/resources/images/tree4.jpg =================================================================== (Binary files differ) Property changes on: web/trunk/src/main/resources/images/tree4.jpg ___________________________________________________________________ Added: svn:executable + * Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: seema t. <see...@gm...> - 2010-06-15 22:54:15
|
Hello, Started work at 3:45pm. Working with Allen for the setup issues of the web based framework. Seema |
From: <al...@us...> - 2010-06-15 20:40:47
|
Revision: 519 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=519&view=rev Author: alllee Date: 2010-06-15 20:40:41 +0000 (Tue, 15 Jun 2010) Log Message: ----------- sandbox for prototype flex / java development Added Paths: ----------- web/sandbox/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2010-06-15 20:38:51
|
Revision: 518 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=518&view=rev Author: alllee Date: 2010-06-15 20:38:45 +0000 (Tue, 15 Jun 2010) Log Message: ----------- adding new web project tree for VC web-based experiments (field experiments) Added Paths: ----------- web/ web/branches/ web/tags/ web/trunk/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: seema t. <see...@gm...> - 2010-06-11 00:31:12
|
Hello, Forgot to checked out at 4:30pm. But I missed my bus so I will work more. Checking in at 5:20pm. Seema On Thu, Jun 10, 2010 at 11:18 AM, seema talele <see...@gm...>wrote: > Hello, > > Started work at 11:15am. > > I helped Scott in table issue for CSID website. > > I will work on the following tasks - > > To do - > 1) Integrate the stage components into one using view state > 2) Integrate the all configuration component and make a wizard. > > > Seema > |
From: seema t. <see...@gm...> - 2010-06-10 18:25:30
|
Hello, Started work at 11:15am. I helped Scott in table issue for CSID website. I will work on the following tasks - To do - 1) Integrate the stage components into one using view state 2) Integrate the all configuration component and make a wizard. Seema |
From: seema t. <see...@gm...> - 2010-06-09 23:22:44
|
Hello, Checking out at 4:00pm. Completed Task - 1) Tried to change the size of the components into percentages, it screw up few things in layout but fixed those issues 2) Downloaded the gameweb and read the documentation and skim through their code here and there. Need to run it to get an idea. 3) Creating Stage configuration component, it has small other components for almost for every stage. Working on this part. To do - 1)Install GameWeb. 2) Finish the rest of the Stage Configuration Component and its subcomponent. Following task need to be done only when all the configuration components are developed - 3) Work in Wizard Step so that it can be embedded into the Wizard Component 4) Automate the transition between steps. Today I have given few thoughts to this configuration part and how to make it generic so that it can be used for Fishery and Water Irrigration. My thoughts and Dr. Janssen also mentioned the same during my project is, that when you select the experiment like fihsery, forestry,etc. The labels should change in the subsequent settings. So, for example in the resource rather than saying number of trees, it should say number of fish. I am thinking what if we put the labels in the form of some text file or XML file. But I do not know if this is really possible or not and how feasible is this. Seema On Wed, Jun 9, 2010 at 2:41 PM, seema talele <see...@gm...> wrote: > Hello, > > Forgot to logged in. Around 2:30 I started work. > > Seema > > > On Wed, Jun 9, 2010 at 2:05 PM, seema talele <see...@gm...>wrote: > >> Hello, >> >> Checking out for lunch at 2:00pm. >> >> Seema >> >> On Wed, Jun 9, 2010 at 11:02 AM, seema talele <see...@gm...>wrote: >> >>> Hello, >>> >>> Started work at 11:00am. >>> >>> I will work on following tasks - >>> >>> To do - >>> 1) Work in Wizard Step so that it can be embedded into the Wizard >>> Component >>> 2) Automate the transition between steps. >>> 3) Stage Configuration Component. >>> >>> Seema >>> >>> >> > |
From: seema t. <see...@gm...> - 2010-06-09 21:42:03
|
Hello, Forgot to logged in. Around 2:30 I started work. Seema On Wed, Jun 9, 2010 at 2:05 PM, seema talele <see...@gm...> wrote: > Hello, > > Checking out for lunch at 2:00pm. > > Seema > > On Wed, Jun 9, 2010 at 11:02 AM, seema talele <see...@gm...>wrote: > >> Hello, >> >> Started work at 11:00am. >> >> I will work on following tasks - >> >> To do - >> 1) Work in Wizard Step so that it can be embedded into the Wizard >> Component >> 2) Automate the transition between steps. >> 3) Stage Configuration Component. >> >> Seema >> >> > |
From: seema t. <see...@gm...> - 2010-06-09 21:05:49
|
Hello, Checking out for lunch at 2:00pm. Seema On Wed, Jun 9, 2010 at 11:02 AM, seema talele <see...@gm...>wrote: > Hello, > > Started work at 11:00am. > > I will work on following tasks - > > To do - > 1) Work in Wizard Step so that it can be embedded into the Wizard Component > 2) Automate the transition between steps. > 3) Stage Configuration Component. > > Seema > > |
From: seema t. <see...@gm...> - 2010-06-09 18:02:47
|
Hello, Started work at 11:00am. I will work on following tasks - To do - 1) Work in Wizard Step so that it can be embedded into the Wizard Component 2) Automate the transition between steps. 3) Stage Configuration Component. Seema |
From: seema t. <see...@gm...> - 2010-06-08 23:46:40
|
Hello, Stop working at 4:45 Completed Task - 1) Finished with the Resource Configuration component. 2) Finished with Wizard Component. To do - 1) Work in Wizard Step so that it can be embedded into the Wizard Component 2) Automate the transition between steps. 2) Stage Configuration Component. Seema On Tue, Jun 8, 2010 at 1:15 PM, seema talele <see...@gm...> wrote: > Hello, > > I started work at 1:15pm > > I am going to continue working with resource configuration component. > > Seema > |
From: seema t. <see...@gm...> - 2010-06-08 20:15:34
|
Hello, I started work at 1:15pm I am going to continue working with resource configuration component. Seema |
From: seema t. <see...@gm...> - 2010-06-07 23:50:22
|
Hello, Checking out at 4:50pm. Worked on Resource Configuration Component, but did not finish. Need to add the GUI for global variable and equation. Seema On Mon, Jun 7, 2010 at 2:48 PM, seema talele <see...@gm...> wrote: > Hello, > > I started working at 2:45pm. > > I am going to work on the experiment configuration part. Last time I > finished the game configuration part. Now I am going to work on resource > configuration part. > > > Seema > |
From: seema t. <see...@gm...> - 2010-06-07 21:48:32
|
Hello, I started working at 2:45pm. I am going to work on the experiment configuration part. Last time I finished the game configuration part. Now I am going to work on resource configuration part. Seema |
From: seema t. <see...@gm...> - 2010-06-05 01:13:51
|
Hello, Stop working at 6:00. Explore the Flash catalyst for an to speed the design process. It seems it needs some study, so continued working in Flex builder. Trying to use View state to change the state of the panel. I used Wizard component in ASP.NET, so I am trying to build the similar component in Flex. Found one example (http://anirudhs.chaosnet.org/blog/2009.12.10.html). Tried to open their file in Flash Catalyst, did not understand much. My plan is to build this component except animation and generalize it so that it can be used for multiple purposes, especially when you need to do some activity in particular steps. So, I stared with developing directly in Flex4. Not finished yet. Few things need to figure out. Next time I will continue working on the component. Seema On Fri, Jun 4, 2010 at 3:00 PM, seema talele <see...@gm...> wrote: > Hello, > > Start work at 3:00pm. > > Work on Game Configuration part of the Forestry experiment. > > Seema > |
From: seema t. <see...@gm...> - 2010-06-04 22:00:30
|
Hello, Start work at 3:00pm. Work on Game Configuration part of the Forestry experiment. Seema |
From: seema t. <see...@gm...> - 2010-06-01 23:48:09
|
Hello, Checking out at 4:48 1) Written small program that will update and parse the URL 2) Started developing Forestry GUI Seema On Tue, Jun 1, 2010 at 12:20 PM, seema talele <see...@gm...>wrote: > Hello, > > I have started work at 12:22. > I am going to explore Spark component framework and try to build some GUI > with it in Flex 4. > > Seema > > |
From: seema t. <see...@gm...> - 2010-06-01 19:20:43
|
Hello, I have started work at 12:22. I am going to explore Spark component framework and try to build some GUI with it in Flex 4. Seema |
From: <al...@us...> - 2010-05-27 23:55:34
|
Revision: 517 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=517&view=rev Author: alllee Date: 2010-05-27 23:55:24 +0000 (Thu, 27 May 2010) Log Message: ----------- fixed autoscroll issue, but will probably change the code so that approved/denied messages move to a separate panel entirely to keep the pending requests panel relatively free / clear. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java 2010-05-10 23:31:53 UTC (rev 516) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java 2010-05-27 23:55:24 UTC (rev 517) @@ -3,7 +3,6 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; -import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -12,6 +11,7 @@ import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; +import javax.swing.JScrollBar; import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.SwingUtilities; @@ -62,13 +62,11 @@ public void run() { CensoredChatRequestView censoredChatRequestView = new CensoredChatRequestView(request.getCensoredChatRequest()); censoredChatRequestView.addToGroupLayout(); - chatRequestsScrollPane.scrollRectToVisible(chatRequestsPanel.getBounds()); + JScrollBar verticalScrollBar = chatRequestsScrollPane.getVerticalScrollBar(); + verticalScrollBar.setValue(verticalScrollBar.getMaximum()); chatRequestsPanel.revalidate(); } }); - - - } private void initGuiComponents() { @@ -90,15 +88,12 @@ horizontalGroup.addGroup(chatTextParallelGroup).addGroup(approveParallelGroup).addGroup(statusLabelParallelGroup).addGroup(denyParallelGroup); groupLayout.setHorizontalGroup(horizontalGroup); - verticalGroup = groupLayout.createSequentialGroup(); GroupLayout.ParallelGroup rowParallelGroup = groupLayout.createParallelGroup(Alignment.BASELINE); rowParallelGroup.addComponent(messagesLabel).addComponent(approveLabel).addComponent(statusLabel).addComponent(denyLabel); verticalGroup.addGroup(rowParallelGroup); groupLayout.setVerticalGroup(verticalGroup); - - scrollablePanel.add(chatRequestsPanel, BorderLayout.CENTER); chatRequestsScrollPane = new JScrollPane(scrollablePanel); chatRequestsScrollPane.setPreferredSize(new Dimension(300, 300)); @@ -164,6 +159,7 @@ } private void updateChatStatus(String message) { + // move this component to the sidebar. approveButton.setEnabled(false); denyButton.setEnabled(false); statusLabel.setText(message); Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java 2010-05-10 23:31:53 UTC (rev 516) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java 2010-05-27 23:55:24 UTC (rev 517) @@ -245,11 +245,11 @@ setInstructions(facilitator.getServerConfiguration().getFacilitatorInstructions()); viewPane = new JScrollPane(); - + Dimension minimumSize = new Dimension(200, 200); + informationPanel.setMinimumSize(minimumSize); splitPane.add(informationPanel); splitPane.add(facilitatorChatPanel.getComponent()); add(splitPane, BorderLayout.CENTER); - splitPane.setDividerLocation(0.5d); } public void initViewPanel() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: seema t. <see...@gm...> - 2010-05-19 23:47:47
|
Hello, 1) I tried to install the GameWeb according to the documentation. It seems documentation is not correct. 2) Installed Flex4 on my laptop as well as on office machine. 3) Started exploring new engine Spark in Flex4. Lot of things to learn Found good resource as a start- http://www.adobe.com/devnet/flex/articles/flex4_sparkintro_05.html Checking out now. Seema On Wed, May 19, 2010 at 2:14 PM, seema talele <see...@gm...>wrote: > Hello, > > I started work at 1:45pm. > As per discussion with Dr. Janssen, I am going to explore GameWeb more. > Once I am done with that I will install Flex on my laptop as well as on my > office machine and start exploring that. > > Seema > > |
From: seema t. <see...@gm...> - 2010-05-19 21:14:40
|
Hello, I started work at 1:45pm. As per discussion with Dr. Janssen, I am going to explore GameWeb more. Once I am done with that I will install Flex on my laptop as well as on my office machine and start exploring that. Seema |
From: <al...@us...> - 2010-05-10 23:32:00
|
Revision: 516 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=516&view=rev Author: alllee Date: 2010-05-10 23:31:53 +0000 (Mon, 10 May 2010) Log Message: ----------- first cut at censored chat requests being displayed and approved/denied by the facilitator. Functional but needs some usability improvements like auto-scrolling when new chats come in (or dealing with approved chats by moving them to a different panel). Modified Paths: -------------- foraging/trunk/build.xml foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ChatPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java Added Paths: ----------- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/CensoredChatRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/FacilitatorCensoredChatRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java foraging/trunk/src/main/resources/images/checked.gif foraging/trunk/src/main/resources/images/unchecked.gif Modified: foraging/trunk/build.xml =================================================================== --- foraging/trunk/build.xml 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/build.xml 2010-05-10 23:31:53 UTC (rev 516) @@ -234,6 +234,7 @@ optimize="off" deprecation="on" source="1.6" + includeAntRuntime="false" > <compilerarg value='-Xlint:unchecked'/> <classpath refid="project.classpath" /> Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ChatPanel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ChatPanel.java 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ChatPanel.java 2010-05-10 23:31:53 UTC (rev 516) @@ -33,6 +33,8 @@ import edu.asu.commons.event.ChatEvent; import edu.asu.commons.event.ChatRequest; import edu.asu.commons.event.EventTypeProcessor; +import edu.asu.commons.foraging.conf.RoundConfiguration; +import edu.asu.commons.foraging.event.CensoredChatRequest; import edu.asu.commons.net.Identifier; @@ -117,10 +119,17 @@ if (message == null || "".equals(message) || targetIdentifier == null) { return; } - client.transmit(new ChatRequest(clientId, message, targetIdentifier)); - displayMessage(getChatHandle(clientId) -// + " -> " + getChatHandle(targetIdentifier) - , message); + RoundConfiguration roundConfiguration = client.getCurrentRoundConfiguration(); + if (roundConfiguration.isCensoredChat()) { + // FIXME: perform extra checks to see if we are able to send this message + client.transmit(new CensoredChatRequest(clientId, message, targetIdentifier)); + } + else { + client.transmit(new ChatRequest(clientId, message, targetIdentifier)); +// displayMessage(getChatHandle(clientId) +//// + " -> " + getChatHandle(targetIdentifier) +// , message); + } chatField.requestFocusInWindow(); chatField.setText(""); } @@ -254,7 +263,7 @@ chatInstructionsPane.setEditable(false); chatInstructionsPane.setBackground(Color.WHITE); JScrollPane chatInstructionsScrollPane = new JScrollPane(chatInstructionsPane); - chatInstructionsPane.setText(client.getDataModel().getRoundConfiguration().getChatInstructions()); + chatInstructionsPane.setText(client.getCurrentRoundConfiguration().getChatInstructions()); add(chatInstructionsScrollPane, BorderLayout.NORTH); add(messageScrollPane, BorderLayout.CENTER); Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java 2010-05-10 23:31:53 UTC (rev 516) @@ -280,8 +280,6 @@ /** * Utility class for throttling client-side messages. * - * @author <a href='All...@as...'>Allen Lee</a> - * @version $Revision$ */ private class MessageQueue implements Runnable { private final static int DEFAULT_MESSAGES_PER_SECOND = 8; @@ -418,6 +416,10 @@ return dataModel; } + public RoundConfiguration getCurrentRoundConfiguration() { + return dataModel.getRoundConfiguration(); + } + public static void main(String[] args) { Runnable createGuiRunnable = new Runnable() { public void run() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-05-10 23:31:53 UTC (rev 516) @@ -18,9 +18,11 @@ * * Something like: * - * Parameter name, value, type, instructions + * Parameter name, value, type, instructions * + * need to deal with i18n at some point as well.. * + * * * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev$ @@ -62,8 +64,6 @@ private final static Map<String, ExperimentType> experimentTypeMap = new HashMap<String, ExperimentType>(3); - - public enum ExperimentType { TWO_DIMENSIONAL("2d"), ABSTRACT("abstract"), FORESTRY("forestry"); private final String name; @@ -507,6 +507,23 @@ return isTokensFieldOfVisionEnabled() || isSubjectsFieldOfVisionEnabled(); } + public boolean isCensoredChat() { + return getBooleanProperty("censored-chat-enabled", false); + } + + public String getCensoredChatInstructions() { + return getProperty("censored-chat-instructions", + "Your messages must be approved by our censor before they will be relayed to the rest of your group."); + } + + public int getNumberOfChatsPerSecond() { + return getIntProperty("chats-per-second", 5); + } + + public int getDelayBetweenChats() { + return getIntProperty("delay-between-chats", 0); + } + public StringBuilder getCurrentRoundInstructions() { return buildInstructions(new StringBuilder()); } @@ -518,16 +535,20 @@ instructionsBuilder.append(getInstructions()); if (isFieldOfVisionEnabled()) { // create note type box, test to see how - // JEditorPaneS render CSS / fieldsets. + // JEditorPaneS render CSS divs or fieldsets..? instructionsBuilder.append("<hr>"); instructionsBuilder.append(getFieldOfVisionInstructions()); } - + if (isChatEnabled()) { + instructionsBuilder.append("<hr>"); + instructionsBuilder.append("Before the beginning of this round you will be able to chat with the other members of your group for ").append(getChatDuration()).append(" seconds."); + } // and add the quiz instructions if the quiz is enabled. if (isQuizEnabled()) { instructionsBuilder.append("<hr>"); instructionsBuilder.append(getQuizInstructions()); } + return instructionsBuilder; } Added: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/CensoredChatRequest.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/CensoredChatRequest.java (rev 0) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/CensoredChatRequest.java 2010-05-10 23:31:53 UTC (rev 516) @@ -0,0 +1,43 @@ +package edu.asu.commons.foraging.event; + +import edu.asu.commons.event.AbstractPersistableEvent; +import edu.asu.commons.event.ChatRequest; +import edu.asu.commons.event.ClientRequest; +import edu.asu.commons.net.Identifier; + +/** + * $Id$ + * + * Client chat request that should be forwarded on to the facilitator for approval. + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class CensoredChatRequest extends AbstractPersistableEvent implements ClientRequest { + + private static final long serialVersionUID = -120847705184240264L; + + private Identifier target; + + public CensoredChatRequest(Identifier source, String message) { + this(source, message, Identifier.ALL); + } + + public CensoredChatRequest(Identifier source, String message, Identifier target) { + super(source, message); + this.target = target; + } + + public Identifier getTarget() { + return target; + } + + public ChatRequest toApprovedChatRequest() { + return new ChatRequest(getId(), getMessage(), getTarget()); + } + + public ChatRequest toDeniedChatRequest() { + return new ChatRequest(getId(), String.format("Your message: [%s] was not approved.", getMessage()), getId()); + } + +} Added: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/FacilitatorCensoredChatRequest.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/FacilitatorCensoredChatRequest.java (rev 0) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/FacilitatorCensoredChatRequest.java 2010-05-10 23:31:53 UTC (rev 516) @@ -0,0 +1,39 @@ +package edu.asu.commons.foraging.event; + +import edu.asu.commons.event.AbstractPersistableEvent; +import edu.asu.commons.event.ClientRequest; +import edu.asu.commons.net.Identifier; + +/** + * $Id$ + * + * Event used to forward censored chat requests to the facilitator. + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class FacilitatorCensoredChatRequest extends AbstractPersistableEvent implements ClientRequest { + + private static final long serialVersionUID = -120847705184240264L; + + private CensoredChatRequest censoredChatRequest; + + public FacilitatorCensoredChatRequest(Identifier facilitatorId, CensoredChatRequest request) { + super(facilitatorId); + this.censoredChatRequest = request; + } + + public CensoredChatRequest getCensoredChatRequest() { + return censoredChatRequest; + } + + public Identifier getSource() { + return censoredChatRequest.getId(); + } + + public Identifier getTarget() { + return censoredChatRequest.getTarget(); + } + + +} Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java 2010-05-10 23:31:53 UTC (rev 516) @@ -16,6 +16,7 @@ import edu.asu.commons.foraging.conf.RoundConfiguration; import edu.asu.commons.foraging.conf.ServerConfiguration; import edu.asu.commons.foraging.event.BeginChatRoundRequest; +import edu.asu.commons.foraging.event.FacilitatorCensoredChatRequest; import edu.asu.commons.foraging.event.FacilitatorEndRoundEvent; import edu.asu.commons.foraging.event.FacilitatorSanctionUpdateEvent; import edu.asu.commons.foraging.event.FacilitatorUpdateEvent; @@ -82,6 +83,7 @@ facilitatorWindow.quizCompleted(); } }); + } public static Facilitator getInstance() { @@ -208,7 +210,7 @@ public static void main(String[] args) { Runnable createGuiRunnable = new Runnable() { public void run() { - Dimension dimension = new Dimension(700, 300); + Dimension dimension = new Dimension(700, 700); Facilitator facilitator = Facilitator.getInstance(); facilitator.connect(); JFrame frame = new JFrame(); Added: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java (rev 0) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java 2010-05-10 23:31:53 UTC (rev 516) @@ -0,0 +1,184 @@ +package edu.asu.commons.foraging.facilitator; + +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.Rectangle; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.GroupLayout; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; +import javax.swing.GroupLayout.Alignment; + +import edu.asu.commons.event.EventTypeProcessor; +import edu.asu.commons.foraging.event.CensoredChatRequest; +import edu.asu.commons.foraging.event.FacilitatorCensoredChatRequest; +import edu.asu.commons.util.ResourceLoader; + +/** + * $Id$ + * + * A JPanel component for approving chat messages. + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class FacilitatorChatPanel { + + private Facilitator facilitator; + + private JPanel chatRequestsPanel; + private JScrollPane chatRequestsScrollPane; + + private GroupLayout groupLayout; + private GroupLayout.ParallelGroup chatTextParallelGroup; + private GroupLayout.ParallelGroup approveParallelGroup; + private GroupLayout.ParallelGroup statusLabelParallelGroup; + private GroupLayout.ParallelGroup denyParallelGroup; + + private GroupLayout.SequentialGroup verticalGroup; + + public FacilitatorChatPanel(Facilitator facilitator) { + this.facilitator = facilitator; + initGuiComponents(); + facilitator.addEventProcessor(new EventTypeProcessor<FacilitatorCensoredChatRequest>(FacilitatorCensoredChatRequest.class) { + public void handle(final FacilitatorCensoredChatRequest request) { + // add formatted message + approve / deny button to component + handleCensoredChatRequest(request); + } + }); + } + + private void handleCensoredChatRequest(final FacilitatorCensoredChatRequest request) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + CensoredChatRequestView censoredChatRequestView = new CensoredChatRequestView(request.getCensoredChatRequest()); + censoredChatRequestView.addToGroupLayout(); + chatRequestsScrollPane.scrollRectToVisible(chatRequestsPanel.getBounds()); + chatRequestsPanel.revalidate(); + } + }); + + + + } + + private void initGuiComponents() { + JPanel scrollablePanel = new JPanel(new BorderLayout()); + scrollablePanel.add(new JLabel("Chat requests"), BorderLayout.NORTH); + chatRequestsPanel = new JPanel(); + groupLayout = new GroupLayout(chatRequestsPanel); + chatRequestsPanel.setLayout(groupLayout); + groupLayout.setAutoCreateGaps(true); + GroupLayout.SequentialGroup horizontalGroup = groupLayout.createSequentialGroup(); + JLabel messagesLabel = new JLabel("Messages"); + JLabel approveLabel = new JLabel("Approve"); + JLabel statusLabel = new JLabel("Status"); + JLabel denyLabel = new JLabel("Deny"); + chatTextParallelGroup = groupLayout.createParallelGroup().addComponent(messagesLabel); + approveParallelGroup = groupLayout.createParallelGroup().addComponent(approveLabel); + statusLabelParallelGroup = groupLayout.createParallelGroup().addComponent(statusLabel); + denyParallelGroup = groupLayout.createParallelGroup().addComponent(denyLabel); + horizontalGroup.addGroup(chatTextParallelGroup).addGroup(approveParallelGroup).addGroup(statusLabelParallelGroup).addGroup(denyParallelGroup); + groupLayout.setHorizontalGroup(horizontalGroup); + + + verticalGroup = groupLayout.createSequentialGroup(); + GroupLayout.ParallelGroup rowParallelGroup = groupLayout.createParallelGroup(Alignment.BASELINE); + rowParallelGroup.addComponent(messagesLabel).addComponent(approveLabel).addComponent(statusLabel).addComponent(denyLabel); + verticalGroup.addGroup(rowParallelGroup); + groupLayout.setVerticalGroup(verticalGroup); + + + + scrollablePanel.add(chatRequestsPanel, BorderLayout.CENTER); + chatRequestsScrollPane = new JScrollPane(scrollablePanel); + chatRequestsScrollPane.setPreferredSize(new Dimension(300, 300)); + } + + public Component getComponent() { + return chatRequestsScrollPane; + } + + /** + * + * Mini component for a chat request that can be approved or denied. + * + */ + public class CensoredChatRequestView { + + private static final long serialVersionUID = -5819416143717776775L; + + private JButton approveButton; + private JButton denyButton; + private JLabel statusLabel; + + private JTextArea chatMessageTextArea; + + public JTextArea getChatMessageTextArea() { + return chatMessageTextArea; + } + + + public CensoredChatRequestView(final CensoredChatRequest request) { + chatMessageTextArea = createTextArea(request); + + approveButton = new JButton(); + denyButton = new JButton(); + approveButton.setIcon(new ImageIcon(ResourceLoader.getResourceAsUrl("images/checked.gif"))); + denyButton.setIcon(new ImageIcon(ResourceLoader.getResourceAsUrl("images/unchecked.gif"))); + statusLabel = new JLabel("Pending"); + + approveButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + facilitator.transmit(request.toApprovedChatRequest()); + updateChatStatus(" approved "); + + } + }); + denyButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent event) { + facilitator.transmit(request.toDeniedChatRequest()); + updateChatStatus(" denied "); + } + }); + } + + private void addToGroupLayout() { + chatTextParallelGroup.addComponent(chatMessageTextArea); + approveParallelGroup.addComponent(approveButton); + statusLabelParallelGroup.addComponent(statusLabel); + denyParallelGroup.addComponent(denyButton); + + GroupLayout.ParallelGroup rowParallelGroup = groupLayout.createParallelGroup(Alignment.BASELINE); + rowParallelGroup.addComponent(chatMessageTextArea).addComponent(approveButton).addComponent(statusLabel).addComponent(denyButton); + verticalGroup.addGroup(rowParallelGroup); + } + + private void updateChatStatus(String message) { + approveButton.setEnabled(false); + denyButton.setEnabled(false); + statusLabel.setText(message); + } + + private JTextArea createTextArea(CensoredChatRequest request) { + JTextArea textArea = new JTextArea( toString( request ) ); + textArea.setEditable(false); + return textArea; + } + + private String toString(CensoredChatRequest request) { + return String.format("%s: %s", request.getId(), request.getMessage()); + } + + } + +} Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java 2010-05-10 23:31:53 UTC (rev 516) @@ -20,6 +20,7 @@ import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JScrollPane; +import javax.swing.JSplitPane; import javax.swing.ScrollPaneConstants; import edu.asu.commons.foraging.conf.RoundConfiguration; @@ -36,6 +37,8 @@ private static final long serialVersionUID = -9067316316468488000L; private Facilitator facilitator; + + private FacilitatorChatPanel facilitatorChatPanel; // private JFrame frame; private Dimension windowDimension; @@ -56,17 +59,17 @@ private int viewSpacing = 50; - private JMenuItem startExperimentMenuItem = null; + private JMenuItem startExperimentMenuItem; - private JMenuItem stopExperimentMenuItem = null; + private JMenuItem stopExperimentMenuItem; - private JMenuItem showInstructionsMenuItem = null; + private JMenuItem showInstructionsMenuItem; - private JMenuItem startRoundMenuItem = null; + private JMenuItem startRoundMenuItem; - private JMenuItem stopRoundMenuItem = null; + private JMenuItem stopRoundMenuItem; - private JMenuItem loadExperimentMenuItem = null; + private JMenuItem loadExperimentMenuItem; private JMenuBar menuBar; @@ -225,7 +228,11 @@ "CSAN Facilitator Instructions"); informationEditorPane.setPreferredSize(new Dimension(400, 400)); informationEditorPane.setEditable(false); + + facilitatorChatPanel = new FacilitatorChatPanel(facilitator); + JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT); + informationScrollPane = new JScrollPane(informationEditorPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); @@ -235,11 +242,14 @@ informationPanel.add(messageLabel, BorderLayout.NORTH); informationPanel.add(informationScrollPane, BorderLayout.CENTER); - setInstructions(facilitator.getServerConfiguration() - .getFacilitatorInstructions()); + setInstructions(facilitator.getServerConfiguration().getFacilitatorInstructions()); viewPane = new JScrollPane(); - add(informationPanel, BorderLayout.CENTER); + + splitPane.add(informationPanel); + splitPane.add(facilitatorChatPanel.getComponent()); + add(splitPane, BorderLayout.CENTER); + splitPane.setDividerLocation(0.5d); } public void initViewPanel() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-05-04 00:31:50 UTC (rev 515) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-05-10 23:31:53 UTC (rev 516) @@ -31,6 +31,7 @@ import edu.asu.commons.foraging.conf.ServerConfiguration; import edu.asu.commons.foraging.event.AgentInfoRequest; import edu.asu.commons.foraging.event.BeginChatRoundRequest; +import edu.asu.commons.foraging.event.CensoredChatRequest; import edu.asu.commons.foraging.event.ClientMovementRequest; import edu.asu.commons.foraging.event.ClientPoseUpdate; import edu.asu.commons.foraging.event.ClientPositionUpdateEvent; @@ -39,6 +40,7 @@ import edu.asu.commons.foraging.event.EnforcementMechanismUpdateEvent; import edu.asu.commons.foraging.event.EnforcementRankingRequest; import edu.asu.commons.foraging.event.ExplicitCollectionModeRequest; +import edu.asu.commons.foraging.event.FacilitatorCensoredChatRequest; import edu.asu.commons.foraging.event.FacilitatorEndRoundEvent; import edu.asu.commons.foraging.event.FacilitatorSanctionUpdateEvent; import edu.asu.commons.foraging.event.FacilitatorUpdateEvent; @@ -283,6 +285,12 @@ } } }); + addEventProcessor(new EventTypeProcessor<CensoredChatRequest>(CensoredChatRequest.class) { + public void handle(final CensoredChatRequest request) { + // send to facilitator immediately for approval + transmit(new FacilitatorCensoredChatRequest(facilitatorId, request)); + } + }); addEventProcessor(new EventTypeProcessor<ChatRequest>(ChatRequest.class) { public void handle(final ChatRequest request) { new Thread () { public void run() { relayChatRequest(request); } }.start(); @@ -760,11 +768,6 @@ ClientData clientData = clients.get(source); getLogger().info(String.format("chat from %s: [ %s ]", clientData.toString(), request)); for (Identifier targetId : clientData.getGroupDataModel().getClientIdentifiers()) { - if (targetId.equals(source)) { - // don't send a chat event back to the originator of the chat - // request - continue; - } ChatEvent chatEvent = new ChatEvent(targetId, request.toString(), source, true); transmit(chatEvent); } Added: foraging/trunk/src/main/resources/images/checked.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/images/checked.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/resources/images/unchecked.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/images/unchecked.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2010-05-04 00:31:57
|
Revision: 515 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=515&view=rev Author: alllee Date: 2010-05-04 00:31:50 +0000 (Tue, 04 May 2010) Log Message: ----------- starting to refactor configuration and instruction generation, going to move to templated instructions and add censored chat requests next. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/ConfigurationDialog.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java Removed Paths: ------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/TreatmentTypeRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/TreatmentType.java Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2010-05-04 00:31:50 UTC (rev 515) @@ -837,21 +837,20 @@ public void showInstructions() { RoundConfiguration roundConfiguration = dataModel.getRoundConfiguration(); instructionsBuilder.delete(0, instructionsBuilder.length()); - if (roundConfiguration.isFirstRound()) { - instructionsBuilder.append(roundConfiguration.getGeneralInstructions()); - } - if (roundConfiguration.isFieldOfVisionEnabled()) { - instructionsBuilder.append(roundConfiguration.getFieldOfVisionInstructions()); - } - instructionsBuilder.append(roundConfiguration.getInstructions()); - + roundConfiguration.buildInstructions(instructionsBuilder); + +// if (roundConfiguration.isFirstRound()) { +// instructionsBuilder.append(roundConfiguration.getGeneralInstructions()); +// } +// if (roundConfiguration.isFieldOfVisionEnabled()) { +// instructionsBuilder.append(roundConfiguration.getFieldOfVisionInstructions()); +// } +// instructionsBuilder.append(roundConfiguration.getInstructions()); +// + // and add the quiz instructions if the quiz is enabled. if (roundConfiguration.isQuizEnabled()) { - instructionsBuilder.append("<hr>"); - instructionsBuilder.append(roundConfiguration.getQuizInstructions()); - // set an ActionListener on the HtmlEditorPane to process the quiz - // submit. instructionsEditorPane.setActionListener(null); instructionsEditorPane.setActionListener(createQuizListener(roundConfiguration)); } Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-05-04 00:31:50 UTC (rev 515) @@ -11,6 +11,20 @@ import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.EnforcementMechanism; +/** + * $Id$ + * + * At some point this should be persistent database objects in a key-value store..? + * + * Something like: + * + * Parameter name, value, type, instructions + * + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration> { private final static long serialVersionUID = 8575239803733029326L; @@ -255,6 +269,9 @@ return getDoubleProperty("dollars-per-token", DEFAULT_DOLLARS_PER_TOKEN); } + /** + * Returns the instructions for this round. + */ public String getInstructions() { return getProperty("instructions", "<b>No instructions available for this round.</b>"); } @@ -267,6 +284,10 @@ return getBooleanProperty("quiz"); } + /** + * FIXME: quiz instructions and quiz enabled should be tightly coupled.. + * @return + */ public String getQuizInstructions() { return getProperty("quiz-instructions"); } @@ -485,5 +506,29 @@ public boolean isFieldOfVisionEnabled() { return isTokensFieldOfVisionEnabled() || isSubjectsFieldOfVisionEnabled(); } + + public StringBuilder getCurrentRoundInstructions() { + return buildInstructions(new StringBuilder()); + } + + public StringBuilder buildInstructions(StringBuilder instructionsBuilder) { + if (isFirstRound()) { + instructionsBuilder.append(getGeneralInstructions()); + } + instructionsBuilder.append(getInstructions()); + if (isFieldOfVisionEnabled()) { + // create note type box, test to see how + // JEditorPaneS render CSS / fieldsets. + instructionsBuilder.append("<hr>"); + instructionsBuilder.append(getFieldOfVisionInstructions()); + } + + // and add the quiz instructions if the quiz is enabled. + if (isQuizEnabled()) { + instructionsBuilder.append("<hr>"); + instructionsBuilder.append(getQuizInstructions()); + } + return instructionsBuilder; + } } Deleted: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/TreatmentTypeRequest.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/TreatmentTypeRequest.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/TreatmentTypeRequest.java 2010-05-04 00:31:50 UTC (rev 515) @@ -1,22 +0,0 @@ -package edu.asu.commons.foraging.event; - -import edu.asu.commons.event.AbstractEvent; -import edu.asu.commons.foraging.model.TreatmentType; -import edu.asu.commons.net.Identifier; - -public class TreatmentTypeRequest extends AbstractEvent { - - private static final long serialVersionUID = 3543634624796618926L; - - private TreatmentType treatmentType; - - public TreatmentTypeRequest(Identifier id, TreatmentType treatmentType) { - super(id); - this.treatmentType = treatmentType; - } - - public TreatmentType getTreatmentType() { - return treatmentType; - } - -} Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/ConfigurationDialog.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/ConfigurationDialog.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/ConfigurationDialog.java 2010-05-04 00:31:50 UTC (rev 515) @@ -9,7 +9,6 @@ import java.util.ArrayList; import java.util.List; -import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; @@ -17,14 +16,12 @@ import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; -import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.JTabbedPane; import javax.swing.JTextArea; import edu.asu.commons.foraging.conf.RoundConfiguration; import edu.asu.commons.foraging.conf.ServerConfiguration; -import edu.asu.commons.foraging.model.TreatmentType; @@ -36,7 +33,6 @@ private List<RoundConfigurationDialog> roundConfigurationDialogs = new ArrayList<RoundConfigurationDialog>(); private Facilitator facilitator; private boolean readOnly = false; - private TreatmentType currentTreatment; private ButtonGroup group; /* @@ -86,9 +82,9 @@ JLabel label = new JLabel("Select one of the treatments"); panel.add(label); panel.add(Box.createVerticalGlue()); - panel.add(createFullVisionPanel(),null); +// panel.add(createFullVisionPanel(),null); panel.add(Box.createVerticalGlue()); - panel.add(createLimitedVisionPanel(),null); +// panel.add(createLimitedVisionPanel(),null); panel.add(Box.createVerticalGlue()); panel.add(getInstructionPanel(), null); panel.add(Box.createVerticalGlue()); @@ -96,45 +92,45 @@ return configurationTabPane; } - private JPanel createFullVisionPanel() { - JRadioButton fullVision; - fullVision = new JRadioButton("Complete field of vision"); - fullVision.setActionCommand("1"); - group.add(fullVision); - fullVision.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { - updateTreatment(event.getActionCommand()); - System.out.println(" "+event.getActionCommand()); - } - }); - JPanel fullVisionPanel = new JPanel(new GridLayout(2, 2)); - fullVisionPanel.setBorder(BorderFactory.createEtchedBorder() ); - fullVisionPanel.add(new JLabel("Full"), null); - fullVisionPanel.add(new JLabel(""), null); - fullVisionPanel.add(new JLabel("Vision"), null); - fullVisionPanel.add(fullVision, null); - return fullVisionPanel; - } - - private JPanel createLimitedVisionPanel() { - JRadioButton limitedVision; - limitedVision = new JRadioButton("Limited field of vision"); - limitedVision.setActionCommand("0"); - group.add(limitedVision); - limitedVision.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent event) { - updateTreatment(event.getActionCommand()); - System.out.println(" "+event.getActionCommand()); - } - }); - JPanel limitedVisionPanel = new JPanel(new GridLayout(2, 2)); - limitedVisionPanel.setBorder(BorderFactory.createEtchedBorder() ); - limitedVisionPanel.add(new JLabel("Limited"), null); - limitedVisionPanel.add(new JLabel(""), null); - limitedVisionPanel.add(new JLabel("Vision"), null); - limitedVisionPanel.add(limitedVision, null); - return limitedVisionPanel; - } +// private JPanel createFullVisionPanel() { +// JRadioButton fullVision; +// fullVision = new JRadioButton("Complete field of vision"); +// fullVision.setActionCommand("1"); +// group.add(fullVision); +// fullVision.addActionListener(new ActionListener() { +// public void actionPerformed(ActionEvent event) { +// updateTreatment(event.getActionCommand()); +// System.out.println(" "+event.getActionCommand()); +// } +// }); +// JPanel fullVisionPanel = new JPanel(new GridLayout(2, 2)); +// fullVisionPanel.setBorder(BorderFactory.createEtchedBorder() ); +// fullVisionPanel.add(new JLabel("Full"), null); +// fullVisionPanel.add(new JLabel(""), null); +// fullVisionPanel.add(new JLabel("Vision"), null); +// fullVisionPanel.add(fullVision, null); +// return fullVisionPanel; +// } +// +// private JPanel createLimitedVisionPanel() { +// JRadioButton limitedVision; +// limitedVision = new JRadioButton("Limited field of vision"); +// limitedVision.setActionCommand("0"); +// group.add(limitedVision); +// limitedVision.addActionListener(new ActionListener() { +// public void actionPerformed(ActionEvent event) { +// updateTreatment(event.getActionCommand()); +// System.out.println(" "+event.getActionCommand()); +// } +// }); +// JPanel limitedVisionPanel = new JPanel(new GridLayout(2, 2)); +// limitedVisionPanel.setBorder(BorderFactory.createEtchedBorder() ); +// limitedVisionPanel.add(new JLabel("Limited"), null); +// limitedVisionPanel.add(new JLabel(""), null); +// limitedVisionPanel.add(new JLabel("Vision"), null); +// limitedVisionPanel.add(limitedVision, null); +// return limitedVisionPanel; +// } private JScrollPane getInstructionPanel() { @@ -220,28 +216,27 @@ ConfigurationDialog.this.facilitator.setRoundParameters(rounds); ConfigurationDialog.this.facilitator.sendSetConfigRequest();*/ - ConfigurationDialog.this.facilitator.sendTreatmentTypeRequest(currentTreatment); } - private void updateTreatment(String treatmentType) { - //List<RoundConfiguration> rounds = new ArrayList<RoundConfiguration>(); - //RoundConfiguration roundConfiguration = new RoundConfiguration(); - currentTreatment = TreatmentType.FULLVISION; - if(treatmentType.equals("0")) { - currentTreatment = TreatmentType.LIMITEDVISION; - } - else { - currentTreatment = TreatmentType.FULLVISION; - } - //roundConfiguration.setProperty("tokens-field-of-vision", Boolean.valueOf(flag).toString()); - //roundConfiguration.setProperty("subjects-field-of-vision", Boolean.valueOf(flag).toString()); - //rounds.add(roundConfiguration); - //ConfigurationDialog.this.facilitator.setRoundParameters(rounds); - //ConfigurationDialog.this.facilitator.sendSetConfigRequest(); - ConfigurationDialog.this.facilitator.sendTreatmentTypeRequest(currentTreatment); - - } +// private void updateTreatment(String treatmentType) { +// //List<RoundConfiguration> rounds = new ArrayList<RoundConfiguration>(); +// //RoundConfiguration roundConfiguration = new RoundConfiguration(); +// currentTreatment = TreatmentType.FULLVISION; +// if(treatmentType.equals("0")) { +// currentTreatment = TreatmentType.LIMITEDVISION; +// } +// else { +// currentTreatment = TreatmentType.FULLVISION; +// } +// //roundConfiguration.setProperty("tokens-field-of-vision", Boolean.valueOf(flag).toString()); +// //roundConfiguration.setProperty("subjects-field-of-vision", Boolean.valueOf(flag).toString()); +// //rounds.add(roundConfiguration); +// //ConfigurationDialog.this.facilitator.setRoundParameters(rounds); +// //ConfigurationDialog.this.facilitator.sendSetConfigRequest(); +// ConfigurationDialog.this.facilitator.sendTreatmentTypeRequest(currentTreatment); +// +// } // private void centerOnParentFrame() { // Dimension parentFrameDimension = parentFrame.getSize(); Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/Facilitator.java 2010-05-04 00:31:50 UTC (rev 515) @@ -21,9 +21,7 @@ import edu.asu.commons.foraging.event.FacilitatorUpdateEvent; import edu.asu.commons.foraging.event.QuizCompletedEvent; import edu.asu.commons.foraging.event.ShowInstructionsRequest; -import edu.asu.commons.foraging.event.TreatmentTypeRequest; import edu.asu.commons.foraging.model.ServerDataModel; -import edu.asu.commons.foraging.model.TreatmentType; @@ -162,11 +160,6 @@ transmit(new BeginChatRoundRequest(getId())); } - public void sendTreatmentTypeRequest(TreatmentType treatmentType) { - transmit(new TreatmentTypeRequest(getId(), treatmentType)); - } - - public void endExperiment() { // configuration.resetRoundConfiguration(); // serverGameState = null; Deleted: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/TreatmentType.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/TreatmentType.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/TreatmentType.java 2010-05-04 00:31:50 UTC (rev 515) @@ -1,29 +0,0 @@ -package edu.asu.commons.foraging.model; - -public enum TreatmentType { - - LIMITEDVISION("Limited Vision"), - FULLVISION("Full Vision"); - - //We may want to add new types of treatments going ahead like - //with sanctioning and voting etc - - private final String treatmentText; - - TreatmentType(String treatmentText) { - this.treatmentText = treatmentText; - } - - public String getTreatmentText() { - return treatmentText; - } - - public static TreatmentType get(int index) { - if (index < values().length && index >= 0) { - return values()[index]; - } - System.err.println("Returning FULLVISION as default."); - return FULLVISION; -// throw new IllegalArgumentException("No enforcement mechanism for index: " + index); - } -} Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-04-29 18:55:09 UTC (rev 514) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-05-04 00:31:50 UTC (rev 515) @@ -61,7 +61,6 @@ import edu.asu.commons.foraging.event.ShowInstructionsRequest; import edu.asu.commons.foraging.event.SubmitRegulationRequest; import edu.asu.commons.foraging.event.SynchronizeClientEvent; -import edu.asu.commons.foraging.event.TreatmentTypeRequest; import edu.asu.commons.foraging.event.UnlockResourceRequest; import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.Direction; @@ -71,7 +70,6 @@ import edu.asu.commons.foraging.model.ResourceDispenser; import edu.asu.commons.foraging.model.SanctionMechanism; import edu.asu.commons.foraging.model.ServerDataModel; -import edu.asu.commons.foraging.model.TreatmentType; import edu.asu.commons.foraging.util.ForagingSaveFileConverter; import edu.asu.commons.net.Dispatcher; import edu.asu.commons.net.Identifier; @@ -117,7 +115,6 @@ private volatile int numberOfCompletedAgentDesigns; private int monitorRotationInterval; - private TreatmentType treatmentType; private Duration currentRoundDuration; // private Duration chatDuration; @@ -490,7 +487,7 @@ } } - private void sendEnforcementUpdate(GroupDataModel group) { + private void sendEnforcementMechanismUpdate(GroupDataModel group) { group.generateEnforcementRankings(); for (Identifier id: group.getClientIdentifiers()) { transmit(new EnforcementMechanismUpdateEvent(id, group)); @@ -684,21 +681,6 @@ } } }); - // FIXME: what is the point of this? - addEventProcessor(new EventTypeProcessor<TreatmentTypeRequest>(TreatmentTypeRequest.class) { - public void handle(TreatmentTypeRequest event) { - // FIXME: assign groups? - if (event.getId().equals(facilitatorId)) { - logger.info("New treatment selected :"+event.getTreatmentType().getTreatmentText()); - for (Identifier id: clients.keySet()) { - transmit(new TreatmentTypeRequest(id, event.getTreatmentType())); - } - } - else { - logger.warning("Ignoring new treatment request from id: " + event.getId()); - } - } - }); addEventProcessor(new EventTypeProcessor<BeginRoundRequest>(BeginRoundRequest.class) { public void handle(BeginRoundRequest event) { if (event.getId().equals(facilitatorId)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |