diff --git a/.gitattributes b/.gitattributes index f7bf62cfe9a..ec3e3ed9b76 100644 --- a/.gitattributes +++ b/.gitattributes @@ -8493,6 +8493,7 @@ src/forge/deck/generate/GenerateThemeDeck.java -text svneol=native#text/plain src/forge/error/ErrorViewer.java svneol=native#text/plain src/forge/error/ExceptionHandler.java -text svneol=native#text/plain src/forge/gui/ForgeAction.java svneol=native#text/plain +src/forge/gui/ForgeFontConstants.java svneol=native#text/plain src/forge/gui/GuiUtils.java svneol=native#text/plain src/forge/gui/ListChooser.java svneol=native#text/plain src/forge/gui/MultiLineLabel.java svneol=native#text/plain @@ -8540,7 +8541,6 @@ src/forge/quest/data/pet/QuestPetHound.java svneol=native#text/plain src/forge/quest/data/pet/QuestPetManager.java svneol=native#text/plain src/forge/quest/data/pet/QuestPetPlant.java svneol=native#text/plain src/forge/quest/data/pet/QuestPetWolf.java svneol=native#text/plain -src/forge/quest/gui/FontConstants.java svneol=native#text/plain src/forge/quest/gui/QuestAbstractPanel.java svneol=native#text/plain src/forge/quest/gui/QuestFrame.java svneol=native#text/plain src/forge/quest/gui/bazaar/QuestBazaarItem.java svneol=native#text/plain diff --git a/src/forge/quest/gui/FontConstants.java b/src/forge/gui/ForgeFontConstants.java similarity index 72% rename from src/forge/quest/gui/FontConstants.java rename to src/forge/gui/ForgeFontConstants.java index 0adfec19e0b..1d65a4ff502 100644 --- a/src/forge/quest/gui/FontConstants.java +++ b/src/forge/gui/ForgeFontConstants.java @@ -1,26 +1,14 @@ -/** - * FontConstants.java - * - * Created on 10.02.2011 - */ - -package forge.quest.gui; - +package forge.gui; import java.awt.Font; - /** - *
- * The class FontConstants. - *
- * - * @version V0.0 10.02.2011 - * @author Clemens Koza + * A replacement FontConstants to allow backward-compatibility with JRE 1.5 */ -public class FontConstants { + +public class ForgeFontConstants { public static final String DIALOG, DIALOG_INPUT, MONOSPACED, SANS_SERIF, SERIF; - + static { String dialog = "Dialog"; String dialogInput = "DialogInput"; @@ -33,8 +21,9 @@ public class FontConstants { monospaced = Font.MONOSPACED; sansSerif = Font.SANS_SERIF; serif = Font.SERIF; - } catch(NoSuchFieldError ex) {} - + } catch (NoSuchFieldError ignored) { + } + DIALOG = dialog; DIALOG_INPUT = dialogInput; MONOSPACED = monospaced; diff --git a/src/forge/quest/gui/bazaar/QuestBazaarItem.java b/src/forge/quest/gui/bazaar/QuestBazaarItem.java index 38faa8b325d..e97cb9d8b73 100644 --- a/src/forge/quest/gui/bazaar/QuestBazaarItem.java +++ b/src/forge/quest/gui/bazaar/QuestBazaarItem.java @@ -3,10 +3,10 @@ package forge.quest.gui.bazaar; import forge.AllZone; +import forge.gui.ForgeFontConstants; import forge.gui.GuiUtils; import forge.gui.MultiLineLabel; import forge.quest.data.bazaar.QuestStallPurchasable; -import forge.quest.gui.FontConstants; import javax.swing.*; import javax.swing.border.CompoundBorder; @@ -44,13 +44,13 @@ public class QuestBazaarItem { iconPanel.add(iconLabel, BorderLayout.NORTH); JLabel nameLabel = new JLabel(item.getPurchaseName()); - nameLabel.setFont(new Font(FontConstants.SANS_SERIF, Font.BOLD, 14)); + nameLabel.setFont(new Font(ForgeFontConstants.SANS_SERIF, Font.BOLD, 14)); JLabel descriptionLabel = new MultiLineLabel("" + item.getPurchaseDescription()+ ""); - descriptionLabel.setFont(new Font(FontConstants.SANS_SERIF, Font.PLAIN, 12)); + descriptionLabel.setFont(new Font(ForgeFontConstants.SANS_SERIF, Font.PLAIN, 12)); JLabel priceLabel = new JLabel("Cost: " + item.getPrice() + " credits"); - priceLabel.setFont(new Font(FontConstants.SANS_SERIF, Font.PLAIN, 12)); + priceLabel.setFont(new Font(ForgeFontConstants.SANS_SERIF, Font.PLAIN, 12)); JButton purchaseButton = new JButton("Buy"); diff --git a/src/forge/quest/gui/main/QuestMainPanel.java b/src/forge/quest/gui/main/QuestMainPanel.java index fea32f4ba50..9610ded26d2 100644 --- a/src/forge/quest/gui/main/QuestMainPanel.java +++ b/src/forge/quest/gui/main/QuestMainPanel.java @@ -2,11 +2,11 @@ package forge.quest.gui.main; import forge.*; +import forge.gui.ForgeFontConstants; import forge.gui.GuiUtils; import forge.quest.data.QuestBattleManager; import forge.quest.data.QuestData; import forge.quest.data.item.QuestItemZeppelin; -import forge.quest.gui.FontConstants; import forge.quest.gui.QuestAbstractPanel; import forge.quest.gui.QuestFrame; @@ -91,7 +91,7 @@ public class QuestMainPanel extends QuestAbstractPanel { JPanel northPanel = new JPanel(); JLabel modeLabel; JLabel difficultyLabel;//Create labels at the top - titleLabel.setFont(new Font(FontConstants.DIALOG, Font.PLAIN, 28)); + titleLabel.setFont(new Font(ForgeFontConstants.DIALOG, Font.PLAIN, 28)); titleLabel.setAlignmentX(LEFT_ALIGNMENT); northPanel.setLayout(new BoxLayout(northPanel, BoxLayout.Y_AXIS)); northPanel.add(titleLabel); @@ -139,7 +139,7 @@ public class QuestMainPanel extends QuestAbstractPanel { } }); eastComponents.add(cardShopButton); - cardShopButton.setFont(new Font(FontConstants.SANS_SERIF, Font.PLAIN, 20)); + cardShopButton.setFont(new Font(ForgeFontConstants.SANS_SERIF, Font.PLAIN, 20)); JButton bazaarButton = null; if (questData.getMode().equals(forge.quest.data.QuestData.FANTASY)) { @@ -151,7 +151,7 @@ public class QuestMainPanel extends QuestAbstractPanel { } }); eastComponents.add(bazaarButton); - bazaarButton.setFont(new Font(FontConstants.SANS_SERIF, Font.PLAIN, 20)); + bazaarButton.setFont(new Font(ForgeFontConstants.SANS_SERIF, Font.PLAIN, 20)); } @@ -161,7 +161,7 @@ public class QuestMainPanel extends QuestAbstractPanel { } }); eastComponents.add(questButton); - questButton.setFont(new Font(FontConstants.SANS_SERIF, Font.BOLD, 18)); + questButton.setFont(new Font(ForgeFontConstants.SANS_SERIF, Font.BOLD, 18)); questButton.setPreferredSize(new Dimension(0, 60)); @@ -171,7 +171,7 @@ public class QuestMainPanel extends QuestAbstractPanel { } }); - playButton.setFont(new Font(FontConstants.DIALOG, Font.BOLD, 28)); + playButton.setFont(new Font(ForgeFontConstants.DIALOG, Font.BOLD, 28)); playButton.setPreferredSize(new Dimension(0, 100)); @@ -188,14 +188,14 @@ public class QuestMainPanel extends QuestAbstractPanel { if (questData.getMode().equals(forge.quest.data.QuestData.FANTASY)) { panel.add(this.lifeLabel); - this.lifeLabel.setFont(new Font(FontConstants.DIALOG, Font.BOLD, 14)); + this.lifeLabel.setFont(new Font(ForgeFontConstants.DIALOG, Font.BOLD, 14)); this.lifeLabel.setIcon(GuiUtils.getResizedIcon(GuiUtils.getIconFromFile("Life.png"), 30, 30)); } GuiUtils.addGap(panel); panel.add(this.creditsLabel); this.creditsLabel.setIcon(GuiUtils.getResizedIcon(GuiUtils.getIconFromFile("CoinStack.png"), 30, 30)); - this.creditsLabel.setFont(new Font(FontConstants.DIALOG, Font.BOLD, 14)); + this.creditsLabel.setFont(new Font(ForgeFontConstants.DIALOG, Font.BOLD, 14)); GuiUtils.addGap(panel, 10); panel.add(cardShopButton); @@ -207,7 +207,7 @@ public class QuestMainPanel extends QuestAbstractPanel { panel.add(Box.createVerticalGlue()); panel.add(questButton); - this.nextQuestLabel.setFont(new Font(FontConstants.DIALOG, Font.PLAIN, 11)); + this.nextQuestLabel.setFont(new Font(ForgeFontConstants.DIALOG, Font.PLAIN, 11)); panel.add(nextQuestLabel); GuiUtils.addGap(panel);