[virtualcommons-svn] commit/foraging: alllee: fixes issue 6 by changing the instructions JScrollPan
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2011-09-01 21:20:30
|
1 new changeset in foraging: http://bitbucket.org/virtualcommons/foraging/changeset/32a91b64094d/ changeset: 32a91b64094d user: alllee date: 2011-09-01 23:21:01 summary: fixes issue 6 by changing the instructions JScrollPane ScrollMode to BACKINGSTORE_SCROLL_MODE instead of the default BLIT_SCROLL_MODE affected #: 2 files (1.5 KB) --- a/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java Thu Sep 01 14:12:16 2011 -0700 +++ b/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java Thu Sep 01 14:21:01 2011 -0700 @@ -30,6 +30,7 @@ import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTextPane; +import javax.swing.JViewport; import javax.swing.SwingUtilities; import javax.swing.Timer; import javax.swing.text.Style; @@ -326,7 +327,7 @@ } private void setInstructions(String s) { - System.err.println("Setting instructions to " + s); +// System.err.println("Setting instructions to " + s); instructionsEditorPane.setText(s); instructionsEditorPane.repaint(); getPanel().repaint(); @@ -355,6 +356,7 @@ instructionsEditorPane = createInstructionsEditorPane(); instructionsScrollPane = new JScrollPane(instructionsEditorPane); instructionsScrollPane.setDoubleBuffered(true); + instructionsScrollPane.getViewport().setScrollMode(JViewport.BACKINGSTORE_SCROLL_MODE); instructionsScrollPane.setName(INSTRUCTIONS_PANEL_NAME); add(instructionsScrollPane); --- a/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java Thu Sep 01 14:12:16 2011 -0700 +++ b/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java Thu Sep 01 14:21:01 2011 -0700 @@ -120,36 +120,9 @@ } private JMenuBar createMenu() { - JMenu menu = new JMenu("Experiment"); menuBar = new JMenuBar(); - - menu.setMnemonic(KeyEvent.VK_E); - - startExperimentMenuItem = new JMenuItem("Start"); - startExperimentMenuItem.setMnemonic(KeyEvent.VK_S); - startExperimentMenuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - facilitator.sendBeginExperimentRequest(); - } - }); - menu.add(startExperimentMenuItem); - - stopExperimentMenuItem = new JMenuItem("Stop"); - stopExperimentMenuItem.setMnemonic(KeyEvent.VK_O); - stopExperimentMenuItem.setEnabled(false); - stopExperimentMenuItem.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - throw new UnsupportedOperationException("FIXME: Cannot stop experiments right now"); -// facilitator.sendStopExperimentRequest(); - //loadConfigurationMenu.setEnabled(true); -// displayInstructions(); - } - }); - menu.add(stopExperimentMenuItem); - menuBar.add(menu); - //Round menu - menu = new JMenu("Round"); + JMenu menu = new JMenu("Round"); menu.setMnemonic(KeyEvent.VK_R); startChatMenuItem = new JMenuItem("Start chat"); @@ -208,19 +181,10 @@ menuItem.setMnemonic(KeyEvent.VK_L); menuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - new ConfigurationDialog(facilitator, (facilitator - .isExperimentRunning() || facilitator.isReplaying())); + new ConfigurationDialog(facilitator, (facilitator.isExperimentRunning() || facilitator.isReplaying())); } }); menu.add(menuItem); - - /* JMenuItem treatment = new JMenuItem("Treatment"); - treatmnet.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - new - } - })*/ - menuBar.add(menu); return menuBar; Repository URL: https://bitbucket.org/virtualcommons/foraging/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |