mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
UI: fixed #4329 - errors on card selection in linux (debian)
This commit is contained in:
parent
70c08a2d81
commit
050a70b7db
1 changed files with 21 additions and 19 deletions
|
|
@ -35,28 +35,30 @@ public final class ManaSymbolsCellRenderer extends DefaultTableCellRenderer {
|
||||||
String manaCost = (String)value;
|
String manaCost = (String)value;
|
||||||
manaPanel.removeAll();
|
manaPanel.removeAll();
|
||||||
manaPanel.setLayout(new BoxLayout(manaPanel, BoxLayout.X_AXIS));
|
manaPanel.setLayout(new BoxLayout(manaPanel, BoxLayout.X_AXIS));
|
||||||
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
if(manaCost != null){
|
||||||
while (tok.hasMoreTokens()) {
|
StringTokenizer tok = new StringTokenizer(manaCost, " ");
|
||||||
String symbol = tok.nextToken();
|
while (tok.hasMoreTokens()) {
|
||||||
|
String symbol = tok.nextToken();
|
||||||
|
|
||||||
JLabel symbolLabel = new JLabel();
|
JLabel symbolLabel = new JLabel();
|
||||||
//symbolLabel.setBorder(new LineBorder(new Color(150, 150, 150))); // debug
|
//symbolLabel.setBorder(new LineBorder(new Color(150, 150, 150))); // debug
|
||||||
symbolLabel.setBorder(new EmptyBorder(0, symbolHorizontalMargin,0, 0));
|
symbolLabel.setBorder(new EmptyBorder(0, symbolHorizontalMargin,0, 0));
|
||||||
|
|
||||||
BufferedImage image = ManaSymbols.getSizedManaSymbol(symbol, symbolWidth);
|
BufferedImage image = ManaSymbols.getSizedManaSymbol(symbol, symbolWidth);
|
||||||
if (image != null){
|
if (image != null){
|
||||||
// icon
|
// icon
|
||||||
symbolLabel.setIcon(new ImageIcon(image));
|
symbolLabel.setIcon(new ImageIcon(image));
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
// text
|
// text
|
||||||
symbolLabel.setText("{" + symbol + "}");
|
symbolLabel.setText("{" + symbol + "}");
|
||||||
symbolLabel.setOpaque(baseLabel.isOpaque());
|
symbolLabel.setOpaque(baseLabel.isOpaque());
|
||||||
symbolLabel.setForeground(baseLabel.getForeground());
|
symbolLabel.setForeground(baseLabel.getForeground());
|
||||||
symbolLabel.setBackground(baseLabel.getBackground());
|
symbolLabel.setBackground(baseLabel.getBackground());
|
||||||
|
}
|
||||||
|
|
||||||
|
manaPanel.add(symbolLabel);
|
||||||
}
|
}
|
||||||
|
|
||||||
manaPanel.add(symbolLabel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return manaPanel;
|
return manaPanel;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue