@Override public void onClickAction() { if (WinPanel.isVisible()) { Clickable.board.shuffle(Board.DEFAULT_SHUFFLE); board.setCheated(false); Clickable.board.newGame(); WinPanel.setVisible(false); } }
@Override public void updatePosition() { width = 200; height = 40; if (ScreenState.isAdventure) { x = WinPanel.x + WinPanel.width / 2 - width - 10; y = WinPanel.y + WinPanel.height / 2 + 30; } else { x = WinPanel.x + WinPanel.width / 2 + 10; y = WinPanel.y + WinPanel.height / 2 + 30; } isVisible = WinPanel.isVisible(); }
@Override public void draw(Graphics g) { if (WinPanel.isVisible()) { g.setColor(Color.LIGHT_GRAY); if (isMouseOn()) { g.setColor(Color.LIGHT_GRAY.brighter()); } g.fillRect(x, y, width, height); g.setColor(Color.BLACK); Font font = new Font("Tahoma", Font.PLAIN, 20); DrawingUtility.drawStringInBox( "PLAY AGAIN", font, x, y, width, height - 5, DrawingUtility.TEXT_CENTER, g); } }