diff --git a/ProyectoConciertoApp/nbproject/project.properties b/ProyectoConciertoApp/nbproject/project.properties index 9b5fa8b..a637123 100644 --- a/ProyectoConciertoApp/nbproject/project.properties +++ b/ProyectoConciertoApp/nbproject/project.properties @@ -33,9 +33,13 @@ dist.javadoc.dir=${dist.dir}/javadoc dist.jlink.dir=${dist.dir}/jlink dist.jlink.output=${dist.jlink.dir}/ProyectoConciertoApp excludes= +file.reference.AbsoluteLayout-RELEASE190.jar=src\\Modelo\\AbsoluteLayout-RELEASE190.jar +file.reference.mysql-connector-java-8.0.30.jar=src\\Modelo\\mysql-connector-java-8.0.30.jar includes=** jar.compress=false -javac.classpath= +javac.classpath=\ + ${file.reference.AbsoluteLayout-RELEASE190.jar}:\ + ${file.reference.mysql-connector-java-8.0.30.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -71,7 +75,7 @@ jlink.additionalmodules= jlink.additionalparam= jlink.launcher=true jlink.launcher.name=ProyectoConciertoApp -main.class=Vista.VentanaConcierto +main.class=proyectoconciertouvct.ProyectoConciertoUVCT manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false diff --git a/ProyectoConciertoApp/src/Modelo/AbsoluteLayout-RELEASE190.jar b/ProyectoConciertoApp/src/Modelo/AbsoluteLayout-RELEASE190.jar new file mode 100644 index 0000000..6cf4145 Binary files /dev/null and b/ProyectoConciertoApp/src/Modelo/AbsoluteLayout-RELEASE190.jar differ diff --git a/ProyectoConciertoApp/src/Modelo/conexion.java b/ProyectoConciertoApp/src/Modelo/conexion.java new file mode 100644 index 0000000..d586987 --- /dev/null +++ b/ProyectoConciertoApp/src/Modelo/conexion.java @@ -0,0 +1,37 @@ +package Modelo; + + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; + +public class conexion { + + public static final String driver = "com.mysql.cj.jdbc.Driver"; + public static final String URL = "jdbc:mysql://localhost:3306/dbconcierto00"; + public static final String USERNAME = "concierto00"; + public static final String PASSWORD = "concierto00"; + private static Connection con = null; + + public static Connection getInstance(){ + System.out.println(USERNAME+" "+PASSWORD+" "+URL); + try{ + Class.forName(driver); + // Nos conectamos a la bd + System.out.println(USERNAME+" "+PASSWORD+" "+URL); + con= (Connection) DriverManager.getConnection(URL, USERNAME, PASSWORD); + // Si la conexion fue exitosa mostramos un mensaje de conexion exitosa + if (con!=null){ + System.out.println("Conectado"); + } + } + // Si la conexion NO fue exitosa mostramos un mensaje de error + catch (ClassNotFoundException | SQLException e){ + System.out.println("Error de conexion" + e); + } + System.out.println(con); + return con; + } +} + + diff --git a/ProyectoConciertoApp/src/Modelo/mysql-connector-java-8.0.30.jar b/ProyectoConciertoApp/src/Modelo/mysql-connector-java-8.0.30.jar new file mode 100644 index 0000000..92ebe1b Binary files /dev/null and b/ProyectoConciertoApp/src/Modelo/mysql-connector-java-8.0.30.jar differ diff --git a/ProyectoConciertoApp/src/Vista/BotonConImagen.java b/ProyectoConciertoApp/src/Vista/BotonConImagen.java new file mode 100644 index 0000000..48c6618 --- /dev/null +++ b/ProyectoConciertoApp/src/Vista/BotonConImagen.java @@ -0,0 +1,77 @@ +package Vista; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +class BotonConImagen extends JButton { + int cambio = 0; + int precio = 150; + private int id; // Campo id privado + private boolean isAmarillo = false; // Estado para indicar si está utilizando el color amarillo + + public BotonConImagen(int id) { + this.id = id; + ImageIcon icono = new ImageIcon("C:/Users/mario/OneDrive/Documentos/NetBeansProjects/Imagene/src/asdasdasdasd.png"); + setIcon(icono); // Establece la imagen en el botón + setPreferredSize(new Dimension(icono.getIconWidth(), icono.getIconHeight())); // Establece el tamaño del botón según el tamaño de la imagen + setBorderPainted(false); + setContentAreaFilled(false); + setFocusPainted(false); + + // Agrega el ActionListener para cambiar el color del botón + addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + if (cambio == 0) { + ImageIcon icono = new ImageIcon("C:/Users/mario/OneDrive/Documentos/NetBeansProjects/Imagene/src/asiento seleccion.png"); + setIcon(icono); // Establece la imagen en el botón + setPreferredSize(new Dimension(icono.getIconWidth(), icono.getIconHeight())); // Establece el tamaño del botón según el tamaño de la imagen + cambio = 1; + isAmarillo = true; + } else { + ImageIcon icono = new ImageIcon("C:/Users/mario/OneDrive/Documentos/NetBeansProjects/Imagene/src/asdasdasdasd.png"); + setIcon(icono); // Establece la imagen en el botón + setPreferredSize(new Dimension(icono.getIconWidth(), icono.getIconHeight())); // Establece el tamaño del botón según el tamaño de la imagen + cambio = 0; + isAmarillo = false; + } + } + }); + } + + // Métodos getter y setter para el campo id + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getPrecio() { + return precio; + } + + public void setPrecio(int precio) { + this.precio = precio; + } + + // Método para verificar si el botón está utilizando el color amarillo + public boolean isAmarillo() { + return isAmarillo; + } + + public void Ocupado(){ + //ImageIcon icono = new ImageIcon("C:/Users/Cesar/Downloads/asiento ocupado.png"); + //setIcon(icono); // Establece la imagen en el botón + setEnabled(false); + } + + public void Disponible(){ + //ImageIcon icono = new ImageIcon("C:/Users/Cesar/Downloads/asiento ocupado.png"); + //setIcon(icono); // Establece la imagen en el botón + setEnabled(true); + } +} \ No newline at end of file diff --git a/ProyectoConciertoApp/src/Vista/MenuConciertos.form b/ProyectoConciertoApp/src/Vista/MenuConciertos.form new file mode 100644 index 0000000..dc2be1a --- /dev/null +++ b/ProyectoConciertoApp/src/Vista/MenuConciertos.form @@ -0,0 +1,99 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/ProyectoConciertoApp/src/Vista/MenuConciertos.java b/ProyectoConciertoApp/src/Vista/MenuConciertos.java new file mode 100644 index 0000000..ceba8df --- /dev/null +++ b/ProyectoConciertoApp/src/Vista/MenuConciertos.java @@ -0,0 +1,134 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package Vista; + +/** + * + * @author mario + */ +public class MenuConciertos extends javax.swing.JFrame { + + /** + * Creates new form MenuConciertos + */ + public MenuConciertos() { + initComponents(); + } + + /** + * 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") + // //GEN-BEGIN:initComponents + private void initComponents() { + + MenuP = new javax.swing.JPanel(); + jScrollPane1 = new javax.swing.JScrollPane(); + Principal = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + + jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); + jScrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); + + javax.swing.GroupLayout PrincipalLayout = new javax.swing.GroupLayout(Principal); + Principal.setLayout(PrincipalLayout); + PrincipalLayout.setHorizontalGroup( + PrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 1188, Short.MAX_VALUE) + ); + PrincipalLayout.setVerticalGroup( + PrincipalLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 759, Short.MAX_VALUE) + ); + + jScrollPane1.setViewportView(Principal); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 0, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 106, Short.MAX_VALUE) + ); + + javax.swing.GroupLayout MenuPLayout = new javax.swing.GroupLayout(MenuP); + MenuP.setLayout(MenuPLayout); + MenuPLayout.setHorizontalGroup( + MenuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1200, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + MenuPLayout.setVerticalGroup( + MenuPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, MenuPLayout.createSequentialGroup() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 761, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(MenuP, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(MenuP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + pack(); + }// //GEN-END:initComponents + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* 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 ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(MenuConciertos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(MenuConciertos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(MenuConciertos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(MenuConciertos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new MenuConciertos().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JPanel MenuP; + private javax.swing.JPanel Principal; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane1; + // End of variables declaration//GEN-END:variables +} diff --git a/ProyectoConciertoApp/src/Vista/VentanaConcierto.java b/ProyectoConciertoApp/src/Vista/VentanaConcierto.java deleted file mode 100644 index 21a22ce..0000000 --- a/ProyectoConciertoApp/src/Vista/VentanaConcierto.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template - */ -package Vista; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -class VentanaConcierto extends JFrame { - private JPanel panelLienzoAccesorios, panelLienzoCara, panelLienzoRopaS, panelLienzoRopaI; - private Zonas zonasPanel; - private ZonaPlata zonaPlata; - private ZonaOro zonaOro; - private ZonaPlatino zonaPlatino; - private ZonaDiamante zonaDiamante; - private JPanel panelCentral; // Nuevo panel para contener zonasPanel y zonaPlata - - public VentanaConcierto() { - setTitle("AvatART"); - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setSize(770, 650); - setLocationRelativeTo(null); - getContentPane().setBackground(new Color(200, 160, 255)); // Lila - - // Configurar el panel de Zonas - zonasPanel = new Zonas(); - zonaPlata = new ZonaPlata(); - zonaOro = new ZonaOro(); - zonaPlatino = new ZonaPlatino(); - zonaDiamante = new ZonaDiamante(); - zonaPlata.setPreferredSize(new Dimension(2000, zonaPlata.getPreferredSize().height)); - zonaOro.setPreferredSize(new Dimension(2000, zonaOro.getPreferredSize().height)); - zonaPlatino.setPreferredSize(new Dimension(1140, zonaPlatino.getPreferredSize().height)); - zonaDiamante.setPreferredSize(new Dimension(960, zonaDiamante.getPreferredSize().height)); - - panelCentral = new JPanel(new BorderLayout()); // Panel central que contendrá zonasPanel y zonaPlata - panelCentral.add(zonasPanel, BorderLayout.CENTER); // Agregar zonasPanel inicialmente - - JScrollPane scrollPane = new JScrollPane(panelCentral); // Usar JScrollPane con panelCentral - scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); - scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER); - - // Ajustar la velocidad del desplazamiento - scrollPane.getHorizontalScrollBar().setUnitIncrement(50); // Ajusta el desplazamiento horizontal más rápido - scrollPane.getVerticalScrollBar().setUnitIncrement(50); // Ajusta el desplazamiento vertical más rápido - - add(scrollPane, BorderLayout.CENTER); // Agregar JScrollPane en lugar de zonasPanel directamente - - JPanel panelComboBox = new JPanel(); - panelComboBox.setLayout(new GridLayout(8, 1, 0, 20)); // Espacio vertical entre componentes - panelComboBox.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); - panelComboBox.setBackground(new Color(200, 160, 255)); // Lila - - JLabel label1 = new JLabel("Elige tus accesorios"); - label1.setFont(new Font("Comic Sans MS", Font.BOLD, 20)); - JLabel label2 = new JLabel("Elige tu cabeza"); - label2.setFont(new Font("Comic Sans MS", Font.BOLD, 20)); - JLabel label3 = new JLabel("Elige tu ropa superior"); - label3.setFont(new Font("Comic Sans MS", Font.BOLD, 20)); - JLabel label4 = new JLabel("Elige tu ropa inferior"); - label4.setFont(new Font("Comic Sans MS", Font.BOLD, 20)); - - - - panelComboBox.add(label1); - panelComboBox.add(label2); - panelComboBox.add(label3); - panelComboBox.add(label4); - - // Crear un botón para volver al estado inicial - JButton btnVolver = new JButton("Volver"); - btnVolver.addActionListener(e -> { - cambiarPanelCentral(zonasPanel); // Volver al estado inicial cuando se hace clic en el botón - }); - - panelComboBox.add(btnVolver); // Agregar el botón al panelComboBox - - // Panel para el título "AvatArt" - JPanel panelTitulo = new JPanel(); - JLabel labelTitulo = new JLabel("AvatART", SwingConstants.LEFT); - labelTitulo.setFont(new Font("Comic Sans MS", Font.BOLD, 50)); - panelTitulo.add(labelTitulo); - panelTitulo.setBackground(new Color(200, 160, 255)); - - add(panelTitulo, BorderLayout.NORTH); - add(panelComboBox, BorderLayout.WEST); - - setVisible(true); - - // Agregar Mouse Listeners - agregarMouseListeners(); - } - - private void agregarMouseListeners() { - zonasPanel.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - int mouseX = e.getX(); - int mouseY = e.getY(); - - if (zonasPanel.isPointInsidePolygon(mouseX, mouseY, zonasPanel.getXPoints(), zonasPanel.getYPoints())) { - JOptionPane.showMessageDialog(null, "Zona Plata"); - cambiarPanelCentral(zonaPlata); // Cambiar a zonaPlata cuando se hace clic en la zona - } else if (zonasPanel.isPointInsidePolygon(mouseX, mouseY, zonasPanel.getXPoints2(), zonasPanel.getYPoints2())) { - JOptionPane.showMessageDialog(null, "Zona Oro"); - cambiarPanelCentral(zonaOro); // Cambiar a zonaOro cuando se hace clic en la zona - } else if (zonasPanel.isPointInsidePolygon(mouseX, mouseY, zonasPanel.getXPoints3(), zonasPanel.getYPoints3())) { - JOptionPane.showMessageDialog(null, "Zona Platino"); - cambiarPanelCentral(zonaPlatino); // Cambiar a zonaPlatino cuando se hace clic en la zona - } else if (zonasPanel.isPointInsidePolygon(mouseX, mouseY, zonasPanel.getXPoints4(), zonasPanel.getYPoints4())) { - JOptionPane.showMessageDialog(null, "Zona Diamante"); - cambiarPanelCentral(zonaDiamante); // Cambiar a zonaDiamante cuando se hace clic en la zona - } - } - - @Override - public void mouseEntered(MouseEvent e) { - Object source = e.getSource(); - if (source instanceof Component) { - Component component = (Component) source; - component.setForeground(component.getForeground().darker()); - zonasPanel.repaint(); - } - } - - @Override - public void mouseExited(MouseEvent e) { - Object source = e.getSource(); - if (source instanceof Component) { - Component component = (Component) source; - component.setForeground(zonasPanel.getCurrentColor()); - zonasPanel.repaint(); - } - } - }); - } - - // Método para cambiar el contenido del panel central - private void cambiarPanelCentral(Component nuevoContenido) { - panelCentral.removeAll(); // Limpiar el panel central - panelCentral.add(nuevoContenido, BorderLayout.CENTER); // Agregar el nuevo contenido - panelCentral.revalidate(); // Revalidar el panel para reflejar los cambios - panelCentral.repaint(); // Repintar el panel - } - - public static void main(String[] args) { - SwingUtilities.invokeLater(() -> { - VentanaConcierto vista = new VentanaConcierto(); - }); - } -} \ No newline at end of file diff --git a/ProyectoConciertoApp/src/Vista/asdasdasdasd.png b/ProyectoConciertoApp/src/Vista/asdasdasdasd.png new file mode 100644 index 0000000..4c5616b Binary files /dev/null and b/ProyectoConciertoApp/src/Vista/asdasdasdasd.png differ diff --git a/ProyectoConciertoApp/src/Vista/asiento noDisponible.png b/ProyectoConciertoApp/src/Vista/asiento noDisponible.png new file mode 100644 index 0000000..0f9457b Binary files /dev/null and b/ProyectoConciertoApp/src/Vista/asiento noDisponible.png differ diff --git a/ProyectoConciertoApp/src/Vista/asiento seleccion.png b/ProyectoConciertoApp/src/Vista/asiento seleccion.png new file mode 100644 index 0000000..2d51d06 Binary files /dev/null and b/ProyectoConciertoApp/src/Vista/asiento seleccion.png differ diff --git a/ProyectoConciertoApp/src/Vista/fondo.png b/ProyectoConciertoApp/src/Vista/fondo.png new file mode 100644 index 0000000..420b3f4 Binary files /dev/null and b/ProyectoConciertoApp/src/Vista/fondo.png differ diff --git a/ProyectoConciertoApp/src/Vista/weeknd.jpg b/ProyectoConciertoApp/src/Vista/weeknd.jpg new file mode 100644 index 0000000..94ac50b Binary files /dev/null and b/ProyectoConciertoApp/src/Vista/weeknd.jpg differ diff --git a/ProyectoConciertoApp/src/Vista/weekndfondo.jpg b/ProyectoConciertoApp/src/Vista/weekndfondo.jpg new file mode 100644 index 0000000..ced4eb3 Binary files /dev/null and b/ProyectoConciertoApp/src/Vista/weekndfondo.jpg differ diff --git a/ProyectoConciertoApp/src/proyectoconciertouvct/ProyectoConciertoUVCT.java b/ProyectoConciertoApp/src/proyectoconciertouvct/ProyectoConciertoUVCT.java new file mode 100644 index 0000000..7171b9a --- /dev/null +++ b/ProyectoConciertoApp/src/proyectoconciertouvct/ProyectoConciertoUVCT.java @@ -0,0 +1,25 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template + */ +package proyectoconciertouvct; + +import Vista.VentanaConciertos; + +/** + * + * @author mario + */ +public class ProyectoConciertoUVCT { + + /** + * @param args the command line arguments + */ + public static void main(String[] args) { + + VentanaConciertos ventana = new VentanaConciertos(); + ventana.setVisible(true); + + } + +}