Class VentanaJuegoPasapalabra

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class VentanaJuegoPasapalabra extends VentanaJuego
Ventana gráfica para el juego PasaPalabra.
Version:
1.1
Author:
Adrián
See Also:
  • Field Details

    • juego

      private final PasaPalabra juego
    • jugador

      private final Usuario jugador
    • partida

      private final Partida partida
    • panelRosco

    • lblDefinicion

      private JTextArea lblDefinicion
    • lblLetra

      private JLabel lblLetra
    • lblAciertos

      private JLabel lblAciertos
    • lblFallos

      private JLabel lblFallos
    • lblPasapalabras

      private JLabel lblPasapalabras
    • lblTiempo

      private JLabel lblTiempo
    • txtRespuesta

      private JTextField txtRespuesta
    • btnResponder

      private JButton btnResponder
    • btnPasapalabra

      private JButton btnPasapalabra
    • btnPausar

      private JButton btnPausar
    • timerSwing

      private Timer timerSwing
    • segundosRestantes

      private int segundosRestantes
    • TIEMPO_INICIAL

      private static final int TIEMPO_INICIAL
      See Also:
  • Constructor Details

    • VentanaJuegoPasapalabra

      public VentanaJuegoPasapalabra(Partida partida, GestorPartidas gestorPartidas, GestorEstadisticas gestorEstadisticas, JFrame ventanaPadre)
      Parameters:
      partida - Partida activa (contiene el juego y los jugadores).
      gestorPartidas - Para pausar y finalizar.
      gestorEstadisticas - Para registrar el resultado al finalizar.
      ventanaPadre - Ventana a la que volver al cerrar.
  • Method Details

    • construirUI

      private void construirUI()
    • construirPanelDerecho

      private JPanel construirPanelDerecho()
    • construirPanelControl

      private JPanel construirPanelControl()
    • actualizarVista

      public void actualizarVista()
      Description copied from class: VentanaJuego
      Actualiza la interfaz gráfica con el estado actual del juego. Cada subclase implementa su propia lógica de pintado.
      Specified by:
      actualizarVista in class VentanaJuego
    • onResponder

      private void onResponder()
    • onPasapalabra

      private void onPasapalabra()
    • accionPausar

      protected void accionPausar()
      Description copied from class: VentanaJuego
      Pausa la partida actual, guarda su estado en disco y vuelve al menú principal.
      Overrides:
      accionPausar in class VentanaJuego
    • accionFinalizar

      protected void accionFinalizar()
      Description copied from class: VentanaJuego
      Finaliza la partida, registra las estadísticas y vuelve al menú principal. El orden importa: primero finalizarPartida() para que fechaFin quede establecida, luego registrarResultado() que necesita esa fecha.
      Overrides:
      accionFinalizar in class VentanaJuego
    • iniciarTimer

      private void iniciarTimer()
    • detenerTimer

      private void detenerTimer()
    • mostrarTiempo

      private void mostrarTiempo(int segundos)
    • crearLabel

      private JLabel crearLabel(String texto, Font fuente, Color color)
    • crearBoton

      private JButton crearBoton(String texto, Color bgColor, ActionListener listener)
    • flashMensaje

      private void flashMensaje(String mensaje, Color color)