[virtualcommons-svn] SF.net SVN: virtualcommons:[321] irrigation/trunk/src/main
Status: Beta
Brought to you by:
alllee
|
From: <al...@us...> - 2009-10-22 17:08:22
|
Revision: 321
http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=321&view=rev
Author: alllee
Date: 2009-10-22 17:08:13 +0000 (Thu, 22 Oct 2009)
Log Message:
-----------
updating progress bar color for windows boxes (need to find a cross platform way to do this for both) and updated general instructions
Modified Paths:
--------------
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/CanalAnimationPanel.java
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/CanalAnimationPanel.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/CanalAnimationPanel.java 2009-10-22 08:20:12 UTC (rev 320)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/CanalAnimationPanel.java 2009-10-22 17:08:13 UTC (rev 321)
@@ -67,7 +67,7 @@
private void initialize() {
this.setPreferredSize(new Dimension(1098,150));
this.setLayout(new GridBagLayout());
- this.setBackground(Color.white);
+ this.setBackground(Color.WHITE);
//initializing the constructor for Gates
for(int i=0;i<6;i++){
gate[i] = new Gate(totalContributedBandwidth,i);
@@ -113,8 +113,8 @@
protected void paintComponent(Graphics graphics){
+ super.paintComponent(graphics); // needed!
updateGUI();
- super.paintComponent(graphics); // needed!
Graphics2D graphics2D = (Graphics2D)graphics;
graphics2D.setColor(Color.BLUE);
graphics2D.fillRect(0,0,100,100);
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java 2009-10-22 08:20:12 UTC (rev 320)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java 2009-10-22 17:08:13 UTC (rev 321)
@@ -435,8 +435,8 @@
clientData.getMaximumTokenInvestment(),
clientData.getInvestedTokens(),
clientData.getUninvestedTokens(),
+ clientData.getTokensEarnedFromWaterCollected(),
clientData.getAllTokensEarnedThisRound(),
- clientData.getTokensEarnedFromWaterCollected(),
clientData.getTotalDollarsEarnedThisRound(),
clientData.getTotalDollarsEarned() + showUpBonus
));
@@ -604,7 +604,7 @@
int clientCapacity = roundConfiguration.getMaximumClientFlowCapacity();
instructionsBuilder.append(
- String.format("<p><b>The irrigation capacity is %d and the maximum available water to you is %d cfps.</b></p>",
+ String.format("<p><b>The irrigation capacity is %d cfps and the maximum amount of water you can collect per second is %d cfps.</b></p>",
irrigationCapacity,
Math.min(irrigationCapacity, clientCapacity)
));
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java 2009-10-22 08:20:12 UTC (rev 320)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java 2009-10-22 17:08:13 UTC (rev 321)
@@ -402,11 +402,15 @@
return waterCollectedToTokensScrollPane;
}
- private Color getProgressBarColor(int timeLeft) {
+ private void setProgressBarColor(int timeLeft) {
if (timeLeft < 10) {
- return Color.RED;
+// timeLeftProgressBar.setForeground( Color.RED );
+ timeLeftProgressBar.setBackground( Color.RED );
+// return Color.RED;
}
- return Color.BLACK;
+ else {
+ timeLeftProgressBar.setBackground( Color.GREEN );
+ }
}
/**
* Should be invoked every second throughout the experiment, from a ClientUpdateEvent sent by the server.
@@ -418,7 +422,7 @@
String timeLeftString = String.format("%d sec", timeLeft);
timeLeftProgressBar.setValue( timeLeft );
timeLeftProgressBar.setString(timeLeftString);
- timeLeftProgressBar.setForeground( getProgressBarColor(timeLeft) );
+ setProgressBarColor(timeLeft);
for (final ClientData clientData : clientDataModel.getClientDataMap().values()) {
if (clientData.isGateOpen()) {
canalPanel.openGate(clientData.getPriority());
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml 2009-10-22 08:20:12 UTC (rev 320)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml 2009-10-22 17:08:13 UTC (rev 321)
@@ -332,36 +332,33 @@
<entry key="general-instructions4">
<![CDATA[
<h3>Growing crops</h3>
-<p>There are FIVE participants in each group, each of which is randomly assigned to
-one of the five positions, A, B, C, D or E. Below is a schematic representing the
-irrigation system. Water comes from the box to the left and the five players
-are located from upstream (leftmost) to downstream (rightmost) accordingly. To
-illustrate the game, assume you are in position B. The black lines represent "gates"
-that you control (i.e, open and close).
-<p>
-<img src="http://dev.commons.asu.edu/irrigation/images/irrigation-example-screenshot.jpg"><br><br>
+<p>There are <b>five</b> participants in each group, each of which is randomly assigned to
+one of the five positions, A, B, C, D or E. Below is a screenshot of the
+graphical interface representation of the irrigation system. Water comes from
+the box to the left and the five players are located from upstream (leftmost)
+to downstream (rightmost) accordingly. To illustrate, assume you are in
+position C. The black lines represent "gates" that you open and close by
+clicking on the large button on the lower left corner of the screen.
+Each round consists of 50 seconds and the amount of time left in the
+experiment is indicated by a bar at the top of the screen.
</p>
-Each round will take 50 seconds and the amount of time left in the experiment
-is indicated at the top of the screen.
+<img src="http://dev.commons.asu.edu/irrigation/images/game-interface-screenshot.jpg">
+<br><br>
<p>
-<img src = "http://dev.commons.asu.edu/irrigation/images/time-remaining-screenshot.jpg"><br>
+You can irrigate your field during the round by opening your gate. Your
+earnings depend on the amount of water you can draw onto your fields and will
+be explained in more detail on the next page. The speed at which you can grow
+a crop depends on the amount of water available to you <b>at the time that you
+open your gate</b>. The maximum flow capacity of the main canal shared by A,
+B, C, D, and E is forty cubic feet per second.
</p>
<p>
-During this round you can irrigate your field. Your earnings depend on the amount
-of water you can draw onto your fields and will be explained in more detail in the
-next screen. The speed at which you can grow a crop depends on the amount of water
-available to you <b>at the time that you open your gate</b>. The maximum flow
-capacity of the main canal shared by A, B, C, D, and E is forty cubic feet per second.
+The maximum amount of water that can flow through your gate when it is opened
+is 25 cubic feet per second. If other people are using the canal, the water
+flow available to you might be less, and it may take longer to get water to
+your field since you are also limited by the amount of water that is flowing
+through the shared canal.
</p>
-<p>
-The maximum capacity that can flow through your gate when it is opened is
-twenty-five cubic feet per second. If other people are using the canal, the water
-flow available to you might be less, and it may take longer to get water to your
-field (you are limited by the flow capacity of the shared canal).
-</p>
-<p>
-The water flow capacity available for your field is shown as a number.
-</p>
]]>
</entry>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|