1
0

Menu font name constant

This commit is contained in:
Victor 2014-03-25 12:57:12 +02:00
parent a0538d97d3
commit b03e58b3e0
3 changed files with 6 additions and 3 deletions

View File

@ -13,6 +13,7 @@ public final class Constants {
public static final int WIDTH = 800, HEIGHT = 600; public static final int WIDTH = 800, HEIGHT = 600;
public static final boolean RESIZABLE = false; public static final boolean RESIZABLE = false;
public static final Dimension SCREEN_DIMENSION = new Dimension(WIDTH, HEIGHT); public static final Dimension SCREEN_DIMENSION = new Dimension(WIDTH, HEIGHT);
public static final String MENU_FONT_NAME = "Stencil";
public static final Font GAME_FONT = new Font("Times New Roman", Font.PLAIN, 24); public static final Font GAME_FONT = new Font("Times New Roman", Font.PLAIN, 24);
// Parameters // Parameters

View File

@ -1,5 +1,6 @@
package com.annimon.turrets; package com.annimon.turrets;
import static com.annimon.turrets.Constants.MENU_FONT_NAME;
import static com.annimon.turrets.Constants.SCREEN_DIMENSION; import static com.annimon.turrets.Constants.SCREEN_DIMENSION;
import com.annimon.turrets.util.GuiUtil; import com.annimon.turrets.util.GuiUtil;
import com.annimon.turrets.util.Prefs; import com.annimon.turrets.util.Prefs;
@ -36,7 +37,7 @@ public final class MenuPanel extends JPanel {
// Init menu list // Init menu list
menuList = new JList<>(MENU_ITEMS); menuList = new JList<>(MENU_ITEMS);
menuList.setOpaque(false); menuList.setOpaque(false);
menuList.setFont(new Font("Stencil", Font.BOLD, 42)); menuList.setFont(new Font(MENU_FONT_NAME, Font.BOLD, 42));
menuList.setForeground(Color.GRAY); menuList.setForeground(Color.GRAY);
menuList.setBackground(Color.BLACK); menuList.setBackground(Color.BLACK);
menuList.setSelectionBackground(Color.BLACK); menuList.setSelectionBackground(Color.BLACK);
@ -53,7 +54,7 @@ public final class MenuPanel extends JPanel {
// Init title // Init title
final JLabel titleLabel = new JLabel("Turrets Online"); final JLabel titleLabel = new JLabel("Turrets Online");
titleLabel.setForeground(TITLE_COLOR); titleLabel.setForeground(TITLE_COLOR);
titleLabel.setFont(new Font("Stencil", Font.BOLD, 70)); titleLabel.setFont(new Font(MENU_FONT_NAME, Font.BOLD, 70));
titleLabel.setHorizontalAlignment(SwingConstants.CENTER); titleLabel.setHorizontalAlignment(SwingConstants.CENTER);
// Init panel // Init panel

View File

@ -1,5 +1,6 @@
package com.annimon.turrets; package com.annimon.turrets;
import static com.annimon.turrets.Constants.MENU_FONT_NAME;
import static com.annimon.turrets.Constants.SCREEN_DIMENSION; import static com.annimon.turrets.Constants.SCREEN_DIMENSION;
import com.annimon.turrets.util.ExceptionHandler; import com.annimon.turrets.util.ExceptionHandler;
import com.annimon.turrets.util.Prefs; import com.annimon.turrets.util.Prefs;
@ -27,7 +28,7 @@ import javax.swing.text.MaskFormatter;
*/ */
public final class OptionsPanel extends JPanel { public final class OptionsPanel extends JPanel {
private static final Font FONT = new Font("Stencil", 1, 30); private static final Font FONT = new Font(MENU_FONT_NAME, 1, 30);
private static final int VERT_INSET = 80, HOR_INSET = 50; private static final int VERT_INSET = 80, HOR_INSET = 50;
private final JCheckBox soundCheckBox; private final JCheckBox soundCheckBox;