Skip to content

Commit

Permalink
Solved checkstyles
Browse files Browse the repository at this point in the history
  • Loading branch information
bagarozzi committed Jul 9, 2024
1 parent c97e153 commit 5b82029
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/main/java/it/unibo/bombardero/view/GameCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*/
public final class GameCard extends GamePlayCard {

private static final int FONT_SIZE = 14;

private static final String TIMER_FORMAT = "mm:ss";

private final Image clockImage;
Expand Down Expand Up @@ -84,7 +86,7 @@ public void paintComponent(final Graphics g) {
super.paintComponent(g);
final int fontYOffset = (int) (g.getFontMetrics(clockFont).getAscent() / 2);
final SimpleDateFormat timerFormatter = new SimpleDateFormat(TIMER_FORMAT, Locale.ITALY);
g.setFont(clockFont.deriveFont(Font.PLAIN, 14));
g.setFont(clockFont.deriveFont(Font.PLAIN, FONT_SIZE));
g.setColor(Color.BLACK);
g.drawString(timerFormatter.format(timeLeft), timerPosition.width, timerPosition.height + fontYOffset);
g.drawImage(clockImage, imageClockPosition.width, imageClockPosition.height, null);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/it/unibo/bombardero/view/GuideCard.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
*/
public final class GuideCard extends GamePlayCard {

private static final float FONT_SIZE = 9.0f;
private static final int LAYOUT_ROWS = 5;
private static final int LAYOUT_COLS = 1;

Expand Down Expand Up @@ -118,7 +119,7 @@ public GuideCard(

messageBox.setHorizontalTextPosition(SwingConstants.CENTER);
messageBox.setVerticalTextPosition(SwingConstants.CENTER);
messageBox.setFont(font.deriveFont(9.0f));
messageBox.setFont(font.deriveFont(FONT_SIZE));

back.setBorder(null);
start.setBorder(null);
Expand Down

0 comments on commit 5b82029

Please sign in to comment.