Examples of JPanelImatge


Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  public PartidaVista( JFrame frame_principal )
  {
    super( frame_principal );

    titol = new JLabel( "jHex" );
    panell_principal = new JPanelImatge( getClass().getResource( "/prop/img/fons_partida.png" ) );
    panell_central = new JPanelTauler( true );
    panell_botons = new JPanel();
    intercanvia = new JButton( "Intercanvia fitxa" );
    mou_ia = new JButton( "Mou IA" );
    demana_pista = new JButton( "Demana pista" );
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  public IdentificaCarregaPartidaVista( JFrame frame_principal, String usuari, String id_partida )
  {
    super( frame_principal );

    titol = new JLabel( "Carrega partida - Identificar-se" );
    panell_dades = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    panell_botons = new JPanel();
    accepta = new JButton( "Accepta" );
    llista_partides = new JButton( "Torna a la llista de partides" );
    menu_principal = new JButton( "Torna al menú principal" );
    this.usuari = new JLabel( usuari );
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

    panell_central.setOpaque( false );

    // Panell nom partida
    // -----------------------------------------------------------------------------------------

    JPanel panell_nom_partida = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    panell_nom_partida.setBorder( BorderFactory.createRaisedBevelBorder() );
    panell_nom_partida.setLayout( new BoxLayout( panell_nom_partida, BoxLayout.PAGE_AXIS ) );
    JPanel camps_nom_partida = new JPanel();
    camps_nom_partida.setLayout( new GridLayout( 1, 2, 10, 10 ) );
    camps_nom_partida.setOpaque( false );
    camps_nom_partida.add( text_nom_partida );
    camps_nom_partida.add( camp_nom_partida );
    camps_nom_partida.setBorder( BorderFactory.createEmptyBorder( 25, 10, 25, 10 ) );
    panell_nom_partida.add( camps_nom_partida );
    panell_central.add( panell_nom_partida );

    // Panell jugador 1
    // -------------------------------------------------------------------------------------------
    JPanel panell_jugador_a =
        new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) ); // Caixa i text "Jugador 1:"
    panell_jugador_a.setOpaque( false );
    panell_jugador_a.setBorder( BorderFactory.createRaisedBevelBorder() );
    panell_jugador_a.setLayout( new BoxLayout( panell_jugador_a, BoxLayout.PAGE_AXIS ) );
    text_jugador_a.setAlignmentX( Component.CENTER_ALIGNMENT );
    panell_jugador_a.add( text_jugador_a );

    JPanel principal_jugador_1 = new JPanel();
    principal_jugador_1.setOpaque( false );
    principal_jugador_1.setLayout( new GridLayout( 1, 2, 10, 10 ) );
    principal_jugador_1.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );

    // Layout de tipus CardLayout per canviar formulari en base a la selecció del tipus d'usuari
    seleccio_jugador_a.setLayout( new CardLayout() );
    seleccio_jugador_a.setOpaque( false );

    // Si l'usuari no ha iniciat sessió com a convidat, mostro l'opció de jugar com a registrat
    if ( !PresentacioCtrl.getInstancia().getEsConvidat() )
    {
      JPanel text_usuari_registrat = new JPanel();
      text_usuari_registrat.setOpaque( false );
      seleccio_jugador_a.add( text_usuari_registrat, PresentacioCtrl.getInstancia().obteNomJugadorPrincipal() );
    }

    // Formulari nom convidat jugador 1 per quan a seleccionat jugar com convidat
    JPanel formulari_nom_convidat_jugador_a = new JPanel();
    formulari_nom_convidat_jugador_a.setLayout( new GridLayout( 2, 1 ) );
    formulari_nom_convidat_jugador_a.setOpaque( false );
    formulari_nom_convidat_jugador_a.add( text_convidat_a );
    formulari_nom_convidat_jugador_a.add( camp_nom_convidat_a );
    seleccio_jugador_a.add( formulari_nom_convidat_jugador_a, "Convidat" );

    // Seleccionable tipus de màquina jugador 1 per quan a seleccionat jugar com una màquina
    JPanel seleccio_tipus_maquina_jugador_a = new JPanel();
    seleccio_tipus_maquina_jugador_a.setLayout( new GridLayout( 1, 1 ) );
    seleccio_tipus_maquina_jugador_a.setOpaque( false );
    seleccio_tipus_maquina_jugador_a.add( combo_tipus_maquina_a );
    seleccio_jugador_a.add( seleccio_tipus_maquina_jugador_a, "Màquina" );

    // Afegeixo a la vista el panell de selecció de tipus de jugador a
    principal_jugador_1.add( combo_tipus_jugador_a );
    principal_jugador_1.add( seleccio_jugador_a );

    panell_jugador_a.add( principal_jugador_1 );
    panell_central.add( panell_jugador_a );

    // Panell jugador 2
    // -------------------------------------------------------------------------------------------
    JPanel panell_jugador_b =
        new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) ); // Caixa i text "Jugador 2:"
    panell_jugador_b.setBorder( BorderFactory.createRaisedBevelBorder() );
    panell_jugador_b.setLayout( new BoxLayout( panell_jugador_b, BoxLayout.PAGE_AXIS ) );
    panell_jugador_b.setOpaque( false );
    text_jugador_b.setAlignmentX( Component.CENTER_ALIGNMENT );
    panell_jugador_b.add( text_jugador_b );

    JPanel principal_jugador_b = new JPanel();
    principal_jugador_b.setLayout( new GridLayout( 1, 2, 10, 10 ) );
    principal_jugador_b.setBorder( BorderFactory.createEmptyBorder( 10, 10, 10, 10 ) );
    principal_jugador_b.setOpaque( false );

    // Layout de tipus CardLayout per canviar formulari en base a la selecció del tipus d'usuari
    seleccio_jugador_b.setLayout( new CardLayout() );
    seleccio_jugador_b.setOpaque( false );

    JPanel seleccio_tipus_maquina_jugador_b = new JPanel(); // Seleccionable tipus de màquina jugador 2
    seleccio_tipus_maquina_jugador_b.setOpaque( false );
    seleccio_tipus_maquina_jugador_b.setLayout( new GridLayout( 1, 1 ) );
    seleccio_tipus_maquina_jugador_b.add( combo_tipus_maquina_b );
    seleccio_jugador_b.add( seleccio_tipus_maquina_jugador_b, "Màquina" );

    JPanel formulari_nom_convidat_jugador_b = new JPanel(); // Formulari nom convidat jugador 2
    formulari_nom_convidat_jugador_b.setLayout( new GridLayout( 2, 1 ) );
    formulari_nom_convidat_jugador_b.setOpaque( false );
    formulari_nom_convidat_jugador_b.add( text_convidat_b );
    formulari_nom_convidat_jugador_b.add( camp_nom_convidat_b );
    seleccio_jugador_b.add( formulari_nom_convidat_jugador_b, "Convidat" );

    // Formulari inici sessió jugador 2 per quan a seleccionat iniciar sessió com usuari registrat
    JPanel formulari_inici_sessio_jugador_b = new JPanel();
    formulari_inici_sessio_jugador_b.setOpaque( false );
    formulari_inici_sessio_jugador_b.setLayout( new GridLayout( 2, 2 ) );
    formulari_inici_sessio_jugador_b.add( text_usuari );
    formulari_inici_sessio_jugador_b.add( camp_nom_usuari_b );
    formulari_inici_sessio_jugador_b.add( text_contrasenya );
    formulari_inici_sessio_jugador_b.add( camp_contrasenya_usuari_b );
    seleccio_jugador_b.add( formulari_inici_sessio_jugador_b, "Usuari registrat" );

    principal_jugador_b.add( combo_tipus_jugador_b );
    principal_jugador_b.add( seleccio_jugador_b );

    panell_jugador_b.add( principal_jugador_b );
    panell_central.add( panell_jugador_b );
  }
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

   * @param frame_vista Frame principal sobre el que s'hauran d'afegir els diferents components.
   */
  public BaseVista( JFrame frame_vista )
  {
    this.frame_vista = frame_vista;
    panell_principal = new JPanelImatge( getClass().getResource( "/prop/img/fons.png" ) );
    panell_titol = new JPanel();
    panell_sortida = new JPanel();
    ajuda = new JButton( "", new ImageIcon( getClass().getResource( "/prop/img/ajuda.png" ) ) );
    surt = new JButton( "", new ImageIcon( getClass().getResource( "/prop/img/surt.png" ) ) );
  }
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  @Override
  protected void inicialitzaPanellCentral()
  {
    panell_central.setLayout( new GridLayout( 3, 1, 10, 10 ) );
    panell_central.setOpaque( false );
    JPanel panell_colors = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    panell_colors.setBorder( BorderFactory.createRaisedBevelBorder() );
    panell_colors.setLayout( new GridLayout( 3, 1, 10, 10 ) );
    grup_colors.add( colors_vermell_blau );
    grup_colors.add( colors_negre_blanc );
    colors_vermell_blau.setOpaque( false );
    colors_negre_blanc.setOpaque( false );

    if ( PresentacioCtrl.getInstancia().obteCombinacioDeColorsJugadorPrincipal() ==
         CombinacionsColors.VERMELL_BLAU )
    {
      colors_vermell_blau.setSelected( true );
    }
    else
    {
      colors_negre_blanc.setSelected( true );
    }

    panell_colors.add( colors );
    panell_colors.add( colors_vermell_blau );
    panell_colors.add( colors_negre_blanc );
    JPanel panell_modes_inici = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    panell_modes_inici.setBorder( BorderFactory.createRaisedBevelBorder() );
    panell_modes_inici.setLayout( new GridLayout( 3, 1, 10, 10 ) );
    grup_modes_inici.add( mode_inici_estandard );
    grup_modes_inici.add( mode_inici_pastis );
    mode_inici_estandard.setOpaque( false );
    mode_inici_pastis.setOpaque( false );

    if ( PresentacioCtrl.getInstancia().obteModeIniciJugadorPrincipal() == ModesInici.ESTANDARD )
    {
      mode_inici_estandard.setSelected( true );
    }
    else
    {
      mode_inici_pastis.setSelected( true );
    }

    panell_modes_inici.add( modes_inici );
    panell_modes_inici.add( mode_inici_estandard );
    panell_modes_inici.add( mode_inici_pastis );
    panell_central.add( panell_colors );
    panell_central.add( panell_modes_inici );
    JPanel panell_botons_opcions = new JPanel();
    if ( PresentacioCtrl.getInstancia().getEsConvidat() )
    {
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  public RegistraVista( JFrame frame_principal )
  {
    super( frame_principal );

    titol = new JLabel( "Registra't" );
    panell_dades = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    accepta = new JButton( "Accepta" );
    torna = new JButton( "Torna al menú d'iniciar sessió" );
    usuari = new JTextField();
    contrasenya = new JPasswordField();
    confirma_contrasenya = new JPasswordField();
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  public DefineixSituacioVista( JFrame frame_principal )
  {
    super( frame_principal );

    titol = new JLabel( "jHex" );
    panell_principal = new JPanelImatge( getClass().getResource( "/prop/img/fons_partida.png" ) );
    panell_central = new JPanelTauler( false );
    panell_botons = new JPanel();
    inicia_partida = new JButton( "Inicia la partida" );
    abandona = new JButton( "Abandona la partida" );
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  public IniciaSessioVista( JFrame frame_principal )
  {
    super( frame_principal );

    titol = new JLabel( "Inicia sessió" );
    panell_dades = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    panell_botons = new JPanel();
    accepta = new JButton( "Accepta" );
    registra = new JButton( "Registra't" );
    convidat = new JButton( "Entra com a convidat" );
    usuari = new JTextField();
View Full Code Here

Examples of prop.hex.presentacio.auxiliars.JPanelImatge

  public CanviaContrasenyaVista( JFrame frame_principal )
  {
    super( frame_principal );

    titol = new JLabel( "Canvia la contrasenya" );
    panell_dades = new JPanelImatge( getClass().getResource( "/prop/img/caixa.png" ) );
    accepta = new JButton( "Accepta" );
    torna = new JButton( "Torna al menú de configuració" );
    contrasenya_actual = new JPasswordField();
    contrasenya_nova = new JPasswordField();
    confirma_contrasenya_nova = new JPasswordField();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.