|
From: <ste...@us...> - 2010-07-25 19:27:27
|
Revision: 1359
http://rails.svn.sourceforge.net/rails/?rev=1359&view=rev
Author: stefanfrey
Date: 2010-07-25 19:27:21 +0000 (Sun, 25 Jul 2010)
Log Message:
-----------
Changed tooltip implementation for bonuses
Modified Paths:
--------------
trunk/18xx/rails/ui/swing/hexmap/GUIHex.java
Modified: trunk/18xx/rails/ui/swing/hexmap/GUIHex.java
===================================================================
--- trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2010-07-25 19:15:33 UTC (rev 1358)
+++ trunk/18xx/rails/ui/swing/hexmap/GUIHex.java 2010-07-25 19:27:21 UTC (rev 1359)
@@ -668,20 +668,15 @@
private String bonusToolTipText(List<RevenueBonusTemplate> bonuses) {
StringBuffer tt = new StringBuffer();
if (bonuses != null) {
- if (bonuses.size() == 1) {
- tt.append("<br>Bonus:");
- tt.append(bonuses.get(0).getToolTip());
- } else {
- Set<String> bonusNames = new HashSet<String>();
- for (RevenueBonusTemplate bonus:bonuses) {
+ Set<String> bonusNames = new HashSet<String>();
+ for (RevenueBonusTemplate bonus:bonuses) {
+ if (bonus.getName() == null) {
+ tt.append("<br>Bonus:");
+ tt.append(bonus.getToolTip());
+ } else if (!bonusNames.contains(bonus.getName())) {
+ tt.append("<br>Bonus:" + bonus.getName());
bonusNames.add(bonus.getName());
}
- tt.append("<br>Bonus:");
- int i=0;
- for (String bonusName:bonusNames) {
- if (i++ != 0) tt.append(",");
- tt.append(bonusName);
- }
}
}
return tt.toString();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|