Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package paquete; import edu.uci.ics.jung.algorithms.layout.CircleLayout; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.graph.*; import edu.uci.ics.jung.graph.util.EdgeType; import edu.uci.ics.jung.visualization.BasicVisualizationServer; import edu.uci.ics.jung.visualization.decorators.ToStringLabeller; import edu.uci.ics.jung.visualization.renderers.Renderer; import edu.uci.ics.jung.visualization.renderers.Renderer.VertexLabel.Position; import java.awt.BasicStroke; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Paint; import java.awt.Point; import java.awt.Polygon; import java.awt.RenderingHints; import java.awt.Shape; import java.awt.Stroke; import java.awt.Toolkit; import java.awt.geom.AffineTransform; import java.awt.image.BufferedImage; import java.io.EOFException; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Stack; import javax.imageio.ImageIO; import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultListModel; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileNameExtensionFilter; import org.apache.commons.collections15.Transformer; /** * * @author Chris */ public class HollywoodUI extends javax.swing.JFrame { private final Color bg_add; Graph<Actor, Arista> HollyUniverseGraph; int cont_backGrounds = 0; URL url; ArrayList<Pelicula> Peliculas = new ArrayList<>(); ArrayList<Actor> actoresArray = new ArrayList<>(); ArrayList<Arista> adyaTemp = new ArrayList<>(); Historial historialGestion = new Historial(); Pelicula movie; Actor temp = new Actor(); DefaultListModel<Pelicula> modelo_list = new DefaultListModel<>(); int x_map = 0; int y_map = 0; int CordenadaX[] = { 110, 390, 690, 115, 520, 310 }; int CordenadaY[] = { 300, 250, 290, 720, 710, 550 }; int CordCont = 0; BufferedImage grafico; int temp_evt[] = new int[2]; public HollywoodUI() { this.HollyUniverseGraph = new SparseMultigraph<>(); initComponents(); this.setLocationRelativeTo(null); bg_add = panel_opaque_add.getBackground(); panel_add.setVisible(false); panel_delete.setVisible(false); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { add_actor = new javax.swing.JDialog(); jPanel4 = new javax.swing.JPanel(); jLabel15 = new javax.swing.JLabel(); label_profile = new javax.swing.JLabel(); tf_nombre = new javax.swing.JTextField(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); tf_nacionalidad = new javax.swing.JTextField(); jLabel19 = new javax.swing.JLabel(); tf_edad = new javax.swing.JTextField(); jLabel20 = new javax.swing.JLabel(); jLabel21 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); list_peliculas = new javax.swing.JList(); btn_buscar_foto = new javax.swing.JToggleButton(); btn_save_actor = new javax.swing.JLabel(); btn_select_pelicula = new javax.swing.JLabel(); add_Pelicula = new javax.swing.JDialog(); jPanel5 = new javax.swing.JPanel(); jLabel22 = new javax.swing.JLabel(); tf_titulo = new javax.swing.JTextField(); jLabel24 = new javax.swing.JLabel(); jLabel25 = new javax.swing.JLabel(); tf_estudio = new javax.swing.JTextField(); jLabel26 = new javax.swing.JLabel(); tf_year = new javax.swing.JTextField(); jLabel27 = new javax.swing.JLabel(); btn_savePelicula = new javax.swing.JLabel(); PU_grafico = new javax.swing.JPopupMenu(); Agregar = new javax.swing.JMenuItem(); cambiar_backGround = new javax.swing.JMenuItem(); menu_modificar = new javax.swing.JMenu(); Actor_menu = new javax.swing.JMenuItem(); Movie_menu = new javax.swing.JMenuItem(); add_relaciones = new javax.swing.JMenuItem(); modifcar_relaciones = new javax.swing.JMenuItem(); eliminar_relaciones = new javax.swing.JMenuItem(); Mostrar_grafo = new javax.swing.JMenuItem(); Save_info = new javax.swing.JMenuItem(); add_actor_mapa = new javax.swing.JDialog(); label_preview = new javax.swing.JLabel(); cb_actores_existentes = new javax.swing.JComboBox(); btn_add_graphic = new javax.swing.JButton(); delete_movie = new javax.swing.JDialog(); jPanel6 = new javax.swing.JPanel(); cb_delete_movie = new javax.swing.JComboBox(); jLabel12 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); Modificar_actor = new javax.swing.JDialog(); jPanel7 = new javax.swing.JPanel(); jLabel16 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); jLabel70 = new javax.swing.JLabel(); jLabel71 = new javax.swing.JLabel(); jLabel72 = new javax.swing.JLabel(); tf_edad_modificar = new javax.swing.JTextField(); tf_nacionalidad_modificar = new javax.swing.JTextField(); tf_nombre_modificar = new javax.swing.JTextField(); jLabel73 = new javax.swing.JLabel(); jScrollPane9 = new javax.swing.JScrollPane(); list_peliculas_modificar = new javax.swing.JList(); btn_modificar_actor = new javax.swing.JLabel(); cb_list_modifica = new javax.swing.JComboBox(); Modificar_pelicula = new javax.swing.JDialog(); jPanel15 = new javax.swing.JPanel(); jLabel74 = new javax.swing.JLabel(); tf_titulo_modificar = new javax.swing.JTextField(); jLabel75 = new javax.swing.JLabel(); jLabel76 = new javax.swing.JLabel(); tf_estudio_modificar = new javax.swing.JTextField(); jLabel77 = new javax.swing.JLabel(); tf_year_modificar = new javax.swing.JTextField(); jLabel78 = new javax.swing.JLabel(); btn_ModificarPelicula = new javax.swing.JLabel(); cb_list_peliculas = new javax.swing.JComboBox(); sub_relaciones = new javax.swing.JDialog(); jPanel16 = new javax.swing.JPanel(); jLabel79 = new javax.swing.JLabel(); cb_Actor_uno = new javax.swing.JComboBox(); cb_Actor_dos = new javax.swing.JComboBox(); jrb_familia = new javax.swing.JRadioButton(); jrb_noviazgo = new javax.swing.JRadioButton(); jrb_amistad = new javax.swing.JRadioButton(); jLabel80 = new javax.swing.JLabel(); btn_agregarRelacion = new javax.swing.JButton(); jrb_matrimonio = new javax.swing.JRadioButton(); Grupo_relaciones = new javax.swing.ButtonGroup(); modif_relaciones = new javax.swing.JDialog(); jPanel17 = new javax.swing.JPanel(); jLabel81 = new javax.swing.JLabel(); cb_Actor_uno1 = new javax.swing.JComboBox(); cb_Actor_dos1 = new javax.swing.JComboBox(); jrb_familia1 = new javax.swing.JRadioButton(); jrb_noviazgo1 = new javax.swing.JRadioButton(); jrb_amistad1 = new javax.swing.JRadioButton(); jLabel82 = new javax.swing.JLabel(); btn_modifcarRelacion = new javax.swing.JButton(); jrb_matrimonio1 = new javax.swing.JRadioButton(); jLabel83 = new javax.swing.JLabel(); btn_visualizar = new javax.swing.JButton(); Grupo_relaciones2 = new javax.swing.ButtonGroup(); Eliminar_relaciones = new javax.swing.JDialog(); jPanel18 = new javax.swing.JPanel(); jLabel84 = new javax.swing.JLabel(); cb_Actor_uno2 = new javax.swing.JComboBox(); cb_Actor_dos2 = new javax.swing.JComboBox(); jrb_familia2 = new javax.swing.JRadioButton(); jrb_noviazgo2 = new javax.swing.JRadioButton(); jrb_amistad2 = new javax.swing.JRadioButton(); jLabel85 = new javax.swing.JLabel(); btn_eliminarRelacion = new javax.swing.JButton(); jrb_matrimonio2 = new javax.swing.JRadioButton(); btn_visualizar1 = new javax.swing.JButton(); historial_window = new javax.swing.JDialog(); jPanel9 = new javax.swing.JPanel(); btn_save_history = new javax.swing.JButton(); btn_salir_history = new javax.swing.JButton(); btn_pop_stack = new javax.swing.JButton(); jScrollPane3 = new javax.swing.JScrollPane(); list_history = new javax.swing.JTextArea(); Opc_actor = new javax.swing.JPopupMenu(); popEliminar = new javax.swing.JMenuItem(); popModificar = new javax.swing.JMenuItem(); label_load = new javax.swing.JDialog(); jLabel31 = new javax.swing.JLabel(); delete_actor = new javax.swing.JDialog(); jLabel32 = new javax.swing.JLabel(); cb_list_eliminar = new javax.swing.JComboBox(); btn_eliminarActor = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); panel_opaque_delete = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); jLabel10 = new javax.swing.JLabel(); panel_opaque_add = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); panel_add = new javax.swing.JPanel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); panel_delete = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); panel_delete1 = new javax.swing.JPanel(); jLabel13 = new javax.swing.JLabel(); jl_eliminarActor1 = new javax.swing.JLabel(); panel_history = new javax.swing.JPanel(); jLabel29 = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); label_grafico = new javax.swing.JLabel(); jLabel28 = new javax.swing.JLabel(); jPanel4.setBackground(new java.awt.Color(255, 255, 255)); jLabel15.setBackground(new java.awt.Color(0, 149, 149)); jLabel15.setFont(new java.awt.Font("Arial Black", 0, 24)); // NOI18N jLabel15.setForeground(new java.awt.Color(0, 153, 153)); jLabel15.setText("Datos del Actor"); label_profile.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/user_profile.png"))); // NOI18N tf_nombre.setBackground(new java.awt.Color(0, 151, 151)); tf_nombre.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_nombre.setForeground(new java.awt.Color(255, 255, 255)); jLabel17.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel17.setForeground(new java.awt.Color(0, 153, 153)); jLabel17.setText("Nombre Completo:"); jLabel18.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel18.setForeground(new java.awt.Color(0, 153, 153)); jLabel18.setText("Edad:"); tf_nacionalidad.setBackground(new java.awt.Color(0, 151, 151)); tf_nacionalidad.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_nacionalidad.setForeground(new java.awt.Color(255, 255, 255)); jLabel19.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel19.setForeground(new java.awt.Color(0, 153, 153)); jLabel19.setText("Nacionalidad:"); tf_edad.setBackground(new java.awt.Color(0, 151, 151)); tf_edad.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_edad.setForeground(new java.awt.Color(255, 255, 255)); jLabel20.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/form_flat.png"))); // NOI18N jLabel21.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel21.setForeground(new java.awt.Color(0, 153, 153)); jLabel21.setText("Peliculas que ha participado"); list_peliculas.setBackground(new java.awt.Color(0, 153, 153)); list_peliculas.setFont(new java.awt.Font("Arial Black", 0, 11)); // NOI18N list_peliculas.setForeground(new java.awt.Color(255, 255, 255)); jScrollPane1.setViewportView(list_peliculas); btn_buscar_foto.setText("Buscar"); btn_buscar_foto.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_buscar_fotoMouseClicked(evt); } }); btn_save_actor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/saveIcon.png"))); // NOI18N btn_save_actor.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btn_save_actor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_save_actorMouseClicked(evt); } }); btn_select_pelicula.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/selectIcon.png"))); // NOI18N btn_select_pelicula.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btn_select_pelicula.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_select_peliculaMouseClicked(evt); } }); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() .addGap(32, 32, 32) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel4Layout.createSequentialGroup() .addComponent(btn_select_pelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_save_actor, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(89, 89, 89))) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(label_profile).addComponent(btn_buscar_foto))) .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel15) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout .createSequentialGroup().addComponent(jLabel18) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tf_edad, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(jLabel17) .addGap(18, 18, 18).addComponent(tf_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(jLabel19) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tf_nacionalidad, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(44, 44, 44))); jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGap(37, 37, 37).addComponent(jLabel15) .addGap(18, 18, 18) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tf_nombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel17)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel18).addComponent(tf_edad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel4Layout.createSequentialGroup().addGap(28, 28, 28).addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel19).addComponent(tf_nacionalidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel4Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(btn_buscar_foto).addGap(18, 18, 18) .addComponent(label_profile)) .addGroup(jPanel4Layout.createSequentialGroup().addComponent(jLabel21) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(btn_save_actor, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_select_pelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); javax.swing.GroupLayout add_actorLayout = new javax.swing.GroupLayout(add_actor.getContentPane()); add_actor.getContentPane().setLayout(add_actorLayout); add_actorLayout.setHorizontalGroup( add_actorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); add_actorLayout.setVerticalGroup( add_actorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel5.setBackground(new java.awt.Color(255, 255, 255)); jLabel22.setBackground(new java.awt.Color(0, 149, 149)); jLabel22.setFont(new java.awt.Font("Arial Black", 0, 24)); // NOI18N jLabel22.setForeground(new java.awt.Color(0, 153, 153)); jLabel22.setText("Datos de Pelicula"); tf_titulo.setBackground(new java.awt.Color(0, 151, 151)); tf_titulo.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_titulo.setForeground(new java.awt.Color(255, 255, 255)); jLabel24.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel24.setForeground(new java.awt.Color(0, 153, 153)); jLabel24.setText("Titulo:"); jLabel25.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel25.setForeground(new java.awt.Color(0, 153, 153)); jLabel25.setText("Ao:"); tf_estudio.setBackground(new java.awt.Color(0, 151, 151)); tf_estudio.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_estudio.setForeground(new java.awt.Color(255, 255, 255)); jLabel26.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel26.setForeground(new java.awt.Color(0, 153, 153)); jLabel26.setText("Estudio:"); tf_year.setBackground(new java.awt.Color(0, 151, 151)); tf_year.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_year.setForeground(new java.awt.Color(255, 255, 255)); jLabel27.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/movie_clip.png"))); // NOI18N btn_savePelicula.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/saveIcon.png"))); // NOI18N btn_savePelicula.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btn_savePelicula.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_savePeliculaMouseClicked(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addGap(32, 32, 32).addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel22) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup().addComponent(jLabel25) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tf_year, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel5Layout.createSequentialGroup().addComponent(jLabel24) .addGap(18, 18, 18).addComponent(tf_titulo, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel5Layout.createSequentialGroup().addComponent(jLabel26) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(tf_estudio, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18).addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel5Layout.createSequentialGroup().addGap(211, 211, 211).addComponent( btn_savePelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(42, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel5Layout.createSequentialGroup().addGap(15, 15, 15).addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel5Layout.createSequentialGroup().addComponent(jLabel22).addGap(18, 18, 18) .addGroup(jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tf_titulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel24))) .addComponent(jLabel27, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel25).addComponent(tf_year, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel26) .addComponent(tf_estudio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(49, 49, 49) .addComponent(btn_savePelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout add_PeliculaLayout = new javax.swing.GroupLayout(add_Pelicula.getContentPane()); add_Pelicula.getContentPane().setLayout(add_PeliculaLayout); add_PeliculaLayout.setHorizontalGroup( add_PeliculaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); add_PeliculaLayout .setVerticalGroup(add_PeliculaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); Agregar.setText("Agregar"); Agregar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { AgregarActionPerformed(evt); } }); PU_grafico.add(Agregar); cambiar_backGround.setText("Cambiar fondo"); cambiar_backGround.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cambiar_backGroundActionPerformed(evt); } }); PU_grafico.add(cambiar_backGround); menu_modificar.setText("modificar"); Actor_menu.setText("Actor"); Actor_menu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Actor_menuActionPerformed(evt); } }); menu_modificar.add(Actor_menu); Movie_menu.setText("Pelicula"); Movie_menu.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Movie_menuActionPerformed(evt); } }); menu_modificar.add(Movie_menu); PU_grafico.add(menu_modificar); add_relaciones.setText("Agregar relaciones"); add_relaciones.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { add_relacionesActionPerformed(evt); } }); PU_grafico.add(add_relaciones); modifcar_relaciones.setText("Modificar Relaciones"); modifcar_relaciones.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { modifcar_relacionesActionPerformed(evt); } }); PU_grafico.add(modifcar_relaciones); eliminar_relaciones.setText("Eliminar Relaciones"); eliminar_relaciones.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { eliminar_relacionesActionPerformed(evt); } }); PU_grafico.add(eliminar_relaciones); Mostrar_grafo.setText("Dibujar prueba"); Mostrar_grafo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Mostrar_grafoActionPerformed(evt); } }); PU_grafico.add(Mostrar_grafo); Save_info.setText("Guardar Informacion"); Save_info.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Save_infoActionPerformed(evt); } }); PU_grafico.add(Save_info); label_preview.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/ActorAdd.png"))); // NOI18N cb_actores_existentes.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cb_actores_existentesItemStateChanged(evt); } }); btn_add_graphic.setText("Agregar al grafico"); btn_add_graphic.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_add_graphicMouseClicked(evt); } }); javax.swing.GroupLayout add_actor_mapaLayout = new javax.swing.GroupLayout(add_actor_mapa.getContentPane()); add_actor_mapa.getContentPane().setLayout(add_actor_mapaLayout); add_actor_mapaLayout.setHorizontalGroup(add_actor_mapaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, add_actor_mapaLayout.createSequentialGroup() .addContainerGap(82, Short.MAX_VALUE) .addGroup(add_actor_mapaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, add_actor_mapaLayout.createSequentialGroup() .addComponent(cb_actores_existentes, javax.swing.GroupLayout.PREFERRED_SIZE, 234, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(41, 41, 41)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, add_actor_mapaLayout.createSequentialGroup().addComponent(btn_add_graphic) .addGap(107, 107, 107))) .addComponent(label_preview, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); add_actor_mapaLayout.setVerticalGroup(add_actor_mapaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(add_actor_mapaLayout.createSequentialGroup().addGap(34, 34, 34) .addComponent(cb_actores_existentes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_add_graphic).addGap(34, 34, 34)) .addGroup(add_actor_mapaLayout.createSequentialGroup().addContainerGap().addComponent(label_preview, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); jPanel6.setBackground(new java.awt.Color(255, 255, 255)); jLabel12.setFont(new java.awt.Font("Arial Black", 0, 18)); // NOI18N jLabel12.setForeground(new java.awt.Color(0, 153, 153)); jLabel12.setText("Panel de eliminacion"); jButton1.setText("Eliminar"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton1MouseClicked(evt); } }); javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout .setHorizontalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addGroup(jPanel6Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addGap(27, 27, 27) .addComponent(jLabel12)) .addGroup(jPanel6Layout.createSequentialGroup().addGap(86, 86, 86) .addComponent(jButton1))) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addComponent(cb_delete_movie, javax.swing.GroupLayout.PREFERRED_SIZE, 205, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap())); jPanel6Layout.setVerticalGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup().addContainerGap().addComponent(jLabel12) .addGap(18, 18, 18) .addComponent(cb_delete_movie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(39, 39, 39).addComponent(jButton1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout delete_movieLayout = new javax.swing.GroupLayout(delete_movie.getContentPane()); delete_movie.getContentPane().setLayout(delete_movieLayout); delete_movieLayout.setHorizontalGroup( delete_movieLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); delete_movieLayout .setVerticalGroup(delete_movieLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel7.setBackground(new java.awt.Color(255, 255, 255)); jLabel16.setFont(new java.awt.Font("Arial Black", 0, 18)); // NOI18N jLabel16.setForeground(new java.awt.Color(0, 153, 153)); jLabel16.setText("Panel para modificar actores"); jLabel23.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/FixIcon.png"))); // NOI18N jLabel70.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel70.setForeground(new java.awt.Color(0, 153, 153)); jLabel70.setText("Nombre Completo:"); jLabel71.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel71.setForeground(new java.awt.Color(0, 153, 153)); jLabel71.setText("Edad:"); jLabel72.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel72.setForeground(new java.awt.Color(0, 153, 153)); jLabel72.setText("Nacionalidad:"); tf_edad_modificar.setBackground(new java.awt.Color(0, 151, 151)); tf_edad_modificar.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_edad_modificar.setForeground(new java.awt.Color(255, 255, 255)); tf_nacionalidad_modificar.setBackground(new java.awt.Color(0, 151, 151)); tf_nacionalidad_modificar.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_nacionalidad_modificar.setForeground(new java.awt.Color(255, 255, 255)); tf_nombre_modificar.setBackground(new java.awt.Color(0, 151, 151)); tf_nombre_modificar.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_nombre_modificar.setForeground(new java.awt.Color(255, 255, 255)); jLabel73.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel73.setForeground(new java.awt.Color(0, 153, 153)); jLabel73.setText("Peliculas que ha participado"); list_peliculas_modificar.setBackground(new java.awt.Color(0, 153, 153)); list_peliculas_modificar.setFont(new java.awt.Font("Arial Black", 0, 11)); // NOI18N list_peliculas_modificar.setForeground(new java.awt.Color(255, 255, 255)); jScrollPane9.setViewportView(list_peliculas_modificar); btn_modificar_actor.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/saveIcon.png"))); // NOI18N btn_modificar_actor.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btn_modificar_actor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_modificar_actorMouseClicked(evt); } }); cb_list_modifica.setBackground(new java.awt.Color(0, 153, 153)); cb_list_modifica.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cb_list_modificaItemStateChanged(evt); } }); javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(cb_list_modifica, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel23, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel7Layout.createSequentialGroup().addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel7Layout.createSequentialGroup().addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(btn_modificar_actor, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel7Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel73, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(jLabel72)).addGap(146, 146, 146)) .addGroup(jPanel7Layout.createSequentialGroup().addComponent(jLabel71) .addGap(103, 103, 103) .addGroup(jPanel7Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tf_edad_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tf_nacionalidad_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(jPanel7Layout.createSequentialGroup().addComponent(jLabel70) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tf_nombre_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(0, 9, Short.MAX_VALUE))) .addContainerGap())); jPanel7Layout.setVerticalGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup().addContainerGap().addGroup(jPanel7Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel7Layout.createSequentialGroup().addComponent(jLabel16).addGap(21, 21, 21) .addComponent(cb_list_modifica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel70).addComponent(tf_nombre_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(tf_edad_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel71)) .addGap(16, 16, 16) .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel72).addComponent(tf_nacionalidad_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel73).addGap(18, 18, 18) .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(btn_modificar_actor, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); javax.swing.GroupLayout Modificar_actorLayout = new javax.swing.GroupLayout( Modificar_actor.getContentPane()); Modificar_actor.getContentPane().setLayout(Modificar_actorLayout); Modificar_actorLayout.setHorizontalGroup( Modificar_actorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); Modificar_actorLayout.setVerticalGroup( Modificar_actorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel15.setBackground(new java.awt.Color(255, 255, 255)); jLabel74.setBackground(new java.awt.Color(0, 149, 149)); jLabel74.setFont(new java.awt.Font("Arial Black", 0, 24)); // NOI18N jLabel74.setForeground(new java.awt.Color(0, 153, 153)); jLabel74.setText("Datos de Pelicula"); tf_titulo_modificar.setBackground(new java.awt.Color(0, 151, 151)); tf_titulo_modificar.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_titulo_modificar.setForeground(new java.awt.Color(255, 255, 255)); jLabel75.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel75.setForeground(new java.awt.Color(0, 153, 153)); jLabel75.setText("Titulo:"); jLabel76.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel76.setForeground(new java.awt.Color(0, 153, 153)); jLabel76.setText("Ao:"); tf_estudio_modificar.setBackground(new java.awt.Color(0, 151, 151)); tf_estudio_modificar.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_estudio_modificar.setForeground(new java.awt.Color(255, 255, 255)); jLabel77.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel77.setForeground(new java.awt.Color(0, 153, 153)); jLabel77.setText("Estudio:"); tf_year_modificar.setBackground(new java.awt.Color(0, 151, 151)); tf_year_modificar.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N tf_year_modificar.setForeground(new java.awt.Color(255, 255, 255)); jLabel78.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/movie_clip.png"))); // NOI18N btn_ModificarPelicula.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/saveIcon.png"))); // NOI18N btn_ModificarPelicula.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btn_ModificarPelicula.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_ModificarPeliculaMouseClicked(evt); } }); cb_list_peliculas.setBackground(new java.awt.Color(0, 153, 153)); cb_list_peliculas.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cb_list_peliculasItemStateChanged(evt); } }); javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15); jPanel15.setLayout(jPanel15Layout); jPanel15Layout.setHorizontalGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addGap(32, 32, 32).addGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel74) .addGroup(jPanel15Layout.createSequentialGroup().addGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel77).addComponent(jLabel76).addComponent(jLabel75)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(tf_year_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tf_estudio_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tf_titulo_modificar, javax.swing.GroupLayout.PREFERRED_SIZE, 259, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(cb_list_peliculas, javax.swing.GroupLayout.PREFERRED_SIZE, 326, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel78, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel15Layout.createSequentialGroup().addGap(215, 215, 215).addComponent( btn_ModificarPelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(42, Short.MAX_VALUE))); jPanel15Layout.setVerticalGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel15Layout.createSequentialGroup().addGap(15, 15, 15).addGroup(jPanel15Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel15Layout.createSequentialGroup().addComponent(jLabel74).addGap(18, 18, 18) .addComponent(cb_list_peliculas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(4, 4, 4)) .addComponent(jLabel78, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE) .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel75, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(tf_titulo_modificar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(29, 29, 29) .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel76, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(tf_year_modificar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel77, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(tf_estudio_modificar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(35, 35, 35).addComponent(btn_ModificarPelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27))); javax.swing.GroupLayout Modificar_peliculaLayout = new javax.swing.GroupLayout( Modificar_pelicula.getContentPane()); Modificar_pelicula.getContentPane().setLayout(Modificar_peliculaLayout); Modificar_peliculaLayout.setHorizontalGroup( Modificar_peliculaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); Modificar_peliculaLayout.setVerticalGroup( Modificar_peliculaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jLabel79.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel79.setText("Panel de relaciones"); Grupo_relaciones.add(jrb_familia); jrb_familia.setText("Familia"); Grupo_relaciones.add(jrb_noviazgo); jrb_noviazgo.setText("Noviazgo"); Grupo_relaciones.add(jrb_amistad); jrb_amistad.setText("Amistad"); jLabel80.setText("Que relacion existe entre ellos?"); btn_agregarRelacion.setText("Generar relacion"); btn_agregarRelacion.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_agregarRelacionMouseClicked(evt); } }); Grupo_relaciones.add(jrb_matrimonio); jrb_matrimonio.setText("Matrimonio"); javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16); jPanel16.setLayout(jPanel16Layout); jPanel16Layout.setHorizontalGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap().addGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup() .addComponent(cb_Actor_uno, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE) .addComponent(cb_Actor_dos, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel16Layout.createSequentialGroup().addGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(btn_agregarRelacion) .addGroup(jPanel16Layout.createSequentialGroup().addComponent(jrb_familia) .addGap(30, 30, 30).addComponent(jrb_noviazgo).addGap(18, 18, 18) .addComponent(jrb_amistad))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jrb_matrimonio).addGap(0, 0, Short.MAX_VALUE)))) .addGroup(jPanel16Layout.createSequentialGroup() .addGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addGap(125, 125, 125) .addComponent(jLabel79)) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap() .addComponent(jLabel80))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap())); jPanel16Layout.setVerticalGroup(jPanel16Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel16Layout.createSequentialGroup().addContainerGap().addComponent(jLabel79) .addGap(18, 18, 18) .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cb_Actor_uno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cb_Actor_dos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel80).addGap(15, 15, 15) .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jrb_familia).addComponent(jrb_noviazgo).addComponent(jrb_amistad) .addComponent(jrb_matrimonio)) .addGap(33, 33, 33).addComponent(btn_agregarRelacion) .addContainerGap(25, Short.MAX_VALUE))); javax.swing.GroupLayout sub_relacionesLayout = new javax.swing.GroupLayout(sub_relaciones.getContentPane()); sub_relaciones.getContentPane().setLayout(sub_relacionesLayout); sub_relacionesLayout.setHorizontalGroup( sub_relacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); sub_relacionesLayout.setVerticalGroup( sub_relacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jLabel81.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel81.setText("Panel de relaciones"); Grupo_relaciones2.add(jrb_familia1); jrb_familia1.setText("Familia"); Grupo_relaciones2.add(jrb_noviazgo1); jrb_noviazgo1.setText("Noviazgo"); Grupo_relaciones2.add(jrb_amistad1); jrb_amistad1.setText("Amistad"); jLabel82.setText("Que relacion existe entre ellos:"); btn_modifcarRelacion.setText("Generar relacion"); btn_modifcarRelacion.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_modifcarRelacionMouseClicked(evt); } }); Grupo_relaciones2.add(jrb_matrimonio1); jrb_matrimonio1.setText("Matrimonio"); jLabel83.setText("Seleccione la nueva relacion"); btn_visualizar.setText("Visualizar Relacion"); btn_visualizar.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_visualizarMouseClicked(evt); } }); javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17); jPanel17.setLayout(jPanel17Layout); jPanel17Layout.setHorizontalGroup(jPanel17Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup().addGroup(jPanel17Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup().addContainerGap() .addComponent(cb_Actor_uno1, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 46, Short.MAX_VALUE) .addComponent(cb_Actor_dos1, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel17Layout.createSequentialGroup().addGroup(jPanel17Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup().addGap(125, 125, 125) .addComponent(jLabel81)) .addGroup(jPanel17Layout.createSequentialGroup().addGap(101, 101, 101).addComponent( jLabel82, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel17Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel17Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel83, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel17Layout.createSequentialGroup() .addGroup(jPanel17Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup() .addComponent(jrb_familia1) .addGap(30, 30, 30) .addComponent(jrb_noviazgo1) .addGap(18, 18, 18) .addComponent(jrb_amistad1)) .addGroup(jPanel17Layout.createSequentialGroup() .addGap(111, 111, 111) .addComponent(btn_modifcarRelacion))) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jrb_matrimonio1))))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) .addGroup(jPanel17Layout.createSequentialGroup().addGap(120, 120, 120).addComponent(btn_visualizar) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel17Layout.setVerticalGroup(jPanel17Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel17Layout.createSequentialGroup().addContainerGap().addComponent(jLabel81) .addGap(18, 18, 18) .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cb_Actor_uno1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cb_Actor_dos1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btn_visualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel82).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jrb_familia1).addComponent(jrb_noviazgo1).addComponent(jrb_amistad1) .addComponent(jrb_matrimonio1)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel83) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btn_modifcarRelacion) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout modif_relacionesLayout = new javax.swing.GroupLayout( modif_relaciones.getContentPane()); modif_relaciones.getContentPane().setLayout(modif_relacionesLayout); modif_relacionesLayout.setHorizontalGroup(modif_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(modif_relacionesLayout.createSequentialGroup().addContainerGap().addComponent(jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); modif_relacionesLayout.setVerticalGroup( modif_relacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jLabel84.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel84.setText("Panel de relaciones"); Grupo_relaciones2.add(jrb_familia2); jrb_familia2.setText("Familia"); Grupo_relaciones2.add(jrb_noviazgo2); jrb_noviazgo2.setText("Noviazgo"); Grupo_relaciones2.add(jrb_amistad2); jrb_amistad2.setText("Amistad"); jLabel85.setText("Que relacion existe entre ellos:"); btn_eliminarRelacion.setText("Eliminar Relacion"); btn_eliminarRelacion.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_eliminarRelacionMouseClicked(evt); } }); Grupo_relaciones2.add(jrb_matrimonio2); jrb_matrimonio2.setText("Matrimonio"); btn_visualizar1.setText("Visualizar Relacion"); btn_visualizar1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_visualizar1MouseClicked(evt); } }); javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18); jPanel18.setLayout(jPanel18Layout); jPanel18Layout.setHorizontalGroup(jPanel18Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup().addGroup(jPanel18Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup().addContainerGap() .addComponent(cb_Actor_uno2, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE) .addComponent(cb_Actor_dos2, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel18Layout.createSequentialGroup().addGroup(jPanel18Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup().addGap(125, 125, 125) .addComponent(jLabel84)) .addGroup(jPanel18Layout.createSequentialGroup().addGap(101, 101, 101).addComponent( jLabel85, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel18Layout.createSequentialGroup().addContainerGap() .addComponent(jrb_familia2).addGap(30, 30, 30) .addGroup(jPanel18Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup().addGap(21, 21, 21) .addComponent(btn_eliminarRelacion)) .addGroup(jPanel18Layout.createSequentialGroup() .addComponent(jrb_noviazgo2).addGap(18, 18, 18) .addComponent(jrb_amistad2) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jrb_matrimonio2))))) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) .addGroup(jPanel18Layout.createSequentialGroup().addGap(120, 120, 120).addComponent(btn_visualizar1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel18Layout.setVerticalGroup(jPanel18Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel18Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel84).addGap(18, 18, 18) .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cb_Actor_uno2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cb_Actor_dos2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btn_visualizar1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel85).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jrb_familia2).addComponent(jrb_noviazgo2).addComponent(jrb_amistad2) .addComponent(jrb_matrimonio2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btn_eliminarRelacion))); javax.swing.GroupLayout Eliminar_relacionesLayout = new javax.swing.GroupLayout( Eliminar_relaciones.getContentPane()); Eliminar_relaciones.getContentPane().setLayout(Eliminar_relacionesLayout); Eliminar_relacionesLayout.setHorizontalGroup(Eliminar_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Eliminar_relacionesLayout.createSequentialGroup().addContainerGap().addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); Eliminar_relacionesLayout.setVerticalGroup(Eliminar_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Eliminar_relacionesLayout.createSequentialGroup() .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 2, Short.MAX_VALUE))); jPanel9.setBackground(new java.awt.Color(255, 255, 255)); btn_save_history.setText("Guardar"); btn_save_history.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_save_historyMouseClicked(evt); } }); btn_salir_history.setText("Salir"); btn_salir_history.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_salir_historyMouseClicked(evt); } }); btn_pop_stack.setText("Eliminar"); btn_pop_stack.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_pop_stackMouseClicked(evt); } }); list_history.setBackground(new java.awt.Color(0, 153, 153)); list_history.setColumns(20); list_history.setFont(new java.awt.Font("Arial Black", 0, 12)); // NOI18N list_history.setForeground(new java.awt.Color(255, 255, 255)); list_history.setRows(5); jScrollPane3.setViewportView(list_history); javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup(jPanel9Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup().addGap(114, 114, 114).addComponent(btn_save_history) .addGap(57, 57, 57).addComponent(btn_pop_stack).addGap(67, 67, 67) .addComponent(btn_salir_history).addContainerGap(145, Short.MAX_VALUE)) .addComponent(jScrollPane3)); jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel9Layout.createSequentialGroup() .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 291, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btn_save_history).addComponent(btn_salir_history) .addComponent(btn_pop_stack)) .addGap(0, 34, Short.MAX_VALUE))); javax.swing.GroupLayout historial_windowLayout = new javax.swing.GroupLayout( historial_window.getContentPane()); historial_window.getContentPane().setLayout(historial_windowLayout); historial_windowLayout.setHorizontalGroup( historial_windowLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); historial_windowLayout.setVerticalGroup( historial_windowLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); popEliminar.setText("Eliminar"); popEliminar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { popEliminarActionPerformed(evt); } }); Opc_actor.add(popEliminar); popModificar.setText("Modificar"); Opc_actor.add(popModificar); jLabel31.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/loader.gif"))); // NOI18N javax.swing.GroupLayout label_loadLayout = new javax.swing.GroupLayout(label_load.getContentPane()); label_load.getContentPane().setLayout(label_loadLayout); label_loadLayout.setHorizontalGroup(label_loadLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel31)); label_loadLayout.setVerticalGroup(label_loadLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jLabel31)); jLabel32.setFont(new java.awt.Font("Arial Black", 0, 18)); // NOI18N jLabel32.setForeground(new java.awt.Color(0, 153, 153)); jLabel32.setText("Panel para eliminar actores"); cb_list_eliminar.setBackground(new java.awt.Color(0, 153, 153)); cb_list_eliminar.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cb_list_eliminarItemStateChanged(evt); } }); btn_eliminarActor.setText("Eliminar"); btn_eliminarActor.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_eliminarActorMouseClicked(evt); } }); javax.swing.GroupLayout delete_actorLayout = new javax.swing.GroupLayout(delete_actor.getContentPane()); delete_actor.getContentPane().setLayout(delete_actorLayout); delete_actorLayout.setHorizontalGroup(delete_actorLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(delete_actorLayout.createSequentialGroup().addGroup(delete_actorLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(delete_actorLayout.createSequentialGroup().addGap(60, 60, 60) .addGroup(delete_actorLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cb_list_eliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 285, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel32))) .addGroup(delete_actorLayout.createSequentialGroup().addGap(144, 144, 144).addComponent( btn_eliminarActor, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(59, Short.MAX_VALUE))); delete_actorLayout.setVerticalGroup(delete_actorLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, delete_actorLayout.createSequentialGroup() .addComponent(jLabel32) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cb_list_eliminar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btn_eliminarActor, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jPanel2.setBackground(new java.awt.Color(16, 188, 188)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/Search.png"))); // NOI18N jLabel1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel1MouseClicked(evt); } }); jLabel2.setFont(new java.awt.Font("Arial Black", 0, 18)); // NOI18N jLabel2.setForeground(new java.awt.Color(255, 255, 255)); jLabel2.setText("Menu "); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout .setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addGap(24, 24, 24).addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1).addContainerGap())); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addComponent(jLabel2) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap(13, Short.MAX_VALUE))))); jPanel3.setBackground(new java.awt.Color(8, 92, 135)); panel_opaque_delete.setBackground(new java.awt.Color(8, 92, 135)); panel_opaque_delete.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { panel_opaque_deleteMouseExited(evt); } }); panel_opaque_delete.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { panel_opaque_deleteMouseMoved(evt); } }); jLabel9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/deleteIcon.png"))); // NOI18N jLabel10.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel10.setForeground(new java.awt.Color(255, 255, 255)); jLabel10.setText("Eliminar"); jLabel10.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jLabel10.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { jLabel10MouseExited(evt); } }); jLabel10.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { jLabel10MouseMoved(evt); } }); javax.swing.GroupLayout panel_opaque_deleteLayout = new javax.swing.GroupLayout(panel_opaque_delete); panel_opaque_delete.setLayout(panel_opaque_deleteLayout); panel_opaque_deleteLayout.setHorizontalGroup( panel_opaque_deleteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_opaque_deleteLayout.createSequentialGroup().addContainerGap() .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_opaque_deleteLayout.setVerticalGroup( panel_opaque_deleteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_opaque_deleteLayout.createSequentialGroup().addContainerGap() .addGroup(panel_opaque_deleteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_opaque_add.setBackground(new java.awt.Color(8, 92, 135)); panel_opaque_add.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { panel_opaque_addMouseExited(evt); } }); panel_opaque_add.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { panel_opaque_addMouseMoved(evt); } }); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/addIcon.png"))); // NOI18N jLabel3.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel3.setForeground(new java.awt.Color(255, 255, 255)); jLabel3.setText("Agregar"); jLabel3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jLabel3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { jLabel3MouseExited(evt); } }); jLabel3.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { jLabel3MouseMoved(evt); } }); javax.swing.GroupLayout panel_opaque_addLayout = new javax.swing.GroupLayout(panel_opaque_add); panel_opaque_add.setLayout(panel_opaque_addLayout); panel_opaque_addLayout.setHorizontalGroup( panel_opaque_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_opaque_addLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); panel_opaque_addLayout.setVerticalGroup( panel_opaque_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, panel_opaque_addLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panel_opaque_addLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap())); panel_add.setBackground(new java.awt.Color(1, 100, 150)); panel_add.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/movie_icon.png"))); // NOI18N jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/userIcon.png"))); // NOI18N jLabel7.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel7.setForeground(new java.awt.Color(255, 255, 255)); jLabel7.setText("Actor"); jLabel7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jLabel7.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel7MouseClicked(evt); } }); jLabel8.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel8.setForeground(new java.awt.Color(255, 255, 255)); jLabel8.setText("Pelicula"); jLabel8.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jLabel8.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel8MouseClicked(evt); } }); javax.swing.GroupLayout panel_addLayout = new javax.swing.GroupLayout(panel_add); panel_add.setLayout(panel_addLayout); panel_addLayout.setHorizontalGroup(panel_addLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_addLayout.createSequentialGroup().addContainerGap() .addGroup(panel_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_addLayout.createSequentialGroup() .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jLabel8)) .addGroup(panel_addLayout.createSequentialGroup() .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jLabel7))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_addLayout.setVerticalGroup(panel_addLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel_addLayout.createSequentialGroup() .addContainerGap() .addGroup(panel_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7)) .addGroup(panel_addLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_addLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) .addGroup(panel_addLayout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel8) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))); panel_delete.setBackground(new java.awt.Color(1, 100, 150)); jLabel11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/movie_icon.png"))); // NOI18N jLabel14.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel14.setForeground(new java.awt.Color(255, 255, 255)); jLabel14.setText("Eliminar pelicula"); jLabel14.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jLabel14.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel14MouseClicked(evt); } }); panel_delete1.setBackground(new java.awt.Color(1, 100, 150)); jLabel13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/userIcon.png"))); // NOI18N jl_eliminarActor1.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jl_eliminarActor1.setForeground(new java.awt.Color(255, 255, 255)); jl_eliminarActor1.setText("Eliminar Actor"); jl_eliminarActor1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jl_eliminarActor1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jl_eliminarActor1MouseClicked(evt); } }); javax.swing.GroupLayout panel_delete1Layout = new javax.swing.GroupLayout(panel_delete1); panel_delete1.setLayout(panel_delete1Layout); panel_delete1Layout.setHorizontalGroup( panel_delete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup( javax.swing.GroupLayout.Alignment.TRAILING, panel_delete1Layout.createSequentialGroup().addContainerGap().addComponent(jLabel13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jl_eliminarActor1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_delete1Layout .setVerticalGroup(panel_delete1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel_delete1Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panel_delete1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jl_eliminarActor1).addComponent(jLabel13)) .addGap(12, 12, 12))); javax.swing.GroupLayout panel_deleteLayout = new javax.swing.GroupLayout(panel_delete); panel_delete.setLayout(panel_deleteLayout); panel_deleteLayout.setHorizontalGroup( panel_deleteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel_deleteLayout.createSequentialGroup().addContainerGap() .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(jLabel14) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addComponent(panel_delete1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); panel_deleteLayout.setVerticalGroup(panel_deleteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, panel_deleteLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(panel_deleteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel14)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(panel_delete1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); panel_history.setBackground(new java.awt.Color(4, 105, 139)); jLabel29.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/historyIcon.png"))); // NOI18N jLabel30.setFont(new java.awt.Font("Arial Black", 0, 14)); // NOI18N jLabel30.setForeground(new java.awt.Color(255, 255, 255)); jLabel30.setText("Ver historial"); jLabel30.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jLabel30.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jLabel30MouseClicked(evt); } public void mouseExited(java.awt.event.MouseEvent evt) { jLabel30MouseExited(evt); } }); jLabel30.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseMoved(java.awt.event.MouseEvent evt) { jLabel30MouseMoved(evt); } }); javax.swing.GroupLayout panel_historyLayout = new javax.swing.GroupLayout(panel_history); panel_history.setLayout(panel_historyLayout); panel_historyLayout.setHorizontalGroup( panel_historyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_historyLayout.createSequentialGroup().addContainerGap() .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); panel_historyLayout .setVerticalGroup(panel_historyLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(panel_historyLayout.createSequentialGroup().addContainerGap() .addGroup(panel_historyLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel30, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel29, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup(jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(panel_opaque_add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(panel_add, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_delete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_opaque_delete, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(panel_history, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() .addComponent(panel_opaque_add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(7, 7, 7) .addComponent(panel_opaque_delete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(panel_history, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(panel_add, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(panel_delete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); label_grafico.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/loaderV6.gif"))); // NOI18N label_grafico.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { label_graficoMouseClicked(evt); } }); jLabel28.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sources/holl (Custom).jpg"))); // NOI18N javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap() .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 191, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(label_grafico, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup().addGap(22, 22, 22) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jLabel28, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(label_grafico))) .addContainerGap())); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); pack(); }// </editor-fold>//GEN-END:initComponents private void panel_opaque_addMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_panel_opaque_addMouseMoved panel_opaque_add.setBackground(Color.LIGHT_GRAY); this.panel_add.setVisible(true); this.panel_delete.setVisible(false); }//GEN-LAST:event_panel_opaque_addMouseMoved private void panel_opaque_addMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_panel_opaque_addMouseExited panel_opaque_add.setBackground(bg_add); }//GEN-LAST:event_panel_opaque_addMouseExited private void panel_opaque_deleteMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_panel_opaque_deleteMouseMoved panel_opaque_delete.setBackground(Color.LIGHT_GRAY); this.panel_delete.setVisible(true); this.panel_add.setVisible(false); }//GEN-LAST:event_panel_opaque_deleteMouseMoved private void panel_opaque_deleteMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_panel_opaque_deleteMouseExited panel_opaque_delete.setBackground(bg_add); }//GEN-LAST:event_panel_opaque_deleteMouseExited private void jLabel3MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel3MouseMoved panel_opaque_add.setBackground(Color.LIGHT_GRAY); this.panel_add.setVisible(true); }//GEN-LAST:event_jLabel3MouseMoved private void jLabel10MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel10MouseMoved panel_opaque_delete.setBackground(Color.LIGHT_GRAY); this.panel_delete.setVisible(true); }//GEN-LAST:event_jLabel10MouseMoved private void jLabel7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel7MouseClicked this.add_actor.setModal(true); this.add_actor.pack(); this.add_actor.setLocationRelativeTo(this); this.add_actor.setVisible(true); }//GEN-LAST:event_jLabel7MouseClicked private void jLabel8MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel8MouseClicked this.add_Pelicula.setModal(true); this.add_Pelicula.pack(); this.add_Pelicula.setLocationRelativeTo(this); this.add_Pelicula.setVisible(true); }//GEN-LAST:event_jLabel8MouseClicked private void jLabel3MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel3MouseExited panel_opaque_add.setBackground(bg_add); }//GEN-LAST:event_jLabel3MouseExited private void jLabel10MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel10MouseExited panel_opaque_delete.setBackground(bg_add); }//GEN-LAST:event_jLabel10MouseExited private void btn_savePeliculaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_savePeliculaMouseClicked try { String titulo = tf_titulo.getText(); String year = tf_year.getText(); String estudio = tf_estudio.getText(); Pelicula tempMovie = new Pelicula(titulo, year, estudio); modelo_list.addElement(new Pelicula(titulo, year, estudio)); list_peliculas.setModel(modelo_list); boolean agregar = true; for (int i = 0; i < Peliculas.size(); i++) { if (Peliculas.get(i).getTitulo().equals(titulo)) { agregar = false; } } if (agregar) { Peliculas.add(tempMovie); System.out.println("Entro para registrar pelicula"); historialGestion.agregarElemento(tempMovie, " se registro pelicula "); } tf_titulo.setText(""); tf_year.setText(""); tf_estudio.setText(""); DefaultComboBoxModel model = (DefaultComboBoxModel) cb_delete_movie.getModel(); DefaultComboBoxModel model_list_modifica = (DefaultComboBoxModel) this.cb_list_peliculas.getModel(); model.addElement(Peliculas.get(Peliculas.size() - 1)); model_list_modifica.addElement(Peliculas.get(Peliculas.size() - 1)); JOptionPane.showMessageDialog(add_Pelicula, "Pelicula agregada con exito", "Agregado", JOptionPane.INFORMATION_MESSAGE); add_Pelicula.setVisible(false); // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); } catch (Exception e) { //e.printStackTrace(); JOptionPane.showMessageDialog(this.add_Pelicula, "Debe ingresar de manera correcta los datos", "Advertencia", JOptionPane.WARNING_MESSAGE); } }//GEN-LAST:event_btn_savePeliculaMouseClicked private void btn_select_peliculaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_select_peliculaMouseClicked try { movie = (Pelicula) list_peliculas.getSelectedValue(); temp.addMovie(movie); // adyaTemp = (ArrayList<Arista>) HollyUniverseGraph.getOutEdges(temp); // actoresArray = (ArrayList<Actor>) HollyUniverseGraph.getVertices(); // HollyUniverseGraph.removeVertex(temp); // boolean ingresar=false; // for (int i = 0; i < actoresArray.size(); i++) { // if (actoresArray.get(i).getNombre().equals(temp.getNombre())) { // ingresar=actoresArray.get(i).addMovie(movie); // temp=actoresArray.get(i); // } // } // HollyUniverseGraph.addVertex(temp); // if (!adyaTemp.isEmpty()) { // for (int i = 0; i < adyaTemp.size(); i++) { // HollyUniverseGraph.addEdge(new Arista(adyaTemp.get(i).getNext(),adyaTemp.get(i).getRelacion()) // , temp, adyaTemp.get(i).getNext()); // } // for (int i = 0; i < adyaTemp.size(); i++) { // HollyUniverseGraph.addEdge(new Arista(temp,adyaTemp.get(i).getRelacion()) // , adyaTemp.get(i).getNext(),temp ); // } // } JOptionPane.showMessageDialog(add_actor, "Pelicula seleccionada, puede continuar", "Seleccion", JOptionPane.INFORMATION_MESSAGE); // if (ingresar) { // historialGestion.agregarElemento(temp, movie, "se agreago pelicula al actor"); // } } catch (Exception e) { // e.printStackTrace(); JOptionPane.showMessageDialog(add_actor, "Error al agregar pelicula", "Error", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_btn_select_peliculaMouseClicked private void btn_save_actorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_save_actorMouseClicked try { label_profile.setIcon(new ImageIcon("./src/sources/user_profile.png")); String nombre = tf_nombre.getText(); int edad = Integer.parseInt(tf_edad.getText()); String nacionalidad = tf_nacionalidad.getText(); temp.setNombre(nombre); temp.setEdad(edad); temp.setNacionalidad(nacionalidad); tf_nombre.setText(""); tf_edad.setText(""); tf_nacionalidad.setText(""); DefaultComboBoxModel model = (DefaultComboBoxModel) this.cb_actores_existentes.getModel(); DefaultComboBoxModel model_list_modifica = (DefaultComboBoxModel) this.cb_list_modifica.getModel(); DefaultComboBoxModel model_relacion1 = (DefaultComboBoxModel) this.cb_Actor_uno.getModel(); DefaultComboBoxModel model_relacion2 = (DefaultComboBoxModel) this.cb_Actor_dos.getModel(); DefaultComboBoxModel model_relacion3 = (DefaultComboBoxModel) this.cb_Actor_uno1.getModel(); DefaultComboBoxModel model_relacion4 = (DefaultComboBoxModel) this.cb_Actor_dos1.getModel(); DefaultComboBoxModel model_relacion5 = (DefaultComboBoxModel) this.cb_Actor_uno2.getModel(); DefaultComboBoxModel model_relacion6 = (DefaultComboBoxModel) this.cb_Actor_dos2.getModel(); DefaultComboBoxModel model_relacion7 = (DefaultComboBoxModel) this.cb_list_eliminar.getModel(); boolean agregar = true; actoresArray = new ArrayList<>(HollyUniverseGraph.getVertices()); for (int i = 0; i < actoresArray.size(); i++) { if (nombre.equals(actoresArray.get(i).getNombre())) { agregar = false; } } if (agregar) { JOptionPane.showMessageDialog(add_actor, "Actor agregado con exito\nahora puede agregar al grafico!!!", "Agregado", JOptionPane.INFORMATION_MESSAGE); HollyUniverseGraph.addVertex(temp); actoresArray.add(temp); historialGestion.agregarElemento(temp, "Se registro un actor"); System.out.println(HollyUniverseGraph.getVertices().toString()); model.addElement(temp); model_list_modifica.addElement(temp); model_relacion1.addElement(temp); model_relacion2.addElement(temp); model_relacion3.addElement(temp); model_relacion4.addElement(temp); model_relacion5.addElement(temp); model_relacion6.addElement(temp); model_relacion7.addElement(temp); } else { JOptionPane.showMessageDialog(add_actor, "Actor NO agregado, el actor ya fue agregado anteriormente ", "Agregado", JOptionPane.ERROR_MESSAGE); } label_grafico.setIcon(new ImageIcon("./src/sources/hollywoodUniverseV2.jpg")); temp = new Actor();//reinicio de actor nuevo add_actor.setVisible(false); } catch (Exception e) { JOptionPane.showMessageDialog(add_actor, "Actor NO agregado, Ocurrio un error inesperado!!! ", "ERROR", JOptionPane.ERROR_MESSAGE); } // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); }//GEN-LAST:event_btn_save_actorMouseClicked private void label_graficoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_label_graficoMouseClicked boolean foundVertex = true; this.actoresArray = new ArrayList<>(this.HollyUniverseGraph.getVertices()); if (evt.isMetaDown()) { for (Actor temporal : actoresArray) { if (evt.getX() > temporal.getArea()[0] && evt.getX() < temporal.getArea()[1] && evt.getY() > temporal.getArea()[2] && evt.getY() < temporal.getArea()[3]) { this.temp_evt[0] = evt.getX(); this.temp_evt[1] = evt.getY(); Opc_actor.show(evt.getComponent(), evt.getX(), evt.getY()); foundVertex = false; } } if (foundVertex) { PU_grafico.show(evt.getComponent(), evt.getX(), evt.getY()); } } }//GEN-LAST:event_label_graficoMouseClicked private void cb_actores_existentesItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cb_actores_existentesItemStateChanged //agregar foto de cada actor... }//GEN-LAST:event_cb_actores_existentesItemStateChanged private void AgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AgregarActionPerformed this.printActores(); }//GEN-LAST:event_AgregarActionPerformed private void jLabel14MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel14MouseClicked delete_movie.setModal(true); delete_movie.pack(); delete_movie.setLocationRelativeTo(this); delete_movie.setVisible(true); }//GEN-LAST:event_jLabel14MouseClicked private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked try { Peliculas.remove(cb_delete_movie.getSelectedIndex()); if (Peliculas.isEmpty()) { DefaultComboBoxModel model = (DefaultComboBoxModel) cb_delete_movie.getModel(); model.removeAllElements(); model.addElement("No hay mas peliculas"); } else { DefaultComboBoxModel model = (DefaultComboBoxModel) cb_delete_movie.getModel(); model.removeElementAt(Peliculas.size() - 1); model.addElement(Peliculas.get(Peliculas.size() - 1)); } JOptionPane.showMessageDialog(delete_movie, "Pelicula eliminada por completo", "INFO", JOptionPane.INFORMATION_MESSAGE); } catch (Exception e) { JOptionPane.showMessageDialog(delete_movie, "Error al tratar de eliminar la pelicula", "Error", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_jButton1MouseClicked private void btn_add_graphicMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_add_graphicMouseClicked x_map = evt.getX(); y_map = evt.getY(); System.out.println("Cordenada X: " + x_map); System.out.println("Cordeanda Y: " + y_map); Image image_actor = new ImageIcon("./src/sources/kevinBacon.jpg").getImage(); Graphics g = label_grafico.getGraphics(); g.drawImage(image_actor, CordenadaX[CordCont], CordenadaY[CordCont], label_grafico); System.out.println("CoordenadaX: " + CordenadaX[CordCont]); System.out.println("CoordenadaY: " + CordenadaY[CordCont]); CordCont++; add_actor_mapa.setVisible(false); }//GEN-LAST:event_btn_add_graphicMouseClicked private void Actor_menuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Actor_menuActionPerformed Modificar_actor.setModal(true); Modificar_actor.pack(); Modificar_actor.setLocationRelativeTo(this); Modificar_actor.setVisible(true); }//GEN-LAST:event_Actor_menuActionPerformed private void cb_list_modificaItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cb_list_modificaItemStateChanged this.tf_nombre_modificar.setText(((Actor) cb_list_modifica.getSelectedItem()).getNombre()); this.tf_edad_modificar.setText(((Actor) cb_list_modifica.getSelectedItem()).getEdad() + ""); this.tf_nacionalidad_modificar.setText(((Actor) cb_list_modifica.getSelectedItem()).getNacionalidad()); //aplicando todos las peliculas a la lista DefaultListModel<Pelicula> lista_peliculas_actor = new DefaultListModel<>(); for (int i = 0; i < ((Actor) cb_list_modifica.getSelectedItem()).getListPelicula().size(); i++) { lista_peliculas_actor.addElement(((Actor) cb_list_modifica.getSelectedItem()).getListPelicula().get(i)); System.out.println(i + 1 + ")" + ((Actor) cb_list_modifica.getSelectedItem()).getListPelicula().get(i)); } this.list_peliculas_modificar.setModel(lista_peliculas_actor); }//GEN-LAST:event_cb_list_modificaItemStateChanged private void Movie_menuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Movie_menuActionPerformed this.Modificar_pelicula.setModal(true); Modificar_pelicula.pack(); Modificar_pelicula.setLocationRelativeTo(this); Modificar_pelicula.setVisible(true); }//GEN-LAST:event_Movie_menuActionPerformed private void cb_list_peliculasItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cb_list_peliculasItemStateChanged this.tf_titulo_modificar.setText(((Pelicula) cb_list_peliculas.getSelectedItem()).getTitulo()); this.tf_year_modificar.setText(((Pelicula) cb_list_peliculas.getSelectedItem()).getYear()); this.tf_estudio_modificar.setText(((Pelicula) cb_list_peliculas.getSelectedItem()).getEstudio()); }//GEN-LAST:event_cb_list_peliculasItemStateChanged private void add_relacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_add_relacionesActionPerformed this.sub_relaciones.setModal(true); sub_relaciones.pack(); sub_relaciones.setLocationRelativeTo(this); sub_relaciones.setVisible(true); }//GEN-LAST:event_add_relacionesActionPerformed private void btn_agregarRelacionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_agregarRelacionMouseClicked Actor actor1 = (Actor) cb_Actor_uno.getSelectedItem(); Actor actor2 = (Actor) cb_Actor_dos.getSelectedItem(); String TempRelacion = "nada"; if (jrb_amistad.isSelected()) { TempRelacion = "Amistad"; } if (jrb_noviazgo.isSelected()) { TempRelacion = "Noviazgo"; } if (jrb_matrimonio.isSelected()) { TempRelacion = "Matrimonio"; } if (jrb_familia.isSelected()) { TempRelacion = "Familia"; } if (!actor1.getNombre().equals(actor2.getNombre())) { if (!TempRelacion.equals("nada")) { Arista temp = HollyUniverseGraph.findEdge(actor1, actor2); if (temp == null) { HollyUniverseGraph.addEdge(new Arista(TempRelacion, actor1, actor2), actor1, actor2, EdgeType.UNDIRECTED); historialGestion.agregarElemento(actor1, actor2, " Se creo " + TempRelacion); JOptionPane.showMessageDialog(btn_agregarRelacion, "Se ha agregado la relacion con exito!!", "AGREGADO DE RELACION", JOptionPane.INFORMATION_MESSAGE); System.out.println(HollyUniverseGraph.findEdge(actor1, actor2).getRelacion() + "----------------------------------------"); } else { JOptionPane.showMessageDialog(btn_agregarRelacion, "Ya existe una relacion!!", "AGREGADO DE RELACION", JOptionPane.WARNING_MESSAGE); } } else { JOptionPane.showMessageDialog(btn_agregarRelacion, "Debe seleccionar una relacion", "ERROR", JOptionPane.ERROR_MESSAGE); } } else { JOptionPane.showMessageDialog(btn_agregarRelacion, "Debe seleccionar distintos actores", "ERROR DE SELECCION DE DATOS", JOptionPane.WARNING_MESSAGE); } // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); sub_relaciones.dispose(); }//GEN-LAST:event_btn_agregarRelacionMouseClicked private void modifcar_relacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifcar_relacionesActionPerformed this.modif_relaciones.setModal(true); modif_relaciones.pack(); modif_relaciones.setLocationRelativeTo(this); modif_relaciones.setVisible(true); }//GEN-LAST:event_modifcar_relacionesActionPerformed private void btn_modifcarRelacionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_modifcarRelacionMouseClicked Actor actor1 = (Actor) cb_Actor_uno1.getSelectedItem(); Actor actor2 = (Actor) cb_Actor_dos1.getSelectedItem(); Arista temp = HollyUniverseGraph.findEdge(actor1, actor2); String TempRelacion = "nada"; if (jrb_amistad1.isSelected()) { TempRelacion = "Amistad"; } if (jrb_noviazgo1.isSelected()) { TempRelacion = "Noviazgo"; } if (jrb_matrimonio1.isSelected()) { TempRelacion = "Matrimonio"; } if (jrb_familia1.isSelected()) { TempRelacion = "Familia"; } HollyUniverseGraph.removeEdge(HollyUniverseGraph.findEdge(actor1, actor2)); HollyUniverseGraph.addEdge(new Arista(TempRelacion, actor1, actor2), actor1, actor2, EdgeType.UNDIRECTED); historialGestion.agregarElemento(actor1, actor2, " Se modifico relacion de " + temp.getRelacion() + " a " + HollyUniverseGraph.findEdge(actor1, actor2).getRelacion()); System.out.println("relacion modificada de " + temp.getRelacion() + " a " + HollyUniverseGraph.findEdge(actor1, actor2).getRelacion()); JOptionPane.showMessageDialog(btn_modifcarRelacion, "La relacion cambio de " + temp.getRelacion() + " a " + HollyUniverseGraph.findEdge(actor1, actor2).getRelacion(), "MODIFICANDO RELACION", JOptionPane.INFORMATION_MESSAGE); modif_relaciones.dispose(); ; // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); }//GEN-LAST:event_btn_modifcarRelacionMouseClicked private void btn_visualizarMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_visualizarMouseClicked Actor actor1 = (Actor) cb_Actor_uno1.getSelectedItem(); Actor actor2 = (Actor) cb_Actor_dos1.getSelectedItem(); Arista temp = HollyUniverseGraph.findEdge(actor1, actor2); if (temp == null) { JOptionPane.showMessageDialog(btn_visualizar, "NO existe relacion", "MODIFICANDO RELACION", JOptionPane.WARNING_MESSAGE); } else { String TempRelacion = temp.getRelacion(); if (TempRelacion.equals("Amistad")) { jrb_amistad1.setSelected(true); } if (TempRelacion.equals("Familia")) { jrb_familia1.setSelected(true); } if (TempRelacion.equals("Noviazgo")) { jrb_noviazgo1.setSelected(true); } if (TempRelacion.equals("Matrimonio")) { jrb_matrimonio1.setSelected(true); } } }//GEN-LAST:event_btn_visualizarMouseClicked private void eliminar_relacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_eliminar_relacionesActionPerformed this.Eliminar_relaciones.setModal(true); Eliminar_relaciones.pack(); Eliminar_relaciones.setLocationRelativeTo(this); Eliminar_relaciones.setVisible(true); }//GEN-LAST:event_eliminar_relacionesActionPerformed private void btn_eliminarRelacionMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_eliminarRelacionMouseClicked Actor actor1 = (Actor) cb_Actor_uno1.getSelectedItem(); Actor actor2 = (Actor) cb_Actor_dos1.getSelectedItem(); Arista temp = HollyUniverseGraph.findEdge(actor1, actor2); String TempRelacion = ""; TempRelacion = temp.getRelacion(); HollyUniverseGraph.removeEdge(HollyUniverseGraph.findEdge(actor1, actor2)); historialGestion.agregarElemento(actor1, actor2, "Se borro la relacion " + TempRelacion); JOptionPane.showMessageDialog(btn_eliminarRelacion, "Relacion borrada exitosamente", "BORRANDO RELACION", JOptionPane.INFORMATION_MESSAGE); Eliminar_relaciones.dispose(); // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); }//GEN-LAST:event_btn_eliminarRelacionMouseClicked private void btn_visualizar1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_visualizar1MouseClicked Actor actor1 = (Actor) cb_Actor_uno2.getSelectedItem(); Actor actor2 = (Actor) cb_Actor_dos2.getSelectedItem(); Arista temp = HollyUniverseGraph.findEdge(actor1, actor2); if (temp == null) { JOptionPane.showMessageDialog(btn_visualizar1, "NO existe relacion", "MODIFICANDO RELACION", JOptionPane.WARNING_MESSAGE); } else { String TempRelacion = temp.getRelacion(); if (TempRelacion.equals("Amistad")) { jrb_amistad2.setSelected(true); } if (TempRelacion.equals("Familia")) { jrb_familia2.setSelected(true); } if (TempRelacion.equals("Noviazgo")) { jrb_noviazgo2.setSelected(true); } if (TempRelacion.equals("Matrimonio")) { jrb_matrimonio2.setSelected(true); } } }//GEN-LAST:event_btn_visualizar1MouseClicked public void Modificar() { this.actoresArray = new ArrayList<>(this.HollyUniverseGraph.getVertices()); for (int i = 0; i < this.HollyUniverseGraph.getVertices().size(); i++) { System.out.println("Nombre del actor: " + this.actoresArray.get(i).getNombre()); } } private void btn_modificar_actorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_modificar_actorMouseClicked try { System.out.println("Antes de Modificar"); Modificar(); Actor tempModifica = (Actor) cb_list_modifica.getSelectedItem(); String nombre = tf_nombre_modificar.getText(); int edad = Integer.parseInt(tf_edad_modificar.getText()); String nacionalidad = tf_nacionalidad_modificar.getText(); boolean encontrado = false; for (int i = 0; i < actoresArray.size(); i++) { if (actoresArray.get(i).equals(tempModifica)) { encontrado = true; actoresArray.get(i).setNombre(nombre); actoresArray.get(i).setEdad(edad); actoresArray.get(i).setNacionalidad(nacionalidad); } } if (encontrado) { // cb_list_modifica.removeAllItems(); // DefaultComboBoxModel modelo = (DefaultComboBoxModel) cb_list_modifica.getModel(); // System.out.println("listo para asignar actores al comboBox..."); // for (int i = 0; i < actoresArray.size(); i++) { // modelo.addElement(actoresArray.get(i)); // System.out.println("Elemento asignado -> " + actoresArray.get(i)); // } // cb_list_modifica.setModel(modelo); tf_nombre_modificar.setText(""); tf_edad_modificar.setText(""); tf_nacionalidad_modificar.setText(""); historialGestion.agregarElemento(tempModifica, "Modificado de actor"); System.out.println("Despues de modificar"); Modificar(); JOptionPane.showMessageDialog(this.Modificar_actor, "Actor modificado con exito", "Informacion", JOptionPane.INFORMATION_MESSAGE); this.Modificar_actor.setVisible(false); } else { JOptionPane.showMessageDialog(this.Modificar_actor, "No se encontro el actor", "Informacion", JOptionPane.INFORMATION_MESSAGE); } // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); } catch (Exception ex) { JOptionPane.showMessageDialog(this.Modificar_actor, "Error al querer modificar actor", "Error", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_btn_modificar_actorMouseClicked private void btn_ModificarPeliculaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_ModificarPeliculaMouseClicked try { Pelicula temp_modifica_pelicula = (Pelicula) cb_list_peliculas.getSelectedItem(); boolean encontrado = false; String titulo = tf_titulo_modificar.getText(); String year = tf_year_modificar.getText(); String estudio = tf_estudio_modificar.getText(); for (int i = 0; i < Peliculas.size(); i++) { if (Peliculas.get(i).getTitulo().equals(temp_modifica_pelicula.getTitulo())) { encontrado = true; Peliculas.get(i).setTitulo(titulo); Peliculas.get(i).setYear(year); Peliculas.get(i).setEstudio(estudio); } } if (encontrado) { tf_titulo_modificar.setText(""); tf_year_modificar.setText(""); tf_estudio_modificar.setText(""); cb_list_peliculas.removeAllItems(); // DefaultComboBoxModel modelo = (DefaultComboBoxModel) cb_list_peliculas.getModel(); // for (int i = 0; i < Peliculas.size(); i++) { // modelo.addElement(Peliculas.get(i)); // } // cb_list_peliculas.setModel(modelo); historialGestion.agregarElemento(temp_modifica_pelicula, "Modificado de pelicula"); JOptionPane.showMessageDialog(this.Modificar_pelicula, "Pelicula modificada con exito", "Informacion", JOptionPane.INFORMATION_MESSAGE); // modelo_history.addElement(historialGestion.historial.pop()); // list_history.setModel(modelo_history); this.Modificar_pelicula.setVisible(false); } else { JOptionPane.showMessageDialog(this.Modificar_pelicula, "No se encontro la pelicula", "Informacion", JOptionPane.INFORMATION_MESSAGE); } } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(this.Modificar_pelicula, "Error a la hora de modificar pelicula", "Error", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_btn_ModificarPeliculaMouseClicked private void jLabel30MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel30MouseClicked this.historial_window.setModal(true); historial_window.pack(); historial_window.setLocationRelativeTo(this); historial_window.setVisible(true); }//GEN-LAST:event_jLabel30MouseClicked private void jLabel30MouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel30MouseMoved panel_history.setBackground(Color.LIGHT_GRAY); }//GEN-LAST:event_jLabel30MouseMoved private void jLabel30MouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel30MouseExited panel_history.setBackground(bg_add); }//GEN-LAST:event_jLabel30MouseExited private void btn_salir_historyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_salir_historyMouseClicked historial_window.setVisible(false); }//GEN-LAST:event_btn_salir_historyMouseClicked private void btn_save_historyMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_save_historyMouseClicked //en contruccion JOptionPane.showMessageDialog(historial_window, "Para su mayor informacion, nos encontramos en construccion", "Mayor Informacion", JOptionPane.INFORMATION_MESSAGE); }//GEN-LAST:event_btn_save_historyMouseClicked private void btn_pop_stackMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_pop_stackMouseClicked if (historialGestion.historial.size() > 0) { list_history.setText(historialGestion.historial.pop()); JOptionPane.showMessageDialog(historial_window, "Ultimo en Entrar, Primero en Salir (UEPS)", "Mayor Informacion", JOptionPane.INFORMATION_MESSAGE); } else { if (historialGestion.historial.isEmpty()) { JOptionPane.showMessageDialog(historial_window, "Para su mayor informacion, no hay nada mas que mostrar en el historial", "Mayor Informacion", JOptionPane.INFORMATION_MESSAGE); } } }//GEN-LAST:event_btn_pop_stackMouseClicked private void cambiar_backGroundActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cambiar_backGroundActionPerformed ImageIcon gif1 = new ImageIcon("./src/sources/loaderV2.gif"); ImageIcon gif2 = new ImageIcon("./src/sources/loaderV3.gif"); ImageIcon gif3 = new ImageIcon("./src/sources/loaderV4.gif"); ImageIcon gif4 = new ImageIcon("./src/sources/loaderV6.gif"); if (cont_backGrounds == 0) { label_grafico.setIcon(gif1); } else { if (cont_backGrounds == 2) { label_grafico.setIcon(gif2); } else { if (cont_backGrounds == 3) { label_grafico.setIcon(gif3); } else { if (cont_backGrounds == 4) { label_grafico.setIcon(gif4); } } } } cont_backGrounds++; if (cont_backGrounds == 5) { cont_backGrounds = 0; } }//GEN-LAST:event_cambiar_backGroundActionPerformed private void Mostrar_grafoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Mostrar_grafoActionPerformed SimpleGraphView sgv = new SimpleGraphView(); sgv.setGrafo(HollyUniverseGraph); Layout<Actor, Arista> layout = new CircleLayout(sgv.grafo); layout.setSize(new Dimension(800, 600)); BasicVisualizationServer<Actor, Arista> bvs = new BasicVisualizationServer<>(layout); bvs.setPreferredSize(new Dimension(850, 650)); //agregando etiquetas al grafo Transformer<Actor, Paint> vertexPaint = new Transformer<Actor, Paint>() { public Paint transform(Actor i) { return Color.GREEN; } }; float dash[] = { 10.0f }; final Stroke edgeStroke = new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10.0f, dash, 0.0f); Transformer<Arista, Stroke> edgeStrokeTransformer = new Transformer<Arista, Stroke>() { public Stroke transform(Arista s) { return edgeStroke; } }; bvs.getRenderContext().setVertexFillPaintTransformer(vertexPaint); // bvs.getRenderContext().setEdgeStrokeTransformer(edgeStrokeTransformer); bvs.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); bvs.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller()); bvs.getRenderer().getVertexLabelRenderer().setPosition(Position.CNTR); JFrame frame = new JFrame("Vista del grafo con libreria JUNG2"); frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); frame.getContentPane().add(bvs); frame.pack(); frame.setLocationRelativeTo(this); frame.setVisible(true); }//GEN-LAST:event_Mostrar_grafoActionPerformed private void popEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_popEliminarActionPerformed this.actoresArray = new ArrayList<>(this.HollyUniverseGraph.getVertices()); int posicion_eliminar = 0; Actor temp_remove = new Actor(); for (Actor temp_actor : actoresArray) { if (temp_evt[0] > temp_actor.getArea()[0] && temp_evt[0] < temp_actor.getArea()[1] && temp_evt[1] > temp_actor.getArea()[2] && temp_evt[1] < temp_actor.getArea()[3]) { temp_remove = temp_actor; break; } posicion_eliminar++; } this.HollyUniverseGraph.removeVertex(temp_remove); printActores(); }//GEN-LAST:event_popEliminarActionPerformed private void btn_buscar_fotoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_buscar_fotoMouseClicked JFileChooser jfc = new JFileChooser(); jfc.setCurrentDirectory(new File("./")); FileFilter filtro = new FileNameExtensionFilter("Jpg, Png", "jpg", "png"); jfc.setFileFilter(filtro); File archivo = null; try { int op = jfc.showOpenDialog(this.add_actor); if (op == JFileChooser.APPROVE_OPTION) { archivo = jfc.getSelectedFile(); } BufferedImage imagen = ImageIO.read(archivo); Image img; img = Toolkit.getDefaultToolkit().createImage(imagen.getSource()) .getScaledInstance(label_profile.getWidth(), label_profile.getHeight(), 0); label_profile.setIcon(new ImageIcon(img)); this.temp.setFoto_actor(resize(imagen, 54, 54)); } catch (Exception e) { JOptionPane.showMessageDialog(add_actor, "Error al intentar abrir archivo", "ERROR", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_btn_buscar_fotoMouseClicked private void Save_infoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Save_infoActionPerformed File archivo_data = new File("./DataGenerated.bin"); FileOutputStream fos = null; ObjectOutputStream oos = null; try { if (!(archivo_data.exists())) { fos = new FileOutputStream(archivo_data); oos = new ObjectOutputStream(fos); oos.writeObject(this.HollyUniverseGraph); oos.flush(); oos.close(); fos.close(); } JOptionPane.showMessageDialog(this, "Archivo escrito con exito", "EXITO", JOptionPane.INFORMATION_MESSAGE); } catch (Exception e) { JOptionPane.showMessageDialog(this, "Error al escribir archivo de datos", "ERROR", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_Save_infoActionPerformed private void jl_eliminarActor1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jl_eliminarActor1MouseClicked delete_actor.setModal(true); delete_actor.pack(); delete_actor.setLocationRelativeTo(this); delete_actor.setVisible(true); }//GEN-LAST:event_jl_eliminarActor1MouseClicked private void cb_list_eliminarItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cb_list_eliminarItemStateChanged }//GEN-LAST:event_cb_list_eliminarItemStateChanged public boolean metodoRemove(ArrayList<Actor> actoresP, Actor ancla, int existe1) { int cont = actoresArray.size(); boolean seEncontro = false; for (int i = 0; i < actoresP.size(); i++) { if (actoresP.get(i).getNombre().equals(actoresArray.get(existe1).getNombre())) { seEncontro = true; } } if (!seEncontro) { cont--; actoresP = new ArrayList<Actor>(HollyUniverseGraph.getNeighbors(actoresArray.get(cont))); } return seEncontro; } private void btn_eliminarActorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_eliminarActorMouseClicked Actor actor1 = (Actor) cb_list_eliminar.getSelectedItem(); Graph<Actor, Arista> tempGraph = HollyUniverseGraph; ArrayList<Arista> tempAristas = new ArrayList<Arista>(tempGraph.getInEdges(actor1)); actoresArray = new ArrayList<Actor>(tempGraph.getVertices()); for (int i = 0; i < actoresArray.size(); i++) { if (actoresArray.get(i).getNombre().equals(actor1.getNombre())) { actoresArray.remove(i); } } System.out.println("actores adyacntes"); ArrayList<Actor> tempActores2 = new ArrayList<Actor>(HollyUniverseGraph.getNeighbors(actor1)); for (int i = 0; i < tempActores2.size(); i++) { System.out.println(tempActores2.get(i).getNombre()); } System.out.println("actores array"); for (int i = 0; i < actoresArray.size(); i++) { System.out.println(actoresArray.get(i).getNombre()); } boolean existe = false; boolean eliminar = true; int existe1 = 0; for (int i = 0; i < actoresArray.size(); i++) { if (!actoresArray.get(i).equals(null)) { existe1 = i; } } ArrayList<Actor> tempActores = new ArrayList<Actor>(tempGraph.getNeighbors(actoresArray.get(0))); for (int i = 0; i < tempActores.size(); i++) { for (int j = 0; j < actoresArray.size(); j++) { if (tempActores.get(i).getNombre().equals(actoresArray.get(j).getNombre())) { existe = true; } } } if (actoresArray.size() > 2) { tempActores = new ArrayList<Actor>(tempGraph.getNeighbors(actoresArray.get(1))); for (int i = 0; i < tempActores.size(); i++) { for (int j = 0; j < actoresArray.size(); j++) { if (tempActores.get(i).getNombre().equals(actoresArray.get(j).getNombre())) { existe = true; } } } } if (actoresArray.size() > 3) { tempActores = new ArrayList<Actor>(tempGraph.getNeighbors(actoresArray.get(2))); for (int i = 0; i < tempActores.size(); i++) { for (int j = 0; j < actoresArray.size(); j++) { if (tempActores.get(i).getNombre().equals(actoresArray.get(j).getNombre())) { existe = true; } } } } if (actoresArray.size() > 4) { tempActores = new ArrayList<Actor>(tempGraph.getNeighbors(actoresArray.get(3))); for (int i = 0; i < tempActores.size(); i++) { for (int j = 0; j < actoresArray.size(); j++) { if (tempActores.get(i).getNombre().equals(actoresArray.get(j).getNombre())) { existe = true; } } } } tempAristas.clear(); if (existe) { HollyUniverseGraph.removeVertex(actor1); DefaultComboBoxModel cb_model = (DefaultComboBoxModel) cb_list_eliminar.getModel(); cb_model.removeElement(actor1); cb_list_eliminar.setModel(cb_model); JOptionPane.showMessageDialog(this.btn_eliminarActor, "Actor eliminado correctamente", "Informacion", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(this.btn_eliminarActor, "El actor no se puede eliminar", "Informacion", JOptionPane.ERROR_MESSAGE); } actoresArray = new ArrayList<Actor>(HollyUniverseGraph.getVertices()); System.out.println("actializacion"); for (int i = 0; i < actoresArray.size(); i++) { System.out.println(actoresArray.get(i).getNombre()); } }//GEN-LAST:event_btn_eliminarActorMouseClicked private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked File archivo = new File("./DataGenerated.bin"); try { FileInputStream fis = new FileInputStream(archivo); ObjectInputStream ois = new ObjectInputStream(fis); Graph<Actor, Arista> graphLectura; try { while ((graphLectura = ((Graph<Actor, Arista>) ois.readObject())) != null) { this.HollyUniverseGraph = graphLectura; } } catch (EOFException e) { System.out.println("Fin del archivo"); } ois.close(); fis.close(); } catch (Exception e) { System.out.println("error..."); } }//GEN-LAST:event_jLabel1MouseClicked public void printActores() { this.actoresArray = new ArrayList<>(this.HollyUniverseGraph.getVertices()); try { int cant_actores = 0; grafico = ImageIO.read(new File("./src/sources/hollywoodUniverseV2.jpg")); Graphics2D g = grafico.createGraphics(); Actor a = null; for (Actor temp_actor : actoresArray) { a = temp_actor; g.setColor(Color.GREEN); g.setFont(new Font("SansSerif", Font.BOLD, 11)); if (cant_actores == 0) { g.drawImage(temp_actor.getFoto_actor(), null, 150, 25); grafico.setRGB(150 + temp_actor.getFoto_actor().getWidth() / 2, 25 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(150, 150 + temp_actor.getFoto_actor().getWidth(), 25, 25 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 150 - 20, 20); a.setLocation(150 + temp_actor.getFoto_actor().getWidth() / 2, 25 + temp_actor.getFoto_actor().getHeight() / 2); } else { if (cant_actores == 1) { g.drawImage(temp_actor.getFoto_actor(), null, 300, 85); grafico.setRGB(300 + temp_actor.getFoto_actor().getWidth() / 2, 85 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(300, 300 + temp_actor.getFoto_actor().getWidth(), 85, 85 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 300, 80); a.setLocation(300 + temp_actor.getFoto_actor().getWidth() / 2, 85 + temp_actor.getFoto_actor().getHeight() / 2); } else { if (cant_actores == 2) { g.drawImage(temp_actor.getFoto_actor(), null, 475, 25); grafico.setRGB(475 + temp_actor.getFoto_actor().getWidth() / 2, 25 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(475, 475 + temp_actor.getFoto_actor().getWidth(), 25, 25 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 475, 25); a.setLocation(475 + temp_actor.getFoto_actor().getWidth() / 2, 25 + temp_actor.getFoto_actor().getHeight() / 2); } else if (cant_actores == 3) { g.drawImage(temp_actor.getFoto_actor(), null, 50, 225); grafico.setRGB(50 + temp_actor.getFoto_actor().getWidth() / 2, 225 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(50, 50 + temp_actor.getFoto_actor().getWidth(), 225, 225 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 50, 220); a.setLocation(50 + temp_actor.getFoto_actor().getWidth() / 2, 225 + temp_actor.getFoto_actor().getHeight() / 2); } else if (cant_actores == 4) { g.drawImage(temp_actor.getFoto_actor(), null, 300, 200); grafico.setRGB(300 + temp_actor.getFoto_actor().getWidth() / 2, 200 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(300, 300 + temp_actor.getFoto_actor().getWidth(), 200, 200 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 300, 195); a.setLocation(300 + temp_actor.getFoto_actor().getWidth() / 2, 200 + temp_actor.getFoto_actor().getHeight() / 2); } else if (cant_actores == 5) { g.drawImage(temp_actor.getFoto_actor(), null, 575, 225); grafico.setRGB(575 + temp_actor.getFoto_actor().getWidth() / 2, 225 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(575, 575 + temp_actor.getFoto_actor().getWidth(), 225, 225 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 575, 220); a.setLocation(575 + temp_actor.getFoto_actor().getWidth() / 2, 225 + temp_actor.getFoto_actor().getHeight() / 2); } else if (cant_actores == 6) { g.drawImage(temp_actor.getFoto_actor(), null, 150, 415); grafico.setRGB(150 + temp_actor.getFoto_actor().getWidth() / 2, 415 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); g.drawString(a.getNombre(), 150, 410); a.setArea(150, 150 + temp_actor.getFoto_actor().getWidth(), 425, 415 + temp_actor.getFoto_actor().getHeight()); a.setLocation(150 + temp_actor.getFoto_actor().getWidth() / 2, 415 + temp_actor.getFoto_actor().getHeight() / 2); } else if (cant_actores == 7) { g.drawImage(temp_actor.getFoto_actor(), null, 300, 350); grafico.setRGB(300 + temp_actor.getFoto_actor().getWidth() / 2, 350 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(300, 300 + temp_actor.getFoto_actor().getWidth(), 350, 350 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 300, 345); a.setLocation(300 + temp_actor.getFoto_actor().getWidth() / 2, 350 + temp_actor.getFoto_actor().getHeight() / 2); } else if (cant_actores == 8) { g.drawImage(temp_actor.getFoto_actor(), null, 475, 415); grafico.setRGB(475 + temp_actor.getFoto_actor().getWidth() / 2, 415 + temp_actor.getFoto_actor().getHeight() / 2, Color.WHITE.getRGB()); a.setArea(475, 475 + temp_actor.getFoto_actor().getWidth(), 415, 415 + temp_actor.getFoto_actor().getHeight()); g.drawString(a.getNombre(), 475, 410); a.setLocation(475 + temp_actor.getFoto_actor().getWidth() / 2, 415 + temp_actor.getFoto_actor().getHeight() / 2); } } } cant_actores++; } } catch (Exception e) { e.printStackTrace(); JOptionPane.showMessageDialog(this, "Ocurrio un error inesperado en el sistema", "ERROR", JOptionPane.ERROR_MESSAGE); } dibujarAristas(); } public BufferedImage resize(BufferedImage img, int newW, int newH) { Image tmp = img.getScaledInstance(newW, newH, Image.SCALE_SMOOTH); BufferedImage dimg = new BufferedImage(newW, newH, BufferedImage.TYPE_INT_ARGB); Graphics2D g2d = dimg.createGraphics(); g2d.drawImage(tmp, 0, 0, null); g2d.dispose(); return dimg; } public void dibujarAristas() { Graphics2D g = grafico.createGraphics(); g.setFont(new Font("SansSerif", Font.BOLD, 11)); adyaTemp = new ArrayList<>(this.HollyUniverseGraph.getEdges()); for (Actor temp_actor : actoresArray) { for (Arista temp_arista : adyaTemp) { g.setColor(Color.BLACK); g.drawLine(temp_actor.getX(), temp_actor.getY(), temp_arista.getNext().getX(), temp_arista.getNext().getY()); int nx = (temp_actor.getX() + temp_arista.getNext().getX()) / 2; int ny = (temp_actor.getY() + temp_arista.getNext().getY()) / 2; g.setColor(Color.ORANGE); if (temp_arista.getRelacion().equals("Amistad")) { g.setColor(Color.BLUE); g.drawString(temp_arista.getRelacion() + "", nx + 10, ny - 3); } else if (temp_arista.getRelacion().equals("Noviazgo")) { g.setColor(Color.GREEN); g.drawString(temp_arista.getRelacion() + "", nx + 10, ny + 23); } else if (temp_arista.getRelacion().equals("Matrimonio")) { g.setColor(Color.RED); g.drawString(temp_arista.getRelacion() + "", nx - 15, ny - 5); } else if (temp_arista.getRelacion().equals("Familia")) { g.setColor(Color.YELLOW); g.drawString(temp_arista.getRelacion() + "", nx - 15, ny - 5); } } } Image img; img = Toolkit.getDefaultToolkit().createImage(grafico.getSource()).getScaledInstance(800, 600, 0); label_grafico.setIcon(new ImageIcon(img)); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Windows".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(HollywoodUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(HollywoodUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(HollywoodUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(HollywoodUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new HollywoodUI().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuItem Actor_menu; private javax.swing.JMenuItem Agregar; private javax.swing.JDialog Eliminar_relaciones; private javax.swing.ButtonGroup Grupo_relaciones; private javax.swing.ButtonGroup Grupo_relaciones2; private javax.swing.JDialog Modificar_actor; private javax.swing.JDialog Modificar_pelicula; private javax.swing.JMenuItem Mostrar_grafo; private javax.swing.JMenuItem Movie_menu; private javax.swing.JPopupMenu Opc_actor; private javax.swing.JPopupMenu PU_grafico; private javax.swing.JMenuItem Save_info; private javax.swing.JDialog add_Pelicula; private javax.swing.JDialog add_actor; private javax.swing.JDialog add_actor_mapa; private javax.swing.JMenuItem add_relaciones; private javax.swing.JLabel btn_ModificarPelicula; private javax.swing.JButton btn_add_graphic; private javax.swing.JButton btn_agregarRelacion; private javax.swing.JToggleButton btn_buscar_foto; private javax.swing.JButton btn_eliminarActor; private javax.swing.JButton btn_eliminarRelacion; private javax.swing.JButton btn_modifcarRelacion; private javax.swing.JLabel btn_modificar_actor; private javax.swing.JButton btn_pop_stack; private javax.swing.JButton btn_salir_history; private javax.swing.JLabel btn_savePelicula; private javax.swing.JLabel btn_save_actor; private javax.swing.JButton btn_save_history; private javax.swing.JLabel btn_select_pelicula; private javax.swing.JButton btn_visualizar; private javax.swing.JButton btn_visualizar1; private javax.swing.JMenuItem cambiar_backGround; private javax.swing.JComboBox cb_Actor_dos; private javax.swing.JComboBox cb_Actor_dos1; private javax.swing.JComboBox cb_Actor_dos2; private javax.swing.JComboBox cb_Actor_uno; private javax.swing.JComboBox cb_Actor_uno1; private javax.swing.JComboBox cb_Actor_uno2; private javax.swing.JComboBox cb_actores_existentes; private javax.swing.JComboBox cb_delete_movie; private javax.swing.JComboBox cb_list_eliminar; private javax.swing.JComboBox cb_list_modifica; private javax.swing.JComboBox cb_list_peliculas; private javax.swing.JDialog delete_actor; private javax.swing.JDialog delete_movie; private javax.swing.JMenuItem eliminar_relaciones; private javax.swing.JDialog historial_window; private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel16; private javax.swing.JLabel jLabel17; private javax.swing.JLabel jLabel18; private javax.swing.JLabel jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel29; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel30; private javax.swing.JLabel jLabel31; private javax.swing.JLabel jLabel32; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel70; private javax.swing.JLabel jLabel71; private javax.swing.JLabel jLabel72; private javax.swing.JLabel jLabel73; private javax.swing.JLabel jLabel74; private javax.swing.JLabel jLabel75; private javax.swing.JLabel jLabel76; private javax.swing.JLabel jLabel77; private javax.swing.JLabel jLabel78; private javax.swing.JLabel jLabel79; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel80; private javax.swing.JLabel jLabel81; private javax.swing.JLabel jLabel82; private javax.swing.JLabel jLabel83; private javax.swing.JLabel jLabel84; private javax.swing.JLabel jLabel85; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel15; private javax.swing.JPanel jPanel16; private javax.swing.JPanel jPanel17; private javax.swing.JPanel jPanel18; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JPanel jPanel4; private javax.swing.JPanel jPanel5; private javax.swing.JPanel jPanel6; private javax.swing.JPanel jPanel7; private javax.swing.JPanel jPanel9; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane9; private javax.swing.JLabel jl_eliminarActor1; private javax.swing.JRadioButton jrb_amistad; private javax.swing.JRadioButton jrb_amistad1; private javax.swing.JRadioButton jrb_amistad2; private javax.swing.JRadioButton jrb_familia; private javax.swing.JRadioButton jrb_familia1; private javax.swing.JRadioButton jrb_familia2; private javax.swing.JRadioButton jrb_matrimonio; private javax.swing.JRadioButton jrb_matrimonio1; private javax.swing.JRadioButton jrb_matrimonio2; private javax.swing.JRadioButton jrb_noviazgo; private javax.swing.JRadioButton jrb_noviazgo1; private javax.swing.JRadioButton jrb_noviazgo2; private javax.swing.JLabel label_grafico; private javax.swing.JDialog label_load; private javax.swing.JLabel label_preview; private javax.swing.JLabel label_profile; private javax.swing.JTextArea list_history; private javax.swing.JList list_peliculas; private javax.swing.JList list_peliculas_modificar; private javax.swing.JMenu menu_modificar; private javax.swing.JDialog modif_relaciones; private javax.swing.JMenuItem modifcar_relaciones; private javax.swing.JPanel panel_add; private javax.swing.JPanel panel_delete; private javax.swing.JPanel panel_delete1; private javax.swing.JPanel panel_history; private javax.swing.JPanel panel_opaque_add; private javax.swing.JPanel panel_opaque_delete; private javax.swing.JMenuItem popEliminar; private javax.swing.JMenuItem popModificar; private javax.swing.JDialog sub_relaciones; private javax.swing.JTextField tf_edad; private javax.swing.JTextField tf_edad_modificar; private javax.swing.JTextField tf_estudio; private javax.swing.JTextField tf_estudio_modificar; private javax.swing.JTextField tf_nacionalidad; private javax.swing.JTextField tf_nacionalidad_modificar; private javax.swing.JTextField tf_nombre; private javax.swing.JTextField tf_nombre_modificar; private javax.swing.JTextField tf_titulo; private javax.swing.JTextField tf_titulo_modificar; private javax.swing.JTextField tf_year; private javax.swing.JTextField tf_year_modificar; // End of variables declaration//GEN-END:variables }