Example #1
0
 private void sugerir() {
   String mensaje = "";
   if (panelActual.equals(pantallaReproduccion)) {
     mensaje = "La canción " + cancionActual.getNombre() + " se ha sugerido con éxito";
   }
   if (panelActual.equals(listaReproduccion)) {
     mensaje = "La canción " + cancionActual.getNombre() + " se ha sugerido con éxito";
   }
   if (panelActual.equals(miListaSugeridas)) {
     mensaje = "Las canciones seleccionadas se han sugerido con éxito";
   }
   if (panelActual.equals(cas)) {
     mensaje = "El álbum Audioslave se ha sugerido con éxito";
   }
   if (panelActual.equals(null)) {
     System.out.println("null");
   }
   JOptionPane.showMessageDialog(this, mensaje);
 }
Example #2
0
  private void iniciarComponentes() {
    dSalir = new DialogoSalir();
    JLayeredPane lp = this.getLayeredPane();

    fondo = new Fondo();
    fondo.setLayout(null);
    fondo.setBounds(7, 11, 526, 314);
    this.getContentPane().add(fondo);

    apagar = new BotonApagar();
    apagar.setBounds(445, 130, 53, 53);
    fondo.add(apagar);

    minimizar = new BotonMinimizar();
    minimizar.setText("_");
    minimizar.setBounds(466, 26, 15, 15);
    fondo.add(minimizar);

    brillo = new Brillo();
    brillo.setBounds(0, 0, this.getWidth(), this.getHeight());
    this.setGlassPane(brillo);
    this.getGlassPane().setVisible(true);

    /* todo lo del panel de reproduccion */
    reproductor = new PanelReproduccion();
    reproductor.setBounds(139, 227, 291, 73);
    lp.add(reproductor, new Integer(2));

    botonPlay = new BotonPlay();
    botonPlay.setBounds(127, 6, 22, 22);
    reproductor.add(botonPlay);

    botonSiguiente = new BotonSiguiente(BotonSiguiente.ADELANTAR);
    botonSiguiente.setBounds(167, 6, 22, 22);
    reproductor.add(botonSiguiente);

    BotonAtras = new BotonSiguiente(BotonSiguiente.ATRASAR);
    BotonAtras.setBounds(85, 6, 22, 22);
    reproductor.add(BotonAtras);

    botonStop = new BotonStop();
    botonStop.setBounds(43, 6, 22, 22);
    reproductor.add(botonStop);

    botonVolumen = new BotonVolumen();
    botonVolumen.setBounds(209, 6, 22, 22);
    reproductor.add(botonVolumen);

    slider = new Slider();
    slider.setBounds(12, 46, 241, 10);
    reproductor.add(slider);

    pv = new PanelVolumen();
    pv.setBounds(
        botonVolumen.getX() - 8 + reproductor.getX(),
        botonVolumen.getY() - 78 + reproductor.getY(),
        33,
        73);
    lp.add(pv, new Integer(3));

    fondoFalso = new FondoFalso();
    fondoFalso.setLayout(null);
    fondoFalso.setBounds(112, 294, 319, 34);

    botonMinimizarPanelReproductor = new BotonEsconder();
    botonMinimizarPanelReproductor.setTipo(BotonEsconder.BAJAR);
    botonMinimizarPanelReproductor.setBounds(fondoFalso.getWidth() / 2, 0, 15, 15);
    fondoFalso.add(botonMinimizarPanelReproductor);

    lp.add(fondoFalso, new Integer(3));
    /* Fin componentes del panel de reproduccion */

    /* Componentes Menu */

    fondoFalso2 = new FondoFalso2();
    fondoFalso2.setLayout(null);
    fondoFalso2.setBounds(132, 11, 273, 29);

    botonMinimizarMenuPrincipal = new BotonEsconder();
    botonMinimizarMenuPrincipal.setTipo(BotonEsconder.SUBIR);
    botonMinimizarMenuPrincipal.setBounds(
        fondoFalso2.getWidth() / 2, fondoFalso2.getHeight() - 15, 15, 15);
    fondoFalso2.add(botonMinimizarMenuPrincipal);

    lp.add(fondoFalso2, new Integer(3));

    /* Fin Componentes Menu */

    /* Pantalla */
    pantalla = new JPanel();
    pantalla.setLayout(new BorderLayout());
    pantalla.setBounds(97, 29, 332, 254);
    fondo.add(pantalla);
    pantallaReproduccion = new pantallaReproduccion();
    /* prueba */
    Cancion c = new Cancion();
    c.setArtista("DragonForce");
    c.setAlbum("Album 1");
    c.setNombre("Through the Fire and Flames");
    c.setMinutos(4);
    c.setSegundos(30);
    c.setUrlAlbum("imagenes/album1.jpg");
    c.setCalificacion(4);
    c.setComentarios("Holasad");
    cancionActual = c;
    /* fin prueba */

    pantallaReproduccion.setCancion(c);
    /* prueba */
    listaReproduccion = new ListaReproduccion();
    /* prueba con lista */
    ArrayList<Cancion> z = new ArrayList<Cancion>();
    for (int i = 0; i < 40; i++) {
      z.add(c);
    }
    listaReproduccion.setListaCanciones(z);
    /* fin prueba */
    miListaSugeridas = new ListaSugeridas(this);
    miListaSugeridas.setListaCanciones(z);

    cas = new AlbumChooser();

    menuPrincipal = new MenuPrincipal();
    menuPrincipal.setBounds(139, 31, 266, 47);
    lp.add(menuPrincipal, new Integer(2));

    botonReproduccionActual =
        new ItemMenuPrincipal("imagenes/reproduccion.png", "imagenes/reproduccionf.png");
    menuPrincipal.add(botonReproduccionActual);
    botonReproduccionActual.setLocation(40, 10);
    botonReproduccionActual.setToolTipText("Reproducción Actual");

    botonListaDeReproduccion = new ItemMenuPrincipal("imagenes/lista.png", "imagenes/listaf.png");
    menuPrincipal.add(botonListaDeReproduccion);
    botonListaDeReproduccion.setLocation(80, 10);
    botonListaDeReproduccion.setToolTipText("Lista de reproducción");

    botonAlbum = new ItemMenuPrincipal("imagenes/album.png", "imagenes/albumf.png");
    menuPrincipal.add(botonAlbum);
    botonAlbum.setLocation(120, 10);
    botonAlbum.setToolTipText("Seleccionar Album");

    botonSugerir = new ItemMenuPrincipal("imagenes/compartir.png", "imagenes/compartirf.png");
    menuPrincipal.add(botonSugerir);
    botonSugerir.setLocation(160, 10);
    botonSugerir.setToolTipText("Sugerir selección");

    botonListaSugeridas = new ItemMenuPrincipal("imagenes/sugerir.png", "imagenes/sugerirf.png");
    menuPrincipal.add(botonListaSugeridas);
    botonListaSugeridas.setLocation(200, 10);
    botonListaSugeridas.setToolTipText("Canciones sugeridas");
  }