Skip to content
Snippets Groups Projects
Commit 50c4f4b3 authored by Lucas Garrido's avatar Lucas Garrido
Browse files

Se implemento la el consultar video desde consultar lista de reprodiccion

parent ae27c347
No related branches found
No related tags found
No related merge requests found
Showing
with 154 additions and 80 deletions
......@@ -4,6 +4,7 @@
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Consultar categoria"/>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
......
......@@ -14,17 +14,21 @@ public class frmConsultaCategoria extends javax.swing.JDialog {
String CategoriaActual;
public frmConsultaCategoria(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
this.setLocationRelativeTo(null);
try {
initComponents();
this.setLocationRelativeTo(null);
ArrayList<String> ListaCategorias = Sys.listarCategorias();
DefaultListModel modelo = new DefaultListModel();
for (String it : ListaCategorias) {
modelo.addElement(it);
}
lstCategorias.setModel(modelo);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, (String) e.getMessage(), "Error:", JOptionPane.ERROR_MESSAGE);
}
ArrayList<String> ListaCategorias = Sys.listarCategorias();
DefaultListModel modelo = new DefaultListModel();
for (String it : ListaCategorias) {
modelo.addElement(it);
}
lstCategorias.setModel(modelo);
}
@SuppressWarnings("unchecked")
......@@ -45,6 +49,7 @@ public class frmConsultaCategoria extends javax.swing.JDialog {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Consultar categoria");
setResizable(false);
jPanel25.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
......
......@@ -10,6 +10,7 @@
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Nueva lista de reproduccion"/>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
......@@ -74,9 +75,6 @@
</Constraints>
</Component>
<Component class="javax.swing.JTextField" name="txtNombre">
<Events>
<EventHandler event="keyTyped" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtNombreKeyTyped"/>
</Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription">
<AbsoluteConstraints x="470" y="40" width="310" height="-1"/>
......
......@@ -15,35 +15,30 @@ public class frmAltaListaDeReproduccion extends javax.swing.JDialog {
IAdmin Sys = f.getIAdmin();
public frmAltaListaDeReproduccion(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
this.setLocationRelativeTo(null);
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modeloUsuario = new DefaultListModel();
for (DtUsuario it : ListaUsuarios) {
modeloUsuario.addElement(it.getNickname());
}
lstUsuarios.setModel(modeloUsuario);
ArrayList<String> ListaCategoria = Sys.listarCategorias();
DefaultListModel modeloCategoria = new DefaultListModel();
for (String it : ListaCategoria) {
modeloCategoria.addElement(it);
try {
initComponents();
this.setLocationRelativeTo(null);
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modeloUsuario = new DefaultListModel();
for (DtUsuario it : ListaUsuarios) {
modeloUsuario.addElement(it.getNickname());
}
lstUsuarios.setModel(modeloUsuario);
ArrayList<String> ListaCategoria = Sys.listarCategorias();
DefaultListModel modeloCategoria = new DefaultListModel();
for (String it : ListaCategoria) {
modeloCategoria.addElement(it);
}
lstCategorias.setModel(modeloCategoria);
lstCategorias.setSelectedIndex(0);
rbParticular.setSelected(true);
rbPublica.setSelected(true);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, (String) e.getMessage(), "Error:", JOptionPane.ERROR_MESSAGE);
}
lstCategorias.setModel(modeloCategoria);
lstCategorias.setSelectedIndex(0);
rbParticular.setSelected(true);
rbPublica.setSelected(true);
}
@SuppressWarnings("unchecked")
......@@ -72,18 +67,13 @@ public class frmAltaListaDeReproduccion extends javax.swing.JDialog {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Nueva lista de reproduccion");
setResizable(false);
jPanel17.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel100.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
jLabel100.setText("Nombre:");
jPanel17.add(jLabel100, new org.netbeans.lib.awtextra.AbsoluteConstraints(410, 40, -1, -1));
txtNombre.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
txtNombreKeyTyped(evt);
}
});
jPanel17.add(txtNombre, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 40, 310, -1));
jPanel18.setBorder(javax.swing.BorderFactory.createEtchedBorder());
......@@ -238,18 +228,13 @@ public class frmAltaListaDeReproduccion extends javax.swing.JDialog {
} catch (Exception e) {
JOptionPane.showMessageDialog(null,(String)e.getMessage(), "Error:", JOptionPane.ERROR_MESSAGE);
}
Sys.liberarMemoriaUsuario();
dispose();
}//GEN-LAST:event_btnAceptarMouseClicked
private void txtNombreKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtNombreKeyTyped
if (!(Character.isDigit(evt.getKeyChar()) || Character.isLetter(evt.getKeyChar()))) {
getToolkit().beep();
evt.consume();
}
}//GEN-LAST:event_txtNombreKeyTyped
private void btnCancelarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnCancelarMouseClicked
txtNombre.setText("");
Sys.liberarMemoriaUsuario();
dispose();
}//GEN-LAST:event_btnCancelarMouseClicked
......
......@@ -141,7 +141,11 @@
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Doble clic para ver mas informacion de video"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lstVideosMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
......
......@@ -3,6 +3,7 @@ package Presentacion.ListaDeReproduccion;
import Logica.DataType.*;
import Logica.Fabrica;
import Logica.Interfaces.IAdmin;
import Presentacion.Video.frmConsultaVideo;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
......@@ -12,21 +13,53 @@ public class frmConsultaListaDeReproduccion extends javax.swing.JDialog {
Fabrica f = Fabrica.getInstancia();
IAdmin Sys = f.getIAdmin();
ArrayList<DtListaDeReproduccion> ListasDeReproducion;
ArrayList<DtVideo> Listavideos;
public frmConsultaListaDeReproduccion(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
this.setLocationRelativeTo(null);
try {
initComponents();
this.setLocationRelativeTo(null);
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modeloUsuario = new DefaultListModel();
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modeloUsuario = new DefaultListModel();
for (DtUsuario it : ListaUsuarios) {
modeloUsuario.addElement(it.getNickname());
for (DtUsuario it : ListaUsuarios) {
modeloUsuario.addElement(it.getNickname());
}
lstUsuarios.setModel(modeloUsuario);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, (String) e.getMessage(), "Error:", JOptionPane.ERROR_MESSAGE);
}
lstUsuarios.setModel(modeloUsuario);
}
public frmConsultaListaDeReproduccion(javax.swing.JDialog parent, boolean modal,String nickname, int idListaVideo) {
super(parent, modal);
try {
initComponents();
this.setLocationRelativeTo(null);
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modeloUsuario = new DefaultListModel();
for (DtUsuario it : ListaUsuarios) {
modeloUsuario.addElement(it.getNickname());
}
lstUsuarios.setModel(modeloUsuario);
lstUsuarios.setSelectedValue(nickname, true);
lstListasRep.setSelectedValue(Sys.seleccionarListaDeReproduccion(idListaVideo).getNombre(), true);
lstListasRep.setEnabled(false);
lstUsuarios.setEnabled(false);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, (String) e.getMessage(), "Error:", JOptionPane.ERROR_MESSAGE);
}
}
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
......@@ -80,6 +113,12 @@ public class frmConsultaListaDeReproduccion extends javax.swing.JDialog {
jPanel20.add(jScrollPane37, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 240, 320));
lstVideos.setToolTipText("Doble clic para ver mas informacion de video");
lstVideos.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lstVideosMouseClicked(evt);
}
});
jScrollPane38.setViewportView(lstVideos);
jPanel20.add(jScrollPane38, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 50, 240, 320));
......@@ -196,7 +235,7 @@ public class frmConsultaListaDeReproduccion extends javax.swing.JDialog {
lbTipo.setText(" " + "PARTICULAR");
}
ArrayList<DtVideo> Listavideos = Sys.listarVideosDeListaDeReproduccion();
Listavideos = Sys.listarVideosDeListaDeReproduccion();
DefaultListModel modelo = new DefaultListModel();
for (DtVideo it : Listavideos) {
modelo.addElement(it.getNombre());
......@@ -208,6 +247,16 @@ public class frmConsultaListaDeReproduccion extends javax.swing.JDialog {
}
}//GEN-LAST:event_lstListasRepValueChanged
private void lstVideosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lstVideosMouseClicked
if (evt.getClickCount() != 2) return;
if (lstVideos.getSelectedIndex()<0) return;
int indexSeleccionado = lstVideos.getSelectedIndex();
int idVideo = Listavideos.get(indexSeleccionado).getId();
new frmConsultaVideo(this, true, lstUsuarios.getSelectedValue(), idVideo).setVisible(true);
}//GEN-LAST:event_lstVideosMouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnAceptar;
private javax.swing.JLabel jLabel106;
......
......@@ -442,7 +442,7 @@
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Doble clic para mas ver informacion del video"/>
<Property name="toolTipText" type="java.lang.String" value="Doble clic para ver mas informacion del video"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lstVideosMouseClicked"/>
......@@ -470,8 +470,11 @@
<Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
<StringArray count="0"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="Doble clic para mas ver informacion de la lista"/>
<Property name="toolTipText" type="java.lang.String" value="Doble clic para ver mas informacion de la lista"/>
</Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lstListaReproduccionMouseClicked"/>
</Events>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
......
package Presentacion.Usuario;
import Presentacion.ListaDeReproduccion.*;
import Logica.DataType.DtCanal;
import Logica.DataType.DtListaDeReproduccion;
import Logica.DataType.DtUsuario;
......@@ -17,6 +18,7 @@ public class frmConsultaUsuario extends javax.swing.JDialog {
IAdmin sys;
ArrayList<DtVideo> listaDeVideos;
ArrayList<DtListaDeReproduccion> listaDeListasRep;
public frmConsultaUsuario(java.awt.Frame parent, boolean modal) {
super(parent, modal);
......@@ -196,7 +198,7 @@ public class frmConsultaUsuario extends javax.swing.JDialog {
jLabel80.setText("Listas de Reproduccion:");
jPanel6.add(jLabel80, new org.netbeans.lib.awtextra.AbsoluteConstraints(770, 240, -1, -1));
lstVideos.setToolTipText("Doble clic para mas ver informacion del video");
lstVideos.setToolTipText("Doble clic para ver mas informacion del video");
lstVideos.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lstVideosMouseClicked(evt);
......@@ -206,7 +208,12 @@ public class frmConsultaUsuario extends javax.swing.JDialog {
jPanel6.add(jScrollPane20, new org.netbeans.lib.awtextra.AbsoluteConstraints(550, 270, 200, 190));
lstListaReproduccion.setToolTipText("Doble clic para mas ver informacion de la lista");
lstListaReproduccion.setToolTipText("Doble clic para ver mas informacion de la lista");
lstListaReproduccion.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
lstListaReproduccionMouseClicked(evt);
}
});
jScrollPane21.setViewportView(lstListaReproduccion);
jPanel6.add(jScrollPane21, new org.netbeans.lib.awtextra.AbsoluteConstraints(770, 272, 190, 190));
......@@ -251,7 +258,8 @@ public class frmConsultaUsuario extends javax.swing.JDialog {
listaDeVideos = sys.listarVideosDeUsuario();
listarVideos(listaDeVideos);
listarListassRep(sys.listarListasDeReproduccionDeUsuario(nick));
listaDeListasRep = sys.listarListasDeReproduccionDeUsuario(nick);
listarListassRep(listaDeListasRep);
listarUsuariosSeguidores(sys.listarUsuarioSeguidores());
listarUsuariosSeguidos(sys.listarUsuarioSeguidos());
......@@ -272,7 +280,7 @@ public class frmConsultaUsuario extends javax.swing.JDialog {
}//GEN-LAST:event_btnAceptarActionPerformed
private void lstVideosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lstVideosMouseClicked
// Clic en listar videos
// Doble clic en la lista de videos
if (evt.getClickCount() != 2) return;
if (lstVideos.getSelectedIndex()<0) return;
......@@ -280,6 +288,16 @@ public class frmConsultaUsuario extends javax.swing.JDialog {
int idVideo = listaDeVideos.get(indexSeleccionado).getId();
new frmConsultaVideo(this, true, lstUsuarios.getSelectedValue(), idVideo).setVisible(true);
}//GEN-LAST:event_lstVideosMouseClicked
private void lstListaReproduccionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lstListaReproduccionMouseClicked
// Doble clic en la lista de Listas de reproduccion
if (evt.getClickCount() != 2) return;
if (lstListaReproduccion.getSelectedIndex()<0) return;
int indexSeleccionado = lstListaReproduccion.getSelectedIndex();
int idLista = listaDeListasRep.get(indexSeleccionado).getId();
new frmConsultaListaDeReproduccion(this, true, lstUsuarios.getSelectedValue(), idLista).setVisible(true);
}//GEN-LAST:event_lstListaReproduccionMouseClicked
///////////////////////////////////////////////////////////////////////////////////////////
private void listarUsuarios(ArrayList<DtUsuario> ListaUsuarios){
......
......@@ -4,6 +4,10 @@
<Properties>
<Property name="defaultCloseOperation" type="int" value="2"/>
<Property name="title" type="java.lang.String" value="Listar usuarios"/>
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.ComponentChooserEditor">
<ComponentRef name="default"/>
</Property>
<Property name="resizable" type="boolean" value="false"/>
</Properties>
<SyntheticProperties>
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
......
......@@ -9,25 +9,31 @@ import Logica.DataType.DtUsuario;
import Logica.Fabrica;
import Logica.Interfaces.IAdmin;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
public class frmListarUsuarios extends javax.swing.JDialog {
public frmListarUsuarios(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
this.setLocationRelativeTo(null);
Fabrica f = Fabrica.getInstancia();
IAdmin Sys = f.getIAdmin();
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modelo = new DefaultListModel();
for (DtUsuario it : ListaUsuarios) {
modelo.addElement(it.getNickname());
try {
initComponents();
this.setLocationRelativeTo(null);
Fabrica f = Fabrica.getInstancia();
IAdmin Sys = f.getIAdmin();
ArrayList<DtUsuario> ListaUsuarios = Sys.listarUsuarios();
DefaultListModel modelo = new DefaultListModel();
for (DtUsuario it : ListaUsuarios) {
modelo.addElement(it.getNickname());
}
lstListaDeUsuario.setModel(modelo);
} catch (Exception e) {
JOptionPane.showMessageDialog(null, (String) e.getMessage(), "Error:", JOptionPane.ERROR_MESSAGE);
}
lstListaDeUsuario.setModel(modelo);
}
......@@ -44,6 +50,7 @@ public class frmListarUsuarios extends javax.swing.JDialog {
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
setTitle("Listar usuarios");
setResizable(false);
lbListarUasario.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment