add rarity information to card details panel set code label tooltip

This commit is contained in:
myk
2013-02-23 07:31:22 +00:00
parent 20d0b5122a
commit 2de05e3a7b

View File

@@ -183,25 +183,17 @@ public class CardDetailPanel extends FPanel implements CardContainer {
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
}
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));
String set = card.getCurSetCode();
this.setInfoLabel.setText(set);
if (null != set && !set.isEmpty()) {
CardEdition edition = Singletons.getModel().getEditions().get(set);
if (null != edition) {
this.setInfoLabel.setToolTipText(edition.getName());
}
}
if (null == edition) {
setInfoLabel.setToolTipText(card.getRarity().name());
} else {
this.nameCostLabel.setText("Morph");
this.typeLabel.setText("Creature");
}
if (card.isCreature()) {
this.powerToughnessLabel.setText(card.getNetAttack() + " / " + card.getNetDefense());
setInfoLabel.setToolTipText(String.format("%s (%s)", edition.getName(), card.getRarity().name()));
}
this.idLabel.setText("Card ID " + card.getUniqueNumber());
if (!this.setInfoLabel.getText().equals("")) {
this.setInfoLabel.setOpaque(true);
switch(card.getRarity()) {
case Uncommon:
@@ -235,11 +227,19 @@ public class CardDetailPanel extends FPanel implements CardContainer {
this.setInfoLabel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
break;
}
// cdLabel7.setText(card.getCurSetCode());
}
} else {
this.nameCostLabel.setText("Morph");
this.typeLabel.setText("Creature");
}
// fill the card text
if (card.isCreature()) {
this.powerToughnessLabel.setText(card.getNetAttack() + " / " + card.getNetDefense());
}
this.idLabel.setText("Card ID " + card.getUniqueNumber());
// fill the card text
this.cdArea.setText(composeCardText(card, canShowThis));
SwingUtilities.invokeLater(new Runnable() {