diff --git a/build/classes/classes/Cliente.class b/build/classes/classes/Cliente.class index 8af4a9f..376fd41 100644 Binary files a/build/classes/classes/Cliente.class and b/build/classes/classes/Cliente.class differ diff --git a/build/classes/classes/Funcionario.class b/build/classes/classes/Funcionario.class index 8ae03ed..80944dc 100644 Binary files a/build/classes/classes/Funcionario.class and b/build/classes/classes/Funcionario.class differ diff --git a/build/classes/telas/Menu.form b/build/classes/telas/Menu.form index b2c096d..5c0bd22 100644 --- a/build/classes/telas/Menu.form +++ b/build/classes/telas/Menu.form @@ -47,7 +47,11 @@ +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -61,7 +65,7 @@ - + @@ -70,7 +74,11 @@ +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -99,13 +107,18 @@ + +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -118,13 +131,18 @@ + +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -137,13 +155,18 @@ + +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -156,13 +179,18 @@ + +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -175,32 +203,42 @@ + +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes - + + +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -281,12 +319,20 @@ +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes diff --git a/build/classes/telas/areaCliente.form b/build/classes/telas/areaCliente.form index 9eeb4a5..32ea4b1 100644 --- a/build/classes/telas/areaCliente.form +++ b/build/classes/telas/areaCliente.form @@ -19,8 +19,10 @@ + +<<<<<<< Updated upstream @@ -57,118 +59,133 @@ +======= + + +>>>>>>> Stashed changes + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -184,31 +201,49 @@ + + + + + + + + + + + + + + + + + + @@ -229,6 +264,9 @@ + + + @@ -282,6 +320,9 @@ + + + @@ -309,8 +350,17 @@ + + + + + + + + +<<<<<<< Updated upstream @@ -324,14 +374,19 @@ +======= + +>>>>>>> Stashed changes - - + + - - - + + + + + diff --git a/build/classes/telas/areaFuncionario$1.class b/build/classes/telas/areaFuncionario$1.class index 388717d..8cc1a7a 100644 Binary files a/build/classes/telas/areaFuncionario$1.class and b/build/classes/telas/areaFuncionario$1.class differ diff --git a/build/classes/telas/areaFuncionario$2.class b/build/classes/telas/areaFuncionario$2.class index 43638e9..8ca9f37 100644 Binary files a/build/classes/telas/areaFuncionario$2.class and b/build/classes/telas/areaFuncionario$2.class differ diff --git a/build/classes/telas/areaFuncionario$3.class b/build/classes/telas/areaFuncionario$3.class index bea8803..47da0a2 100644 Binary files a/build/classes/telas/areaFuncionario$3.class and b/build/classes/telas/areaFuncionario$3.class differ diff --git a/build/classes/telas/areaFuncionario$4.class b/build/classes/telas/areaFuncionario$4.class index 40fdcf8..e0c7568 100644 Binary files a/build/classes/telas/areaFuncionario$4.class and b/build/classes/telas/areaFuncionario$4.class differ diff --git a/build/classes/telas/areaFuncionario.class b/build/classes/telas/areaFuncionario.class index a808402..8d59e7a 100644 Binary files a/build/classes/telas/areaFuncionario.class and b/build/classes/telas/areaFuncionario.class differ diff --git a/build/classes/telas/areaFuncionario.form b/build/classes/telas/areaFuncionario.form index 9618935..e7c72c9 100644 --- a/build/classes/telas/areaFuncionario.form +++ b/build/classes/telas/areaFuncionario.form @@ -19,38 +19,232 @@ + - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + + + + + +
+
+ + + + + + + + + + @@ -66,7 +260,7 @@ - + @@ -85,13 +279,21 @@ - - - - - - - + + + + + + + + + + + + + + + @@ -99,8 +301,9 @@ + - + @@ -132,7 +335,7 @@ - + @@ -251,5 +454,17 @@
+ + + + + + + + + + + + diff --git a/build/classes/telas/areaGerente.form b/build/classes/telas/areaGerente.form index 5d716f0..9c95351 100644 --- a/build/classes/telas/areaGerente.form +++ b/build/classes/telas/areaGerente.form @@ -70,7 +70,7 @@ - + @@ -149,7 +149,11 @@ +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -314,7 +318,11 @@ +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -550,7 +558,11 @@ +<<<<<<< Updated upstream +======= + +>>>>>>> Stashed changes @@ -666,6 +678,9 @@ + + + @@ -676,13 +691,16 @@ + + + - + diff --git a/build/classes/telas/telaLogin$1.class b/build/classes/telas/telaLogin$1.class index 4d04b30..3f2677d 100644 Binary files a/build/classes/telas/telaLogin$1.class and b/build/classes/telas/telaLogin$1.class differ diff --git a/build/classes/telas/telaLogin.form b/build/classes/telas/telaLogin.form index aec091d..14b8576 100644 --- a/build/classes/telas/telaLogin.form +++ b/build/classes/telas/telaLogin.form @@ -19,99 +19,120 @@ + - - - - - - - - - - - - - - + + + + + + + + + + - + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - + - - - + + - + + + + + + + - - - - - - - - - + + + + + - - - + + + + + + + + + + + + + + + - + + + + + + + + + + @@ -123,21 +144,22 @@ + + + + + + - - - - - - + @@ -152,7 +174,7 @@ - + @@ -160,18 +182,21 @@ - - - - - - - - - - + + + + + + + + + + + + + diff --git a/build/classes/telas/telaPagamento$1.class b/build/classes/telas/telaPagamento$1.class index 0341d92..49fd70c 100644 Binary files a/build/classes/telas/telaPagamento$1.class and b/build/classes/telas/telaPagamento$1.class differ diff --git a/build/classes/telas/telaPagamento.class b/build/classes/telas/telaPagamento.class index a31b75d..7193429 100644 Binary files a/build/classes/telas/telaPagamento.class and b/build/classes/telas/telaPagamento.class differ diff --git a/build/classes/telas/telaPagamento.form b/build/classes/telas/telaPagamento.form index 59498b9..aa604af 100644 --- a/build/classes/telas/telaPagamento.form +++ b/build/classes/telas/telaPagamento.form @@ -1,8 +1,13 @@
+ + + + + @@ -25,46 +30,41 @@ + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - @@ -73,7 +73,7 @@ - + @@ -88,18 +88,19 @@ - + + - + - + @@ -130,11 +131,18 @@ + + + + + + + @@ -157,6 +165,9 @@ + + + @@ -165,6 +176,9 @@ + + + @@ -177,5 +191,16 @@ + + + + + + + + + + + diff --git a/build/classes/telas/verCarrinho.form b/build/classes/telas/verCarrinho.form index baaf9d5..ff486d0 100644 --- a/build/classes/telas/verCarrinho.form +++ b/build/classes/telas/verCarrinho.form @@ -21,181 +21,212 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + - - - - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + - + + + + + + + + + + + + + + + + +
+
+ + + + + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnRemoverItem"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="99" red="99" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Remover item"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnEsvaziarCarrinho"> <Properties> - <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> - <Table columnCount="5" rowCount="4"> - <Column editable="true" title="Título" type="java.lang.String"/> - <Column editable="true" title="Preço" type="java.lang.Double"/> - <Column editable="true" title="Quantidade" type="java.lang.Integer"/> - <Column editable="true" title="Cód. Produto" type="java.lang.String"/> - <Column editable="true" title="Descrição" type="java.lang.String"/> - </Table> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="ff" type="rgb"/> </Property> - <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> - <TableColumnModel selectionModel="0"> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - </TableColumnModel> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> </Property> - <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> - <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + <Property name="text" type="java.lang.String" value="Esvaziar carrinho"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblProdutosCarrinho"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> </Property> + <Property name="text" type="java.lang.String" value="Meus produtos no carrinho"/> </Properties> </Component> + <Component class="javax.swing.JButton" name="btnConfirmarCompra"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="0" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Confirmar compra"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Visualizar Carrinho Atual"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Ver carrinhos antigos"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> </SubComponents> </Container> - <Component class="javax.swing.JButton" name="btnRemoverItem"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="99" green="99" red="99" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Remover item"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnEsvaziarCarrinho"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Esvaziar carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblProdutosCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Meus produtos no carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnConfirmarCompra"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="ff" red="0" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Confirmar compra"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="24" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Visualizar Carrinho Atual"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton1"> + <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/Telas/VerCarrinho.png"/> </Property> - <Property name="text" type="java.lang.String" value="Ver carrinhos antigos"/> </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> - </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> </Component> </SubComponents> </Form> diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index edbd425..c8c83d2 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,6 +3,7 @@ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <group> +<<<<<<< Updated upstream <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/cadastarGerente.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/teste.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/Menu.java</file> @@ -13,7 +14,31 @@ <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaCliente.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaFuncionario.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/telaPagamento.java</file> +======= + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/Menu.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/cadastrarCliente.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/ControleClientes.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaCliente.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/AreaGerenteTeste.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaFuncionario.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/telaPagamento.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Produto.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/CriarNovoProduto.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Estoque.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/telaLogin.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/verProdutos_a.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Cliente.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Pedido.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/cadastarGerente.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/teste.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Carrinho.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Gerente.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/verProdutos.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/ControleEstoque.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Pagamento.java</file> +>>>>>>> Stashed changes <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/verCarrinho.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Usuario.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Funcionario.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/cadastrarFuncionario.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/ControleFuncionarios.java</file> diff --git a/src/classes/Carrinho.java b/src/classes/Carrinho.java index f40f442..dd65f48 100644 --- a/src/classes/Carrinho.java +++ b/src/classes/Carrinho.java @@ -8,7 +8,12 @@ public class Carrinho { protected int numCarrinho; protected Date data; protected double total; +<<<<<<< Updated upstream protected List<String> produtos; +======= + public static ArrayList<Produto> listaProdutos = new ArrayList(); + public static ArrayList<Carrinho> listaCarrinho = new ArrayList(); +>>>>>>> Stashed changes //Construtor de carrinho. Um vazio e outro com os atributos dados public Carrinho() { @@ -20,6 +25,32 @@ public Carrinho(int numCarrinho, Date data, double total, List<String> produtos) this.total = total; this.produtos = produtos; } + + public String mostarProdutos(){ + String resultado=""; + for(Produto item: listaProdutos){ + resultado = resultado +item.getTitulo()+" X "+item.getQuantidadeComprada()+" , "; + } + return resultado; + } + public Carrinho(int numCarrinho, String data, double total,ArrayList<Produto> listaProdutos) { + this.numCarrinho = numCarrinho; + this.data = data; + this.total = total; + this.listaProdutos = listaProdutos; + } + + public static void setListaProdutos(ArrayList<Produto> listaProdutos) { + Carrinho.listaProdutos = listaProdutos; + } + + public static void setListaCarrinho(ArrayList<Carrinho> listaCarrinho) { + Carrinho.listaCarrinho = listaCarrinho; + } + + + + //Métodos getters e setters para cada um dos atributos @@ -47,9 +78,20 @@ public void setTotal(double total) { this.total = total; } +<<<<<<< Updated upstream public List<String> getProdutos() { return produtos; } +======= + public String getData() { + return data; + } + + public void setData(String data) { + this.data = data; + } + +>>>>>>> Stashed changes public void setProdutos(List<String> produtos) { this.produtos = produtos; diff --git a/src/classes/Cliente.java b/src/classes/Cliente.java index 87704b9..a0b3f4e 100644 --- a/src/classes/Cliente.java +++ b/src/classes/Cliente.java @@ -97,6 +97,23 @@ public static int getIndex_cliente() { return index_cliente; } + public boolean loginCliente(String email, String senha){ + if(this.email.equals(email) && this.senha.equals(senha)){ + return true; + }else{ + return false; + } + + } + @Override + public String toString(){ + String resultado = super.toString(); + resultado += "Endereço: "+this.endereco + "\n" + +"Data Nascimento: "+this.dataNascimento+"\n" + +" Celular: "+this.celular; + return resultado; + } + diff --git a/src/classes/Funcionario.java b/src/classes/Funcionario.java index ea2dacf..3bc4037 100644 --- a/src/classes/Funcionario.java +++ b/src/classes/Funcionario.java @@ -40,7 +40,17 @@ public void setCadastroFuncionario(String cadastroFuncionario) { @Override public String toString() { - return "Funcionario{" + "cadastroFuncionario=" + cadastroFuncionario + '}'; + String resultado = super.toString(); + resultado += resultado + "cadastro de Funcionário: "+this.getCadastroFuncionario(); + return resultado; + } + + public boolean loginFuncionario(String email, String senha){ + if(this.email.equals(email)&&this.senha.equals(senha)){ + return true; + }else{ + return false; + } } diff --git a/src/classes/Gerente.java b/src/classes/Gerente.java index 7467f07..9578ea6 100644 --- a/src/classes/Gerente.java +++ b/src/classes/Gerente.java @@ -31,6 +31,20 @@ public void setCadastroGerente(String cadastroGerente) { this.cadastroGerente = cadastroGerente; } + public boolean LoginGerente(String email,String senha){ + if(this.email.equals(email)&&this.senha.equals(senha)){ + return true; + }else{ + return false; + } + } + @Override + public String toString(){ + String resultado = super.toString(); + resultado += "cadastro Gerente: "+this.getCadastroGerente(); + return resultado; + } + } diff --git a/src/classes/Pagamento.java b/src/classes/Pagamento.java index 203e869..7c5ced2 100644 --- a/src/classes/Pagamento.java +++ b/src/classes/Pagamento.java @@ -1,5 +1,6 @@ package classes; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -7,6 +8,9 @@ public class Pagamento extends Carrinho{ private String formaPagamento; private String senha; private Pedido pedido; + public static ArrayList<Carrinho> listaCarrinhos = new ArrayList(); + public static int indiceCarrinho; + public static ArrayList<Carrinho> listaCarrinhosAntigos = new ArrayList(); public Pagamento(String formaPagamento, String senha, int numCarrinho, Date data, double total, List<String> produtos) { super(numCarrinho, data, total, produtos); @@ -44,5 +48,13 @@ public boolean Pagar(String senha){ return false; } } + @Override + public String mostarProdutos(){ + String resultado=""; + for(Produto item: listaProdutos){ + resultado = resultado +item.getTitulo()+" X "+item.getQuantidadeComprada()+","; + } + return resultado; + } } diff --git a/src/imagens/Telas/BuscarProdutos.png b/src/imagens/Telas/BuscarProdutos.png new file mode 100644 index 0000000..e029052 Binary files /dev/null and b/src/imagens/Telas/BuscarProdutos.png differ diff --git a/src/imagens/Telas/Login.png b/src/imagens/Telas/Login.png new file mode 100644 index 0000000..5202816 Binary files /dev/null and b/src/imagens/Telas/Login.png differ diff --git a/src/imagens/Telas/Menu.png b/src/imagens/Telas/Menu.png new file mode 100644 index 0000000..9f40803 Binary files /dev/null and b/src/imagens/Telas/Menu.png differ diff --git a/src/imagens/Telas/VerCarrinho.png b/src/imagens/Telas/VerCarrinho.png new file mode 100644 index 0000000..aae14a6 Binary files /dev/null and b/src/imagens/Telas/VerCarrinho.png differ diff --git "a/src/imagens/Telas/\303\201reaCliente.png" "b/src/imagens/Telas/\303\201reaCliente.png" new file mode 100644 index 0000000..8793c2b Binary files /dev/null and "b/src/imagens/Telas/\303\201reaCliente.png" differ diff --git "a/src/imagens/Telas/\303\201reaFuncion\303\241rio.png" "b/src/imagens/Telas/\303\201reaFuncion\303\241rio.png" new file mode 100644 index 0000000..f0490a9 Binary files /dev/null and "b/src/imagens/Telas/\303\201reaFuncion\303\241rio.png" differ diff --git "a/src/imagens/Telas/\303\201reaGerente.png" "b/src/imagens/Telas/\303\201reaGerente.png" new file mode 100644 index 0000000..33e7429 Binary files /dev/null and "b/src/imagens/Telas/\303\201reaGerente.png" differ diff --git a/src/telas/ControleEstoque.form b/src/telas/ControleEstoque.form index 68831a7..ec4c27d 100644 --- a/src/telas/ControleEstoque.form +++ b/src/telas/ControleEstoque.form @@ -24,14 +24,14 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="jPanel2" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> <Component id="jScrollPane1" min="-2" pref="820" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="428" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -39,9 +39,9 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <Component id="jPanel2" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Component id="jScrollPane1" min="-2" pref="217" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace pref="47" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -52,16 +52,16 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="24" pref="467" max="32767" attributes="0"/> - <Component id="lblControleEstoque" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="386" max="-2" attributes="0"/> - </Group> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> +<<<<<<< Updated upstream <EmptySpace max="32767" attributes="0"/> <Component id="jButton1" min="-2" max="-2" attributes="0"/> +======= + <EmptySpace pref="40" max="32767" attributes="0"/> + <Component id="btnCriar" min="-2" max="-2" attributes="0"/> +>>>>>>> Stashed changes <EmptySpace min="-2" pref="50" max="-2" attributes="0"/> <Component id="btnAlterarItem" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="65" max="-2" attributes="0"/> @@ -71,15 +71,18 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace min="0" pref="0" max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblTituloEstoque" alignment="1" min="-2" max="-2" attributes="0"/> - <Component id="lblPrecoEstoque" alignment="1" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtTituloEstoque" alignment="0" min="-2" pref="122" max="-2" attributes="0"/> - <Component id="txtPrecoEstoque" alignment="0" min="-2" pref="122" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="lblTituloEstoque" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtTituloEstoque" min="-2" pref="122" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="lblPrecoEstoque" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtPrecoEstoque" min="-2" pref="122" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <Component id="lblCodigoEstoque" min="-2" pref="128" max="-2" attributes="0"/> @@ -95,50 +98,77 @@ <EmptySpace max="-2" attributes="0"/> </Group> </Group> - <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <Component id="btnCancelarItem" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="69" max="-2" attributes="0"/> <Component id="btnExcluirItem" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnPesquisarItem" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="62" max="-2" attributes="0"/> </Group> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="lblDescricaoEstoque" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="txtDescricaoEstoque" min="-2" pref="162" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="108" max="-2" attributes="0"/> - <Component id="btnBuscar" min="-2" pref="83" max="-2" attributes="0"/> - </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="103" max="32767" attributes="0"/> + <Component id="lblDescricaoEstoque" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="264" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="128" max="-2" attributes="0"/> </Group> </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> <EmptySpace max="32767" attributes="0"/> - <Component id="btnPesquisarItem" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="62" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblControleEstoque" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="406" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnBuscar" min="-2" pref="83" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="435" max="-2" attributes="0"/> + </Group> + </Group> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblControleEstoque" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="41" max="32767" attributes="0"/> + <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="44" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="48" max="-2" attributes="0"/> + </Group> <Group type="102" attributes="0"> + <Component id="lblControleEstoque" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblDescricaoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblQuantiaEstoque" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtQuantiaEstoque" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblCodigoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCodigoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTituloEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblTituloEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblCodigoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodigoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtPrecoEstoque" min="-2" max="-2" attributes="0"/> + <Component id="lblPrecoEstoque" min="-2" max="-2" attributes="0"/> + </Group> </Group> </Group> +<<<<<<< Updated upstream <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="3" attributes="0"> <Component id="lblDescricaoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> @@ -167,9 +197,23 @@ <Group type="103" groupAlignment="0" attributes="0"> <Component id="txtPrecoEstoque" min="-2" max="-2" attributes="0"/> <Component id="lblPrecoEstoque" min="-2" max="-2" attributes="0"/> +======= +>>>>>>> Stashed changes </Group> </Group> </Group> + <EmptySpace min="-2" pref="4" max="-2" attributes="0"/> + <Component id="btnBuscar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnAlterarItem" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelarItem" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvarItem" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnPesquisarItem" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnExcluirItem" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCriar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="12" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -188,11 +232,6 @@ <Property name="toolTipText" type="java.lang.String" value="insira a quantia em estoque"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtDescricaoEstoque"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira a descrição"/> - </Properties> - </Component> <Component class="javax.swing.JTextField" name="txtPrecoEstoque"> <Properties> <Property name="toolTipText" type="java.lang.String" value="insira o preço do produto"/> @@ -305,6 +344,9 @@ <Property name="text" type="java.lang.String" value="Excluir"/> <Property name="toolTipText" type="java.lang.String" value="Excluir algum produto do estoque"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcluirItemActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="lblControleEstoque"> <Properties> @@ -322,6 +364,21 @@ <Property name="text" type="java.lang.String" value="Criar Item"/> </Properties> </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane3"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTextArea" name="txtDescricaoEstoque"> + <Properties> + <Property name="columns" type="int" value="20"/> + <Property name="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> </SubComponents> </Container> <Container class="javax.swing.JScrollPane" name="jScrollPane1"> @@ -346,6 +403,9 @@ <TableHeader reorderingAllowed="true" resizingAllowed="true"/> </Property> </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblMostraProdutosMouseClicked"/> + </Events> </Component> </SubComponents> </Container> diff --git a/src/telas/ControleEstoque.java b/src/telas/ControleEstoque.java index 4de618d..16cca3c 100644 --- a/src/telas/ControleEstoque.java +++ b/src/telas/ControleEstoque.java @@ -4,6 +4,14 @@ */ package telas; +<<<<<<< Updated upstream +======= +import static classes.Estoque.estoque; +import classes.Produto; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +>>>>>>> Stashed changes /** * * @author Yuri @@ -44,7 +52,7 @@ public void enableEstoqueFields(){ txtTituloEstoque.setEnabled(true); txtPrecoEstoque.setEnabled(true); txtQuantiaEstoque.setEnabled(true); - txtCodigoEstoque.setEnabled(true); + txtCodigoEstoque.setEnabled(false); txtDescricaoEstoque.setEnabled(true); lblTituloEstoque.setEnabled(true); @@ -65,6 +73,45 @@ public void disableEstoqueButtons(){ btnBuscar.setEnabled(false); } +<<<<<<< Updated upstream +======= + + public void clearEstoqueFields(){ + txtTituloEstoque.setText(""); + txtPrecoEstoque.setText(""); + txtQuantiaEstoque.setText(""); + txtCodigoEstoque.setText(""); + txtDescricaoEstoque.setText(""); + } + + + private void carregarTabelaProdutos(){ + DefaultTableModel modeloTabelaProdutos = new DefaultTableModel(new Object[] {"Título","Autor","Gênero","Preço","Quantia Estoque","Código Produto","Descrição"},0); + + for(int i=0;i<estoque.size();i++){ + Object linha[] = new Object[] {estoque.get(i).getTitulo(), + estoque.get(i).getAutor(), + estoque.get(i).getGenero(), + estoque.get(i).getPreço(), + estoque.get(i).getQuantidadeEstoque(), + estoque.get(i).getCodigoDoProduto(), + estoque.get(i).getDescrição()}; + modeloTabelaProdutos.addRow(linha); + + } + tblMostraProdutos.setModel(modeloTabelaProdutos); + + tblMostraProdutos.getColumnModel().getColumn(0).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(1).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(2).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(3).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(4).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(5).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(6).setPreferredWidth(WIDTH); + + + } +>>>>>>> Stashed changes /** * This method is called from within the constructor to initialize the form. @@ -78,7 +125,6 @@ private void initComponents() { jPanel2 = new javax.swing.JPanel(); txtTituloEstoque = new javax.swing.JTextField(); txtQuantiaEstoque = new javax.swing.JTextField(); - txtDescricaoEstoque = new javax.swing.JTextField(); txtPrecoEstoque = new javax.swing.JTextField(); txtCodigoEstoque = new javax.swing.JTextField(); lblTituloEstoque = new javax.swing.JLabel(); @@ -93,7 +139,13 @@ private void initComponents() { btnPesquisarItem = new javax.swing.JButton(); btnExcluirItem = new javax.swing.JButton(); lblControleEstoque = new javax.swing.JLabel(); +<<<<<<< Updated upstream jButton1 = new javax.swing.JButton(); +======= + btnCriar = new javax.swing.JButton(); + jScrollPane3 = new javax.swing.JScrollPane(); + txtDescricaoEstoque = new javax.swing.JTextArea(); +>>>>>>> Stashed changes jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); @@ -109,8 +161,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { txtQuantiaEstoque.setToolTipText("insira a quantia em estoque"); - txtDescricaoEstoque.setToolTipText("insira a descrição"); - txtPrecoEstoque.setToolTipText("insira o preço do produto"); txtCodigoEstoque.setToolTipText("insira o código do produto"); @@ -172,6 +222,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnExcluirItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N btnExcluirItem.setText("Excluir"); btnExcluirItem.setToolTipText("Excluir algum produto do estoque"); + btnExcluirItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirItemActionPerformed(evt); + } + }); lblControleEstoque.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N lblControleEstoque.setText("Controle do estoque"); @@ -179,19 +234,24 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N jButton1.setText("Criar Item"); + txtDescricaoEstoque.setColumns(20); + txtDescricaoEstoque.setRows(5); + jScrollPane3.setViewportView(txtDescricaoEstoque); + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(24, 467, Short.MAX_VALUE) - .addComponent(lblControleEstoque) - .addGap(386, 386, 386)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() +<<<<<<< Updated upstream .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1) +======= + .addContainerGap(40, Short.MAX_VALUE) + .addComponent(btnCriar) +>>>>>>> Stashed changes .addGap(50, 50, 50) .addComponent(btnAlterarItem) .addGap(65, 65, 65) @@ -200,13 +260,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel2Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblTituloEstoque, javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(lblPrecoEstoque, javax.swing.GroupLayout.Alignment.TRAILING)) - .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(34, 34, 34) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblTituloEstoque) + .addGap(18, 18, 18) + .addComponent(txtTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblPrecoEstoque) + .addGap(18, 18, 18) + .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(35, 35, 35) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(lblCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) @@ -217,43 +279,45 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGap(33, 33, 33) .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(btnCancelarItem) .addGap(69, 69, 69) - .addComponent(btnExcluirItem)) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(lblDescricaoEstoque) - .addGap(18, 18, 18) - .addComponent(txtDescricaoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(108, 108, 108) - .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnPesquisarItem) - .addGap(62, 62, 62)) + .addComponent(btnExcluirItem) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnPesquisarItem) + .addGap(62, 62, 62)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(0, 103, Short.MAX_VALUE) + .addComponent(lblDescricaoEstoque) + .addGap(29, 29, 29) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 264, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(128, 128, 128)))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addComponent(lblControleEstoque) + .addGap(406, 406, 406)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(435, 435, 435)))) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() - .addContainerGap() - .addComponent(lblControleEstoque) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE) + .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(44, 44, 44) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblControleEstoque) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblQuantiaEstoque) - .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblCodigoEstoque) - .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(9, 9, 9) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblDescricaoEstoque) +<<<<<<< Updated upstream .addComponent(txtDescricaoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnBuscar))) @@ -273,6 +337,34 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblPrecoEstoque))))) +======= + .addComponent(lblQuantiaEstoque) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblTituloEstoque)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblCodigoEstoque) + .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblPrecoEstoque))))))) + .addGap(4, 4, 4) + .addComponent(btnBuscar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnAlterarItem) + .addComponent(btnCancelarItem) + .addComponent(btnSalvarItem) + .addComponent(btnPesquisarItem) + .addComponent(btnExcluirItem) + .addComponent(btnCriar)) + .addGap(0, 12, Short.MAX_VALUE)) +>>>>>>> Stashed changes ); jScrollPane1.setToolTipText("tabela com os produtos em estoque"); @@ -296,27 +388,45 @@ public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); +<<<<<<< Updated upstream jScrollPane1.setViewportView(jTable1); +======= + tblMostraProdutos.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tblMostraProdutosMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tblMostraProdutos); + if (tblMostraProdutos.getColumnModel().getColumnCount() > 0) { + tblMostraProdutos.getColumnModel().getColumn(0).setPreferredWidth(50); + tblMostraProdutos.getColumnModel().getColumn(1).setPreferredWidth(20); + tblMostraProdutos.getColumnModel().getColumn(2).setPreferredWidth(15); + tblMostraProdutos.getColumnModel().getColumn(3).setPreferredWidth(8); + tblMostraProdutos.getColumnModel().getColumn(4).setPreferredWidth(3); + tblMostraProdutos.getColumnModel().getColumn(5).setPreferredWidth(5); + tblMostraProdutos.getColumnModel().getColumn(6).setPreferredWidth(100); + } +>>>>>>> Stashed changes javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGap(79, 79, 79) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 820, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(428, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addContainerGap(47, Short.MAX_VALUE)) ); pack(); @@ -332,6 +442,7 @@ private void btnCancelarItemActionPerformed(java.awt.event.ActionEvent evt) {//G disableEstoqueFields(); disableEstoqueButtons(); //btnAddItem.setEnabled(true); + clearEstoqueFields(); btnPesquisarItem.setEnabled(true); }//GEN-LAST:event_btnCancelarItemActionPerformed @@ -356,8 +467,58 @@ private void btnPesquisarItemActionPerformed(java.awt.event.ActionEvent evt) {// private void btnAlterarItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAlterarItemActionPerformed // TODO add your handling code here: + enableEstoqueFields(); + btnSalvarItem.setEnabled(true); + btnCancelarItem.setEnabled(true); + btnPesquisarItem.setEnabled(true); + + }//GEN-LAST:event_btnAlterarItemActionPerformed +<<<<<<< Updated upstream +======= + private void btnCriarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCriarActionPerformed + // TODO add your handling code here: + new CriarNovoProduto().setVisible(true); + btnSalvarItem.setEnabled(true); + + lblTituloEstoque.setEnabled(true); + }//GEN-LAST:event_btnCriarActionPerformed + + private void tblMostraProdutosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblMostraProdutosMouseClicked + // TODO add your handling code here: + + btnAlterarItem.setEnabled(true); + btnExcluirItem.setEnabled(true); + + + int i = tblMostraProdutos.getSelectedRow(); + System.out.println(i); + if(i>=0 && i<estoque.size()){ + Produto item = estoque.get(i); + System.out.println(item.getTitulo()); + txtTituloEstoque.setText(item.getTitulo()); + txtPrecoEstoque.setText(String.valueOf(item.getPreço())); + txtQuantiaEstoque.setText(String.valueOf(item.getQuantidadeEstoque())); + txtCodigoEstoque.setText(item.getCodigoDoProduto()); + txtDescricaoEstoque.setText(item.getDescrição()); + } + }//GEN-LAST:event_tblMostraProdutosMouseClicked + + private void btnExcluirItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirItemActionPerformed + // TODO add your handling code here: + int i = tblMostraProdutos.getSelectedRow(); + + if(i>=0 && i<estoque.size()){ + estoque.remove(i); + + } + carregarTabelaProdutos(); + + + }//GEN-LAST:event_btnExcluirItemActionPerformed + +>>>>>>> Stashed changes /** * @param args the command line arguments */ @@ -403,7 +564,11 @@ public void run() { private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel2; private javax.swing.JScrollPane jScrollPane1; +<<<<<<< Updated upstream private javax.swing.JTable jTable1; +======= + private javax.swing.JScrollPane jScrollPane3; +>>>>>>> Stashed changes private javax.swing.JLabel lblCodigoEstoque; private javax.swing.JLabel lblControleEstoque; private javax.swing.JLabel lblDescricaoEstoque; @@ -411,7 +576,7 @@ public void run() { private javax.swing.JLabel lblQuantiaEstoque; private javax.swing.JLabel lblTituloEstoque; private javax.swing.JTextField txtCodigoEstoque; - private javax.swing.JTextField txtDescricaoEstoque; + private javax.swing.JTextArea txtDescricaoEstoque; private javax.swing.JTextField txtPrecoEstoque; private javax.swing.JTextField txtQuantiaEstoque; private javax.swing.JTextField txtTituloEstoque; diff --git a/src/telas/CriarNovoProduto.form b/src/telas/CriarNovoProduto.form new file mode 100644 index 0000000..02d5396 --- /dev/null +++ b/src/telas/CriarNovoProduto.form @@ -0,0 +1,220 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="Cadastro de novo produto"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="56" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="txtAutor" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Component id="txtTitulo" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnCriarNovoItem" min="-2" max="-2" attributes="0"/> + <Component id="txtGenero" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="97" max="-2" attributes="0"/> + <Component id="txtPreco" min="-2" pref="262" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodigoProduto" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="txtQuantiaEstoque" pref="262" max="32767" attributes="0"/> + <Component id="jScrollPane1" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="195" max="-2" attributes="0"/> + <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="479" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="213" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTitulo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPreco" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodigoProduto" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtAutor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtQuantiaEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="45" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtGenero" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnCriarNovoItem" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="368" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Cadastrar novo Produto"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Título"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Autor"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Gênero"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="text" type="java.lang.String" value="Preço"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="Quantidade Estoque"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="text" type="java.lang.String" value="Descrição"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTitulo"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtTituloActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtAutor"> + </Component> + <Component class="javax.swing.JTextField" name="txtGenero"> + </Component> + <Component class="javax.swing.JTextField" name="txtPreco"> + </Component> + <Component class="javax.swing.JTextField" name="txtQuantiaEstoque"> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTextArea" name="txtAreaDescricao"> + <Properties> + <Property name="columns" type="int" value="20"/> + <Property name="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnCriarNovoItem"> + <Properties> + <Property name="text" type="java.lang.String" value="Criar novo Item"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCriarNovoItemActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCancelar"> + <Properties> + <Property name="text" type="java.lang.String" value="Cancelar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="text" type="java.lang.String" value="Código Produto"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCodigoProduto"> + </Component> + </SubComponents> +</Form> diff --git a/src/telas/CriarNovoProduto.java b/src/telas/CriarNovoProduto.java new file mode 100644 index 0000000..2e6dadc --- /dev/null +++ b/src/telas/CriarNovoProduto.java @@ -0,0 +1,267 @@ +/* + * 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 telas; + +import static classes.Estoque.estoque; +import classes.Produto; +import javax.swing.JOptionPane; + +/** + * + * @author Yuri + */ +public class CriarNovoProduto extends javax.swing.JFrame { + + /** + * Creates new form CriarNovoProduto + */ + public CriarNovoProduto() { + 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") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + txtTitulo = new javax.swing.JTextField(); + txtAutor = new javax.swing.JTextField(); + txtGenero = new javax.swing.JTextField(); + txtPreco = new javax.swing.JTextField(); + txtQuantiaEstoque = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtAreaDescricao = new javax.swing.JTextArea(); + btnCriarNovoItem = new javax.swing.JButton(); + btnCancelar = new javax.swing.JButton(); + jLabel8 = new javax.swing.JLabel(); + txtCodigoProduto = new javax.swing.JTextField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Cadastro de novo produto"); + + jLabel1.setText("Cadastrar novo Produto"); + + jLabel2.setText("Título"); + + jLabel3.setText("Autor"); + + jLabel4.setText("Gênero"); + + jLabel5.setText("Preço"); + + jLabel6.setText("Quantidade Estoque"); + + jLabel7.setText("Descrição"); + + txtTitulo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtTituloActionPerformed(evt); + } + }); + + txtAreaDescricao.setColumns(20); + txtAreaDescricao.setRows(5); + jScrollPane1.setViewportView(txtAreaDescricao); + + btnCriarNovoItem.setText("Criar novo Item"); + btnCriarNovoItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCriarNovoItemActionPerformed(evt); + } + }); + + btnCancelar.setText("Cancelar"); + btnCancelar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarActionPerformed(evt); + } + }); + + jLabel8.setText("Código Produto"); + jLabel8.setToolTipText(""); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(56, 56, 56) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addGap(29, 29, 29) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnCriarNovoItem) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel5) + .addGap(97, 97, 97) + .addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodigoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6) + .addComponent(jLabel7)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE) + .addComponent(jScrollPane1))))) + .addGroup(layout.createSequentialGroup() + .addGap(195, 195, 195) + .addComponent(btnCancelar)))) + .addGroup(layout.createSequentialGroup() + .addGap(479, 479, 479) + .addComponent(jLabel1))) + .addContainerGap(213, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(jLabel5) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8) + .addComponent(txtCodigoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(25, 25, 25) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(jLabel6) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(45, 45, 45) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jLabel7) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(32, 32, 32) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCriarNovoItem) + .addComponent(btnCancelar)) + .addGap(0, 368, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void txtTituloActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTituloActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtTituloActionPerformed + + private void btnCriarNovoItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCriarNovoItemActionPerformed + // TODO add your handling code here: + + String titulo = txtTitulo.getText(); + String autor = txtAutor.getText(); + String genero = txtGenero.getText(); + double preco = Double.parseDouble(txtPreco.getText()); + int qntEstoque = Integer.parseInt(txtQuantiaEstoque.getText()); + String codigoProduto = txtCodigoProduto.getText(); + String descricao = txtAreaDescricao.getText(); + + Produto produto1 = new Produto(titulo,autor,genero,preco,qntEstoque,codigoProduto,descricao); + + estoque.add(produto1); + JOptionPane.showMessageDialog(null,"Item cadastrado com sucesso!", "Novo produto criado!",JOptionPane.PLAIN_MESSAGE); + this.setVisible(false); + + + + }//GEN-LAST:event_btnCriarNovoItemActionPerformed + + private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnCancelarActionPerformed + + /** + * @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 ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.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 CriarNovoProduto().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnCancelar; + private javax.swing.JButton btnCriarNovoItem; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea txtAreaDescricao; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextField txtCodigoProduto; + private javax.swing.JTextField txtGenero; + private javax.swing.JTextField txtPreco; + private javax.swing.JTextField txtQuantiaEstoque; + private javax.swing.JTextField txtTitulo; + // End of variables declaration//GEN-END:variables +} diff --git a/src/telas/Menu.form b/src/telas/Menu.form index b2c096d..5c0bd22 100644 --- a/src/telas/Menu.form +++ b/src/telas/Menu.form @@ -47,7 +47,11 @@ </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> +<<<<<<< Updated upstream <Component id="jPanel1" min="-2" pref="1081" max="-2" attributes="0"/> +======= + <Component id="jPanel1" min="-2" pref="1064" max="-2" attributes="0"/> +>>>>>>> Stashed changes </Group> </DimensionLayout> </Layout> @@ -61,7 +65,7 @@ <Component class="javax.swing.JLabel" name="lblLogin"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="48" style="1"/> + <Font name="Old London" size="60" style="1"/> </Property> <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> <Color blue="0" green="0" red="ff" type="rgb"/> @@ -70,7 +74,11 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="570" y="60" width="-1" height="-1"/> +======= + <AbsoluteConstraints x="220" y="20" width="890" height="60"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> @@ -99,13 +107,18 @@ <Image iconType="3" name="/imagens/simbolos/business_inventory_maintenance_product_box_boxes_2326_64.png"/> </Property> <Property name="text" type="java.lang.String" value="Atualizar Estoque"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAtualizarEstoqueActionPerformed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="1270" y="700" width="400" height="130"/> +======= + <AbsoluteConstraints x="1410" y="620" width="400" height="130"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> @@ -118,13 +131,18 @@ <Image iconType="3" name="/imagens/simbolos/4105931-add-to-cart-buy-cart-sell-shop-shopping-cart_113919_64.png"/> </Property> <Property name="text" type="java.lang.String" value="Ver carrinho"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnVerCarrinhoActionPerformed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="1270" y="410" width="400" height="130"/> +======= + <AbsoluteConstraints x="1400" y="400" width="400" height="130"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> @@ -137,13 +155,18 @@ <Image iconType="3" name="/imagens/simbolos/searchmagnifierinterfacesymbol1_79893_64.png"/> </Property> <Property name="text" type="java.lang.String" value="Buscar Produto"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="750" y="410" width="400" height="130"/> +======= + <AbsoluteConstraints x="790" y="380" width="400" height="130"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> @@ -156,13 +179,18 @@ <Image iconType="3" name="/imagens/simbolos/technicalsupport_support_representative_person_people_man_1641_64.png"/> </Property> <Property name="text" type="java.lang.String" value="Funcionário"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFuncionarioActionPerformed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="250" y="700" width="400" height="130"/> +======= + <AbsoluteConstraints x="100" y="620" width="400" height="130"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> @@ -175,32 +203,42 @@ <Image iconType="3" name="/imagens/simbolos/customer_person_people_man_you_1625_64.png"/> </Property> <Property name="text" type="java.lang.String" value="Gerente"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnGerenteActionPerformed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="750" y="700" width="400" height="130"/> +======= + <AbsoluteConstraints x="780" y="610" width="400" height="130"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> <Component class="javax.swing.JButton" name="btnCliente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="36" style="1"/> + <Font name="Segoe UI" size="31" style="1"/> </Property> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/imagens/simbolos/person_user_customer_man_male_man_boy_people_1687_64.png"/> </Property> <Property name="text" type="java.lang.String" value="Cliente"/> + <Property name="contentAreaFilled" type="boolean" value="false"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnClienteActionPerformed"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="250" y="410" width="400" height="130"/> +======= + <AbsoluteConstraints x="100" y="380" width="400" height="130"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> @@ -281,12 +319,20 @@ <Component class="javax.swing.JLabel" name="lblImagem"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> +<<<<<<< Updated upstream <Image iconType="3" name="/imagens/background_resize.jpg"/> +======= + <Image iconType="3" name="/imagens/Telas/Menu.png"/> +>>>>>>> Stashed changes </Property> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="0" y="0" width="1920" height="1080"/> +======= + <AbsoluteConstraints x="0" y="-120" width="-1" height="1290"/> +>>>>>>> Stashed changes </Constraint> </Constraints> </Component> diff --git a/src/telas/Menu.java b/src/telas/Menu.java index c5fe0d7..27d94a4 100644 --- a/src/telas/Menu.java +++ b/src/telas/Menu.java @@ -56,6 +56,7 @@ public Menu() { setLocationRelativeTo(null); this.setExtendedState(MAXIMIZED_BOTH); +<<<<<<< Updated upstream verificarLogin(logado); Gerente gerente; gerente = new Gerente("admin","admin","admin@gmail.com","admin"); @@ -68,6 +69,11 @@ public Menu() { listaClientes.add(cliente); +======= + verificarLogin(logado, user); + criarContasIniciais(); + atualizarBotoes(); +>>>>>>> Stashed changes } /** * This method is called from within the constructor to initialize the form. @@ -75,6 +81,114 @@ public Menu() { * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") +<<<<<<< Updated upstream +======= + public void criarContasIniciais(){ + if(listaFuncionarios.size()==0 & listaClientes.size()==0 & estoque.size()==0){ + Gerente gerente; + gerente = new Gerente("admin","000.000.000-00","admin@gmail.com","admin"); + listaGerente.add(gerente); + Funcionario funcionario; + funcionario = new Funcionario("func","000.000.000-00","func@gmail.com","func"); + listaFuncionarios.add(funcionario); + Cliente cliente = new Cliente("user","000.000.000-00","user@gmail.com","user","Pernambuco","10/05/1990","999-9999"); + listaClientes.add(cliente); + Produto produto1 = new Produto("Eragon","Christopher Paolini","Aventura",15.69,3,"1","Eragon se torna um cavaleiro de Dragão"); + estoque.add(produto1); + + } + } + public void verificarLogin(boolean logado, String user){ + // Habilitar/desabilitar botão de Logout + if(logado==true){ + btnLogout.setVisible(true); + btnLogin.setVisible(false); + if(user.equals("cliente")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como cliente!"); + }else if(user.equals("funcionario")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como funcionário"); + }else if(user.equals("gerente")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como gerente"); + } + }else{ + btnLogout.setVisible(false); + btnLogin.setVisible(true); + lblLogin.setVisible(false); + } + } + public void atualizarLogin(){ + // Habilitar/desabilitar botão de Logout + if(logado==true){ + btnLogout.setVisible(true); + btnLogin.setVisible(false); + if(user.equals("cliente")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como cliente!"); + }else if(user.equals("funcionario")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como funcionário"); + }else if(user.equals("gerente")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como gerente"); + } + }else{ + btnLogout.setVisible(false); + btnLogin.setVisible(true); + lblLogin.setVisible(false); + } + } + public void atualizarBotoes(){ + if(logado==true){ + if(user.equals("")){ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.setEnabled(false); + btnGerente.setEnabled(false); + btnAtualizarEstoque.setEnabled(false); + btnVerCarrinho.setEnabled(false); + } + if(user.equals("cliente")){ + btnCliente.setText("Área do Cliente"); + btnFuncionario.setEnabled(false); + btnGerente.setEnabled(false); + btnAtualizarEstoque.setEnabled(false); + btnVerCarrinho.setEnabled(true); + + + } + if(user.equals("funcionario")){ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.setEnabled(true); + btnFuncionario.setText("Área do Funcionário"); + btnGerente.setEnabled(false); + btnAtualizarEstoque.setEnabled(true); + btnVerCarrinho.setEnabled(true); + + } + if(user.equals("gerente")){ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.setEnabled(true); + btnFuncionario.setText("Criar Funcionário"); + btnGerente.setEnabled(true); + btnGerente.setText("Área do Gerente"); + btnAtualizarEstoque.setEnabled(true); + btnVerCarrinho.setEnabled(true); + + } + + }else{ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.setEnabled(false); + btnGerente.setEnabled(false); + btnAtualizarEstoque.setEnabled(false); + btnVerCarrinho.setEnabled(false); + + } + } + +>>>>>>> Stashed changes // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { @@ -105,10 +219,14 @@ private void initComponents() { jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - lblLogin.setFont(new java.awt.Font("Segoe UI", 1, 48)); // NOI18N + lblLogin.setFont(new java.awt.Font("Old London", 1, 60)); // NOI18N lblLogin.setForeground(new java.awt.Color(255, 0, 0)); lblLogin.setText("Você entrou como cliente"); +<<<<<<< Updated upstream jPanel1.add(lblLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 60, -1, -1)); +======= + jPanel1.add(lblLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 20, 890, 60)); +>>>>>>> Stashed changes lblBookStockManager.setFont(new java.awt.Font("Segoe UI", 1, 48)); // NOI18N lblBookStockManager.setForeground(new java.awt.Color(255, 255, 255)); @@ -118,62 +236,92 @@ private void initComponents() { btnAtualizarEstoque.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnAtualizarEstoque.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/business_inventory_maintenance_product_box_boxes_2326_64.png"))); // NOI18N btnAtualizarEstoque.setText("Atualizar Estoque"); + btnAtualizarEstoque.setContentAreaFilled(false); btnAtualizarEstoque.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAtualizarEstoqueActionPerformed(evt); } }); +<<<<<<< Updated upstream jPanel1.add(btnAtualizarEstoque, new org.netbeans.lib.awtextra.AbsoluteConstraints(1270, 700, 400, 130)); +======= + jPanel1.add(btnAtualizarEstoque, new org.netbeans.lib.awtextra.AbsoluteConstraints(1410, 620, 400, 130)); +>>>>>>> Stashed changes btnVerCarrinho.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnVerCarrinho.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/4105931-add-to-cart-buy-cart-sell-shop-shopping-cart_113919_64.png"))); // NOI18N btnVerCarrinho.setText("Ver carrinho"); + btnVerCarrinho.setContentAreaFilled(false); btnVerCarrinho.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnVerCarrinhoActionPerformed(evt); } }); +<<<<<<< Updated upstream jPanel1.add(btnVerCarrinho, new org.netbeans.lib.awtextra.AbsoluteConstraints(1270, 410, 400, 130)); +======= + jPanel1.add(btnVerCarrinho, new org.netbeans.lib.awtextra.AbsoluteConstraints(1400, 400, 400, 130)); +>>>>>>> Stashed changes btnPesquisar.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnPesquisar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/searchmagnifierinterfacesymbol1_79893_64.png"))); // NOI18N btnPesquisar.setText("Buscar Produto"); + btnPesquisar.setContentAreaFilled(false); btnPesquisar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPesquisarActionPerformed(evt); } }); +<<<<<<< Updated upstream jPanel1.add(btnPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(750, 410, 400, 130)); +======= + jPanel1.add(btnPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 380, 400, 130)); +>>>>>>> Stashed changes btnFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/technicalsupport_support_representative_person_people_man_1641_64.png"))); // NOI18N btnFuncionario.setText("Funcionário"); + btnFuncionario.setContentAreaFilled(false); btnFuncionario.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnFuncionarioActionPerformed(evt); } }); +<<<<<<< Updated upstream jPanel1.add(btnFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 700, 400, 130)); +======= + jPanel1.add(btnFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 620, 400, 130)); +>>>>>>> Stashed changes btnGerente.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnGerente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/customer_person_people_man_you_1625_64.png"))); // NOI18N btnGerente.setText("Gerente"); + btnGerente.setContentAreaFilled(false); btnGerente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnGerenteActionPerformed(evt); } }); +<<<<<<< Updated upstream jPanel1.add(btnGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(750, 700, 400, 130)); +======= + jPanel1.add(btnGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 610, 400, 130)); +>>>>>>> Stashed changes - btnCliente.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N + btnCliente.setFont(new java.awt.Font("Segoe UI", 1, 31)); // NOI18N btnCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/person_user_customer_man_male_man_boy_people_1687_64.png"))); // NOI18N btnCliente.setText("Cliente"); + btnCliente.setContentAreaFilled(false); btnCliente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnClienteActionPerformed(evt); } }); +<<<<<<< Updated upstream jPanel1.add(btnCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 410, 400, 130)); +======= + jPanel1.add(btnCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(100, 380, 400, 130)); +>>>>>>> Stashed changes btnLogout.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnLogout.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/logout_90894_64.png"))); // NOI18N @@ -207,8 +355,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { lblLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/livro01.png"))); // NOI18N jPanel1.add(lblLogo, new org.netbeans.lib.awtextra.AbsoluteConstraints(1490, 10, 390, 210)); +<<<<<<< Updated upstream lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/background_resize.jpg"))); // NOI18N jPanel1.add(lblImagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1920, 1080)); +======= + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/Menu.png"))); // NOI18N + jPanel1.add(lblImagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -120, -1, 1290)); + lblImagem.getAccessibleContext().setAccessibleName(""); +>>>>>>> Stashed changes javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); @@ -220,7 +374,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) +<<<<<<< Updated upstream .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 1081, javax.swing.GroupLayout.PREFERRED_SIZE) +======= + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 1064, javax.swing.GroupLayout.PREFERRED_SIZE) +>>>>>>> Stashed changes ); pack(); @@ -232,6 +390,8 @@ private void btnLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR user=""; verificarLogin(logado); JOptionPane.showMessageDialog(null,"Você acabou de sair do sistema", "Mensagem",JOptionPane.PLAIN_MESSAGE); + atualizarBotoes(); + }//GEN-LAST:event_btnLogoutActionPerformed diff --git a/src/telas/areaCliente.form b/src/telas/areaCliente.form index 9eeb4a5..32ea4b1 100644 --- a/src/telas/areaCliente.form +++ b/src/telas/areaCliente.form @@ -19,8 +19,10 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,4,53,0,0,7,-128"/> </AuxValues> +<<<<<<< Updated upstream <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> @@ -57,118 +59,133 @@ </Group> </Group> </DimensionLayout> +======= + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> +>>>>>>> Stashed changes </Layout> <SubComponents> <Container class="javax.swing.JPanel" name="jPanel1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="790" y="100" width="628" height="890"/> + </Constraint> + </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Component id="btnAlterarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="136" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="143" max="32767" attributes="0"/> + <Component id="btnCancelarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblDadosCliente" alignment="0" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="3" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="2" max="-2" attributes="0"/> - <Component id="txtNomeCliente" min="-2" pref="159" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> - <Component id="txtCPFCliente" min="-2" pref="83" max="-2" attributes="0"/> - </Group> - </Group> + <Group type="102" attributes="0"> + <Component id="ftxNascimentoCliente" min="-2" pref="607" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="211" max="-2" attributes="0"/> - <Component id="lblNascimentoCliente" min="-2" pref="104" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="ftxNascimentoCliente" min="-2" pref="75" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="lblEmailCliente" alignment="0" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace min="3" pref="3" max="-2" attributes="0"/> - <Component id="lblSenhaCliente" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <Component id="lblCelularCliente" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> - <Component id="txtEmailCliente" pref="115" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="ftxTelefone" min="-2" max="-2" attributes="0"/> - <Component id="txtSenhaCliente" max="32767" attributes="0"/> - </Group> - </Group> - </Group> - <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> - <Component id="lblEnderecoCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="txtEnderecoCliente" min="-2" pref="107" max="-2" attributes="0"/> + <Component id="lblNascimentoCliente" min="-2" pref="342" max="-2" attributes="0"/> + <Component id="lblEmailCliente" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblCelularCliente" min="-2" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Component id="txtEmailCliente" alignment="0" pref="607" max="32767" attributes="0"/> + <Component id="lblSenhaCliente" alignment="0" min="-2" pref="128" max="-2" attributes="0"/> + <Component id="txtSenhaCliente" alignment="0" max="32767" attributes="0"/> </Group> </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> </Group> - <EmptySpace min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblDadosCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblAreaCliente" min="-2" pref="290" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="165" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="btnAlterarCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="150" max="-2" attributes="0"/> - <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtNomeCliente" alignment="0" max="32767" attributes="0"/> + <Component id="lblNomeCliente" alignment="0" min="-2" pref="126" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtEnderecoCliente" alignment="0" max="32767" attributes="0"/> + <Component id="lblEnderecoCliente" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtCPFCliente" alignment="0" max="32767" attributes="0"/> + <Component id="lblCPFCliente" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxTelefone" min="-2" pref="607" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/> - <Component id="btnCancelarCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> - <Component id="lblDadosCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblNomeCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtNomeCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblEmailCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtEmailCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblEnderecoCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtEnderecoCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblAreaCliente" alignment="3" min="-2" pref="60" max="-2" attributes="0"/> + <Component id="lblDadosCliente" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblSenhaCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblNascimentoCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtSenhaCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="ftxNascimentoCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblCelularCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="ftxTelefone" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblNomeCliente" min="-2" pref="48" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNomeCliente" min="-2" pref="37" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblEnderecoCliente" min="-2" pref="67" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEnderecoCliente" min="-2" pref="42" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCPFCliente" min="-2" pref="58" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCPFCliente" min="-2" pref="40" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblNascimentoCliente" min="-2" pref="53" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxNascimentoCliente" min="-2" pref="39" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblCelularCliente" min="-2" pref="55" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxTelefone" min="-2" pref="34" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblEmailCliente" min="-2" pref="57" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmailCliente" min="-2" pref="40" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblSenhaCliente" min="-2" pref="55" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtSenhaCliente" min="-2" pref="40" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnAlterarCliente" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnSalvarCliente" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnCancelarCliente" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="14" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="80" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -184,31 +201,49 @@ </Component> <Component class="javax.swing.JLabel" name="lblNomeCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Nome"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblCPFCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="CPF"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblEmailCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="E-mail"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblSenhaCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Senha"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblEnderecoCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Endereço"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblNascimentoCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="data de nascimento"/> </Properties> </Component> @@ -229,6 +264,9 @@ <Properties> <Property name="toolTipText" type="java.lang.String" value="senha do cliente"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtSenhaClienteActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JTextField" name="txtEnderecoCliente"> <Properties> @@ -282,6 +320,9 @@ </Component> <Component class="javax.swing.JLabel" name="lblCelularCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Celular"/> </Properties> </Component> @@ -309,8 +350,17 @@ <Property name="toolTipText" type="java.lang.String" value="CPF do cliente"/> </Properties> </Component> + <Component class="javax.swing.JLabel" name="lblAreaCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="48" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Área do Cliente"/> + </Properties> + </Component> </SubComponents> </Container> +<<<<<<< Updated upstream <Component class="javax.swing.JButton" name="btnSairCliente"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> @@ -324,14 +374,19 @@ </Events> </Component> <Component class="javax.swing.JLabel" name="lblAreaCliente"> +======= + <Component class="javax.swing.JLabel" name="jLabel1"> +>>>>>>> Stashed changes <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/Telas/ÁreaCliente.png"/> </Property> - <Property name="text" type="java.lang.String" value="Área do Cliente"/> </Properties> - </Component> - <Component class="javax.swing.JSeparator" name="jSeparator1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> </Component> </SubComponents> </Form> diff --git a/src/telas/areaCliente.java b/src/telas/areaCliente.java index 2f21e46..4369092 100644 --- a/src/telas/areaCliente.java +++ b/src/telas/areaCliente.java @@ -25,6 +25,8 @@ public areaCliente() { btnSalvarCliente.setEnabled(false); btnCancelarCliente.setEnabled(false); loadClienteFields(); + this.setExtendedState(MAXIMIZED_BOTH); + } @@ -106,24 +108,31 @@ private void initComponents() { txtCPFCliente = new javax.swing.JFormattedTextField(); btnSairCliente = new javax.swing.JButton(); lblAreaCliente = new javax.swing.JLabel(); - jSeparator1 = new javax.swing.JSeparator(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Área do cliente"); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); lblDadosCliente.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N lblDadosCliente.setText("meus dados"); + lblNomeCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblNomeCliente.setText("Nome"); + lblCPFCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblCPFCliente.setText("CPF"); + lblEmailCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblEmailCliente.setText("E-mail"); + lblSenhaCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblSenhaCliente.setText("Senha"); + lblEnderecoCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblEnderecoCliente.setText("Endereço"); + lblNascimentoCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblNascimentoCliente.setText("data de nascimento"); txtNomeCliente.setToolTipText("Nome do cliente"); @@ -136,6 +145,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { txtEmailCliente.setToolTipText("email cadastrado"); txtSenhaCliente.setToolTipText("senha do cliente"); + txtSenhaCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtSenhaClienteActionPerformed(evt); + } + }); txtEnderecoCliente.setToolTipText("endereço salvo"); @@ -169,6 +183,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + lblCelularCliente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N lblCelularCliente.setText("Celular"); try { @@ -192,95 +207,109 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } txtCPFCliente.setToolTipText("CPF do cliente"); + lblAreaCliente.setFont(new java.awt.Font("Old London", 1, 48)); // NOI18N + lblAreaCliente.setText("Área do Cliente"); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(30, 30, 30) + .addComponent(btnAlterarCliente) + .addGap(136, 136, 136) + .addComponent(btnSalvarCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 143, Short.MAX_VALUE) + .addComponent(btnCancelarCliente) + .addGap(45, 45, 45)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblDadosCliente) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(3, 3, 3) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(lblNomeCliente) - .addGap(2, 2, 2) - .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(lblCPFCliente) - .addGap(38, 38, 38) - .addComponent(txtCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(ftxNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 607, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(211, 211, 211) - .addComponent(lblNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(ftxNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(20, 20, 20) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(lblEmailCliente) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addGap(3, 3, 3) - .addComponent(lblSenhaCliente))) - .addComponent(lblCelularCliente)) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addComponent(txtEmailCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(ftxTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtSenhaCliente)))) - .addGap(37, 37, 37) - .addComponent(lblEnderecoCliente) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(txtEnderecoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))))) - .addGap(45, 45, 45)) - .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 342, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblEmailCliente) + .addComponent(lblCelularCliente) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(txtEmailCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 607, Short.MAX_VALUE) + .addComponent(lblSenhaCliente, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtSenhaCliente, javax.swing.GroupLayout.Alignment.LEADING))) + .addGap(0, 0, Short.MAX_VALUE)))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(btnAlterarCliente) - .addGap(150, 150, 150) - .addComponent(btnSalvarCliente) + .addComponent(lblDadosCliente) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnCancelarCliente) - .addGap(63, 63, 63)) + .addComponent(lblAreaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(165, 165, 165)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtNomeCliente) + .addComponent(lblNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtEnderecoCliente) + .addComponent(lblEnderecoCliente)) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtCPFCliente) + .addComponent(lblCPFCliente)) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(ftxTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 607, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(26, 26, 26) - .addComponent(lblDadosCliente) - .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblNomeCliente) - .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblEmailCliente) - .addComponent(txtEmailCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblEnderecoCliente) - .addComponent(txtEnderecoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(30, 30, 30) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblCPFCliente) - .addComponent(lblSenhaCliente) - .addComponent(lblNascimentoCliente) - .addComponent(txtSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(ftxNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(18, 18, 18) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblCelularCliente) - .addComponent(ftxTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(25, 25, 25) + .addComponent(lblAreaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblDadosCliente)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblEnderecoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEnderecoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxNascimentoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblCelularCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblEmailCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmailCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(24, 24, 24) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnAlterarCliente) .addComponent(btnSalvarCliente) .addComponent(btnCancelarCliente)) - .addContainerGap(14, Short.MAX_VALUE)) + .addGap(80, 80, 80)) ); +<<<<<<< Updated upstream btnSairCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/exit_icon-icons.com_70975.png"))); // NOI18N btnSairCliente.setText("Sair"); btnSairCliente.setToolTipText("Sair da área do cliente"); @@ -322,6 +351,12 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) ); +======= + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(790, 100, 628, 890)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/ÁreaCliente.png"))); // NOI18N + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); +>>>>>>> Stashed changes pack(); }// </editor-fold>//GEN-END:initComponents @@ -351,6 +386,7 @@ private void btnCancelarClienteActionPerformed(java.awt.event.ActionEvent evt) { btnAlterarCliente.setEnabled(true); btnCancelarCliente.setEnabled(false); btnSalvarCliente.setEnabled(false); + loadClienteFields(); }//GEN-LAST:event_btnCancelarClienteActionPerformed private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed @@ -361,6 +397,10 @@ private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {// btnSalvarCliente.setEnabled(false); }//GEN-LAST:event_btnSalvarClienteActionPerformed + private void txtSenhaClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSenhaClienteActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtSenhaClienteActionPerformed + /** * @param args the command line arguments */ @@ -403,8 +443,8 @@ public void run() { private javax.swing.JButton btnSalvarCliente; private javax.swing.JFormattedTextField ftxNascimentoCliente; private javax.swing.JFormattedTextField ftxTelefone; + private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; - private javax.swing.JSeparator jSeparator1; private javax.swing.JLabel lblAreaCliente; private javax.swing.JLabel lblCPFCliente; private javax.swing.JLabel lblCelularCliente; diff --git a/src/telas/areaFuncionario.form b/src/telas/areaFuncionario.form index 9618935..e7c72c9 100644 --- a/src/telas/areaFuncionario.form +++ b/src/telas/areaFuncionario.form @@ -19,38 +19,232 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,4,56,0,0,7,126"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace pref="45" max="32767" attributes="0"/> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> </Layout> <SubComponents> - <Container class="javax.swing.JPanel" name="jPanel1"> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="8f" green="b5" red="d3" type="rgb"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="830" y="210" width="550" height="700"/> + </Constraint> + </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="267" max="-2" attributes="0"/> - <Component id="lblAreaFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jFormattedTextField1" min="-2" pref="115" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnBuscarCliente" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="159" max="-2" attributes="0"/> + <Component id="lblControleClientes" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtNomeCliente" min="-2" pref="149" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblCodigoCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodCliente" min="-2" pref="173" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnNovoCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="83" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="103" max="-2" attributes="0"/> + <Component id="btnExluirCliente" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <EmptySpace pref="77" max="32767" attributes="0"/> </Group> + <Component id="jScrollPane3" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblControleClientes" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblNomeCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNomeCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jFormattedTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Component id="btnBuscarCliente" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="42" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblCodigoCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnNovoCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnExluirCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="80" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="187" max="-2" attributes="0"/> + <EmptySpace pref="182" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="lblControleClientes"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de Clientes"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblNomeCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Nome"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNomeCliente"> + </Component> + <Component class="javax.swing.JLabel" name="lblCPFCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="CPF"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblCodigoCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Código de Cliente"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCodCliente"> + </Component> + <Component class="javax.swing.JButton" name="btnBuscarCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Buscar"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnNovoCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Novo"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNovoClienteActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvarCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Salvar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarClienteActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnExluirCliente"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old English Text MT" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Excluir"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExluirClienteActionPerformed"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane3"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="tblControleClientes"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="5" rowCount="4"> + <Column editable="true" title="Código Cliente" type="java.lang.String"/> + <Column editable="true" title="Nome" type="java.lang.String"/> + <Column editable="true" title="CPF" type="java.lang.String"/> + <Column editable="true" title="Data Nascimento" type="java.lang.String"/> + <Column editable="true" title="Endereço" type="java.lang.String"/> + </Table> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JFormattedTextField" name="jFormattedTextField1"> + <Properties> + <Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) { ex.printStackTrace(); }"> + <Format format="###.###.###-##" subtype="-1" type="5"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="120" y="180" width="520" height="370"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> @@ -66,7 +260,7 @@ </Group> </Group> </Group> - <EmptySpace pref="24" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> @@ -85,13 +279,21 @@ </Group> </Group> </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="btnAlterarFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="168" max="-2" attributes="0"/> - <Component id="btnSalvarFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="129" max="-2" attributes="0"/> - <Component id="btnCancelarFuncionario" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnAlterarFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="133" max="-2" attributes="0"/> + <Component id="btnSalvarFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="101" max="-2" attributes="0"/> + <Component id="btnCancelarFuncionario" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="172" max="-2" attributes="0"/> + <Component id="lblAreaFuncionario" min="-2" max="-2" attributes="0"/> + </Group> + </Group> <EmptySpace max="32767" attributes="0"/> </Group> </Group> @@ -99,8 +301,9 @@ <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> <Component id="lblAreaFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> <Component id="lblDadosFuncionario" min="-2" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="lblNomeFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> @@ -132,7 +335,7 @@ <Component id="btnSalvarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnCancelarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="44" max="32767" attributes="0"/> + <EmptySpace pref="96" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -251,5 +454,17 @@ </Component> </SubComponents> </Container> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/Telas/ÁreaFuncionário.png"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> </SubComponents> </Form> diff --git a/src/telas/areaFuncionario.java b/src/telas/areaFuncionario.java index 5157dd8..48a2ff0 100644 --- a/src/telas/areaFuncionario.java +++ b/src/telas/areaFuncionario.java @@ -4,8 +4,10 @@ */ package telas; +import static classes.Cliente.listaClientes; import classes.Funcionario; import static classes.Funcionario.listaFuncionarios; +import javax.swing.table.DefaultTableModel; //import static telas.cadastrarFuncionario.listaFuncionarios; /** @@ -25,6 +27,8 @@ public areaFuncionario() { btnSalvarFuncionario.setEnabled(false); btnCancelarFuncionario.setEnabled(false); loadFuncionarioFields(); + this.setExtendedState(MAXIMIZED_BOTH); + setLocationRelativeTo(null); } @@ -64,6 +68,31 @@ public void loadFuncionarioFields(){ txtSenhaFuncionario.setText(funcionario_dados.getSenha()); txtCodigoFuncionario.setText(funcionario_dados.getCadastroFuncionario()); } + private void carregarTabelaCliente(){ + DefaultTableModel modeloTabelaCliente = new DefaultTableModel(new Object[] {"Cod.Cliente","Nome","CPF","Data Nascimento","Endereço"},0); + + for(int i=0;i<listaClientes.size();i++){ + Object linha[] = new Object[] {listaClientes.get(i).getIdCliente(), + listaClientes.get(i).getNome(), + listaClientes.get(i).getCPF(), + listaClientes.get(i).getDataNascimento(), + listaClientes.get(i).getEndereco()}; + modeloTabelaCliente.addRow(linha); + + + } + //Tabela recebe modelo de clientes + tblControleClientes.setModel(modeloTabelaCliente); + + tblControleClientes.getColumnModel().getColumn(0).setPreferredWidth(3); + tblControleClientes.getColumnModel().getColumn(1).setPreferredWidth(50); + tblControleClientes.getColumnModel().getColumn(2).setPreferredWidth(14); + tblControleClientes.getColumnModel().getColumn(3).setPreferredWidth(10); + tblControleClientes.getColumnModel().getColumn(4).setPreferredWidth(100); + + + + } /** * This method is called from within the constructor to initialize the form. @@ -74,6 +103,20 @@ public void loadFuncionarioFields(){ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + jPanel3 = new javax.swing.JPanel(); + lblControleClientes = new javax.swing.JLabel(); + lblNomeCliente = new javax.swing.JLabel(); + txtNomeCliente = new javax.swing.JTextField(); + lblCPFCliente = new javax.swing.JLabel(); + lblCodigoCliente = new javax.swing.JLabel(); + txtCodCliente = new javax.swing.JTextField(); + btnBuscarCliente = new javax.swing.JButton(); + btnNovoCliente = new javax.swing.JButton(); + btnSalvarCliente = new javax.swing.JButton(); + btnExluirCliente = new javax.swing.JButton(); + jScrollPane3 = new javax.swing.JScrollPane(); + tblControleClientes = new javax.swing.JTable(); + jFormattedTextField1 = new javax.swing.JFormattedTextField(); jPanel1 = new javax.swing.JPanel(); lblDadosFuncionario = new javax.swing.JLabel(); lblNomeFuncionario = new javax.swing.JLabel(); @@ -90,9 +133,150 @@ private void initComponents() { btnCancelarFuncionario = new javax.swing.JButton(); btnSalvarFuncionario = new javax.swing.JButton(); lblAreaFuncionario = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Área do funcionário"); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanel3.setBackground(new java.awt.Color(211, 181, 143)); + + lblControleClientes.setFont(new java.awt.Font("Old English Text MT", 1, 36)); // NOI18N + lblControleClientes.setText("Controle de Clientes"); + + lblNomeCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + lblNomeCliente.setText("Nome"); + + lblCPFCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + lblCPFCliente.setText("CPF"); + + lblCodigoCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + lblCodigoCliente.setText("Código de Cliente"); + + btnBuscarCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + btnBuscarCliente.setText("Buscar"); + + btnNovoCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + btnNovoCliente.setText("Novo"); + btnNovoCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoClienteActionPerformed(evt); + } + }); + + btnSalvarCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + btnSalvarCliente.setText("Salvar"); + btnSalvarCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarClienteActionPerformed(evt); + } + }); + + btnExluirCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + btnExluirCliente.setText("Excluir"); + btnExluirCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExluirClienteActionPerformed(evt); + } + }); + + tblControleClientes.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null, null}, + {null, null, null, null, null}, + {null, null, null, null, null}, + {null, null, null, null, null} + }, + new String [] { + "Código Cliente", "Nome", "CPF", "Data Nascimento", "Endereço" + } + ) { + Class[] types = new Class [] { + java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + }); + jScrollPane3.setViewportView(tblControleClientes); + + try { + jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(lblCPFCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnBuscarCliente)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addGap(159, 159, 159) + .addComponent(lblControleClientes))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(lblNomeCliente) + .addGap(18, 18, 18) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(lblCodigoCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(btnNovoCliente) + .addGap(83, 83, 83) + .addComponent(btnSalvarCliente) + .addGap(103, 103, 103) + .addComponent(btnExluirCliente))))) + .addContainerGap(77, Short.MAX_VALUE)) + .addComponent(jScrollPane3) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(lblControleClientes) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblNomeCliente) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(51, 51, 51) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblCPFCliente) + .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(40, 40, 40) + .addComponent(btnBuscarCliente))) + .addGap(42, 42, 42) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblCodigoCliente) + .addComponent(txtCodCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnNovoCliente) + .addComponent(btnSalvarCliente) + .addComponent(btnExluirCliente)) + .addGap(80, 80, 80) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(182, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 210, 550, 700)); lblDadosFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N lblDadosFuncionario.setText("meus dados"); @@ -154,10 +338,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(267, 267, 267) - .addComponent(lblAreaFuncionario) - .addGap(0, 0, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -170,7 +350,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(lblEmailFuncionario) .addComponent(lblSenhaFuncionario) .addComponent(lblCodFuncionario)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -184,19 +364,25 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(btnAlterarFuncionario) - .addGap(168, 168, 168) - .addComponent(btnSalvarFuncionario) - .addGap(129, 129, 129) - .addComponent(btnCancelarFuncionario) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(btnAlterarFuncionario) + .addGap(133, 133, 133) + .addComponent(btnSalvarFuncionario) + .addGap(101, 101, 101) + .addComponent(btnCancelarFuncionario)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(172, 172, 172) + .addComponent(lblAreaFuncionario))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(8, 8, 8) .addComponent(lblAreaFuncionario) - .addGap(26, 26, 26) + .addGap(18, 18, 18) .addComponent(lblDadosFuncionario) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblNomeFuncionario) @@ -222,24 +408,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(btnAlterarFuncionario) .addComponent(btnSalvarFuncionario) .addComponent(btnCancelarFuncionario)) - .addContainerGap(44, Short.MAX_VALUE)) + .addContainerGap(96, Short.MAX_VALUE)) ); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap(45, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - ); + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 180, 520, 370)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/ÁreaFuncionário.png"))); // NOI18N + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); pack(); }// </editor-fold>//GEN-END:initComponents @@ -258,7 +433,7 @@ private void btnCancelarFuncionarioActionPerformed(java.awt.event.ActionEvent ev btnAlterarFuncionario.setEnabled(true); btnSalvarFuncionario.setEnabled(false); btnCancelarFuncionario.setEnabled(false); - + loadFuncionarioFields(); }//GEN-LAST:event_btnCancelarFuncionarioActionPerformed @@ -270,6 +445,30 @@ private void btnSalvarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) btnCancelarFuncionario.setEnabled(false); }//GEN-LAST:event_btnSalvarFuncionarioActionPerformed + private void btnNovoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoClienteActionPerformed + // TODO add your handling code here: + new cadastrarCliente().setVisible(true); + btnExluirCliente.setEnabled(false); + btnSalvarCliente.setEnabled(true); + }//GEN-LAST:event_btnNovoClienteActionPerformed + + private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed + // TODO add your handling code here: + carregarTabelaCliente(); + }//GEN-LAST:event_btnSalvarClienteActionPerformed + + private void btnExluirClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExluirClienteActionPerformed + // TODO add your handling code here: + + int i = tblControleClientes.getSelectedRow(); + + if(i>=0 && i<listaClientes.size()){ + listaClientes.remove(i); + + } + carregarTabelaCliente(); + }//GEN-LAST:event_btnExluirClienteActionPerformed + /** * @param args the command line arguments */ @@ -307,19 +506,34 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnAlterarFuncionario; + private javax.swing.JButton btnBuscarCliente; private javax.swing.JButton btnCancelarFuncionario; + private javax.swing.JButton btnExluirCliente; + private javax.swing.JButton btnNovoCliente; + private javax.swing.JButton btnSalvarCliente; private javax.swing.JButton btnSalvarFuncionario; + private javax.swing.JFormattedTextField jFormattedTextField1; + private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel3; + private javax.swing.JScrollPane jScrollPane3; private javax.swing.JLabel lblAreaFuncionario; + private javax.swing.JLabel lblCPFCliente; private javax.swing.JLabel lblCPFFuncionario; private javax.swing.JLabel lblCodFuncionario; + private javax.swing.JLabel lblCodigoCliente; + private javax.swing.JLabel lblControleClientes; private javax.swing.JLabel lblDadosFuncionario; private javax.swing.JLabel lblEmailFuncionario; + private javax.swing.JLabel lblNomeCliente; private javax.swing.JLabel lblNomeFuncionario; private javax.swing.JLabel lblSenhaFuncionario; + private javax.swing.JTable tblControleClientes; private javax.swing.JTextField txtCPFFuncionario; + private javax.swing.JTextField txtCodCliente; private javax.swing.JTextField txtCodigoFuncionario; private javax.swing.JTextField txtEmailFuncionario; + private javax.swing.JTextField txtNomeCliente; private javax.swing.JTextField txtNomeFuncionario; private javax.swing.JTextField txtSenhaFuncionario; // End of variables declaration//GEN-END:variables diff --git a/src/telas/areaGerente.form b/src/telas/areaGerente.form index 5d716f0..9c95351 100644 --- a/src/telas/areaGerente.form +++ b/src/telas/areaGerente.form @@ -70,7 +70,7 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="90" y="280" width="530" height="670"/> + <AbsoluteConstraints x="40" y="210" width="530" height="700"/> </Constraint> </Constraints> @@ -149,7 +149,11 @@ <Component id="ftxCPFGerente" min="-2" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> <Component id="lblEmailGerente" min="-2" max="-2" attributes="0"/> +<<<<<<< Updated upstream <EmptySpace max="32767" attributes="0"/> +======= + <EmptySpace pref="41" max="32767" attributes="0"/> +>>>>>>> Stashed changes <Component id="txtEmailGerente" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> <Component id="lblSenhaGerente" min="-2" max="-2" attributes="0"/> @@ -314,7 +318,11 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="910" y="220" width="870" height="430"/> +======= + <AbsoluteConstraints x="900" y="40" width="870" height="380"/> +>>>>>>> Stashed changes </Constraint> </Constraints> @@ -550,7 +558,11 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> +<<<<<<< Updated upstream <AbsoluteConstraints x="850" y="670" width="940" height="390"/> +======= + <AbsoluteConstraints x="830" y="530" width="940" height="390"/> +>>>>>>> Stashed changes </Constraint> </Constraints> @@ -666,6 +678,9 @@ <Properties> <Property name="text" type="java.lang.String" value="Novo"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNovoClienteActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="jButton3"> <Properties> @@ -676,13 +691,16 @@ <Properties> <Property name="text" type="java.lang.String" value="Excluir"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExluirClienteActionPerformed"/> + </Events> </Component> </SubComponents> </Container> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/ÁreaGerente.png"/> + <Image iconType="3" name="/imagens/Telas/ÁreaGerente.png"/> </Property> </Properties> <Constraints> diff --git a/src/telas/areaGerente.java b/src/telas/areaGerente.java index 7877159..6a4e66a 100644 --- a/src/telas/areaGerente.java +++ b/src/telas/areaGerente.java @@ -27,7 +27,8 @@ public areaGerente() { btnCancelarGerente.setEnabled(false); btnSalvarGerente.setEnabled(false); btnAlterarGerente.setEnabled(true); - + btnBuscarFuncionario.setEnabled(true); + btnNovoFuncionario.setEnabled(true); //btnPesquisarFuncionario.setEnabled(true); loadGerenteInfo(); @@ -253,7 +254,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(ftxCPFGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(lblEmailGerente) +<<<<<<< Updated upstream .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) +======= + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE) +>>>>>>> Stashed changes .addComponent(txtEmailGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(9, 9, 9) .addComponent(lblSenhaGerente) @@ -271,7 +276,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGap(102, 102, 102)) ); - getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 280, 530, 670)); + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 210, 530, 700)); jPanel2.setBackground(new java.awt.Color(211, 181, 143)); @@ -415,7 +420,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addContainerGap()) ); +<<<<<<< Updated upstream getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(910, 220, 870, 430)); +======= + getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(900, 40, 870, 380)); +>>>>>>> Stashed changes jPanel3.setBackground(new java.awt.Color(211, 181, 143)); @@ -434,11 +443,65 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N jButton1.setText("Buscar"); +<<<<<<< Updated upstream jButton2.setText("Novo"); +======= + btnNovoCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + btnNovoCliente.setText("Novo"); + btnNovoCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoClienteActionPerformed(evt); + } + }); +>>>>>>> Stashed changes jButton3.setText("Salvar"); +<<<<<<< Updated upstream jButton4.setText("Excluir"); +======= + btnExluirCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + btnExluirCliente.setText("Excluir"); + btnExluirCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExluirClienteActionPerformed(evt); + } + }); + + tblControleClientes.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null, null}, + {null, null, null, null, null}, + {null, null, null, null, null}, + {null, null, null, null, null} + }, + new String [] { + "Código Cliente", "Nome", "CPF", "Data Nascimento", "Endereço" + } + ) { + Class[] types = new Class [] { + java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + }); + jScrollPane3.setViewportView(tblControleClientes); + if (tblControleClientes.getColumnModel().getColumnCount() > 0) { + tblControleClientes.getColumnModel().getColumn(0).setPreferredWidth(3); + tblControleClientes.getColumnModel().getColumn(1).setPreferredWidth(50); + tblControleClientes.getColumnModel().getColumn(2).setPreferredWidth(14); + tblControleClientes.getColumnModel().getColumn(3).setPreferredWidth(10); + tblControleClientes.getColumnModel().getColumn(4).setPreferredWidth(100); + } + + try { + jFormattedTextField1.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } +>>>>>>> Stashed changes javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); @@ -494,10 +557,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGap(0, 293, Short.MAX_VALUE)) ); +<<<<<<< Updated upstream getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(850, 670, 940, 390)); jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/ÁreaGerente.png"))); // NOI18N getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -30, 1920, 1140)); +======= + getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 530, 940, 390)); + + lblBackground.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/ÁreaGerente.png"))); // NOI18N + getContentPane().add(lblBackground, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -30, 1920, 1140)); +>>>>>>> Stashed changes pack(); }// </editor-fold>//GEN-END:initComponents @@ -551,6 +621,33 @@ private void txtCodigoFuncionarioActionPerformed(java.awt.event.ActionEvent evt) // TODO add your handling code here: }//GEN-LAST:event_txtCodigoFuncionarioActionPerformed +<<<<<<< Updated upstream +======= + private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed + // TODO add your handling code here: + carregarTabelaCliente(); + }//GEN-LAST:event_btnSalvarClienteActionPerformed + + private void btnExluirClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExluirClienteActionPerformed + // TODO add your handling code here: + + int i = tblControleClientes.getSelectedRow(); + + if(i>=0 && i<listaClientes.size()){ + listaClientes.remove(i); + + } + carregarTabelaCliente(); + }//GEN-LAST:event_btnExluirClienteActionPerformed + + private void btnNovoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoClienteActionPerformed + // TODO add your handling code here: + new cadastrarCliente().setVisible(true); + btnExluirCliente.setEnabled(false); + btnSalvarCliente.setEnabled(true); + }//GEN-LAST:event_btnNovoClienteActionPerformed + +>>>>>>> Stashed changes /** * @param args the command line arguments */ diff --git a/src/telas/carrinhosAntigos.form b/src/telas/carrinhosAntigos.form index 4658861..2ce7216 100644 --- a/src/telas/carrinhosAntigos.form +++ b/src/telas/carrinhosAntigos.form @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" ?> -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Consultar carrinhos anteriores"/> @@ -44,61 +44,56 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="216" max="-2" attributes="0"/> - <Component id="btnPesquisarCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="239" max="-2" attributes="0"/> - <Component id="btnCancelarCarrinho" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="366" max="-2" attributes="0"/> - <Component id="lblCarrinhosAnteriores" min="-2" max="-2" attributes="0"/> - </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="jScrollPane1" alignment="0" min="-2" pref="885" max="-2" attributes="0"/> - <Group type="103" alignment="0" groupAlignment="1" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="271" max="-2" attributes="0"/> - <Component id="lblData" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtData" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="163" max="-2" attributes="0"/> - <Component id="lblCodPedido" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtCodPedido" min="-2" pref="135" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="91" max="-2" attributes="0"/> + <Component id="lblNumCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtNumCarrinho" min="-2" pref="77" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblTotal" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtTotal" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="333" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="366" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Component id="lblData" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtData" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="lblCarrinhosAnteriores" min="-2" max="-2" attributes="0"/> </Group> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <Component id="lblTotal" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtTotal" min="-2" pref="54" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="133" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" attributes="0"> - <Component id="lblNumCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="txtNumCarrinho" min="-2" pref="77" max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Component id="lblCodRastreio" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="txtCodRastreio" min="-2" pref="160" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace min="-2" pref="67" max="-2" attributes="0"/> - <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="216" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="btnBuscarCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="49" max="-2" attributes="0"/> + <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="419" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="btnPesquisarCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="239" max="-2" attributes="0"/> + <Component id="btnCancelarCarrinho" min="-2" max="-2" attributes="0"/> </Group> - <Component id="jScrollPane2" min="-2" pref="419" max="-2" attributes="0"/> </Group> </Group> </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> </Group> <EmptySpace pref="180" max="32767" attributes="0"/> @@ -116,28 +111,18 @@ <Component id="txtNumCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblData" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtData" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblCodPedido" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCodPedido" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblTotal" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTotal" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace type="unrelated" pref="27" max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="103" alignment="1" groupAlignment="0" attributes="0"> - <Component id="lblProdutos" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jScrollPane2" alignment="0" min="-2" pref="63" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="txtCodRastreio" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblCodRastreio" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblTotal" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtTotal" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="lblProdutos" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnBuscarCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> </Group> + <Component id="jScrollPane2" alignment="0" min="-2" pref="63" max="-2" attributes="0"/> </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> <Component id="btnPesquisarCarrinho" min="-2" max="-2" attributes="0"/> <Component id="btnCancelarCarrinho" min="-2" max="-2" attributes="0"/> @@ -157,7 +142,7 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="javax.swing.JTable" name="tblCliente"> + <Component class="javax.swing.JTable" name="tblCarrinhosAntigos"> <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="4" rowCount="4"> @@ -202,16 +187,6 @@ <Property name="text" type="java.lang.String" value="Total"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="lblCodPedido"> - <Properties> - <Property name="text" type="java.lang.String" value="Cod.Pedido"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblCodRastreio"> - <Properties> - <Property name="text" type="java.lang.String" value="Cod.Rastreio"/> - </Properties> - </Component> <Component class="javax.swing.JTextField" name="txtNumCarrinho"> <Properties> <Property name="toolTipText" type="java.lang.String" value="número do carrinho"/> @@ -222,16 +197,6 @@ <Property name="toolTipText" type="java.lang.String" value="valor total"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtCodPedido"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="código do pedido"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtCodRastreio"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="código do rastreio"/> - </Properties> - </Component> <Component class="javax.swing.JFormattedTextField" name="txtData"> <Properties> <Property name="formatterFactory" type="javax.swing.JFormattedTextField$AbstractFormatterFactory" editor="org.netbeans.modules.form.editors.AbstractFormatterFactoryEditor" preCode="try {" postCode="} catch (java.text.ParseException ex) { ex.printStackTrace(); }"> @@ -267,6 +232,11 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarCarrinhoActionPerformed"/> </Events> </Component> + <Component class="javax.swing.JButton" name="btnBuscarCarrinho"> + <Properties> + <Property name="text" type="java.lang.String" value="Buscar"/> + </Properties> + </Component> <Container class="javax.swing.JScrollPane" name="jScrollPane2"> <AuxValues> <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> diff --git a/src/telas/carrinhosAntigos.java b/src/telas/carrinhosAntigos.java index 5e5d0c3..a38b1cd 100644 --- a/src/telas/carrinhosAntigos.java +++ b/src/telas/carrinhosAntigos.java @@ -4,6 +4,11 @@ */ package telas; +import classes.Carrinho; +import static classes.Pagamento.listaCarrinhosAntigos; +import javax.swing.table.DefaultTableModel; +import classes.Pagamento; + /** * * @author Yuri @@ -18,6 +23,7 @@ public carrinhosAntigos() { setLocationRelativeTo(null); disableCarrinhoFields(); btnCancelarCarrinho.setEnabled(false); + carregarTabelaCarrinhosAntigos(); } @@ -25,35 +31,55 @@ public void enableCarrinhoFields(){ txtNumCarrinho.setEnabled(true); txtData.setEnabled(true); txtProdutos.setEnabled(true); - txtCodPedido.setEnabled(true); - txtCodRastreio.setEnabled(true); txtTotal.setEnabled(true); lblNumCarrinho.setEnabled(true); lblData.setEnabled(true); lblProdutos.setEnabled(true); - lblCodPedido.setEnabled(true); - lblCodRastreio.setEnabled(true); lblTotal.setEnabled(true); } - public void disableCarrinhoFields(){ + public void disableCarrinhoFields(){ txtNumCarrinho.setEnabled(false); txtData.setEnabled(false); txtProdutos.setEnabled(false); - txtCodPedido.setEnabled(false); - txtCodRastreio.setEnabled(false); txtTotal.setEnabled(false); lblNumCarrinho.setEnabled(false); lblData.setEnabled(false); lblProdutos.setEnabled(false); - lblCodPedido.setEnabled(false); - lblCodRastreio.setEnabled(false); lblTotal.setEnabled(false); } + + private void carregarTabelaCarrinhosAntigos() { + DefaultTableModel modeloTabelaCarrinhosAntigos = new DefaultTableModel(new Object[] {"Num.Carrinho","Data do Pedido","Produtos","Total"},0); + + for(int i=0;i<listaCarrinhosAntigos.size();i++){ + Carrinho carrinhoSelecionado = listaCarrinhosAntigos.get(i); + + Object linha[]; + linha = new Object[]{carrinhoSelecionado.getNumCarrinho(), + carrinhoSelecionado.getData(), + carrinhoSelecionado.mostarProdutos(), + carrinhoSelecionado.getTotal()}; + + modeloTabelaCarrinhosAntigos.addRow(linha); + + } + //Tabela recebe modelo + tblCarrinhosAntigos.setModel(modeloTabelaCarrinhosAntigos); + + tblCarrinhosAntigos.getColumnModel().getColumn(0).setPreferredWidth(3); + tblCarrinhosAntigos.getColumnModel().getColumn(1).setPreferredWidth(14); + tblCarrinhosAntigos.getColumnModel().getColumn(2).setPreferredWidth(100); + tblCarrinhosAntigos.getColumnModel().getColumn(3).setPreferredWidth(5); + + + } + + /** * 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 @@ -65,28 +91,25 @@ private void initComponents() { jPanel2 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); - tblCliente = new javax.swing.JTable(); + tblCarrinhosAntigos = new javax.swing.JTable(); lblCarrinhosAnteriores = new javax.swing.JLabel(); lblNumCarrinho = new javax.swing.JLabel(); lblData = new javax.swing.JLabel(); lblProdutos = new javax.swing.JLabel(); lblTotal = new javax.swing.JLabel(); - lblCodPedido = new javax.swing.JLabel(); - lblCodRastreio = new javax.swing.JLabel(); txtNumCarrinho = new javax.swing.JTextField(); txtTotal = new javax.swing.JTextField(); - txtCodPedido = new javax.swing.JTextField(); - txtCodRastreio = new javax.swing.JTextField(); txtData = new javax.swing.JFormattedTextField(); btnPesquisarCarrinho = new javax.swing.JButton(); btnCancelarCarrinho = new javax.swing.JButton(); + btnBuscarCarrinho = new javax.swing.JButton(); jScrollPane2 = new javax.swing.JScrollPane(); txtProdutos = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Consultar carrinhos anteriores"); - tblCliente.setModel(new javax.swing.table.DefaultTableModel( + tblCarrinhosAntigos.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null}, {null, null, null, null}, @@ -105,7 +128,7 @@ public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); - jScrollPane1.setViewportView(tblCliente); + jScrollPane1.setViewportView(tblCarrinhosAntigos); lblCarrinhosAnteriores.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N lblCarrinhosAnteriores.setText("Consultar Carrinhos Antigos"); @@ -118,18 +141,10 @@ public Class getColumnClass(int columnIndex) { lblTotal.setText("Total"); - lblCodPedido.setText("Cod.Pedido"); - - lblCodRastreio.setText("Cod.Rastreio"); - txtNumCarrinho.setToolTipText("número do carrinho"); txtTotal.setToolTipText("valor total"); - txtCodPedido.setToolTipText("código do pedido"); - - txtCodRastreio.setToolTipText("código do rastreio"); - try { txtData.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####"))); } catch (java.text.ParseException ex) { @@ -156,6 +171,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + btnBuscarCarrinho.setText("Buscar"); + txtProdutos.setColumns(20); txtProdutos.setRows(5); jScrollPane2.setViewportView(txtProdutos); @@ -166,49 +183,45 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(216, 216, 216) - .addComponent(btnPesquisarCarrinho) - .addGap(239, 239, 239) - .addComponent(btnCancelarCarrinho)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGap(366, 366, 366) - .addComponent(lblCarrinhosAnteriores)) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(66, 66, 66) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 885, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup() - .addGap(271, 271, 271) - .addComponent(lblData) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(163, 163, 163) - .addComponent(lblCodPedido) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtCodPedido, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(lblTotal) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(133, 133, 133)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(lblNumCarrinho) - .addGap(18, 18, 18) - .addComponent(txtNumCarrinho, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(lblCodRastreio) - .addGap(18, 18, 18) - .addComponent(txtCodRastreio, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(67, 67, 67) - .addComponent(lblProdutos) - .addGap(18, 18, 18))) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 419, javax.swing.GroupLayout.PREFERRED_SIZE)))))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(91, 91, 91) + .addComponent(lblNumCarrinho) + .addGap(18, 18, 18) + .addComponent(txtNumCarrinho, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblTotal) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(333, 333, 333)))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(366, 366, 366) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(lblData) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblCarrinhosAnteriores))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(216, 216, 216) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(btnBuscarCarrinho) + .addGap(49, 49, 49) + .addComponent(lblProdutos) + .addGap(18, 18, 18) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 419, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(btnPesquisarCarrinho) + .addGap(239, 239, 239) + .addComponent(btnCancelarCarrinho))))) + .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap(180, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( @@ -222,21 +235,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(txtNumCarrinho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblData) .addComponent(txtData, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblCodPedido) - .addComponent(txtCodPedido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblTotal) + .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 27, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblProdutos) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtCodRastreio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblCodRastreio)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblTotal) - .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addComponent(btnBuscarCarrinho)) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(btnPesquisarCarrinho) @@ -312,21 +318,18 @@ public void run() { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnBuscarCarrinho; private javax.swing.JButton btnCancelarCarrinho; private javax.swing.JButton btnPesquisarCarrinho; private javax.swing.JPanel jPanel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JLabel lblCarrinhosAnteriores; - private javax.swing.JLabel lblCodPedido; - private javax.swing.JLabel lblCodRastreio; private javax.swing.JLabel lblData; private javax.swing.JLabel lblNumCarrinho; private javax.swing.JLabel lblProdutos; private javax.swing.JLabel lblTotal; - private javax.swing.JTable tblCliente; - private javax.swing.JTextField txtCodPedido; - private javax.swing.JTextField txtCodRastreio; + private javax.swing.JTable tblCarrinhosAntigos; private javax.swing.JFormattedTextField txtData; private javax.swing.JTextField txtNumCarrinho; private javax.swing.JTextArea txtProdutos; diff --git a/src/telas/telaLogin.form b/src/telas/telaLogin.form index aec091d..14b8576 100644 --- a/src/telas/telaLogin.form +++ b/src/telas/telaLogin.form @@ -19,99 +19,120 @@ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,3,-128,0,0,7,-128"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - </Group> - </DimensionLayout> + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> </Layout> <SubComponents> <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1320" y="190" width="600" height="550"/> + </Constraint> + </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="52" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="92" max="-2" attributes="0"/> + <Component id="lblLogin" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblSenha" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="52" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0"> - <Component id="lblSenha" min="-2" max="-2" attributes="0"/> - <Component id="txtSenha" min="-2" pref="325" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblCadastrarse" alignment="0" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <Component id="btnEntrar" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="19" max="-2" attributes="0"/> - </Group> + <Component id="lblEmail" alignment="0" min="-2" pref="184" max="-2" attributes="0"/> + <Component id="pswSenha" alignment="0" min="-2" pref="520" max="-2" attributes="0"/> + <Component id="txtEmail" alignment="0" min="-2" pref="520" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblCadastrarse" min="-2" pref="455" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="btnEntrar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="134" max="-2" attributes="0"/> + <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> </Group> </Group> </Group> - <Component id="txtEmail" min="-2" pref="325" max="-2" attributes="0"/> - <Component id="lblEmail" min="-2" max="-2" attributes="0"/> </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="179" max="-2" attributes="0"/> - <Component id="lblLogin" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="28" max="32767" attributes="0"/> </Group> </Group> - <EmptySpace pref="79" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> - <Component id="lblLogin" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLogin" min="-2" pref="79" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblEmail" min="-2" max="-2" attributes="0"/> + <Component id="lblEmail" min="-2" pref="58" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Component id="txtEmail" min="-2" pref="36" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblSenha" min="-2" pref="71" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="pswSenha" min="-2" pref="33" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="txtEmail" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblSenha" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="5" max="-2" attributes="0"/> - <Component id="txtSenha" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnEntrar" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnCancelar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblCadastrarse" min="-2" pref="45" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="btnCancelar" max="32767" attributes="0"/> + <Component id="btnEntrar" pref="69" max="32767" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblCadastrarse" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="38" max="32767" attributes="0"/> + <EmptySpace pref="77" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> + <Component class="javax.swing.JLabel" name="lblCadastrarse"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Não tem uma conta? Cadastrar-se como cliente."/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblCadastrarseMouseClicked"/> + </Events> + </Component> <Component class="javax.swing.JLabel" name="lblLogin"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Font name="Old London" size="72" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> </Property> <Property name="text" type="java.lang.String" value="Bem vindo"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblEmail"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="60" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> <Property name="text" type="java.lang.String" value="E-mail"/> <Property name="toolTipText" type="java.lang.String" value=""/> </Properties> @@ -123,21 +144,22 @@ </Component> <Component class="javax.swing.JLabel" name="lblSenha"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="60" style="0"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> <Property name="text" type="java.lang.String" value="Senha"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtSenha"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="Insira a senha"/> - </Properties> - </Component> <Component class="javax.swing.JButton" name="btnEntrar"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> <Color blue="0" green="cc" red="33" type="rgb"/> </Property> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="14" style="1"/> + <Font name="Old London" size="48" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Entrar"/> <Property name="toolTipText" type="java.lang.String" value="fazer login"/> @@ -152,7 +174,7 @@ <Color blue="0" green="0" red="ff" type="rgb"/> </Property> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="14" style="1"/> + <Font name="Old London" size="48" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Cancelar"/> </Properties> @@ -160,18 +182,21 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JLabel" name="lblCadastrarse"> - <Properties> - <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="66" green="66" red="ff" type="rgb"/> - </Property> - <Property name="text" type="java.lang.String" value="Não tem uma conta? Cadastrar-se como cliente."/> - </Properties> - <Events> - <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblCadastrarseMouseClicked"/> - </Events> + <Component class="javax.swing.JPasswordField" name="pswSenha"> </Component> </SubComponents> </Container> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/Telas/Login.png"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> + </Component> </SubComponents> </Form> diff --git a/src/telas/telaLogin.java b/src/telas/telaLogin.java index a96db05..f575958 100644 --- a/src/telas/telaLogin.java +++ b/src/telas/telaLogin.java @@ -30,6 +30,8 @@ public class telaLogin extends javax.swing.JFrame { public telaLogin() { initComponents(); setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); + } @@ -43,32 +45,48 @@ public telaLogin() { private void initComponents() { jPanel1 = new javax.swing.JPanel(); + lblCadastrarse = new javax.swing.JLabel(); lblLogin = new javax.swing.JLabel(); lblEmail = new javax.swing.JLabel(); txtEmail = new javax.swing.JTextField(); lblSenha = new javax.swing.JLabel(); - txtSenha = new javax.swing.JTextField(); btnEntrar = new javax.swing.JButton(); btnCancelar = new javax.swing.JButton(); - lblCadastrarse = new javax.swing.JLabel(); + pswSenha = new javax.swing.JPasswordField(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Tela de Login"); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanel1.setOpaque(false); + + lblCadastrarse.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + lblCadastrarse.setForeground(new java.awt.Color(255, 102, 102)); + lblCadastrarse.setText("Não tem uma conta? Cadastrar-se como cliente."); + lblCadastrarse.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + lblCadastrarseMouseClicked(evt); + } + }); - lblLogin.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + lblLogin.setFont(new java.awt.Font("Old London", 1, 72)); // NOI18N + lblLogin.setForeground(new java.awt.Color(255, 255, 255)); lblLogin.setText("Bem vindo"); + lblEmail.setFont(new java.awt.Font("Old London", 0, 60)); // NOI18N + lblEmail.setForeground(new java.awt.Color(255, 255, 255)); lblEmail.setText("E-mail"); lblEmail.setToolTipText(""); txtEmail.setToolTipText("Insira o email"); + lblSenha.setFont(new java.awt.Font("Old London", 0, 60)); // NOI18N + lblSenha.setForeground(new java.awt.Color(255, 255, 255)); lblSenha.setText("Senha"); - txtSenha.setToolTipText("Insira a senha"); - btnEntrar.setBackground(new java.awt.Color(51, 204, 0)); - btnEntrar.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnEntrar.setFont(new java.awt.Font("Old London", 1, 48)); // NOI18N btnEntrar.setText("Entrar"); btnEntrar.setToolTipText("fazer login"); btnEntrar.addActionListener(new java.awt.event.ActionListener() { @@ -78,7 +96,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); btnCancelar.setBackground(new java.awt.Color(255, 0, 0)); - btnCancelar.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnCancelar.setFont(new java.awt.Font("Old London", 1, 48)); // NOI18N btnCancelar.setText("Cancelar"); btnCancelar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -86,76 +104,61 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - lblCadastrarse.setForeground(new java.awt.Color(255, 102, 102)); - lblCadastrarse.setText("Não tem uma conta? Cadastrar-se como cliente."); - lblCadastrarse.addMouseListener(new java.awt.event.MouseAdapter() { - public void mouseClicked(java.awt.event.MouseEvent evt) { - lblCadastrarseMouseClicked(evt); - } - }); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(52, 52, 52) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGap(92, 92, 92) + .addComponent(lblLogin) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(52, 52, 52) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(lblSenha) - .addComponent(txtSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(21, 21, 21) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblCadastrarse) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(btnEntrar) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnCancelar) - .addGap(19, 19, 19))))) - .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 325, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblEmail))) + .addComponent(lblSenha, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(179, 179, 179) - .addComponent(lblLogin))) - .addContainerGap(79, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(pswSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 520, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 520, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(21, 21, 21) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblCadastrarse, javax.swing.GroupLayout.PREFERRED_SIZE, 455, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnEntrar) + .addGap(134, 134, 134) + .addComponent(btnCancelar))))) + .addGap(0, 28, Short.MAX_VALUE)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(37, 37, 37) - .addComponent(lblLogin) - .addGap(18, 18, 18) - .addComponent(lblEmail) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(lblSenha) - .addGap(5, 5, 5) - .addComponent(txtSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap() + .addComponent(lblLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnEntrar) - .addComponent(btnCancelar)) + .addComponent(lblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(22, 22, 22) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblCadastrarse) - .addContainerGap(38, Short.MAX_VALUE)) + .addComponent(lblSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(pswSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblCadastrarse, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(btnCancelar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnEntrar, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)) + .addContainerGap(77, Short.MAX_VALUE)) ); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - ); + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(1320, 190, 600, 550)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/Login.png"))); // NOI18N + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); pack(); }// </editor-fold>//GEN-END:initComponents @@ -174,7 +177,7 @@ private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR // TODO add your handling code here: String emailInput = txtEmail.getText(); - String senhaInput = txtSenha.getText(); + String senhaInput = new String(pswSenha.getPassword()); if(listaGerente.size()>0){ for(Gerente pessoa : listaGerente){ @@ -215,10 +218,14 @@ private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR Cliente.index_cliente=Integer.parseInt(item.getIdCliente());//PROBLEMA AQUI DE NOVO!! JOptionPane.showMessageDialog(null,"Entrou como cliente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); this.setVisible(false); +<<<<<<< Updated upstream new Menu().setVisible(true); JPanel panel = new JPanel(); panel.repaint(); panel.revalidate(); +======= + +>>>>>>> Stashed changes break; } @@ -267,12 +274,13 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancelar; private javax.swing.JButton btnEntrar; + private javax.swing.JLabel jLabel1; private javax.swing.JPanel jPanel1; private javax.swing.JLabel lblCadastrarse; private javax.swing.JLabel lblEmail; private javax.swing.JLabel lblLogin; private javax.swing.JLabel lblSenha; + private javax.swing.JPasswordField pswSenha; private javax.swing.JTextField txtEmail; - private javax.swing.JTextField txtSenha; // End of variables declaration//GEN-END:variables } diff --git a/src/telas/telaPagamento.form b/src/telas/telaPagamento.form index 59498b9..aa604af 100644 --- a/src/telas/telaPagamento.form +++ b/src/telas/telaPagamento.form @@ -1,8 +1,13 @@ <?xml version="1.0" encoding="UTF-8" ?> <Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <NonVisualComponents> + <Component class="javax.swing.ButtonGroup" name="buttonGroup1"> + </Component> + </NonVisualComponents> <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="tela de pagamento"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -25,46 +30,41 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblValorTotal" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblNumCarrinho" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblProduto" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="txtValorTotal" max="32767" attributes="0"/> + <Component id="txtNumCarrinho" max="32767" attributes="0"/> + <Component id="txtProdutos" min="-2" pref="136" max="-2" attributes="0"/> + </Group> + </Group> <Group type="102" attributes="0"> <EmptySpace min="-2" pref="167" max="-2" attributes="0"/> <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="btnPagar" min="-2" max="-2" attributes="0"/> - <Component id="lblFormaPagamento" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="rdbBoleto" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> - <Component id="rdbPix" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace min="-2" pref="71" max="-2" attributes="0"/> - <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> - </Group> - </Group> + <Component id="btnPagar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="64" max="-2" attributes="0"/> + <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblFormaPagamento" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="rdbBoleto" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Component id="rdbPix" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> </Group> - </Group> - <EmptySpace pref="50" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblValorTotal" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblNumCarrinho" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblProduto" alignment="0" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="txtValorTotal" pref="136" max="32767" attributes="0"/> - <Component id="txtNumCarrinho" max="32767" attributes="0"/> - <Component id="txtProdutos" max="32767" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -73,7 +73,7 @@ <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="txtValorTotal" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblValorTotal" alignment="3" min="-2" max="-2" attributes="0"/> @@ -88,18 +88,19 @@ <Component id="lblProduto" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtProdutos" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="lblFormaPagamento" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="rdbBoleto" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="rdbPix" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="61" max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnPagar" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnCancelar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="63" max="32767" attributes="0"/> + <EmptySpace pref="57" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -130,11 +131,18 @@ </Component> <Component class="javax.swing.JRadioButton" name="rdbBoleto"> <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="buttonGroup1"/> + </Property> + <Property name="selected" type="boolean" value="true"/> <Property name="text" type="java.lang.String" value="Boleto"/> </Properties> </Component> <Component class="javax.swing.JRadioButton" name="rdbPix"> <Properties> + <Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor"> + <ComponentRef name="buttonGroup1"/> + </Property> <Property name="text" type="java.lang.String" value="Pix"/> </Properties> </Component> @@ -157,6 +165,9 @@ <Properties> <Property name="toolTipText" type="java.lang.String" value="seus produtos"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtProdutosActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnPagar"> <Properties> @@ -165,6 +176,9 @@ </Property> <Property name="text" type="java.lang.String" value="Pagar"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPagarActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JButton" name="btnCancelar"> <Properties> @@ -177,5 +191,16 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarActionPerformed"/> </Events> </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="10" style="1"/> + </Property> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="cc" red="0" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Desconto de 5% pagando com Pix!"/> + </Properties> + </Component> </SubComponents> </Form> diff --git a/src/telas/telaPagamento.java b/src/telas/telaPagamento.java index e3115d0..3a768b6 100644 --- a/src/telas/telaPagamento.java +++ b/src/telas/telaPagamento.java @@ -4,6 +4,12 @@ */ package telas; +import classes.Carrinho; +import static classes.Carrinho.listaProdutos; +import static classes.Pagamento.indiceCarrinho; +import static classes.Pagamento.listaCarrinhos; +import static classes.Pagamento.listaCarrinhosAntigos; + /** * * @author Yuri @@ -16,9 +22,21 @@ public class telaPagamento extends javax.swing.JFrame { public telaPagamento() { initComponents(); setLocationRelativeTo(null); + + txtValorTotal.setText(String.valueOf(carrinhoSelecionado.getTotal())); + txtNumCarrinho.setText(String.valueOf(carrinhoSelecionado.getNumCarrinho())); + txtProdutos.setText(carrinhoSelecionado.mostarProdutos()); + + } + Carrinho carrinhoSelecionado = listaCarrinhos.get(indiceCarrinho); + public void resetCampos(){ + txtValorTotal.setText(""); + txtNumCarrinho.setText(""); + txtProdutos.setText(""); + } /** * 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 @@ -28,6 +46,7 @@ public telaPagamento() { // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + buttonGroup1 = new javax.swing.ButtonGroup(); lblPagamento = new javax.swing.JLabel(); lblValorTotal = new javax.swing.JLabel(); txtValorTotal = new javax.swing.JTextField(); @@ -40,8 +59,10 @@ private void initComponents() { txtProdutos = new javax.swing.JTextField(); btnPagar = new javax.swing.JButton(); btnCancelar = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("tela de pagamento"); lblPagamento.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N lblPagamento.setText("Pagamento"); @@ -52,8 +73,11 @@ private void initComponents() { lblFormaPagamento.setText("Forma de pagamento"); + buttonGroup1.add(rdbBoleto); + rdbBoleto.setSelected(true); rdbBoleto.setText("Boleto"); + buttonGroup1.add(rdbPix); rdbPix.setText("Pix"); lblNumCarrinho.setText("Número do carrinho"); @@ -63,9 +87,19 @@ private void initComponents() { lblProduto.setText("Produtos"); txtProdutos.setToolTipText("seus produtos"); + txtProdutos.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtProdutosActionPerformed(evt); + } + }); btnPagar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/3440914-bag-basket-cart-ecommerce-pay-shopping-store_107519.png"))); // NOI18N btnPagar.setText("Pagar"); + btnPagar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPagarActionPerformed(evt); + } + }); btnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/cancel_77947.png"))); // NOI18N btnCancelar.setText("Cancelar"); @@ -75,49 +109,51 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 10)); // NOI18N + jLabel1.setForeground(new java.awt.Color(0, 204, 0)); + jLabel1.setText("Desconto de 5% pagando com Pix!"); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblValorTotal) + .addComponent(lblNumCarrinho) + .addComponent(lblProduto)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtValorTotal) + .addComponent(txtNumCarrinho) + .addComponent(txtProdutos, javax.swing.GroupLayout.PREFERRED_SIZE, 136, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(layout.createSequentialGroup() .addGap(167, 167, 167) .addComponent(lblPagamento)) .addGroup(layout.createSequentialGroup() .addGap(53, 53, 53) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(btnPagar) - .addComponent(lblFormaPagamento)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(18, 18, 18) - .addComponent(rdbBoleto) - .addGap(33, 33, 33) - .addComponent(rdbPix)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(71, 71, 71) - .addComponent(btnCancelar))))) - .addContainerGap(50, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGap(72, 72, 72) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblValorTotal) - .addComponent(lblNumCarrinho) - .addComponent(lblProduto)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(txtValorTotal, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE) - .addComponent(txtNumCarrinho) - .addComponent(txtProdutos)) - .addGap(38, 38, 38)) + .addComponent(btnPagar) + .addGap(64, 64, 64) + .addComponent(btnCancelar)) + .addGroup(layout.createSequentialGroup() + .addComponent(lblFormaPagamento) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(rdbBoleto) + .addGap(33, 33, 33) + .addComponent(rdbPix) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel1))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(lblPagamento) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblValorTotal)) @@ -129,16 +165,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblProduto) .addComponent(txtProdutos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(21, 21, 21) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblFormaPagamento) .addComponent(rdbBoleto) - .addComponent(rdbPix)) - .addGap(34, 34, 34) + .addComponent(rdbPix) + .addComponent(jLabel1)) + .addGap(61, 61, 61) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnPagar) .addComponent(btnCancelar)) - .addContainerGap(63, Short.MAX_VALUE)) + .addContainerGap(57, Short.MAX_VALUE)) ); pack(); @@ -149,6 +186,20 @@ private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F this.setVisible(false); }//GEN-LAST:event_btnCancelarActionPerformed + private void btnPagarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPagarActionPerformed + // TODO add your handling code here: + listaCarrinhosAntigos.add(carrinhoSelecionado); + listaCarrinhos.remove(indiceCarrinho); + listaProdutos.clear(); + resetCampos(); + + + }//GEN-LAST:event_btnPagarActionPerformed + + private void txtProdutosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtProdutosActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtProdutosActionPerformed + /** * @param args the command line arguments */ @@ -187,6 +238,8 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancelar; private javax.swing.JButton btnPagar; + private javax.swing.ButtonGroup buttonGroup1; + private javax.swing.JLabel jLabel1; private javax.swing.JLabel lblFormaPagamento; private javax.swing.JLabel lblNumCarrinho; private javax.swing.JLabel lblPagamento; diff --git a/src/telas/verCarrinho.form b/src/telas/verCarrinho.form index baaf9d5..ff486d0 100644 --- a/src/telas/verCarrinho.form +++ b/src/telas/verCarrinho.form @@ -21,181 +21,212 @@ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="120" y="190" width="810" height="510"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="810" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="244" pref="244" max="-2" attributes="0"/> + <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> + </Group> <Group type="102" attributes="0"> <Component id="lblProdutosCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace min="326" pref="326" max="-2" attributes="0"/> <Component id="jButton1" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" attributes="0"> <EmptySpace min="6" pref="6" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="6" pref="6" max="-2" attributes="0"/> - <Component id="btnRemoverItem" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="136" max="-2" attributes="0"/> - <Component id="btnEsvaziarCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="106" max="-2" attributes="0"/> - <Component id="btnConfirmarCompra" min="-2" max="-2" attributes="0"/> - </Group> - <Component id="jScrollPane1" min="-2" pref="762" max="-2" attributes="0"/> - </Group> + <Component id="jScrollPane1" min="-2" pref="762" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="12" pref="12" max="-2" attributes="0"/> + <Component id="btnRemoverItem" min="-2" max="-2" attributes="0"/> + <EmptySpace min="136" pref="136" max="-2" attributes="0"/> + <Component id="btnEsvaziarCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace min="106" pref="106" max="-2" attributes="0"/> + <Component id="btnConfirmarCompra" min="-2" max="-2" attributes="0"/> </Group> </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="250" max="-2" attributes="0"/> - <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> </Group> - <EmptySpace pref="48" max="32767" attributes="0"/> </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblProdutosCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="jScrollPane1" min="-2" pref="270" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnRemoverItem" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnEsvaziarCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnConfirmarCompra" alignment="3" min="-2" max="-2" attributes="0"/> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="510" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="3" pref="3" max="-2" attributes="0"/> + <Component id="lblProdutosCarrinho" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="12" pref="12" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="270" max="-2" attributes="0"/> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnRemoverItem" min="-2" max="-2" attributes="0"/> + <Component id="btnEsvaziarCarrinho" min="-2" max="-2" attributes="0"/> + <Component id="btnConfirmarCompra" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> </Group> - <EmptySpace pref="63" max="32767" attributes="0"/> </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Container class="javax.swing.JScrollPane" name="jScrollPane1"> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + </DimensionLayout> + </Layout> <SubComponents> - <Component class="javax.swing.JTable" name="tblProdutos"> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jScrollPane1MouseClicked"/> + </Events> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="tblProdutos"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="5" rowCount="4"> + <Column editable="true" title="Título" type="java.lang.String"/> + <Column editable="true" title="Preço" type="java.lang.Double"/> + <Column editable="true" title="Quantidade" type="java.lang.Integer"/> + <Column editable="true" title="Cód. Produto" type="java.lang.Integer"/> + <Column editable="true" title="Descrição" type="java.lang.String"/> + </Table> + </Property> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnRemoverItem"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="99" red="99" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Remover item"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnEsvaziarCarrinho"> <Properties> - <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> - <Table columnCount="5" rowCount="4"> - <Column editable="true" title="Título" type="java.lang.String"/> - <Column editable="true" title="Preço" type="java.lang.Double"/> - <Column editable="true" title="Quantidade" type="java.lang.Integer"/> - <Column editable="true" title="Cód. Produto" type="java.lang.String"/> - <Column editable="true" title="Descrição" type="java.lang.String"/> - </Table> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="ff" type="rgb"/> </Property> - <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> - <TableColumnModel selectionModel="0"> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - </TableColumnModel> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> </Property> - <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> - <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + <Property name="text" type="java.lang.String" value="Esvaziar carrinho"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblProdutosCarrinho"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> </Property> + <Property name="text" type="java.lang.String" value="Meus produtos no carrinho"/> </Properties> </Component> + <Component class="javax.swing.JButton" name="btnConfirmarCompra"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="0" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Confirmar compra"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Visualizar Carrinho Atual"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Ver carrinhos antigos"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> </SubComponents> </Container> - <Component class="javax.swing.JButton" name="btnRemoverItem"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="99" green="99" red="99" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Remover item"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnEsvaziarCarrinho"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Esvaziar carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblProdutosCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Meus produtos no carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnConfirmarCompra"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="ff" red="0" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Confirmar compra"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="24" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Visualizar Carrinho Atual"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton1"> + <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/Telas/VerCarrinho.png"/> </Property> - <Property name="text" type="java.lang.String" value="Ver carrinhos antigos"/> </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> - </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> </Component> </SubComponents> </Form> diff --git a/src/telas/verCarrinho.java b/src/telas/verCarrinho.java index d80c428..57cdf5d 100644 --- a/src/telas/verCarrinho.java +++ b/src/telas/verCarrinho.java @@ -4,6 +4,19 @@ */ package telas; +<<<<<<< Updated upstream +======= +import classes.Carrinho; +import static classes.Carrinho.listaCarrinho; +import static classes.Carrinho.listaProdutos; +import static classes.Estoque.estoque; +import static classes.Pagamento.listaCarrinhos; +import static classes.Pagamento.indiceCarrinho; +import classes.Produto; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +>>>>>>> Stashed changes /** * * @author Yuri @@ -16,6 +29,12 @@ public class verCarrinho extends javax.swing.JFrame { public verCarrinho() { initComponents(); setLocationRelativeTo(null); +<<<<<<< Updated upstream +======= + carregarTabelaProdutos(); + this.setExtendedState(MAXIMIZED_BOTH); + +>>>>>>> Stashed changes } @@ -28,6 +47,7 @@ public verCarrinho() { // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tblProdutos = new javax.swing.JTable(); btnRemoverItem = new javax.swing.JButton(); @@ -36,9 +56,17 @@ private void initComponents() { btnConfirmarCompra = new javax.swing.JButton(); lblVisualizarCarrinho = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Visualizar meu carrinho"); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jScrollPane1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jScrollPane1MouseClicked(evt); + } + }); tblProdutos.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -52,7 +80,7 @@ private void initComponents() { } ) { Class[] types = new Class [] { - java.lang.String.class, java.lang.Double.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class + java.lang.String.class, java.lang.Double.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { @@ -92,60 +120,81 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(lblProdutosCarrinho) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton1)) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addComponent(btnRemoverItem) - .addGap(136, 136, 136) - .addComponent(btnEsvaziarCarrinho) - .addGap(106, 106, 106) - .addComponent(btnConfirmarCompra)) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 762, javax.swing.GroupLayout.PREFERRED_SIZE))))) - .addGroup(layout.createSequentialGroup() - .addGap(250, 250, 250) - .addComponent(lblVisualizarCarrinho))) - .addContainerGap(48, Short.MAX_VALUE)) + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 810, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(244, 244, 244) + .addComponent(lblVisualizarCarrinho)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblProdutosCarrinho) + .addGap(326, 326, 326) + .addComponent(jButton1)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 762, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(btnRemoverItem) + .addGap(136, 136, 136) + .addComponent(btnEsvaziarCarrinho) + .addGap(106, 106, 106) + .addComponent(btnConfirmarCompra))) + .addGap(0, 0, Short.MAX_VALUE))) ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(lblVisualizarCarrinho) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblProdutosCarrinho) - .addComponent(jButton1)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnRemoverItem) - .addComponent(btnEsvaziarCarrinho) - .addComponent(btnConfirmarCompra)) - .addContainerGap(63, Short.MAX_VALUE)) + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 510, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(lblVisualizarCarrinho) + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(3, 3, 3) + .addComponent(lblProdutosCarrinho)) + .addComponent(jButton1)) + .addGap(12, 12, 12) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnRemoverItem) + .addComponent(btnEsvaziarCarrinho) + .addComponent(btnConfirmarCompra)) + .addGap(0, 0, Short.MAX_VALUE))) ); + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 190, 810, 510)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/VerCarrinho.png"))); // NOI18N + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); + pack(); }// </editor-fold>//GEN-END:initComponents private void btnConfirmarCompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarCompraActionPerformed // TODO add your handling code here: + if(listaProdutos.size()>0){ + double contador_total = 0; + for(Produto itemListado : listaProdutos){ + contador_total += (itemListado.getPreço()*itemListado.getQuantidadeComprada()); + } + Carrinho carrinho1 = new Carrinho(1,"27/08/2024",contador_total,listaProdutos); + listaCarrinhos.add(carrinho1); + indiceCarrinho = 0; + new telaPagamento().setVisible(true); + } + else{ + JOptionPane.showMessageDialog(null, "O carrinho não pode estar vazio!", "Erro ao levar para pagamento", JOptionPane.ERROR_MESSAGE); + } }//GEN-LAST:event_btnConfirmarCompraActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed @@ -153,6 +202,11 @@ private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS new carrinhosAntigos().setVisible(true); }//GEN-LAST:event_jButton1ActionPerformed + private void jScrollPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jScrollPane1MouseClicked + // TODO add your handling code here: + + }//GEN-LAST:event_jScrollPane1MouseClicked + /** * @param args the command line arguments */ @@ -193,6 +247,8 @@ public void run() { private javax.swing.JButton btnEsvaziarCarrinho; private javax.swing.JButton btnRemoverItem; private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lblProdutosCarrinho; private javax.swing.JLabel lblVisualizarCarrinho; diff --git a/src/telas/verProdutos.java b/src/telas/verProdutos.java index 7d8494e..a46a454 100644 --- a/src/telas/verProdutos.java +++ b/src/telas/verProdutos.java @@ -8,6 +8,7 @@ * * @author v */ + public class verProdutos extends javax.swing.JFrame { /** @@ -15,6 +16,13 @@ public class verProdutos extends javax.swing.JFrame { */ public verProdutos() { initComponents(); +<<<<<<< Updated upstream +======= + carregarTabelaProdutos(); + txtQuantidade.setText("1"); + Produto item; + Carrinho carrinho1 = new Carrinho(1,"27/08/2024"); +>>>>>>> Stashed changes } /** @@ -185,11 +193,67 @@ private void btnSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS private void btnComprarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnComprarActionPerformed // TODO add your handling code here: +<<<<<<< Updated upstream }//GEN-LAST:event_btnComprarActionPerformed /** * @param args the command line arguments */ +======= + int i = tabela_produtos.getSelectedRow(); + String selected=""; + System.out.println(i); + if(i>=0 && i<estoque.size()){ + Produto item = estoque.get(i); + selected = item.getTitulo(); + System.out.println(item.getTitulo()); + txtTitulo.setText(item.getTitulo()); + } + System.out.println("Item selecionado para compra foi: "+selected); + System.out.println("Carrinho Criado!"); + Produto itemComprado; + for(Produto itemBusca : estoque){ + JOptionPane.showMessageDialog(null,"Busca Iniciada!", "Notificação Adicionar item ao carrinho",JOptionPane.PLAIN_MESSAGE); + System.out.println("Busca inciada!"); + + if(itemBusca.getTitulo().equals(selected)){ + JOptionPane.showMessageDialog(null,"Item Encontrado!", "Notificação Adicionar item ao carrinho",JOptionPane.PLAIN_MESSAGE); + itemComprado = itemBusca; + if(Integer.parseInt(txtQuantidade.getText())<itemComprado.getQuantidadeEstoque()){ + listaProdutos.add(itemComprado); + itemComprado.setQuantidadeComprada(Integer.parseInt(txtQuantidade.getText())); + itemBusca.setQuantidadeEstoque(itemBusca.getQuantidadeEstoque()-itemComprado.getQuantidadeComprada()); + JOptionPane.showMessageDialog(null,"Item adicionado ao carrinho com sucesso!", "Notificação Adicionar item ao carrinho",JOptionPane.PLAIN_MESSAGE); + + } + } + } + + + }//GEN-LAST:event_btnComprarActionPerformed + + private void TabelaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_TabelaFocusGained + + }//GEN-LAST:event_TabelaFocusGained + + private void txtQuantidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtQuantidadeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtQuantidadeActionPerformed + + private void tabela_produtosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabela_produtosMouseClicked + // TODO add your handling code here: + int i = tabela_produtos.getSelectedRow(); + + System.out.println(i); + if(i>=0 && i<=estoque.size()){ + Produto item = estoque.get(i); + System.out.println(item.getTitulo()); + txtTitulo.setText(item.getTitulo()); + } + + }//GEN-LAST:event_tabela_produtosMouseClicked + +>>>>>>> Stashed changes public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">