[virtualcommons-svn] commit/irrigation: alllee: minor UI enhancements and configuration fixes
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-02-03 08:31:03
|
1 new commit in irrigation: https://bitbucket.org/virtualcommons/irrigation/changeset/7eddd3cd0a9c/ changeset: 7eddd3cd0a9c user: alllee date: 2012-02-03 09:30:45 summary: minor UI enhancements and configuration fixes affected #: 7 files diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 build.xml --- a/build.xml +++ b/build.xml @@ -159,6 +159,7 @@ </target><target name='deploy'> + <fail message="Please verify that server.address is properly set in build.properties" unless="server.address"/><antcall target='deploy-to'><param name='deploy.dir' value='${web.dir}'/></antcall> diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 pom.xml --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ <dependency><groupId>edu.asu.commons</groupId><artifactId>csidex</artifactId> - <version>0.3-SNAPSHOT</version> + <version>0.4-SNAPSHOT</version></dependency><dependency><groupId>org.jfree</groupId> diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java --- a/src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java +++ b/src/main/java/edu/asu/commons/irrigation/client/ChatPanel.java @@ -123,7 +123,8 @@ StyleContext.DEFAULT_STYLE); // Style regularStyle = styledDocument.addStyle("regular", // defaultStyle); - StyleConstants.setFontFamily(defaultStyle, "Helvetica"); + StyleConstants.setFontSize(defaultStyle, 16); + StyleConstants.setFontFamily(defaultStyle, UserInterfaceUtils.getDefaultFont().getFamily()); StyleConstants.setBold(styledDocument.addStyle("bold", defaultStyle), true); StyleConstants.setItalic(styledDocument.addStyle("italic", defaultStyle), true); } @@ -145,6 +146,7 @@ messageWindow.setEditable(false); messageWindow.setBackground(Color.WHITE); messageScrollPane = new JScrollPane(messageWindow); +// UserInterfaceUtils.addStyles(messageWindow, 16); addStylesToMessageWindow(); textEntryPanel = new TextEntryPanel(); chatInstructionsPane = UserInterfaceUtils.createInstructionsEditorPane(); @@ -158,7 +160,7 @@ public void displayMessage(String chatHandle, String message) { final StyledDocument document = messageWindow.getStyledDocument(); if (!chatHandle.endsWith(":")) { - chatHandle = chatHandle.concat(":"); + chatHandle = chatHandle.concat(": "); } try { document.insertString(0, chatHandle, document.getStyle("bold")); diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 src/main/java/edu/asu/commons/irrigation/client/GamePanel.java --- a/src/main/java/edu/asu/commons/irrigation/client/GamePanel.java +++ b/src/main/java/edu/asu/commons/irrigation/client/GamePanel.java @@ -30,7 +30,9 @@ /** * $Id$ * - * Primary game interface window for the irrigation game. + * Primary in-round game interface window for the irrigation game. Displays the + * + * FIXME: refactor layout * * @author <a href='mailto:All...@as...'>Allen Lee</a>, Sanket Joshi * @version $Rev$ diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java --- a/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java +++ b/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java @@ -98,9 +98,17 @@ return isFirstRound() || getBooleanProperty("reset-infrastructure-efficiency", false); } + /** + * Returns the instructions for this round. If undefined at the round level it uses default instructions at the parent ServerConfiguration level. + */ public String getInstructions() { - return getStringProperty("instructions", getParentConfiguration().getSameAsPreviousRoundInstructions()); - } + ST template = createStringTemplate(getProperty("instructions", getParentConfiguration().getSameAsPreviousRoundInstructions())); + // FIXME: probably should just lift these out into methods on RoundConfiguration + // and refer to them as self.durationInMinutes or self.dollarsPerTokenCurrencyString, etc. + template.add("duration", inMinutes(getDuration()) + " minutes"); + template.add("dollarsPerToken", toCurrencyString(getDollarsPerToken())); + return template.render(); + } public boolean shouldDisplayGroupTokens() { return getBooleanProperty("display-group-tokens"); diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java --- a/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java +++ b/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java @@ -39,15 +39,15 @@ } public String getLogFileDestination() { - return assistant.getStringProperty("log", DEFAULT_LOG_FILE_DESTINATION); + return getStringProperty("log", DEFAULT_LOG_FILE_DESTINATION); } public String getPersistenceDirectory() { - return assistant.getStringProperty("save-dir", "data"); + return getStringProperty("save-dir", "data"); } public boolean shouldUpdateFacilitator() { - return assistant.getBooleanProperty("update-facilitator"); + return getBooleanProperty("update-facilitator"); } @Override @@ -73,19 +73,19 @@ } public boolean isUndisruptedFlowRequired(){ - return assistant.getBooleanProperty("undisrupted-flow-required", false); + return getBooleanProperty("undisrupted-flow-required", false); } public String getUndisruptedFlowInstructions() { - return assistant.getProperty("undisrupted-flow-instructions", ""); + return getProperty("undisrupted-flow-instructions", ""); } public double getShowUpPayment() { - return assistant.getDoubleProperty("showup-payment", 5.0d); + return getDoubleProperty("showup-payment", 5.0d); } public String getInitialInstructions() { - ST template = createStringTemplate(assistant.getProperty("initial-instructions")); + ST template = createStringTemplate(getProperty("initial-instructions")); template.groupThatCreatedThisInstance.registerRenderer(Number.class, new NumberRenderer()); NumberFormat formatter = NumberFormat.getCurrencyInstance(); template.add("showUpPayment", formatter.format(getShowUpPayment())); @@ -95,11 +95,11 @@ } public String getChatInstructions() { - return createStringTemplate(assistant.getProperty("chat-instructions")).render(); + return createStringTemplate(getProperty("chat-instructions")).render(); } public String getChatDurationInMinutes() { - long minutes = assistant.inMinutes(getChatDuration()); + long minutes = inMinutes(getChatDuration()); return String.format("%d minute%s", minutes, (minutes > 1) ? "s" : ""); } @@ -124,7 +124,7 @@ } public double getQuizCorrectAnswerReward() { - return assistant.getDoubleProperty("quiz-correct-answer-reward", DEFAULT_QUIZ_CORRECT_ANSWER_REWARD); + return getDoubleProperty("quiz-correct-answer-reward", DEFAULT_QUIZ_CORRECT_ANSWER_REWARD); } public double getMaximumQuizEarnings() { @@ -132,15 +132,15 @@ } public String getWelcomeInstructions() { - return assistant.getProperty("welcome-instructions"); + return getProperty("welcome-instructions"); } public int getNumberOfQuizQuestions() { - return assistant.getIntProperty("numberOfQuizQuestions", 6); + return getIntProperty("numberOfQuizQuestions", 6); } public Map<String, String> getQuizAnswers() { - Properties properties = assistant.getProperties(); + Properties properties = getProperties(); Map<String, String> answers = new HashMap<String, String>(); for (int i = 1; properties.containsKey("q" + i); i++) { String key = "q" + i; @@ -156,48 +156,48 @@ } public String getQuizQuestion(int pageNumber) { - return assistant.getProperty("general-instructionsq" + pageNumber); + return getProperty("general-instructionsq" + pageNumber); } public String getQuizPage(int pageNumber) { - return assistant.getProperty("quiz-page"+pageNumber); + return getProperty("quiz-page"+pageNumber); } public String getWaterCollectedToTokensTable() { - return assistant.getProperty("water-collected-to-tokens-table"); + return getProperty("water-collected-to-tokens-table"); } public String getFinalInstructions() { - return assistant.getProperty("final-instructions", "<b>The experiment is now over. Thanks for participating!</b>"); + return getProperty("final-instructions", "<b>The experiment is now over. Thanks for participating!</b>"); } public String getInvestmentInstructions() { - return assistant.getProperty("investment-instructions"); + return getProperty("investment-instructions"); } public int getNumberOfQuizPages() { - return assistant.getIntProperty("question-pages", 2); + return getIntProperty("quiz-pages", 2); } public int getChatDuration() { - return assistant.getIntProperty("chat-duration", 60); + return getIntProperty("chat-duration", 60); } public String getGameScreenshotInstructions() { - return assistant.getProperty("game-screenshot-instructions"); + return getProperty("game-screenshot-instructions"); } public String getSameAsPreviousRoundInstructions() { - return createStringTemplate(assistant.getProperty("same-as-previous-round-instructions")).render(); + return createStringTemplate(getProperty("same-as-previous-round-instructions")).render(); } public String getClientDebriefingTemplate() { - return assistant.getProperty("client-debriefing"); + return getProperty("client-debriefing"); } public double getDollarsPerToken() { - return assistant.getDoubleProperty("dollars-per-token", DEFAULT_DOLLARS_PER_TOKEN); + return getDoubleProperty("dollars-per-token", DEFAULT_DOLLARS_PER_TOKEN); } public static int getTokensEarned(int waterCollected) { diff -r cd8b8aba3bfd94931c8ec1b1d214a5d12e2b9a8e -r 7eddd3cd0a9c4aaaec33711bd55df034e0918ce6 src/main/resources/configuration/asu/2011/pretest/irrigation.xml --- a/src/main/resources/configuration/asu/2011/pretest/irrigation.xml +++ b/src/main/resources/configuration/asu/2011/pretest/irrigation.xml @@ -27,6 +27,7 @@ <entry key="round20">round20.xml</entry><entry key="round21">round21.xml</entry> +<entry key='quiz-pages'>2</entry><entry key="wait-for-participants">true</entry><entry key="number-of-rounds">22</entry> Repository URL: https://bitbucket.org/virtualcommons/irrigation/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |