[virtualcommons-svn] commit/foraging: alllee: fixing gap size between strategies
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-03-08 00:17:11
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/b201f24e3dba/ changeset: b201f24e3dba user: alllee date: 2012-03-08 01:17:10 summary: fixing gap size between strategies affected #: 1 file diff -r aacbab9ce97f6c0c6a47f509adbfbb557466701f -r b201f24e3dba4671bfd907673506e8c78bbc2e97 src/main/java/edu/asu/commons/foraging/ui/VotingForm.java --- a/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java +++ b/src/main/java/edu/asu/commons/foraging/ui/VotingForm.java @@ -45,6 +45,8 @@ */ public class VotingForm extends JPanel { + private static final int DEFAULT_STRATEGY_GAP_SIZE = 80; + private static final long serialVersionUID = 3871660663519284024L; public final static String NAME = "Strategy voting form"; @@ -77,7 +79,7 @@ horizontalGroup.addGroup(horizontalButtonParallelGroup); GroupLayout.SequentialGroup verticalGroup = groupLayout.createSequentialGroup(); - boolean imposedStrategyEnabled = client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); + boolean imposedStrategyEnabled = (client != null) && client.getCurrentRoundConfiguration().isImposedStrategyEnabled(); // XXX: this is certainly what Rawlins was warning against String rightColumnHeader = votingResults.isEmpty() ? (imposedStrategyEnabled) ? "" : "Select" @@ -91,7 +93,7 @@ horizontalLabelParallelGroup.addComponent(strategyHeaderLabel); verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(strategyHeaderLabel).addGap(20).addComponent(rightHeaderLabel)); - Dimension labelDimension = new Dimension(800, 100); + Dimension labelDimension = new Dimension(1000, 100); for (ForagingStrategy strategy: strategies) { JLabel ruleLabel = new JLabel("<html>" + strategy.getDescription() + "</html>"); @@ -115,7 +117,7 @@ component = new JLabel(String.valueOf(numberOfVotes == null ? 0 : numberOfVotes)); } horizontalButtonParallelGroup.addComponent(component); - verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addComponent(component)); + verticalGroup.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE).addComponent(ruleLabel).addGap(DEFAULT_STRATEGY_GAP_SIZE).addComponent(component)); } if (votingResults.isEmpty()) { JButton submitButton = getSubmitButton(); 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. |