diff --git a/build/classes/classes/Carrinho.class b/build/classes/classes/Carrinho.class index 6b5f815..11c513f 100644 Binary files a/build/classes/classes/Carrinho.class and b/build/classes/classes/Carrinho.class differ diff --git a/build/classes/classes/Cliente.class b/build/classes/classes/Cliente.class index 8af4a9f..fe74c0c 100644 Binary files a/build/classes/classes/Cliente.class and b/build/classes/classes/Cliente.class differ diff --git a/build/classes/classes/Estoque.class b/build/classes/classes/Estoque.class index 69b49d0..a5b3a0c 100644 Binary files a/build/classes/classes/Estoque.class and b/build/classes/classes/Estoque.class differ diff --git a/build/classes/classes/Funcionario.class b/build/classes/classes/Funcionario.class index 8ae03ed..70384fb 100644 Binary files a/build/classes/classes/Funcionario.class and b/build/classes/classes/Funcionario.class differ diff --git a/build/classes/classes/Gerente.class b/build/classes/classes/Gerente.class index 5f47da3..6472a3e 100644 Binary files a/build/classes/classes/Gerente.class and b/build/classes/classes/Gerente.class differ diff --git a/build/classes/classes/Usuario.class b/build/classes/classes/Usuario.class index 5917616..040360b 100644 Binary files a/build/classes/classes/Usuario.class and b/build/classes/classes/Usuario.class differ diff --git a/build/classes/telas/Menu$1.class b/build/classes/telas/Menu$1.class index a99b2af..d5492b1 100644 Binary files a/build/classes/telas/Menu$1.class and b/build/classes/telas/Menu$1.class differ diff --git a/build/classes/telas/Menu$2.class b/build/classes/telas/Menu$2.class index 40211f7..d819c80 100644 Binary files a/build/classes/telas/Menu$2.class and b/build/classes/telas/Menu$2.class differ diff --git a/build/classes/telas/Menu$3.class b/build/classes/telas/Menu$3.class index d249d2a..ef626dd 100644 Binary files a/build/classes/telas/Menu$3.class and b/build/classes/telas/Menu$3.class differ diff --git a/build/classes/telas/Menu$4.class b/build/classes/telas/Menu$4.class index 1585875..392c1e2 100644 Binary files a/build/classes/telas/Menu$4.class and b/build/classes/telas/Menu$4.class differ diff --git a/build/classes/telas/Menu$5.class b/build/classes/telas/Menu$5.class index ae19d05..f2f9cbe 100644 Binary files a/build/classes/telas/Menu$5.class and b/build/classes/telas/Menu$5.class differ diff --git a/build/classes/telas/Menu$6.class b/build/classes/telas/Menu$6.class index 6c97234..2073cec 100644 Binary files a/build/classes/telas/Menu$6.class and b/build/classes/telas/Menu$6.class differ diff --git a/build/classes/telas/Menu$7.class b/build/classes/telas/Menu$7.class index ae8e17d..889c7f5 100644 Binary files a/build/classes/telas/Menu$7.class and b/build/classes/telas/Menu$7.class differ diff --git a/build/classes/telas/Menu$8.class b/build/classes/telas/Menu$8.class index 837ffdc..5d44461 100644 Binary files a/build/classes/telas/Menu$8.class and b/build/classes/telas/Menu$8.class differ diff --git a/build/classes/telas/Menu.class b/build/classes/telas/Menu.class index c011cbb..9c0f7e3 100644 Binary files a/build/classes/telas/Menu.class and b/build/classes/telas/Menu.class differ diff --git a/build/classes/telas/Menu.form b/build/classes/telas/Menu.form index f8fee9f..183e4d2 100644 --- a/build/classes/telas/Menu.form +++ b/build/classes/telas/Menu.form @@ -17,7 +17,7 @@ - + @@ -39,10 +39,7 @@ - - - - + @@ -61,146 +58,136 @@ - - - - - - - - - - - - - - - - - + - + - + - + + - + - + + - + - + + - + - + - + + - + - + - + + - + - + - + + - + @@ -250,38 +237,41 @@ - + - - + + - - + + - + + + + - + - + - + - + @@ -289,7 +279,7 @@ - + diff --git a/build/classes/telas/areaCliente$1.class b/build/classes/telas/areaCliente$1.class index d2216fc..9cfdaad 100644 Binary files a/build/classes/telas/areaCliente$1.class and b/build/classes/telas/areaCliente$1.class differ diff --git a/build/classes/telas/areaCliente$2.class b/build/classes/telas/areaCliente$2.class index 104d535..7a5df10 100644 Binary files a/build/classes/telas/areaCliente$2.class and b/build/classes/telas/areaCliente$2.class differ diff --git a/build/classes/telas/areaCliente$3.class b/build/classes/telas/areaCliente$3.class index 10aab8a..15bd921 100644 Binary files a/build/classes/telas/areaCliente$3.class and b/build/classes/telas/areaCliente$3.class differ diff --git a/build/classes/telas/areaCliente$4.class b/build/classes/telas/areaCliente$4.class index 4cfb3fa..5491bef 100644 Binary files a/build/classes/telas/areaCliente$4.class and b/build/classes/telas/areaCliente$4.class differ diff --git a/build/classes/telas/areaCliente$5.class b/build/classes/telas/areaCliente$5.class index 4e8258e..89885f8 100644 Binary files a/build/classes/telas/areaCliente$5.class and b/build/classes/telas/areaCliente$5.class differ diff --git a/build/classes/telas/areaCliente.class b/build/classes/telas/areaCliente.class index cbd1202..0549f4e 100644 Binary files a/build/classes/telas/areaCliente.class and b/build/classes/telas/areaCliente.class differ diff --git a/build/classes/telas/areaCliente.form b/build/classes/telas/areaCliente.form index 87778c9..889c0ec 100644 --- a/build/classes/telas/areaCliente.form +++ b/build/classes/telas/areaCliente.form @@ -4,6 +4,9 @@ + + + @@ -19,216 +22,206 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -236,7 +229,7 @@ - + @@ -244,6 +237,11 @@ + + + + + @@ -251,7 +249,7 @@ - + @@ -259,6 +257,11 @@ + + + + + @@ -266,7 +269,7 @@ - + @@ -274,11 +277,24 @@ + + + + + + + + + + + + + @@ -286,7 +302,15 @@ + + + + + + + + @@ -294,7 +318,15 @@ + + + + + + + + @@ -302,19 +334,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - + + + + + diff --git a/build/classes/telas/areaFuncionario$1.class b/build/classes/telas/areaFuncionario$1.class index 388717d..536b0b6 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..2816bf9 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..6a77b52 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..d256b47 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..2fe3eab 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..7fc917a 100644 --- a/build/classes/telas/areaFuncionario.form +++ b/build/classes/telas/areaFuncionario.form @@ -4,6 +4,9 @@ + + + @@ -19,120 +22,157 @@ + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - + - - - - + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - + @@ -141,58 +181,88 @@ - + + + + + + + - + + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -202,7 +272,7 @@ - + @@ -217,7 +287,7 @@ - + @@ -232,7 +302,7 @@ - + @@ -244,12 +314,232 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + diff --git a/build/classes/telas/areaGerente$1.class b/build/classes/telas/areaGerente$1.class index 414c519..1f4c621 100644 Binary files a/build/classes/telas/areaGerente$1.class and b/build/classes/telas/areaGerente$1.class differ diff --git a/build/classes/telas/areaGerente$2.class b/build/classes/telas/areaGerente$2.class index 73046fb..091096e 100644 Binary files a/build/classes/telas/areaGerente$2.class and b/build/classes/telas/areaGerente$2.class differ diff --git a/build/classes/telas/areaGerente$3.class b/build/classes/telas/areaGerente$3.class index a0501bf..829e23a 100644 Binary files a/build/classes/telas/areaGerente$3.class and b/build/classes/telas/areaGerente$3.class differ diff --git a/build/classes/telas/areaGerente$4.class b/build/classes/telas/areaGerente$4.class index d492855..8c5f056 100644 Binary files a/build/classes/telas/areaGerente$4.class and b/build/classes/telas/areaGerente$4.class differ diff --git a/build/classes/telas/areaGerente$5.class b/build/classes/telas/areaGerente$5.class index e6f1205..9e1b7d7 100644 Binary files a/build/classes/telas/areaGerente$5.class and b/build/classes/telas/areaGerente$5.class differ diff --git a/build/classes/telas/areaGerente$6.class b/build/classes/telas/areaGerente$6.class index c6490c7..e2d8daa 100644 Binary files a/build/classes/telas/areaGerente$6.class and b/build/classes/telas/areaGerente$6.class differ diff --git a/build/classes/telas/areaGerente$7.class b/build/classes/telas/areaGerente$7.class index f2215da..4a7d459 100644 Binary files a/build/classes/telas/areaGerente$7.class and b/build/classes/telas/areaGerente$7.class differ diff --git a/build/classes/telas/areaGerente$8.class b/build/classes/telas/areaGerente$8.class index 5df3139..9c2509c 100644 Binary files a/build/classes/telas/areaGerente$8.class and b/build/classes/telas/areaGerente$8.class differ diff --git a/build/classes/telas/areaGerente$9.class b/build/classes/telas/areaGerente$9.class index e1b46ac..f0d76b5 100644 Binary files a/build/classes/telas/areaGerente$9.class and b/build/classes/telas/areaGerente$9.class differ diff --git a/build/classes/telas/areaGerente.class b/build/classes/telas/areaGerente.class index 0bb348b..ab8c4a7 100644 Binary files a/build/classes/telas/areaGerente.class and b/build/classes/telas/areaGerente.class differ diff --git a/build/classes/telas/areaGerente.form b/build/classes/telas/areaGerente.form index 5308d3c..4411f23 100644 --- a/build/classes/telas/areaGerente.form +++ b/build/classes/telas/areaGerente.form @@ -27,6 +27,9 @@ + + + @@ -49,6 +52,25 @@ + + + + + + + + + + + + + + + + + + + @@ -57,7 +79,7 @@ - + @@ -303,7 +325,7 @@ - + @@ -342,9 +364,9 @@ - + - + @@ -377,7 +399,7 @@ - + @@ -422,12 +444,12 @@ + + + - - - @@ -443,6 +465,9 @@ + + + @@ -460,9 +485,9 @@ - - - + + +
@@ -489,17 +514,20 @@
+ + +
+ + + - - - @@ -509,15 +537,18 @@ + + + - - - + + + @@ -537,7 +568,7 @@ - + @@ -556,7 +587,10 @@ - + + + + @@ -574,11 +608,11 @@ - + + - @@ -603,7 +637,7 @@ - + @@ -655,14 +689,23 @@ + + + + + + + + + @@ -674,11 +717,17 @@ + + + + + + @@ -688,11 +737,11 @@ - - - - - + + + + +
@@ -743,7 +792,7 @@ - + diff --git a/build/classes/telas/cadastrarCliente$1.class b/build/classes/telas/cadastrarCliente$1.class index f2864b3..9610680 100644 Binary files a/build/classes/telas/cadastrarCliente$1.class and b/build/classes/telas/cadastrarCliente$1.class differ diff --git a/build/classes/telas/cadastrarCliente$2.class b/build/classes/telas/cadastrarCliente$2.class index 8c186df..3acdae1 100644 Binary files a/build/classes/telas/cadastrarCliente$2.class and b/build/classes/telas/cadastrarCliente$2.class differ diff --git a/build/classes/telas/cadastrarCliente.class b/build/classes/telas/cadastrarCliente.class index 29b8f13..4dbdb51 100644 Binary files a/build/classes/telas/cadastrarCliente.class and b/build/classes/telas/cadastrarCliente.class differ diff --git a/build/classes/telas/cadastrarCliente.form b/build/classes/telas/cadastrarCliente.form index fe416fe..c1c254a 100644 --- a/build/classes/telas/cadastrarCliente.form +++ b/build/classes/telas/cadastrarCliente.form @@ -27,15 +27,20 @@ - + + - + - + + + + + @@ -46,76 +51,65 @@ + - + + + + + + + + + + - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + - - - - - - - - - - + + + - + @@ -147,13 +141,10 @@ - - - + - @@ -281,19 +272,6 @@ - - - - - - - - - - - - -
diff --git a/build/classes/telas/telaLogin$1.class b/build/classes/telas/telaLogin$1.class index 4d04b30..c4955cc 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.class b/build/classes/telas/telaLogin.class index d0531c7..54a1eab 100644 Binary files a/build/classes/telas/telaLogin.class and b/build/classes/telas/telaLogin.class differ diff --git a/build/classes/telas/telaLogin.form b/build/classes/telas/telaLogin.form index aec091d..f1abaac 100644 --- a/build/classes/telas/telaLogin.form +++ b/build/classes/telas/telaLogin.form @@ -4,6 +4,9 @@ + + + @@ -19,84 +22,75 @@ + - - - - - - - - - - - - - - + + + + + + + + + + - - + + + - - - - - - - - - - - - - - - - - - - - - + + + - - - + + + + + - + + + + + + + + + + + - - - - + + + - - - - + + + + - - + + - - - + + + @@ -105,13 +99,22 @@ - + + + + - + + + + + + + @@ -120,24 +123,28 @@ + + + + + + + + + - - - - - - + @@ -152,7 +159,7 @@ - + @@ -162,6 +169,9 @@ + + + @@ -171,7 +181,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/classes/telas/telaPagamento$1.class b/build/classes/telas/telaPagamento$1.class index 0341d92..89e93c2 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..c056304 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..0de69e1 100644 --- a/build/classes/telas/telaPagamento.form +++ b/build/classes/telas/telaPagamento.form @@ -1,8 +1,13 @@
+ + + + + @@ -36,20 +41,26 @@ - - - - - + + + + + + + + + + + - + - + - + @@ -94,12 +105,14 @@ - + + + - + @@ -130,13 +143,27 @@ + + + + + + + + + + + + + + @@ -165,6 +192,9 @@ + + + @@ -177,5 +207,13 @@ + + + + + + + + diff --git a/build/classes/telas/verCarrinho$1.class b/build/classes/telas/verCarrinho$1.class index 5d92b5f..0d61f20 100644 Binary files a/build/classes/telas/verCarrinho$1.class and b/build/classes/telas/verCarrinho$1.class differ diff --git a/build/classes/telas/verCarrinho$2.class b/build/classes/telas/verCarrinho$2.class index d3c5e4c..10e02b5 100644 Binary files a/build/classes/telas/verCarrinho$2.class and b/build/classes/telas/verCarrinho$2.class differ diff --git a/build/classes/telas/verCarrinho.class b/build/classes/telas/verCarrinho.class index dab223b..26d4d35 100644 Binary files a/build/classes/telas/verCarrinho.class and b/build/classes/telas/verCarrinho.class differ diff --git a/build/classes/telas/verCarrinho.form b/build/classes/telas/verCarrinho.form index baaf9d5..04a382e 100644 --- a/build/classes/telas/verCarrinho.form +++ b/build/classes/telas/verCarrinho.form @@ -4,6 +4,9 @@ + + + @@ -19,183 +22,622 @@ + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - + + + + + - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +
+
+ + + + + <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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblProdutosMouseClicked"/> + </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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="btnRemoverItemMouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRemoverItemActionPerformed"/> + </Events> + </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> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEsvaziarCarrinhoActionPerformed"/> + </Events> + </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="btnVerCarrinhosAntigos"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="80" green="ff" red="5b" 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="Ver carrinhos antigos"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnVerCarrinhosAntigosActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel4"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="27" green="53" red="63" 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="860" y="390" width="1000" height="520"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" 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"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="14" max="32767" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </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.JPanel" name="jPanel5"> <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> - <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 name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="54" green="b0" red="d1" type="rgb"/> </Property> </Properties> - </Component> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel6" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="19" 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="jPanel6" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="12" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel6"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="53" green="ae" red="d0" type="rgb"/> + </Property> + </Properties> + + <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 min="-2" pref="337" 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> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" 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"/> + <EmptySpace min="-2" pref="132" max="-2" attributes="0"/> + <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="42" max="-2" 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"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="419" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="384" max="-2" attributes="0"/> + <Component id="lblCarrinhosAnteriores" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="130" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <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="24" max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="885" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="169" 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="18" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblCarrinhosAnteriores" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" pref="44" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblNumCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> + <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"/> + </Group> + <Component id="lblProdutos" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" 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> + <EmptySpace min="0" pref="1" max="32767" attributes="0"/> + </Group> + <Component id="jScrollPane3" pref="0" max="32767" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="btnPesquisarCarrinho" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelarCarrinho" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="266" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane2"> + <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.JTable" name="tblCliente"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="4"> + <Column editable="false" title="NumCarrinho" type="java.lang.Integer"/> + <Column editable="false" title="Data do pedido" type="java.lang.String"/> + <Column editable="false" title="Produtos" type="java.lang.Object"/> + <Column editable="false" title="Total" type="java.lang.Double"/> + </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> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblClienteMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="lblCarrinhosAnteriores"> + <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="Consultar Carrinhos Antigos"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblNumCarrinho"> + <Properties> + <Property name="text" type="java.lang.String" value="NumCarrinho"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblData"> + <Properties> + <Property name="text" type="java.lang.String" value="Data"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblProdutos"> + <Properties> + <Property name="text" type="java.lang.String" value="Produtos"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblTotal"> + <Properties> + <Property name="text" type="java.lang.String" value="Total"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNumCarrinho"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="número do carrinho"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTotal"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="valor total"/> + </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(); }"> + <Format format="##/##/####" subtype="-1" type="5"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="data do pedido"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnPesquisarCarrinho"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/simbolos/searchmagnifierinterfacesymbol1_79893.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Pesquisar"/> + <Property name="toolTipText" type="java.lang.String" value="pesquisar por carrinho"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarCarrinhoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarCarrinho"> + <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="Cancelar"/> + <Property name="toolTipText" type="java.lang.String" value="cancelar operação"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarCarrinhoActionPerformed"/> + </Events> + </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="txtProdutos"> + <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="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Fechar janela"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> </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"> + <Component class="javax.swing.JButton" name="btnSair"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> + <Color blue="0" green="33" 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"/> + <Font name="Old London" size="36" style="0"/> </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"/> + <Property name="text" type="java.lang.String" value="Sair"/> </Properties> <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1540" y="50" width="-1" height="40"/> + </Constraint> + </Constraints> </Component> - <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> + <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="24" 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="Visualizar Carrinho Atual"/> + <Property name="toolTipText" type="java.lang.String" value=""/> </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> - <Component class="javax.swing.JButton" name="jButton1"> + <Container class="javax.swing.JPanel" name="jPanel3"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="27" green="53" red="63" type="rgb"/> </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> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="50" y="150" width="840" height="490"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="840" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="490" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + </Container> </SubComponents> </Form> diff --git a/build/classes/telas/verProdutos$1.class b/build/classes/telas/verProdutos$1.class index ff32a16..91b3725 100644 Binary files a/build/classes/telas/verProdutos$1.class and b/build/classes/telas/verProdutos$1.class differ diff --git a/build/classes/telas/verProdutos$2.class b/build/classes/telas/verProdutos$2.class index 91287aa..1e531de 100644 Binary files a/build/classes/telas/verProdutos$2.class and b/build/classes/telas/verProdutos$2.class differ diff --git a/build/classes/telas/verProdutos$3.class b/build/classes/telas/verProdutos$3.class index 9fda7e6..e8f5e40 100644 Binary files a/build/classes/telas/verProdutos$3.class and b/build/classes/telas/verProdutos$3.class differ diff --git a/build/classes/telas/verProdutos$4.class b/build/classes/telas/verProdutos$4.class index 279aa8a..58bb784 100644 Binary files a/build/classes/telas/verProdutos$4.class and b/build/classes/telas/verProdutos$4.class differ diff --git a/build/classes/telas/verProdutos.class b/build/classes/telas/verProdutos.class index 6356194..b743207 100644 Binary files a/build/classes/telas/verProdutos.class and b/build/classes/telas/verProdutos.class differ diff --git a/build/classes/telas/verProdutos.form b/build/classes/telas/verProdutos.form index 0bc78df..243cb7a 100644 --- a/build/classes/telas/verProdutos.form +++ b/build/classes/telas/verProdutos.form @@ -3,6 +3,10 @@ <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="Busca por produtos"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/pesquisar64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -18,113 +22,113 @@ <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,54,0,0,7,126"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="813" 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="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="463" 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="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - </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"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="b6" green="e0" red="ed" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jPanel1MouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="560" y="310" width="760" height="510"/> + </Constraint> + </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="317" max="-2" attributes="0"/> - <Component id="titulo" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Component id="Tabela" min="-2" pref="653" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="89" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="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="149" max="-2" attributes="0"/> - <Component id="btnSobre" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="199" max="-2" attributes="0"/> - <Component id="btnComprar" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="299" max="-2" attributes="0"/> - <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> - </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="txtTitulo" min="-2" pref="493" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="titulo" min="-2" max="-2" attributes="0"/> + <Component id="txtTitulo" min="-2" pref="493" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtQuantidade" min="-2" pref="38" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" attributes="0"> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - <EmptySpace min="154" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="Tabela" alignment="0" min="-2" pref="653" max="-2" attributes="0"/> + <Component id="lblNome" min="-2" max="-2" attributes="0"/> + <Component id="txtAutor" alignment="0" min="-2" pref="493" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="74" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="122" max="-2" attributes="0"/> + <Component id="btnSobre" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnComprar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="85" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblAutor" min="-2" pref="57" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="172" max="-2" attributes="0"/> </Group> </Group> </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="296" max="-2" attributes="0"/> + <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <EmptySpace min="-2" 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="28" max="-2" attributes="0"/> - <Component id="titulo" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtQuantidade" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> + <EmptySpace min="-2" pref="41" max="-2" attributes="0"/> + <Component id="lblNome" min="-2" pref="31" max="-2" attributes="0"/> + </Group> + <Component id="titulo" alignment="0" min="-2" pref="53" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtQuantidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" pref="22" max="-2" attributes="0"/> </Group> - <Component id="txtTitulo" min="-2" max="-2" attributes="0"/> + <Component id="txtTitulo" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblAutor" alignment="3" min="-2" pref="27" max="-2" attributes="0"/> + <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtAutor" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="13" max="32767" attributes="0"/> <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="Tabela" min="-2" pref="243" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="btnComprar" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="btnSobre" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnSobre" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnComprar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -133,14 +137,19 @@ <Component class="javax.swing.JLabel" name="titulo"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Inter" size="24" style="1"/> + <Font name="Old London" size="36" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Produtos"/> + <Property name="text" type="java.lang.String" value="Pesquisar por produtos"/> + <Property name="toolTipText" type="java.lang.String" value=""/> </Properties> </Component> <Component class="javax.swing.JButton" name="btnPesquisar"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="14" style="1"/> + </Property> <Property name="text" type="java.lang.String" value="Pesquisar"/> + <Property name="toolTipText" type="java.lang.String" value="Pesquisar por título ou autor"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/> @@ -166,27 +175,27 @@ </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"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> @@ -211,15 +220,18 @@ <Component class="javax.swing.JLabel" name="lblNome"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Inter" size="14" style="0"/> + <Font name="Old London" size="24" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Nome:"/> + <Property name="text" type="java.lang.String" value="Titulo:"/> </Properties> </Component> <Component class="javax.swing.JButton" name="btnSobre"> <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/information_info_1565.png"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="99" red="0" type="rgb"/> + </Property> + <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="Sobre"/> </Properties> @@ -229,8 +241,11 @@ </Component> <Component class="javax.swing.JButton" name="btnComprar"> <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/accept_icon-icons.com_74428.png"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="cc" red="0" type="rgb"/> + </Property> + <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="Adicionar ao carrinho"/> </Properties> @@ -240,6 +255,9 @@ </Component> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="18" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Quantidade"/> </Properties> </Component> @@ -250,7 +268,48 @@ </Component> <Component class="javax.swing.JTextField" name="txtTitulo"> </Component> + <Component class="javax.swing.JLabel" name="lblAutor"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Autor"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtAutor"> + </Component> </SubComponents> </Container> + <Component class="javax.swing.JButton" name="btnSair"> + <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="Old London" size="48" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1720" y="20" width="130" height="60"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/BuscarItem.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/nbproject/private/private.xml b/nbproject/private/private.xml index 9d355c5..4bdc098 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -12,17 +12,22 @@ <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/telas/cadastros.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/telas/verProdutos.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/OperadorSistema.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> <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 357cdda..98cce0b 100644 --- a/src/classes/Carrinho.java +++ b/src/classes/Carrinho.java @@ -10,15 +10,78 @@ public class Carrinho { protected String data; protected double total; public static ArrayList<Produto> listaProdutos = new ArrayList(); + private String idCliente; + public ArrayList<Produto> itensNoCarrinho = new ArrayList(); + //Construtor de carrinho. Um vazio e outro com os atributos dados public Carrinho() { } - - public Carrinho(int numCarrinho, String data) { + + public Carrinho(int numCarrinho, String data) { this.numCarrinho = numCarrinho; this.data = data; } + + + //Esse construtor já calcula o saldo + public Carrinho(int numCarrinho, String data,ArrayList<Produto> itensNoCarrinho) { + this.numCarrinho = numCarrinho; + this.data = data; + this.itensNoCarrinho = itensNoCarrinho; + this.total = 0; + double saldo = 0; + for(Produto item : itensNoCarrinho){ + saldo += item.getPreço()*item.getQuantidadeComprada(); + + } + this.total=saldo; + } + + public void verificarCarrinho(Cliente cliente){ + if(cliente.getIdCliente().equals(this.getidCliente())){ + cliente.getListaCarrinho(); + } + + } + //Método separado para contar o saldo do carrinho + public void contarSaldo(){ + double saldo = 0; + for(Produto item : itensNoCarrinho){ + saldo += item.getPreço()*item.getQuantidadeComprada(); + } + this.total=saldo; + } + //Método de adicionar item ao carrinho + public void addItem(Produto item){ + itensNoCarrinho.add(item); + + } + //Método de remover produto do carrinho + public void removeProduto(int i){ + itensNoCarrinho.remove(i); + } + public void clearLista(){ + listaProdutos.clear(); + } + + public String mostarProdutos(ArrayList<Produto> itensNoCarrinho){ + String resumo=""; + for(Produto item: itensNoCarrinho){ + resumo = resumo + " "+item.getTitulo()+"*"+item.getQuantidadeComprada(); + + } + return resumo; + + + } + public String mostrarProdutos(){ + String resumo=""; + for(Produto item: this.itensNoCarrinho){ + resumo = resumo+" "+item.getTitulo()+"*"+item.getQuantidadeComprada()+","; + } + return resumo; + } //Métodos getters e setters para cada um dos atributos @@ -39,7 +102,29 @@ public void setTotal(double total) { this.total = total; } + public void setData(String data) { + this.data = data; + } + + public String getData() { + return data; + } + + public String getidCliente() { + return idCliente; + } + + public void setIdCarrinho(String idCarrinho) { + this.idCliente = idCliente; + } + + public ArrayList<Produto> getItensNoCarrinho() { + return itensNoCarrinho; + } + + public void setItensNoCarrinho(ArrayList<Produto> itensNoCarrinho) { + this.itensNoCarrinho = itensNoCarrinho; + } + - - } diff --git a/src/classes/Cliente.java b/src/classes/Cliente.java index 87704b9..9530489 100644 --- a/src/classes/Cliente.java +++ b/src/classes/Cliente.java @@ -10,16 +10,17 @@ * * @author Yuri */ -public class Cliente extends Usuario{ +public class Cliente extends Usuario implements OperadorSistema{ //A classe de cliente herda de funcionário //Declaração de atributos privados para o cliente private String endereco; private String dataNascimento; private String celular; - private ArrayList carrinho; private String idCliente; public static ArrayList<Cliente> listaClientes = new ArrayList(); + public ArrayList<Carrinho> listaCarrinho = new ArrayList(); + public static int index_cliente; @@ -66,14 +67,6 @@ public void setCelular(String celular) { this.celular = celular; } - public ArrayList getCarrinho() { - return carrinho; - } - - public void setCarrinho(ArrayList carrinho) { - this.carrinho = carrinho; - } - public Cliente() { } @@ -98,6 +91,43 @@ public static int getIndex_cliente() { } + + public ArrayList<Carrinho> getListaCarrinho() { + return listaCarrinho; + } + + + public void addCarrinhoLista(Carrinho carrinho){ + listaCarrinho.add(carrinho); + } + + @Override + public boolean login(String email, String senha) { + for(Cliente pessoa : listaClientes){ + if(email.equals(pessoa.email) && senha.equals(pessoa.senha)){ + return true; + } + } + return false; + + } + + @Override + public boolean logout() { + return false; + } + + @Override + public void pesquisar(String titulo) { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public void consultarEmail(String cpf) { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + } diff --git a/src/classes/Estoque.java b/src/classes/Estoque.java index b66a727..5d0aea0 100644 --- a/src/classes/Estoque.java +++ b/src/classes/Estoque.java @@ -25,4 +25,7 @@ public void addEstoque(Produto produto){ public void removeEstoque(Produto produto){ estoque.remove(produto); } + public int retornarTamanhoEstoque(){ + return estoque.size(); + } } diff --git a/src/classes/Funcionario.java b/src/classes/Funcionario.java index ea2dacf..462e47b 100644 --- a/src/classes/Funcionario.java +++ b/src/classes/Funcionario.java @@ -10,10 +10,11 @@ * * @author Yuri */ -public class Funcionario extends Usuario{ +public class Funcionario extends Usuario implements OperadorSistema{ private String cadastroFuncionario; public static int index_func; public static ArrayList<Funcionario> listaFuncionarios = new ArrayList(); + private ArrayList<Carrinho> listaCarrinhoFuncionario = new ArrayList(); @@ -42,6 +43,42 @@ public void setCadastroFuncionario(String cadastroFuncionario) { public String toString() { return "Funcionario{" + "cadastroFuncionario=" + cadastroFuncionario + '}'; } + + @Override + public boolean login(String email, String senha) { + for(Funcionario func: listaFuncionarios){ + if(email.equals(func.getEmail()) && senha.equals(func.getSenha())){ + return true; + } + }return false; + } + + @Override + public boolean logout() { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public void pesquisar(String titulo) { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public void consultarEmail(String cpf) { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + public void addListaCarrinhosFuncionarios(Carrinho carrinho2) { + listaCarrinhoFuncionario.add(carrinho2); + } + + public ArrayList<Carrinho> getListaCarrinhoFuncionario() { + return listaCarrinhoFuncionario; + } + + public void setListaCarrinhoFuncionario(ArrayList<Carrinho> listaCarrinhoFuncionario) { + this.listaCarrinhoFuncionario = listaCarrinhoFuncionario; + } diff --git a/src/classes/Gerente.java b/src/classes/Gerente.java index edf9004..82d26b0 100644 --- a/src/classes/Gerente.java +++ b/src/classes/Gerente.java @@ -4,13 +4,17 @@ */ package classes; +import java.util.ArrayList; + /** * * @author Yuri */ -public class Gerente extends Usuario{ +public class Gerente extends Usuario implements OperadorSistema{ //Classe Gerente herda de Usuário private String cadastroGerente; + private ArrayList<Carrinho> listaCarrinhoGerente = new ArrayList(); + //Construtor para Gerente, com os atributos de Usuário public Gerente(String nome, String CPF, String email, String senha) { @@ -31,7 +35,41 @@ public String getCadastroGerente() { public void setCadastroGerente(String cadastroGerente) { this.cadastroGerente = cadastroGerente; } - - + + @Override + public boolean login(String email, String senha) { + if(super.email.equals(email) && super.senha.equals(senha)){ + return true; + } + return false; + + } + + @Override + public boolean logout() { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public void pesquisar(String titulo) { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + @Override + public void consultarEmail(String cpf) { + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + public void addListaCarrinhosGerente(Carrinho carrinho2) { + listaCarrinhoGerente.add(carrinho2); + } + + public ArrayList<Carrinho> getListaCarrinhoGerente() { + return listaCarrinhoGerente; + } + + public void setListaCarrinhoGerente(ArrayList<Carrinho> listaCarrinhoGerente) { + this.listaCarrinhoGerente = listaCarrinhoGerente; + } + } diff --git a/src/classes/OperadorSistema.java b/src/classes/OperadorSistema.java new file mode 100644 index 0000000..511fc29 --- /dev/null +++ b/src/classes/OperadorSistema.java @@ -0,0 +1,17 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Interface.java to edit this template + */ +package classes; + +/** + * + * @author Yuri + */ +public interface OperadorSistema { + boolean login(String email,String senha); + boolean logout(); + void pesquisar(String titulo); + void esqueciSenha(String email,String cpf); + void consultarEmail(String cpf); +} diff --git a/src/classes/Usuario.java b/src/classes/Usuario.java index 0ee17a6..d197324 100644 --- a/src/classes/Usuario.java +++ b/src/classes/Usuario.java @@ -10,7 +10,7 @@ * * @author Yuri */ -abstract class Usuario { +public abstract class Usuario { //Definição da classe abstrata Usuário //Definição de atributos protegidos para a classe abstrata usuário @@ -19,7 +19,14 @@ abstract class Usuario { protected String email; protected String senha; static ArrayList<Cliente> listaClientes = new ArrayList(); // Definição de um ArrayList para Clientes - static ArrayList<Carrinho> historicoCarrinhos = new ArrayList(); + public static ArrayList<Carrinho> historicoCarrinhos = new ArrayList(); + public ArrayList<Carrinho> listaCarrinho = new ArrayList(); + private Carrinho carrinho; + public static boolean usuario_logado = false; + public static String usuario_tipo =""; + + + public Usuario(){ this.listaClientes = new ArrayList(); @@ -85,6 +92,10 @@ public void esqueciSenha(String CPF,String senhanova){ } } + + public ArrayList<Carrinho> getListaCarrinho() { + return listaCarrinho; + } } diff --git a/src/imagens/BuscarItem.png b/src/imagens/BuscarItem.png new file mode 100644 index 0000000..8abb3e6 Binary files /dev/null and b/src/imagens/BuscarItem.png differ diff --git a/src/imagens/Telas/360_F_559104679_E9EW2fuD15ZfrKSDvHkc6QuiTPL92NlY.jpg b/src/imagens/Telas/360_F_559104679_E9EW2fuD15ZfrKSDvHkc6QuiTPL92NlY.jpg new file mode 100644 index 0000000..7dd53c6 Binary files /dev/null and b/src/imagens/Telas/360_F_559104679_E9EW2fuD15ZfrKSDvHkc6QuiTPL92NlY.jpg differ diff --git a/src/imagens/Telas/BuscarItem.png b/src/imagens/Telas/BuscarItem.png new file mode 100644 index 0000000..85d5779 Binary files /dev/null and b/src/imagens/Telas/BuscarItem.png differ 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/Cadastro.png b/src/imagens/Telas/Cadastro.png new file mode 100644 index 0000000..a45df5a Binary files /dev/null and b/src/imagens/Telas/Cadastro.png differ diff --git a/src/imagens/Telas/ControleEstoque.png b/src/imagens/Telas/ControleEstoque.png new file mode 100644 index 0000000..5005481 Binary files /dev/null and b/src/imagens/Telas/ControleEstoque.png differ diff --git a/src/imagens/Telas/Flying-Castle-thumbnail.jpg b/src/imagens/Telas/Flying-Castle-thumbnail.jpg new file mode 100644 index 0000000..ff743a8 Binary files /dev/null and b/src/imagens/Telas/Flying-Castle-thumbnail.jpg 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/d15eda291e7c8954479b0ece7c6385e0.jpg b/src/imagens/Telas/d15eda291e7c8954479b0ece7c6385e0.jpg new file mode 100644 index 0000000..1904fcd Binary files /dev/null and b/src/imagens/Telas/d15eda291e7c8954479b0ece7c6385e0.jpg 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/imagens/logo256.png b/src/imagens/logo256.png new file mode 100644 index 0000000..cf47c9b Binary files /dev/null and b/src/imagens/logo256.png differ diff --git a/src/imagens/logo32.png b/src/imagens/logo32.png new file mode 100644 index 0000000..f40dabd Binary files /dev/null and b/src/imagens/logo32.png differ diff --git a/src/imagens/logo512.png b/src/imagens/logo512.png new file mode 100644 index 0000000..5b1f0c4 Binary files /dev/null and b/src/imagens/logo512.png differ diff --git a/src/imagens/logo_128.png b/src/imagens/logo_128.png new file mode 100644 index 0000000..ca3b3f7 Binary files /dev/null and b/src/imagens/logo_128.png differ diff --git a/src/imagens/logo_v3.png b/src/imagens/logo_v3.png new file mode 100644 index 0000000..f5932a4 Binary files /dev/null and b/src/imagens/logo_v3.png differ diff --git a/src/imagens/simbolos/aventureiro.png b/src/imagens/simbolos/aventureiro.png new file mode 100644 index 0000000..42eecb6 Binary files /dev/null and b/src/imagens/simbolos/aventureiro.png differ diff --git a/src/imagens/simbolos/aventureiro64.png b/src/imagens/simbolos/aventureiro64.png new file mode 100644 index 0000000..21c34e6 Binary files /dev/null and b/src/imagens/simbolos/aventureiro64.png differ diff --git a/src/imagens/simbolos/bruxo_1.png b/src/imagens/simbolos/bruxo_1.png new file mode 100644 index 0000000..79a15cb Binary files /dev/null and b/src/imagens/simbolos/bruxo_1.png differ diff --git a/src/imagens/simbolos/caixas64.png b/src/imagens/simbolos/caixas64.png new file mode 100644 index 0000000..6a38f2c Binary files /dev/null and b/src/imagens/simbolos/caixas64.png differ diff --git a/src/imagens/simbolos/carrinho64.png b/src/imagens/simbolos/carrinho64.png new file mode 100644 index 0000000..c1d3332 Binary files /dev/null and b/src/imagens/simbolos/carrinho64.png differ diff --git a/src/imagens/simbolos/cavaleiro.png b/src/imagens/simbolos/cavaleiro.png new file mode 100644 index 0000000..bbc785b Binary files /dev/null and b/src/imagens/simbolos/cavaleiro.png differ diff --git a/src/imagens/simbolos/cavaleiro64.png b/src/imagens/simbolos/cavaleiro64.png new file mode 100644 index 0000000..0ab20ca Binary files /dev/null and b/src/imagens/simbolos/cavaleiro64.png differ diff --git a/src/imagens/simbolos/login64.png b/src/imagens/simbolos/login64.png new file mode 100644 index 0000000..3009bf9 Binary files /dev/null and b/src/imagens/simbolos/login64.png differ diff --git a/src/imagens/simbolos/pesquisar64.png b/src/imagens/simbolos/pesquisar64.png new file mode 100644 index 0000000..c5582c5 Binary files /dev/null and b/src/imagens/simbolos/pesquisar64.png differ diff --git a/src/imagens/simbolos/rei.png b/src/imagens/simbolos/rei.png new file mode 100644 index 0000000..670f3f1 Binary files /dev/null and b/src/imagens/simbolos/rei.png differ diff --git a/src/imagens/simbolos/rei64.png b/src/imagens/simbolos/rei64.png new file mode 100644 index 0000000..b748bdb Binary files /dev/null and b/src/imagens/simbolos/rei64.png differ diff --git a/src/telas/ControleEstoque.form b/src/telas/ControleEstoque.form index fec09b6..cd2868a 100644 --- a/src/telas/ControleEstoque.form +++ b/src/telas/ControleEstoque.form @@ -4,6 +4,9 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Controle do estoque"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/caixas64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -19,157 +22,176 @@ <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,59,0,0,7,127"/> </AuxValues> - <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"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <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"/> - <Component id="jScrollPane1" min="-2" pref="217" max="-2" attributes="0"/> - <EmptySpace max="32767" 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="jPanel2"> + <Component class="javax.swing.JButton" name="btnSair"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1490" y="30" width="-1" height="40"/> + </Constraint> + </Constraints> + </Component> + <Container class="javax.swing.JPanel" name="jPanelAlterarItem"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="20" y="50" width="860" height="-1"/> + </Constraint> + </Constraints> <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"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="lblTituloEstoque" pref="60" max="32767" attributes="0"/> + <Component id="lblPrecoEstoque" max="32767" attributes="0"/> + </Group> + <EmptySpace min="2" max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnCriar" min="-2" max="-2" attributes="0"/> - <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"/> + <Component id="txtPrecoEstoque" alignment="1" min="-2" pref="122" max="-2" attributes="0"/> + <Component id="btnAlterarItem" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="txtTituloEstoque" alignment="1" min="-2" pref="122" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="78" max="-2" attributes="0"/> <Component id="btnSalvarItem" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="64" max="-2" attributes="0"/> </Group> <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"/> + <Component id="lblQuantiaEstoque" min="-2" max="-2" attributes="0"/> + <Component id="lblCodigoEstoque" min="-2" pref="181" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="34" 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"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> <Component id="txtCodigoEstoque" min="-2" pref="115" max="-2" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> - <Component id="lblQuantiaEstoque" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> - <Component id="txtQuantiaEstoque" min="-2" pref="115" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="btnCancelarItem" alignment="1" min="-2" pref="110" max="-2" attributes="0"/> + <Component id="txtQuantiaEstoque" min="-2" pref="115" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblDescricaoEstoque" min="-2" max="-2" attributes="0"/> </Group> </Group> + </Group> + </Group> + <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"/> + <Component id="jScrollPane2" min="-2" pref="197" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Component id="btnBuscar" min="-2" pref="119" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="89" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> + <Component id="btnPesquisarItem" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="131" max="-2" attributes="0"/> </Group> </Group> - <Group type="103" groupAlignment="1" attributes="0"> + </Group> + <Group type="102" 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 min="-2" pref="19" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="820" 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="0" attributes="0"> + <EmptySpace min="-2" pref="179" max="-2" attributes="0"/> + <Component id="lblControleEstoque" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnPesquisarItem" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="62" 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"> <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="103" groupAlignment="0" attributes="0"> + <Component id="lblControleEstoque" min="-2" pref="49" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblQuantiaEstoque" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtQuantiaEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="48" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnBuscar" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblPrecoEstoque" min="-2" pref="33" max="-2" attributes="0"/> + <Component id="txtPrecoEstoque" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace type="separate" 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="lblTituloEstoque" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="txtTituloEstoque" alignment="3" min="-2" max="-2" attributes="0"/> </Group> </Group> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" attributes="0"> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblDescricaoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtDescricaoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblQuantiaEstoque" alignment="3" min="-2" pref="39" max="-2" attributes="0"/> + <Component id="txtQuantiaEstoque" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblDescricaoEstoque" alignment="3" min="-2" pref="39" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="12" 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="lblCodigoEstoque" max="32767" attributes="0"/> + </Group> + <Component id="txtCodigoEstoque" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="btnBuscar" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace min="-2" pref="27" 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"/> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnCancelarItem" alignment="0" max="32767" attributes="0"/> + <Component id="btnSalvarItem" alignment="0" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="btnPesquisarItem" min="-2" pref="35" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> </Group> <Group type="102" attributes="0"> - <Group type="103" groupAlignment="3" 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 type="unrelated" max="-2" attributes="0"/> - <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> + <Component id="btnAlterarItem" min="-2" pref="30" max="-2" attributes="0"/> + <EmptySpace min="0" pref="-5" max="32767" attributes="0"/> </Group> </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="217" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -177,77 +199,142 @@ <SubComponents> <Component class="javax.swing.JTextField" name="txtTituloEstoque"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="insira o título do produto"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtTituloEstoqueActionPerformed"/> </Events> </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane2"> + <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="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> <Component class="javax.swing.JTextField" name="txtQuantiaEstoque"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="insira a quantia em estoque"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtDescricaoEstoque"> + <Component class="javax.swing.JButton" name="btnPesquisarItem"> <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira a descrição"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="99" red="99" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Pesquisar"/> + <Property name="toolTipText" type="java.lang.String" value="pesquisar por título"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarItemActionPerformed"/> + </Events> </Component> - <Component class="javax.swing.JTextField" name="txtPrecoEstoque"> + <Component class="javax.swing.JLabel" name="lblPrecoEstoque"> <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira o preço do produto"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Preço"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="txtCodigoEstoque"> + <Component class="javax.swing.JButton" name="btnSalvarItem"> <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira o código do produto"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="33" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Salvar"/> + <Property name="toolTipText" type="java.lang.String" value="salvar os dados"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarItemActionPerformed"/> + </Events> </Component> - <Component class="javax.swing.JLabel" name="lblTituloEstoque"> + <Component class="javax.swing.JButton" name="btnBuscar"> <Properties> - <Property name="text" type="java.lang.String" value="Titulo"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Buscar"/> + <Property name="toolTipText" type="java.lang.String" value="aperte para buscar pelo item"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="lblPrecoEstoque"> + <Component class="javax.swing.JButton" name="btnAlterarItem"> <Properties> - <Property name="text" type="java.lang.String" value="Preço"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Alterar Item"/> + <Property name="toolTipText" type="java.lang.String" value="alterar dados de algum produto"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAlterarItemActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="lblQuantiaEstoque"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Quantia em estoque"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblCodigoEstoque"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Código de produto"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="lblDescricaoEstoque"> + <Component class="javax.swing.JLabel" name="lblTituloEstoque"> <Properties> - <Property name="text" type="java.lang.String" value="Descrição"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Titulo"/> </Properties> </Component> - <Component class="javax.swing.JButton" name="btnBuscar"> + <Component class="javax.swing.JTextField" name="txtPrecoEstoque"> <Properties> - <Property name="text" type="java.lang.String" value="Buscar"/> - <Property name="toolTipText" type="java.lang.String" value="aperte para buscar pelo item"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="insira o preço do produto"/> </Properties> </Component> - <Component class="javax.swing.JButton" name="btnAlterarItem"> + <Component class="javax.swing.JTextField" name="txtCodigoEstoque"> <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="ff" 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"/> + <Font name="Old London" size="24" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Alterar Item"/> - <Property name="toolTipText" type="java.lang.String" value="alterar dados de algum produto"/> + <Property name="toolTipText" type="java.lang.String" value="insira o código do produto"/> </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAlterarItemActionPerformed"/> - </Events> </Component> <Component class="javax.swing.JButton" name="btnCancelarItem"> <Properties> @@ -255,7 +342,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="18" style="1"/> + <Font name="Old London" size="24" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Cancelar"/> <Property name="toolTipText" type="java.lang.String" value="cancelar operação"/> @@ -264,134 +351,408 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarItemActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JButton" name="btnSalvarItem"> + <Component class="javax.swing.JLabel" name="lblDescricaoEstoque"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Descrição"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblControleEstoque"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle do estoque - Alteração de item"/> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="tabela com os produtos em estoque"/> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="tblMostraProdutos"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="7" rowCount="4"> + <Column editable="false" title="Título" type="java.lang.String"/> + <Column editable="false" title="Autor" type="java.lang.String"/> + <Column editable="false" title="Gênero" type="java.lang.String"/> + <Column editable="false" title="Preço" type="java.lang.Double"/> + <Column editable="false" title="Qnt. Estoque" type="java.lang.Integer"/> + <Column editable="false" title="Cód. Prod." type="java.lang.String"/> + <Column editable="false" 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="50" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="20" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="15" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="8" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="3" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="5" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="100" 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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblMostraProdutosMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanelAdicaoItem"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="890" y="570" width="990" height="460"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="195" max="-2" attributes="0"/> + <Component id="lblControleAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Component id="jScrollPane3" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jTextField1" min="-2" pref="145" max="-2" attributes="0"/> + </Group> + <Component id="btnCriar1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="btnSalvarItemAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="132" max="-2" attributes="0"/> + <Component id="btnCancelarItemAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="94" max="-2" attributes="0"/> + <Component id="btnExcluirItemAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="60" max="32767" attributes="0"/> + <Component id="btnPesquisarItem1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel4" min="-2" pref="63" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + <Component id="jTextField3" min="-2" pref="156" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jTextField2" min="-2" pref="93" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblControleAdicao" min="-2" pref="66" max="-2" attributes="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"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" pref="30" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" pref="32" max="-2" attributes="0"/> + <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="9" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTextField2" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" pref="33" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jTextField1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="2" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" pref="33" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="41" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnCriar1" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="btnSalvarItemAdicao" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="btnCancelarItemAdicao" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="btnExcluirItemAdicao" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="btnPesquisarItem1" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane3" pref="263" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane3"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="tabela com os produtos em estoque"/> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTable" name="tblMostraProdutosAdicao"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="7" rowCount="4"> + <Column editable="false" title="Título" type="java.lang.String"/> + <Column editable="false" title="Autor" type="java.lang.String"/> + <Column editable="false" title="Gênero" type="java.lang.String"/> + <Column editable="false" title="Preço" type="java.lang.Double"/> + <Column editable="false" title="Qnt. Estoque" type="java.lang.Integer"/> + <Column editable="false" title="Cód. Prod." type="java.lang.String"/> + <Column editable="false" 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="50" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="20" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="15" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="8" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="3" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="5" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="100" 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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblMostraProdutosAdicaoMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnCriar1"> + <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="text" type="java.lang.String" value="Criar Item"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCriar1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvarItemAdicao"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> <Color blue="0" green="ff" red="33" type="rgb"/> </Property> <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="24" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Salvar"/> <Property name="toolTipText" type="java.lang.String" value="salvar os dados"/> </Properties> <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarItemActionPerformed"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarItemAdicaoActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JButton" name="btnPesquisarItem"> + <Component class="javax.swing.JButton" name="btnPesquisarItem1"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> <Color blue="ff" 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"/> + <Font name="Old London" size="24" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Pesquisar"/> <Property name="toolTipText" type="java.lang.String" value="pesquisar por título"/> </Properties> <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarItemActionPerformed"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarItem1ActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JButton" name="btnExcluirItem"> + <Component class="javax.swing.JButton" name="btnCancelarItemAdicao"> + <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="Old London" size="24" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Cancelar"/> + <Property name="toolTipText" type="java.lang.String" value="cancelar operação"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarItemAdicaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnExcluirItemAdicao"> <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"/> + <Font name="Old London" size="24" style="1"/> </Property> <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="btnExcluirItemAdicaoActionPerformed"/> + </Events> </Component> - <Component class="javax.swing.JLabel" name="lblControleEstoque"> + <Component class="javax.swing.JLabel" name="lblControleAdicao"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="24" style="1"/> + <Font name="Old London" size="36" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Controle do estoque"/> + <Property name="text" type="java.lang.String" value="Controle do estoque - Adição/Remoção de item"/> </Properties> </Component> - <Component class="javax.swing.JButton" name="btnCriar"> + <Component class="javax.swing.JLabel" name="jLabel2"> <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="24" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Criar Item"/> + <Property name="text" type="java.lang.String" value="Titulo"/> </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCriarActionPerformed"/> - </Events> </Component> - </SubComponents> - </Container> - <Container class="javax.swing.JScrollPane" name="jScrollPane1"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="tabela com os produtos em estoque"/> - </Properties> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTable" name="tblMostraProdutos"> + <Component class="javax.swing.JTextField" name="jTextField1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Codigo de Produto"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField2"> <Properties> - <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> - <Table columnCount="7" rowCount="4"> - <Column editable="true" title="Título" type="java.lang.String"/> - <Column editable="true" title="Autor" type="java.lang.String"/> - <Column editable="true" title="Gênero" type="java.lang.String"/> - <Column editable="true" title="Preço" type="java.lang.Double"/> - <Column editable="true" title="Qnt. Estoque" type="java.lang.Integer"/> - <Column editable="true" title="Cód. Prod." type="java.lang.String"/> - <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="50" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="20" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="15" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="8" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="3" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="5" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="100" 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 name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> </Property> </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="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Buscar"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Autor"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField3"> + </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/ControleEstoque.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="1930" height="-1"/> + </Constraint> + </Constraints> + </Component> </SubComponents> </Form> diff --git a/src/telas/ControleEstoque.java b/src/telas/ControleEstoque.java index d813c99..6c38452 100644 --- a/src/telas/ControleEstoque.java +++ b/src/telas/ControleEstoque.java @@ -5,7 +5,9 @@ package telas; import static classes.Estoque.estoque; +import classes.Produto; import javax.swing.table.DefaultTableModel; +import static telas.cadastros.cadastrosFlag; /** * @@ -22,8 +24,13 @@ public ControleEstoque() { disableEstoqueFields(); disableEstoqueButtons(); carregarTabelaProdutos(); + carregarTabelaProdutosAdicao(); + disableEstoqueAdicaoButtons(); //btnAddItem.setEnabled(true); btnPesquisarItem.setEnabled(true); + txtCodigoEstoque.setEnabled(false); + this.setExtendedState(MAXIMIZED_BOTH); + setLocationRelativeTo(null); setLocationRelativeTo(null); @@ -63,12 +70,31 @@ public void disableEstoqueButtons(){ //btnAddItem.setEnabled(false); btnAlterarItem.setEnabled(false); btnSalvarItem.setEnabled(false); - btnExcluirItem.setEnabled(false); + //btnExcluirItem.setEnabled(false); btnCancelarItem.setEnabled(false); btnPesquisarItem.setEnabled(false); btnBuscar.setEnabled(false); } + public void disableEstoqueAdicaoButtons(){ + btnSalvarItemAdicao.setEnabled(false); + btnExcluirItemAdicao.setEnabled(false); + btnCancelarItemAdicao.setEnabled(false); + + + + } + public void carregarCamposProduto(){ + int i = tblMostraProdutos.getSelectedRow(); + if(i>=0 && i<estoque.size()){ + Produto item = estoque.get(i); + txtTituloEstoque.setText(item.getTitulo()); + txtPrecoEstoque.setText(String.valueOf(item.getPreço())); + txtQuantiaEstoque.setText(String.valueOf(item.getQuantidadeEstoque())); + txtCodigoEstoque.setText(String.valueOf(item.getCodigoDoProduto())); + txtDescricaoEstoque.setText(item.getDescrição()); + } + } private void carregarTabelaProdutos(){ @@ -96,6 +122,32 @@ private void carregarTabelaProdutos(){ tblMostraProdutos.getColumnModel().getColumn(6).setPreferredWidth(WIDTH); + } + private void carregarTabelaProdutosAdicao(){ + 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); + + } + tblMostraProdutosAdicao.setModel(modeloTabelaProdutos); + + tblMostraProdutosAdicao.getColumnModel().getColumn(0).setPreferredWidth(WIDTH); + tblMostraProdutosAdicao.getColumnModel().getColumn(1).setPreferredWidth(WIDTH); + tblMostraProdutosAdicao.getColumnModel().getColumn(2).setPreferredWidth(WIDTH); + tblMostraProdutosAdicao.getColumnModel().getColumn(3).setPreferredWidth(WIDTH); + tblMostraProdutosAdicao.getColumnModel().getColumn(4).setPreferredWidth(WIDTH); + tblMostraProdutosAdicao.getColumnModel().getColumn(5).setPreferredWidth(WIDTH); + tblMostraProdutosAdicao.getColumnModel().getColumn(6).setPreferredWidth(WIDTH); + + } /** @@ -107,31 +159,60 @@ private void carregarTabelaProdutos(){ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { - jPanel2 = new javax.swing.JPanel(); + btnSair = new javax.swing.JButton(); + jPanelAlterarItem = new javax.swing.JPanel(); txtTituloEstoque = new javax.swing.JTextField(); + jScrollPane2 = new javax.swing.JScrollPane(); + txtDescricaoEstoque = new javax.swing.JTextArea(); 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(); + btnPesquisarItem = new javax.swing.JButton(); lblPrecoEstoque = new javax.swing.JLabel(); - lblQuantiaEstoque = new javax.swing.JLabel(); - lblCodigoEstoque = new javax.swing.JLabel(); - lblDescricaoEstoque = new javax.swing.JLabel(); + btnSalvarItem = new javax.swing.JButton(); btnBuscar = new javax.swing.JButton(); btnAlterarItem = new javax.swing.JButton(); + lblQuantiaEstoque = new javax.swing.JLabel(); + lblCodigoEstoque = new javax.swing.JLabel(); + lblTituloEstoque = new javax.swing.JLabel(); + txtPrecoEstoque = new javax.swing.JTextField(); + txtCodigoEstoque = new javax.swing.JTextField(); btnCancelarItem = new javax.swing.JButton(); - btnSalvarItem = new javax.swing.JButton(); - btnPesquisarItem = new javax.swing.JButton(); - btnExcluirItem = new javax.swing.JButton(); + lblDescricaoEstoque = new javax.swing.JLabel(); lblControleEstoque = new javax.swing.JLabel(); - btnCriar = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); tblMostraProdutos = new javax.swing.JTable(); + jPanelAdicaoItem = new javax.swing.JPanel(); + jScrollPane3 = new javax.swing.JScrollPane(); + tblMostraProdutosAdicao = new javax.swing.JTable(); + btnCriar1 = new javax.swing.JButton(); + btnSalvarItemAdicao = new javax.swing.JButton(); + btnPesquisarItem1 = new javax.swing.JButton(); + btnCancelarItemAdicao = new javax.swing.JButton(); + btnExcluirItemAdicao = new javax.swing.JButton(); + lblControleAdicao = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jTextField1 = new javax.swing.JTextField(); + jLabel3 = new javax.swing.JLabel(); + jTextField2 = new javax.swing.JTextField(); + jButton1 = new javax.swing.JButton(); + jLabel4 = new javax.swing.JLabel(); + jTextField3 = new javax.swing.JTextField(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Controle do estoque"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/caixas64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + btnSair.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1490, 30, -1, 40)); + + txtTituloEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtTituloEstoque.setToolTipText("insira o título do produto"); txtTituloEstoque.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -139,29 +220,43 @@ 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"); + txtDescricaoEstoque.setColumns(20); + txtDescricaoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + txtDescricaoEstoque.setRows(5); + jScrollPane2.setViewportView(txtDescricaoEstoque); - txtCodigoEstoque.setToolTipText("insira o código do produto"); + txtQuantiaEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + txtQuantiaEstoque.setToolTipText("insira a quantia em estoque"); - lblTituloEstoque.setText("Titulo"); + btnPesquisarItem.setBackground(new java.awt.Color(153, 153, 255)); + btnPesquisarItem.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + btnPesquisarItem.setText("Pesquisar"); + btnPesquisarItem.setToolTipText("pesquisar por título"); + btnPesquisarItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarItemActionPerformed(evt); + } + }); + lblPrecoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N lblPrecoEstoque.setText("Preço"); - lblQuantiaEstoque.setText("Quantia em estoque"); - - lblCodigoEstoque.setText("Código de produto"); - - lblDescricaoEstoque.setText("Descrição"); + btnSalvarItem.setBackground(new java.awt.Color(51, 255, 0)); + btnSalvarItem.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + btnSalvarItem.setText("Salvar"); + btnSalvarItem.setToolTipText("salvar os dados"); + btnSalvarItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarItemActionPerformed(evt); + } + }); + btnBuscar.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N btnBuscar.setText("Buscar"); btnBuscar.setToolTipText("aperte para buscar pelo item"); btnAlterarItem.setBackground(new java.awt.Color(255, 255, 0)); - btnAlterarItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnAlterarItem.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N btnAlterarItem.setText("Alterar Item"); btnAlterarItem.setToolTipText("alterar dados de algum produto"); btnAlterarItem.addActionListener(new java.awt.event.ActionListener() { @@ -170,8 +265,23 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + lblQuantiaEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblQuantiaEstoque.setText("Quantia em estoque"); + + lblCodigoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblCodigoEstoque.setText("Código de produto"); + + lblTituloEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblTituloEstoque.setText("Titulo"); + + txtPrecoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + txtPrecoEstoque.setToolTipText("insira o preço do produto"); + + txtCodigoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + txtCodigoEstoque.setToolTipText("insira o código do produto"); + btnCancelarItem.setBackground(new java.awt.Color(255, 0, 0)); - btnCancelarItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCancelarItem.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N btnCancelarItem.setText("Cancelar"); btnCancelarItem.setToolTipText("cancelar operação"); btnCancelarItem.addActionListener(new java.awt.event.ActionListener() { @@ -180,137 +290,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - btnSalvarItem.setBackground(new java.awt.Color(51, 255, 0)); - btnSalvarItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - btnSalvarItem.setText("Salvar"); - btnSalvarItem.setToolTipText("salvar os dados"); - btnSalvarItem.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnSalvarItemActionPerformed(evt); - } - }); - - btnPesquisarItem.setBackground(new java.awt.Color(153, 153, 255)); - btnPesquisarItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - btnPesquisarItem.setText("Pesquisar"); - btnPesquisarItem.setToolTipText("pesquisar por título"); - btnPesquisarItem.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnPesquisarItemActionPerformed(evt); - } - }); - - btnExcluirItem.setBackground(new java.awt.Color(153, 153, 153)); - btnExcluirItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - btnExcluirItem.setText("Excluir"); - btnExcluirItem.setToolTipText("Excluir algum produto do estoque"); - - lblControleEstoque.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N - lblControleEstoque.setText("Controle do estoque"); - - btnCriar.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - btnCriar.setText("Criar Item"); - btnCriar.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnCriarActionPerformed(evt); - } - }); + lblDescricaoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblDescricaoEstoque.setText("Descrição"); - 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() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnCriar) - .addGap(50, 50, 50) - .addComponent(btnAlterarItem) - .addGap(65, 65, 65) - .addComponent(btnSalvarItem) - .addGap(64, 64, 64)) - .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.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(lblCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(lblQuantiaEstoque) - .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.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)) - ); - 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.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .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() - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblDescricaoEstoque) - .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))) - .addGap(27, 27, 27) - .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnAlterarItem) - .addComponent(btnCancelarItem) - .addComponent(btnSalvarItem) - .addComponent(btnPesquisarItem) - .addComponent(btnExcluirItem) - .addComponent(btnCriar))) - .addGroup(jPanel2Layout.createSequentialGroup() - .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.UNRELATED) - .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))))) - ); + lblControleEstoque.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + lblControleEstoque.setText("Controle do estoque - Alteração de item"); jScrollPane1.setToolTipText("tabela com os produtos em estoque"); @@ -328,10 +312,22 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class }; + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false + }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + 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) { @@ -344,27 +340,308 @@ public Class getColumnClass(int columnIndex) { tblMostraProdutos.getColumnModel().getColumn(6).setPreferredWidth(100); } - 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) + javax.swing.GroupLayout jPanelAlterarItemLayout = new javax.swing.GroupLayout(jPanelAlterarItem); + jPanelAlterarItem.setLayout(jPanelAlterarItemLayout); + jPanelAlterarItemLayout.setHorizontalGroup( + jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(lblTituloEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE) + .addComponent(lblPrecoEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnAlterarItem, javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(txtTituloEstoque, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(78, 78, 78) + .addComponent(btnSalvarItem)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblQuantiaEstoque) + .addComponent(lblCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 181, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(23, 23, 23) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnCancelarItem, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblDescricaoEstoque))))) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(23, 23, 23) + .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(89, 89, 89)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnPesquisarItem) + .addGap(131, 131, 131)))) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(19, 19, 19) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 820, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(179, 179, 179) + .addComponent(lblControleEstoque))) .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)) ); - 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) + jPanelAlterarItemLayout.setVerticalGroup( + jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(lblControleEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(24, 24, 24) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnBuscar)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblDescricaoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(12, 12, 12) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(3, 3, 3) + .addComponent(lblCodigoEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(6, 6, 6))) + .addGap(18, 18, 18) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCancelarItem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnSalvarItem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(btnPesquisarItem, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE))) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(btnAlterarItem, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + getContentPane().add(jPanelAlterarItem, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 860, -1)); + + jScrollPane3.setToolTipText("tabela com os produtos em estoque"); + + tblMostraProdutosAdicao.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, null}, + {null, null, null, null, null, null, null} + }, + new String [] { + "Título", "Autor", "Gênero", "Preço", "Qnt. Estoque", "Cód. Prod.", "Descrição" + } + ) { + Class[] types = new Class [] { + java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Double.class, java.lang.Integer.class, java.lang.String.class, java.lang.String.class + }; + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tblMostraProdutosAdicao.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tblMostraProdutosAdicaoMouseClicked(evt); + } + }); + jScrollPane3.setViewportView(tblMostraProdutosAdicao); + if (tblMostraProdutosAdicao.getColumnModel().getColumnCount() > 0) { + tblMostraProdutosAdicao.getColumnModel().getColumn(0).setPreferredWidth(50); + tblMostraProdutosAdicao.getColumnModel().getColumn(1).setPreferredWidth(20); + tblMostraProdutosAdicao.getColumnModel().getColumn(2).setPreferredWidth(15); + tblMostraProdutosAdicao.getColumnModel().getColumn(3).setPreferredWidth(8); + tblMostraProdutosAdicao.getColumnModel().getColumn(4).setPreferredWidth(3); + tblMostraProdutosAdicao.getColumnModel().getColumn(5).setPreferredWidth(5); + tblMostraProdutosAdicao.getColumnModel().getColumn(6).setPreferredWidth(100); + } + + btnCriar1.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + btnCriar1.setText("Criar Item"); + btnCriar1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCriar1ActionPerformed(evt); + } + }); + + btnSalvarItemAdicao.setBackground(new java.awt.Color(51, 255, 0)); + btnSalvarItemAdicao.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + btnSalvarItemAdicao.setText("Salvar"); + btnSalvarItemAdicao.setToolTipText("salvar os dados"); + btnSalvarItemAdicao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarItemAdicaoActionPerformed(evt); + } + }); + + btnPesquisarItem1.setBackground(new java.awt.Color(153, 153, 255)); + btnPesquisarItem1.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + btnPesquisarItem1.setText("Pesquisar"); + btnPesquisarItem1.setToolTipText("pesquisar por título"); + btnPesquisarItem1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarItem1ActionPerformed(evt); + } + }); + + btnCancelarItemAdicao.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelarItemAdicao.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + btnCancelarItemAdicao.setText("Cancelar"); + btnCancelarItemAdicao.setToolTipText("cancelar operação"); + btnCancelarItemAdicao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarItemAdicaoActionPerformed(evt); + } + }); + + btnExcluirItemAdicao.setBackground(new java.awt.Color(153, 153, 153)); + btnExcluirItemAdicao.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + btnExcluirItemAdicao.setText("Excluir"); + btnExcluirItemAdicao.setToolTipText("Excluir algum produto do estoque"); + btnExcluirItemAdicao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirItemAdicaoActionPerformed(evt); + } + }); + + lblControleAdicao.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + lblControleAdicao.setText("Controle do estoque - Adição/Remoção de item"); + + jLabel2.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jLabel2.setText("Titulo"); + + jTextField1.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + + jLabel3.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jLabel3.setText("Codigo de Produto"); + + jTextField2.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + + jButton1.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jButton1.setText("Buscar"); + + jLabel4.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jLabel4.setText("Autor"); + + javax.swing.GroupLayout jPanelAdicaoItemLayout = new javax.swing.GroupLayout(jPanelAdicaoItem); + jPanelAdicaoItem.setLayout(jPanelAdicaoItemLayout); + jPanelAdicaoItemLayout.setHorizontalGroup( + jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addGap(195, 195, 195) + .addComponent(lblControleAdicao) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jScrollPane3) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addGap(15, 15, 15) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(jLabel2) + .addGap(18, 18, 18) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(btnCriar1)) + .addGap(23, 23, 23) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(btnSalvarItemAdicao) + .addGap(132, 132, 132) + .addComponent(btnCancelarItemAdicao) + .addGap(94, 94, 94) + .addComponent(btnExcluirItemAdicao) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE) + .addComponent(btnPesquisarItem1)) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(37, 37, 37) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel3) + .addGap(18, 18, 18) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jButton1) + .addGap(9, 9, 9))) + .addGap(24, 24, 24)) + ); + jPanelAdicaoItemLayout.setVerticalGroup( + jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(lblControleAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAdicaoItemLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 9, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(35, 35, 35)) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addGap(2, 2, 2) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(41, 41, 41))) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCriar1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSalvarItemAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnCancelarItemAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnExcluirItemAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisarItem1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE) + .addContainerGap()) ); + getContentPane().add(jPanelAdicaoItem, new org.netbeans.lib.awtextra.AbsoluteConstraints(890, 570, 990, 460)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/ControleEstoque.png"))); // NOI18N + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1930, -1)); + pack(); }// </editor-fold>//GEN-END:initComponents @@ -378,6 +655,8 @@ private void btnCancelarItemActionPerformed(java.awt.event.ActionEvent evt) {//G disableEstoqueFields(); disableEstoqueButtons(); //btnAddItem.setEnabled(true); + carregarCamposProduto(); + tblMostraProdutos.clearSelection(); btnPesquisarItem.setEnabled(true); }//GEN-LAST:event_btnCancelarItemActionPerformed @@ -385,7 +664,14 @@ private void btnSalvarItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN // TODO add your handling code here: disableEstoqueFields(); disableEstoqueButtons(); + txtCodigoEstoque.setEnabled(false); + int index = tblMostraProdutos.getSelectedRow(); + Produto produto = estoque.get(index); + produto.setTitulo(txtTituloEstoque.getText()); + produto.setPreço(Double.parseDouble(txtPrecoEstoque.getText())); + produto.setCodigoDoProduto(txtCodigoEstoque.getText()); carregarTabelaProdutos(); + carregarTabelaProdutosAdicao(); //btnAddItem.setEnabled(true); btnPesquisarItem.setEnabled(true); }//GEN-LAST:event_btnSalvarItemActionPerformed @@ -404,15 +690,66 @@ 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: + btnSalvarItem.setEnabled(true); + enableEstoqueFields(); + txtCodigoEstoque.setEnabled(false); }//GEN-LAST:event_btnAlterarItemActionPerformed - private void btnCriarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCriarActionPerformed + private void tblMostraProdutosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblMostraProdutosMouseClicked // TODO add your handling code here: - new CriarNovoProduto().setVisible(true); - btnSalvarItem.setEnabled(true); + btnAlterarItem.setEnabled(true); + btnCancelarItem.setEnabled(true); + //btnExcluirItem.setEnabled(true); + carregarCamposProduto(); + }//GEN-LAST:event_tblMostraProdutosMouseClicked + + private void tblMostraProdutosAdicaoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblMostraProdutosAdicaoMouseClicked + // TODO add your handling code here: + btnExcluirItemAdicao.setEnabled(true); + btnCancelarItemAdicao.setEnabled(true); + + }//GEN-LAST:event_tblMostraProdutosAdicaoMouseClicked + + private void btnCriar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCriar1ActionPerformed + // TODO add your handling code here: + cadastrosFlag="criarItem"; + new cadastros().setVisible(true); + btnSalvarItemAdicao.setEnabled(true); lblTituloEstoque.setEnabled(true); - }//GEN-LAST:event_btnCriarActionPerformed + }//GEN-LAST:event_btnCriar1ActionPerformed + + private void btnSalvarItemAdicaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarItemAdicaoActionPerformed + // TODO add your handling code here: + + carregarTabelaProdutosAdicao(); + carregarTabelaProdutos(); + }//GEN-LAST:event_btnSalvarItemAdicaoActionPerformed + + private void btnPesquisarItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarItem1ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_btnPesquisarItem1ActionPerformed + + private void btnCancelarItemAdicaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarItemAdicaoActionPerformed + // TODO add your handling code here: + tblMostraProdutosAdicao.clearSelection(); + }//GEN-LAST:event_btnCancelarItemAdicaoActionPerformed + + private void btnExcluirItemAdicaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirItemAdicaoActionPerformed + // TODO add your handling code here: + + int index = tblMostraProdutosAdicao.getSelectedRow(); + + if(index>=0 && index<estoque.size()){ + estoque.remove(index); + } + carregarTabelaProdutosAdicao(); + }//GEN-LAST:event_btnExcluirItemAdicaoActionPerformed + + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed /** * @param args the command line arguments @@ -453,21 +790,38 @@ public void run() { private javax.swing.JButton btnAlterarItem; private javax.swing.JButton btnBuscar; private javax.swing.JButton btnCancelarItem; - private javax.swing.JButton btnCriar; - private javax.swing.JButton btnExcluirItem; + private javax.swing.JButton btnCancelarItemAdicao; + private javax.swing.JButton btnCriar1; + private javax.swing.JButton btnExcluirItemAdicao; private javax.swing.JButton btnPesquisarItem; + private javax.swing.JButton btnPesquisarItem1; + private javax.swing.JButton btnSair; private javax.swing.JButton btnSalvarItem; - private javax.swing.JPanel jPanel2; + private javax.swing.JButton btnSalvarItemAdicao; + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JPanel jPanelAdicaoItem; + private javax.swing.JPanel jPanelAlterarItem; private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JTextField jTextField1; + private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField3; private javax.swing.JLabel lblCodigoEstoque; + private javax.swing.JLabel lblControleAdicao; private javax.swing.JLabel lblControleEstoque; private javax.swing.JLabel lblDescricaoEstoque; private javax.swing.JLabel lblPrecoEstoque; private javax.swing.JLabel lblQuantiaEstoque; private javax.swing.JLabel lblTituloEstoque; private javax.swing.JTable tblMostraProdutos; + private javax.swing.JTable tblMostraProdutosAdicao; 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 index b99c9d8..59592ba 100644 --- a/src/telas/CriarNovoProduto.form +++ b/src/telas/CriarNovoProduto.form @@ -23,197 +23,229 @@ <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 min="-2" pref="524" max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="251" 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="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="350" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="907" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="56" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" 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"/> + <EmptySpace min="-2" pref="468" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" 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 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="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="jLabel7" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="btnCriarNovoItem" min="-2" max="-2" attributes="0"/> + <Component id="txtGenero" min="-2" pref="262" 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 type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" 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" min="-2" pref="262" max="-2" 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="195" max="-2" attributes="0"/> - <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> - </Group> </Group> + <EmptySpace max="32767" 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"/> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="301" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" 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" alignment="0" 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 max="32767" 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="Criar novo Produto no sistema"/> - </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"/> + </DimensionLayout> + </Layout> <SubComponents> - <Component class="javax.swing.JTextArea" name="txtAreaDescricao"> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Criar novo Produto no sistema"/> + </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="columns" type="int" value="20"/> - <Property name="rows" type="int" value="5"/> + <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> </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 index f45115b..ffacbc6 100644 --- a/src/telas/CriarNovoProduto.java +++ b/src/telas/CriarNovoProduto.java @@ -30,6 +30,7 @@ public CriarNovoProduto() { // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); @@ -92,87 +93,109 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jLabel8.setText("Código Produto"); jLabel8.setToolTipText(""); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 907, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(468, 468, 468) + .addComponent(jLabel1)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel1Layout.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(jPanel1Layout.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, jPanel1Layout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnCriarNovoItem) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.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(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel6) + .addComponent(jLabel7)) + .addGap(18, 18, 18) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(195, 195, 195) + .addComponent(btnCancelar))))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 301, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addGroup(jPanel1Layout.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(jPanel1Layout.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(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.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(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCriarNovoItem) + .addComponent(btnCancelar)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, 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() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(524, 524, 524) - .addComponent(jLabel1)) - .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))))) - .addContainerGap(213, Short.MAX_VALUE)) + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(251, 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)) + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(350, Short.MAX_VALUE)) ); pack(); @@ -254,6 +277,7 @@ public void run() { private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; + private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea txtAreaDescricao; private javax.swing.JTextField txtAutor; diff --git a/src/telas/Menu.form b/src/telas/Menu.form index f8fee9f..183e4d2 100644 --- a/src/telas/Menu.form +++ b/src/telas/Menu.form @@ -17,7 +17,7 @@ <Property name="defaultCloseOperation" type="int" value="3"/> <Property name="title" type="java.lang.String" value="Menu principal"/> <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> - <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/logo_digitalbooks03_small3.png")).getImage()" type="code"/> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/logo_128.png")).getImage()" type="code"/> </Property> </Properties> <SyntheticProperties> @@ -39,10 +39,7 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - </Group> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> </Group> </DimensionLayout> <DimensionLayout dim="1"> @@ -61,146 +58,136 @@ <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"/> - </Property> - <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> - </Property> - <Property name="text" type="java.lang.String" value="Você entrou como cliente"/> - </Properties> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="220" y="20" width="-1" height="-1"/> - </Constraint> - </Constraints> - </Component> - <Component class="javax.swing.JLabel" name="lblBookStockManager"> - <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="80" 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="BookStock"/> + <Property name="text" type="java.lang.String" value="Você entrou como cliente"/> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="1580" y="210" width="-1" height="-1"/> + <AbsoluteConstraints x="210" y="-10" width="1060" height="100"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JToggleButton" name="btnAtualizarEstoque"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="36" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <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"> - <AbsoluteConstraints x="1160" y="570" width="400" height="130"/> + <AbsoluteConstraints x="1420" y="640" width="400" height="130"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JButton" name="btnVerCarrinho"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="36" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <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"> - <AbsoluteConstraints x="1160" y="390" width="400" height="130"/> + <AbsoluteConstraints x="1400" y="420" width="400" height="130"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JButton" name="btnPesquisar"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="36" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <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"> - <AbsoluteConstraints x="740" y="390" width="400" height="130"/> + <AbsoluteConstraints x="780" y="400" width="400" height="130"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JButton" name="btnFuncionario"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="36" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/technicalsupport_support_representative_person_people_man_1641_64.png"/> + <Image iconType="3" name="/imagens/simbolos/cavaleiro64.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"> - <AbsoluteConstraints x="310" y="570" width="400" height="130"/> + <AbsoluteConstraints x="110" y="640" width="400" height="130"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JButton" name="btnGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="36" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/customer_person_people_man_you_1625_64.png"/> + <Image iconType="3" name="/imagens/simbolos/rei64.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"> - <AbsoluteConstraints x="740" y="570" width="400" height="130"/> + <AbsoluteConstraints x="770" y="640" width="400" height="130"/> </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="Old London" size="36" 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"/> + <Image iconType="3" name="/imagens/simbolos/aventureiro64.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"> - <AbsoluteConstraints x="310" y="390" width="400" height="130"/> + <AbsoluteConstraints x="130" y="400" width="400" height="130"/> </Constraint> </Constraints> </Component> @@ -250,38 +237,41 @@ </Constraint> </Constraints> </Component> - <Component class="javax.swing.JLabel" name="jLabel1"> + <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="48" style="1"/> + <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="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="ff" green="ff" red="ff" type="rgb"/> + <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="Manager"/> + <Property name="text" type="java.lang.String" value="Fechar"/> </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="1600" y="260" width="-1" height="-1"/> + <AbsoluteConstraints x="1715" y="20" width="160" height="70"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JLabel" name="lblLogo"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/livro01.png"/> + <Image iconType="3" name="/imagens/logo256.png"/> </Property> </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="1460" y="0" width="390" height="210"/> + <AbsoluteConstraints x="860" y="100" width="-1" height="250"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JLabel" name="lblImagem"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/madeira-background.jpg"/> + <Image iconType="3" name="/imagens/Telas/Menu.png"/> </Property> </Properties> <AccessibilityProperties> @@ -289,7 +279,7 @@ </AccessibilityProperties> <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="1190"/> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> </Constraint> </Constraints> </Component> diff --git a/src/telas/Menu.java b/src/telas/Menu.java index e826e3a..4ce736b 100644 --- a/src/telas/Menu.java +++ b/src/telas/Menu.java @@ -6,6 +6,7 @@ import classes.Cliente; import static classes.Cliente.listaClientes; +import classes.Estoque; import static classes.Estoque.estoque; import classes.Funcionario; import static classes.Funcionario.listaFuncionarios; @@ -13,6 +14,7 @@ import classes.Produto; import javax.swing.JOptionPane; import static telas.cadastarGerente.listaGerente; +import static telas.cadastros.cadastrosFlag; //import static telas.cadastrarCliente.listaClientes; //import static telas.cadastrarFuncionario.listaFuncionarios; @@ -25,7 +27,8 @@ public class Menu extends javax.swing.JFrame { static boolean logado = false; - static String user;// 'gerente','funcionario','cliente' + static String user="anonimo";// 'gerente','funcionario','cliente' + Estoque estoqueLoja = new Estoque(); /** @@ -39,6 +42,7 @@ public Menu() { this.setExtendedState(MAXIMIZED_BOTH); verificarLogin(logado, user); criarContasIniciais(); + atualizarBotoes(); } /** * This method is called from within the constructor to initialize the form. @@ -54,10 +58,23 @@ public void criarContasIniciais(){ 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"); + Cliente cliente = new Cliente("user","000.000.000-00","user@gmail.com","user","Pernambuco","10/05/1990","99999-9999"); listaClientes.add(cliente); + Cliente cliente1 = new Cliente("Alberto","010.034.123-00","alberto@gmail.com","alberto","Brasília","15/12/2000","88888-8888"); + listaClientes.add(cliente1); + Produto produto1 = new Produto("Eragon","Christopher Paolini","Aventura",15.69,3,"1","Eragon se torna um cavaleiro de Dragão"); - estoque.add(produto1); + estoqueLoja.addEstoque(produto1); + Produto produto2 = new Produto("Diario de um banana","Jeff Kiney","Comédia",10.40,5,"2","Diário de Greg Heffley"); + estoqueLoja.addEstoque(produto2); + Produto produto3 = new Produto("Eldest","Christopher Paolini","Aventura",20.69,6,"3","Eragon e Murtagh lutam na campina ardente"); + estoqueLoja.addEstoque(produto3); + Produto produto4 = new Produto("Brisingr","Christopher Paolini","Aventura",18.29,6,"4","Eragon treina com Oromis"); + estoqueLoja.addEstoque(produto4); + Produto produto5 = new Produto("Herança","Christopher Paolini","Aventura",24.89,6,"5","Eragon luta contra o Rei Galbatorix"); + estoqueLoja.addEstoque(produto5); + + } } @@ -103,7 +120,54 @@ public void atualizarLogin(){ lblLogin.setVisible(false); } } + public void atualizarBotoes(){ + if(logado==true){ + if(user.equals("")){ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.setText("Área do Funcionário"); + 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); + + } + } // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { @@ -111,7 +175,6 @@ private void initComponents() { jLabel2 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); lblLogin = new javax.swing.JLabel(); - lblBookStockManager = new javax.swing.JLabel(); btnAtualizarEstoque = new javax.swing.JToggleButton(); btnVerCarrinho = new javax.swing.JButton(); btnPesquisar = new javax.swing.JButton(); @@ -120,7 +183,7 @@ private void initComponents() { btnCliente = new javax.swing.JButton(); btnLogout = new javax.swing.JButton(); btnLogin = new javax.swing.JButton(); - jLabel1 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); lblLogo = new javax.swing.JLabel(); lblImagem = new javax.swing.JLabel(); @@ -130,79 +193,80 @@ private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Menu principal"); - setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/logo_digitalbooks03_small3.png")).getImage()); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/logo_128.png")).getImage()); jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - lblLogin.setFont(new java.awt.Font("Segoe UI", 1, 48)); // NOI18N - lblLogin.setForeground(new java.awt.Color(255, 0, 0)); + lblLogin.setFont(new java.awt.Font("Old London", 1, 80)); // NOI18N + lblLogin.setForeground(new java.awt.Color(255, 255, 255)); lblLogin.setText("Você entrou como cliente"); - jPanel1.add(lblLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 20, -1, -1)); + jPanel1.add(lblLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(210, -10, 1060, 100)); - lblBookStockManager.setFont(new java.awt.Font("Segoe UI", 1, 48)); // NOI18N - lblBookStockManager.setForeground(new java.awt.Color(255, 255, 255)); - lblBookStockManager.setText("BookStock"); - jPanel1.add(lblBookStockManager, new org.netbeans.lib.awtextra.AbsoluteConstraints(1580, 210, -1, -1)); - - btnAtualizarEstoque.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N + btnAtualizarEstoque.setFont(new java.awt.Font("Old London", 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); } }); - jPanel1.add(btnAtualizarEstoque, new org.netbeans.lib.awtextra.AbsoluteConstraints(1160, 570, 400, 130)); + jPanel1.add(btnAtualizarEstoque, new org.netbeans.lib.awtextra.AbsoluteConstraints(1420, 640, 400, 130)); - btnVerCarrinho.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N + btnVerCarrinho.setFont(new java.awt.Font("Old London", 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); } }); - jPanel1.add(btnVerCarrinho, new org.netbeans.lib.awtextra.AbsoluteConstraints(1160, 390, 400, 130)); + jPanel1.add(btnVerCarrinho, new org.netbeans.lib.awtextra.AbsoluteConstraints(1400, 420, 400, 130)); - btnPesquisar.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N + btnPesquisar.setFont(new java.awt.Font("Old London", 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); } }); - jPanel1.add(btnPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 390, 400, 130)); + jPanel1.add(btnPesquisar, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 400, 400, 130)); - 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.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N + btnFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/cavaleiro64.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); } }); - jPanel1.add(btnFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 570, 400, 130)); + jPanel1.add(btnFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 640, 400, 130)); - 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.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N + btnGerente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/rei64.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); } }); - jPanel1.add(btnGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 570, 400, 130)); + jPanel1.add(btnGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(770, 640, 400, 130)); - btnCliente.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N - btnCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/person_user_customer_man_male_man_boy_people_1687_64.png"))); // NOI18N + btnCliente.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N + btnCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/aventureiro64.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); } }); - jPanel1.add(btnCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 390, 400, 130)); + jPanel1.add(btnCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 400, 400, 130)); 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 @@ -228,25 +292,28 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); jPanel1.add(btnLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 200, 70)); - jLabel1.setFont(new java.awt.Font("Segoe UI", 1, 48)); // NOI18N - jLabel1.setForeground(new java.awt.Color(255, 255, 255)); - jLabel1.setText("Manager"); - jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(1600, 260, -1, -1)); + jButton1.setBackground(new java.awt.Color(255, 0, 0)); + jButton1.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + jButton1.setText("Fechar"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(1715, 20, 160, 70)); - lblLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/livro01.png"))); // NOI18N - jPanel1.add(lblLogo, new org.netbeans.lib.awtextra.AbsoluteConstraints(1460, 0, 390, 210)); + lblLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/logo256.png"))); // NOI18N + jPanel1.add(lblLogo, new org.netbeans.lib.awtextra.AbsoluteConstraints(860, 100, -1, 250)); - lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/madeira-background.jpg"))); // NOI18N - jPanel1.add(lblImagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, 1190)); + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/Menu.png"))); // NOI18N + jPanel1.add(lblImagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); lblImagem.getAccessibleContext().setAccessibleName(""); 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) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -261,7 +328,9 @@ private void btnLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR logado=false; user=""; verificarLogin(logado,user); - JOptionPane.showMessageDialog(null,"Você acabou de sair do sistema", "Mensagem",JOptionPane.PLAIN_MESSAGE); + JOptionPane.showMessageDialog(null,"Você acabou de sair do sistema", "Mensagem",JOptionPane.INFORMATION_MESSAGE); + atualizarBotoes(); + }//GEN-LAST:event_btnLogoutActionPerformed @@ -288,15 +357,23 @@ private void btnClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI if(logado==true){ if(user.equals("gerente") || user.equals("funcionario")){ - JOptionPane.showMessageDialog(null,"Você tem acesso a criar nova conta de cliente","Notificação de acesso a cliente",JOptionPane.ERROR_MESSAGE); - new cadastrarCliente().setVisible(true); + //JOptionPane.showMessageDialog(null,"Você tem acesso a criar nova conta de cliente","Notificação de acesso a cliente",JOptionPane.ERROR_MESSAGE); + int response = JOptionPane.showConfirmDialog(null, "Gostaria de criar uma nova conta como Cliente?","Confirmação",JOptionPane.YES_NO_OPTION); + if(response==JOptionPane.YES_OPTION){ + cadastrosFlag = "cliente"; + new cadastros().setVisible(true); + } }else{ new areaCliente().setVisible(true); } }else{ - JOptionPane.showMessageDialog(null,"Você não entrou no sistema. Crie uma nova conta como Cliente", "Mensagem",JOptionPane.PLAIN_MESSAGE); + int response = JOptionPane.showConfirmDialog(null, "Você não entrou no sistema. Gostaria de criar uma nova conta como Cliente?","Confirmação",JOptionPane.YES_NO_OPTION); + if(response==JOptionPane.YES_OPTION){ + new cadastros().setVisible(true); + user="anonimo"; + } - new cadastrarCliente().setVisible(true); + //new cadastrarCliente().setVisible(true); } }//GEN-LAST:event_btnClienteActionPerformed @@ -313,8 +390,13 @@ private void btnFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GE if(logado==true){ if( user.equals("gerente")){ - new cadastrarFuncionario().setVisible(true); + int response = JOptionPane.showConfirmDialog(null, "Gostaria de criar uma nova conta como Funcionário?","Confirmação",JOptionPane.YES_NO_OPTION); + if(response==JOptionPane.YES_OPTION){ + cadastrosFlag = "funcionario"; + new cadastros().setVisible(true); + } }else if(user.equals("funcionario")){ + //cadastrosFlag="funcionario"; new areaFuncionario().setVisible(true); } else{ @@ -370,6 +452,11 @@ private void btnAtualizarEstoqueActionPerformed(java.awt.event.ActionEvent evt) } }//GEN-LAST:event_btnAtualizarEstoqueActionPerformed + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + // TODO add your handling code here: + System.exit(0); + }//GEN-LAST:event_jButton1ActionPerformed + /** * @param args the command line arguments */ @@ -414,11 +501,10 @@ public void run() { private javax.swing.JButton btnLogout; private javax.swing.JButton btnPesquisar; private javax.swing.JButton btnVerCarrinho; - private javax.swing.JLabel jLabel1; + private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel2; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JPanel jPanel1; - private javax.swing.JLabel lblBookStockManager; private javax.swing.JLabel lblImagem; private javax.swing.JLabel lblLogin; private javax.swing.JLabel lblLogo; diff --git a/src/telas/areaCliente.form b/src/telas/areaCliente.form index 87778c9..889c0ec 100644 --- a/src/telas/areaCliente.form +++ b/src/telas/areaCliente.form @@ -4,6 +4,9 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Área do cliente"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/aventureiro64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -19,216 +22,206 @@ <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,51"/> </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="262" max="-2" attributes="0"/> - <Component id="lblAreaCliente" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> - <Component id="jPanel1" min="-2" pref="628" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace pref="32" max="32767" attributes="0"/> - </Group> - <Component id="jSeparator1" max="32767" attributes="0"/> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="lblAreaCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jSeparator1" min="-2" pref="10" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace 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> + <Component class="javax.swing.JButton" name="btnCarrinhosAnteriores"> + <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="Acessar Carrinhos Anteriores"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCarrinhosAnterioresActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="70" y="270" width="-1" height="70"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JButton" name="btnSair"> + <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="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1660" y="30" width="130" height="60"/> + </Constraint> + </Constraints> + </Component> <Container class="javax.swing.JPanel" name="jPanel1"> + <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="788" y="100" width="610" height="810"/> + </Constraint> + </Constraints> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" 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="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"/> - </Group> - </Group> - </Group> - </Group> - <EmptySpace min="-2" pref="45" 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"/> - <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"/> - </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"/> - <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"/> - </Group> - </Group> - </DimensionLayout> + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> </Layout> <SubComponents> <Component class="javax.swing.JLabel" name="lblDadosCliente"> <Properties> <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="24" style="1"/> </Property> - <Property name="text" type="java.lang.String" value="meus dados"/> + <Property name="text" type="java.lang.String" value="Meus Dados"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="26" width="130" height="30"/> + </Constraint> + </Constraints> </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="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Nome"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="60" width="80" height="50"/> + </Constraint> + </Constraints> </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="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="CPF"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="270" width="70" height="70"/> + </Constraint> + </Constraints> </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="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="E-mail"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="130" width="100" height="50"/> + </Constraint> + </Constraints> </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="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Senha"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="360" width="130" height="50"/> + </Constraint> + </Constraints> </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="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Endereço"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="200" width="130" height="50"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JLabel" name="lblNascimentoCliente"> <Properties> - <Property name="text" type="java.lang.String" value="data de nascimento"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Data de nascimento"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="440" width="260" height="50"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JTextField" name="txtNomeCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="Nome do cliente"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNomeClienteActionPerformed"/> </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="110" width="560" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JTextField" name="txtEmailCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="email cadastrado"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="180" width="560" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JTextField" name="txtSenhaCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="senha do cliente"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="410" width="550" height="30"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JTextField" name="txtEnderecoCliente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="endereço salvo"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="250" width="550" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JButton" name="btnSalvarCliente"> <Properties> @@ -236,7 +229,7 @@ <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="18" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Salvar"/> <Property name="toolTipText" type="java.lang.String" value="salvar as alterações"/> @@ -244,6 +237,11 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarClienteActionPerformed"/> </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="230" y="730" width="-1" height="60"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JButton" name="btnAlterarCliente"> <Properties> @@ -251,7 +249,7 @@ <Color blue="0" green="ff" 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"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Alterar"/> <Property name="toolTipText" type="java.lang.String" value="alterar os dados"/> @@ -259,6 +257,11 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAlterarClienteActionPerformed"/> </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="20" y="730" width="-1" height="60"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JButton" name="btnCancelarCliente"> <Properties> @@ -266,7 +269,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="18" style="1"/> + <Font name="Old London" size="36" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Cancelar"/> <Property name="toolTipText" type="java.lang.String" value="cancelar a operação"/> @@ -274,11 +277,24 @@ <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarClienteActionPerformed"/> </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="430" y="730" width="-1" height="60"/> + </Constraint> + </Constraints> </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="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Celular"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="10" y="530" width="160" height="50"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JFormattedTextField" name="ftxNascimentoCliente"> <Properties> @@ -286,7 +302,15 @@ <Format format="##/##/####" subtype="-1" type="5"/> </Property> <Property name="toolTipText" type="java.lang.String" value="data de nascimento do cliente"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="484" width="550" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JFormattedTextField" name="ftxTelefone"> <Properties> @@ -294,7 +318,15 @@ <Format format="#####-####" subtype="-1" type="5"/> </Property> <Property name="toolTipText" type="java.lang.String" value="número de contato"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="20" y="590" width="560" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JFormattedTextField" name="txtCPFCliente"> <Properties> @@ -302,19 +334,54 @@ <Format format="###.###.###-##" subtype="-1" type="5"/> </Property> <Property name="toolTipText" type="java.lang.String" value="CPF do cliente"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="30" y="330" width="560" height="40"/> + </Constraint> + </Constraints> + </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="36" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Área do Cliente"/> </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="200" y="0" width="-1" height="50"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JSeparator" name="jSeparator1"> + <Properties> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="45" green="72" red="96" 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="0" y="60" width="610" height="10"/> + </Constraint> + </Constraints> </Component> </SubComponents> </Container> - <Component class="javax.swing.JLabel" name="lblAreaCliente"> + <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/Á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 19b4d9d..1eb4f93 100644 --- a/src/telas/areaCliente.java +++ b/src/telas/areaCliente.java @@ -5,7 +5,9 @@ package telas; import classes.Cliente; +import static classes.Cliente.index_cliente; import static classes.Cliente.listaClientes; +import javax.swing.JOptionPane; //import static telas.cadastrarCliente.listaClientes; /** @@ -25,7 +27,9 @@ public areaCliente() { btnSalvarCliente.setEnabled(false); btnCancelarCliente.setEnabled(false); loadClienteFields(); - + disableClienteFields(); + this.setExtendedState(MAXIMIZED_BOTH); + } @@ -85,6 +89,8 @@ public void loadClienteFields(){ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + btnCarrinhosAnteriores = new javax.swing.JButton(); + btnSair = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); lblDadosCliente = new javax.swing.JLabel(); lblNomeCliente = new javax.swing.JLabel(); @@ -106,40 +112,85 @@ private void initComponents() { txtCPFCliente = new javax.swing.JFormattedTextField(); 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"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/aventureiro64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - lblDadosCliente.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N - lblDadosCliente.setText("meus dados"); + btnCarrinhosAnteriores.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + btnCarrinhosAnteriores.setText("Acessar Carrinhos Anteriores"); + btnCarrinhosAnteriores.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCarrinhosAnterioresActionPerformed(evt); + } + }); + getContentPane().add(btnCarrinhosAnteriores, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 270, -1, 70)); + btnSair.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1660, 30, 130, 60)); + + jPanel1.setBackground(new java.awt.Color(211, 181, 143)); + jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + lblDadosCliente.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N + lblDadosCliente.setText("Meus Dados"); + jPanel1.add(lblDadosCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 26, 130, 30)); + + lblNomeCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblNomeCliente.setText("Nome"); + jPanel1.add(lblNomeCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 80, 50)); + lblCPFCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblCPFCliente.setText("CPF"); + jPanel1.add(lblCPFCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 270, 70, 70)); + lblEmailCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblEmailCliente.setText("E-mail"); + jPanel1.add(lblEmailCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 130, 100, 50)); + lblSenhaCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblSenhaCliente.setText("Senha"); + jPanel1.add(lblSenhaCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 360, 130, 50)); + lblEnderecoCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblEnderecoCliente.setText("Endereço"); + jPanel1.add(lblEnderecoCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 200, 130, 50)); - lblNascimentoCliente.setText("data de nascimento"); + lblNascimentoCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + lblNascimentoCliente.setText("Data de nascimento"); + jPanel1.add(lblNascimentoCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 440, 260, 50)); + txtNomeCliente.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtNomeCliente.setToolTipText("Nome do cliente"); txtNomeCliente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtNomeClienteActionPerformed(evt); } }); + jPanel1.add(txtNomeCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 110, 560, 40)); + txtEmailCliente.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtEmailCliente.setToolTipText("email cadastrado"); + jPanel1.add(txtEmailCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 180, 560, 40)); + txtSenhaCliente.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtSenhaCliente.setToolTipText("senha do cliente"); + jPanel1.add(txtSenhaCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 410, 550, 30)); + txtEnderecoCliente.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtEnderecoCliente.setToolTipText("endereço salvo"); + jPanel1.add(txtEnderecoCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 250, 550, 40)); btnSalvarCliente.setBackground(new java.awt.Color(51, 204, 0)); - btnSalvarCliente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnSalvarCliente.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N btnSalvarCliente.setText("Salvar"); btnSalvarCliente.setToolTipText("salvar as alterações"); btnSalvarCliente.addActionListener(new java.awt.event.ActionListener() { @@ -147,9 +198,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnSalvarClienteActionPerformed(evt); } }); + jPanel1.add(btnSalvarCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 730, -1, 60)); btnAlterarCliente.setBackground(new java.awt.Color(255, 255, 0)); - btnAlterarCliente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnAlterarCliente.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N btnAlterarCliente.setText("Alterar"); btnAlterarCliente.setToolTipText("alterar os dados"); btnAlterarCliente.addActionListener(new java.awt.event.ActionListener() { @@ -157,9 +209,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnAlterarClienteActionPerformed(evt); } }); + jPanel1.add(btnAlterarCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 730, -1, 60)); btnCancelarCliente.setBackground(new java.awt.Color(255, 0, 0)); - btnCancelarCliente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCancelarCliente.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N btnCancelarCliente.setText("Cancelar"); btnCancelarCliente.setToolTipText("cancelar a operação"); btnCancelarCliente.addActionListener(new java.awt.event.ActionListener() { @@ -167,8 +220,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelarClienteActionPerformed(evt); } }); + jPanel1.add(btnCancelarCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 730, -1, 60)); + lblCelularCliente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblCelularCliente.setText("Celular"); + jPanel1.add(lblCelularCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 530, 160, 50)); try { ftxNascimentoCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####"))); @@ -176,6 +232,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ex.printStackTrace(); } ftxNascimentoCliente.setToolTipText("data de nascimento do cliente"); + ftxNascimentoCliente.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jPanel1.add(ftxNascimentoCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 484, 550, 40)); try { ftxTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-####"))); @@ -183,6 +241,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ex.printStackTrace(); } ftxTelefone.setToolTipText("número de contato"); + ftxTelefone.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jPanel1.add(ftxTelefone, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 590, 560, 40)); try { txtCPFCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); @@ -190,124 +250,20 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ex.printStackTrace(); } txtCPFCliente.setToolTipText("CPF do cliente"); + txtCPFCliente.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + jPanel1.add(txtCPFCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 330, 560, 40)); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .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))) - .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() - .addContainerGap() - .addComponent(btnAlterarCliente) - .addGap(150, 150, 150) - .addComponent(btnSalvarCliente) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnCancelarCliente) - .addGap(63, 63, 63)) - ); - 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) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnAlterarCliente) - .addComponent(btnSalvarCliente) - .addComponent(btnCancelarCliente)) - .addContainerGap(14, Short.MAX_VALUE)) - ); - - lblAreaCliente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + lblAreaCliente.setFont(new java.awt.Font("Old London", 1, 36)); // NOI18N lblAreaCliente.setText("Área do Cliente"); + jPanel1.add(lblAreaCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 0, -1, 50)); + + jSeparator1.setForeground(new java.awt.Color(150, 114, 69)); + jPanel1.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 60, 610, 10)); - 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(262, 262, 262) - .addComponent(lblAreaCliente)) - .addGroup(layout.createSequentialGroup() - .addGap(30, 30, 30) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 628, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addContainerGap(32, Short.MAX_VALUE)) - .addComponent(jSeparator1) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(lblAreaCliente) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .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(788, 100, 610, 810)); + + 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)); pack(); }// </editor-fold>//GEN-END:initComponents @@ -335,12 +291,38 @@ private void btnCancelarClienteActionPerformed(java.awt.event.ActionEvent evt) { private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed // TODO add your handling code here: + Cliente cliente = listaClientes.get(index_cliente); + cliente.setNome(txtNomeCliente.getText()); + cliente.setCPF(txtCPFCliente.getText()); + cliente.setCelular(ftxTelefone.getText()); + cliente.setDataNascimento(ftxNascimentoCliente.getText()); + cliente.setEmail(txtEmailCliente.getText()); + cliente.setSenha(txtSenhaCliente.getText()); + cliente.setEndereco(txtEnderecoCliente.getText()); + + + + + + disableClienteFields(); btnAlterarCliente.setEnabled(true); btnCancelarCliente.setEnabled(false); btnSalvarCliente.setEnabled(false); + JOptionPane.showMessageDialog(null, "Dados atualizados com sucesso!", "Atualização de dados", JOptionPane.INFORMATION_MESSAGE); + }//GEN-LAST:event_btnSalvarClienteActionPerformed + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed + + private void btnCarrinhosAnterioresActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCarrinhosAnterioresActionPerformed + // TODO add your handling code here: + new verCarrinho().setVisible(true); + }//GEN-LAST:event_btnCarrinhosAnterioresActionPerformed + /** * @param args the command line arguments */ @@ -379,9 +361,12 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnAlterarCliente; private javax.swing.JButton btnCancelarCliente; + private javax.swing.JButton btnCarrinhosAnteriores; + private javax.swing.JButton btnSair; 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; diff --git a/src/telas/areaFuncionario.form b/src/telas/areaFuncionario.form index 9618935..7fc917a 100644 --- a/src/telas/areaFuncionario.form +++ b/src/telas/areaFuncionario.form @@ -4,6 +4,9 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Área do funcionário"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/cavaleiro64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -19,120 +22,157 @@ <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,54,0,0,7,-128"/> </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> + <Component class="javax.swing.JButton" name="btnSair"> + <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="Old London" size="48" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1650" y="10" width="130" height="60"/> + </Constraint> + </Constraints> + </Component> <Container class="javax.swing.JPanel" name="jPanel1"> + <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="540" 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> - <Group type="102" alignment="1" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblDadosFuncionario" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> <EmptySpace min="6" pref="6" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblCPFFuncionario" min="-2" max="-2" attributes="0"/> - <Component id="lblNomeFuncionario" min="-2" max="-2" attributes="0"/> - <Component id="lblEmailFuncionario" min="-2" max="-2" attributes="0"/> - <Component id="lblSenhaFuncionario" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblCodFuncionario" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </Group> - <EmptySpace pref="24" max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtEmailFuncionario" max="32767" attributes="0"/> - <Component id="txtCPFFuncionario" min="-2" pref="139" max="-2" attributes="0"/> - <Component id="txtNomeFuncionario" min="-2" pref="245" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="txtCPFFuncionario" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Component id="txtNomeFuncionario" min="-2" pref="494" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="22" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtEmailFuncionario" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblNomeFuncionario" min="-2" pref="87" max="-2" attributes="0"/> + <Component id="lblSenhaFuncionario" alignment="0" min="-2" pref="91" max="-2" attributes="0"/> + <Component id="lblEmailFuncionario" min="-2" pref="91" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Component id="txtSenhaFuncionario" min="-2" pref="486" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Component id="lblCPFFuncionario" min="-2" pref="87" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> </Group> - <EmptySpace min="-2" pref="314" max="-2" attributes="0"/> </Group> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtSenhaFuncionario" alignment="0" min="-2" pref="118" max="-2" attributes="0"/> - <Component id="txtCodigoFuncionario" min="-2" pref="185" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="txtCodigoFuncionario" alignment="1" min="-2" pref="497" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="btnAlterarFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="70" max="-2" attributes="0"/> + <Component id="btnSalvarFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="58" max="-2" attributes="0"/> + <Component id="btnCancelarFuncionario" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="lblDadosFuncionario" min="-2" pref="124" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="lblAreaFuncionario" min="-2" pref="286" max="-2" attributes="0"/> + </Group> + <Component id="lblCodFuncionario" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </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"/> - <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"> - <Component id="lblAreaFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="26" 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"/> - <Component id="txtNomeFuncionario" 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="lblCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblAreaFuncionario" min="-2" pref="53" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Component id="lblDadosFuncionario" min="-2" pref="40" max="-2" attributes="0"/> + </Group> </Group> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblNomeFuncionario" min="-2" pref="42" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblEmailFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtEmailFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> + <Component id="txtNomeFuncionario" min="-2" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblSenhaFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtSenhaFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> + <Component id="lblCPFFuncionario" min="-2" pref="50" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCPFFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblEmailFuncionario" min="-2" pref="42" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmailFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblSenhaFuncionario" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtSenhaFuncionario" min="-2" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblCodFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCodigoFuncionario" 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="btnAlterarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnSalvarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnCancelarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblCodFuncionario" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodigoFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="104" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnAlterarFuncionario" alignment="1" min="-2" pref="56" max="-2" attributes="0"/> + <Group type="103" alignment="1" groupAlignment="3" attributes="0"> + <Component id="btnCancelarFuncionario" alignment="3" min="-2" pref="58" max="-2" attributes="0"/> + <Component id="btnSalvarFuncionario" alignment="3" min="-2" pref="56" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace pref="44" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -141,58 +181,88 @@ <Component class="javax.swing.JLabel" name="lblDadosFuncionario"> <Properties> <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="24" style="0"/> </Property> <Property name="text" type="java.lang.String" value="meus dados"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblNomeFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Nome"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblCPFFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="CPF"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblEmailFuncionario"> <Properties> - <Property name="text" type="java.lang.String" value="e-mail"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Email"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblSenhaFuncionario"> <Properties> - <Property name="text" type="java.lang.String" value="senha"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Senha"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblCodFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Código de Funcionário"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtNomeFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="Nome do funcionário"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtCPFFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="CPF do funcionário"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtEmailFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="email do funcionário"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtSenhaFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="senha do funcionário"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtCodigoFuncionario"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="código do funcionário"/> </Properties> </Component> @@ -202,7 +272,7 @@ <Color blue="0" green="ff" 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="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Alterar"/> <Property name="toolTipText" type="java.lang.String" value="Alterar algum dado"/> @@ -217,7 +287,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="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Cancelar"/> <Property name="toolTipText" type="java.lang.String" value="Cancelar a operação"/> @@ -232,7 +302,7 @@ <Color blue="0" green="ff" red="66" 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="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Salvar"/> <Property name="toolTipText" type="java.lang.String" value="salvar dados"/> @@ -244,12 +314,232 @@ <Component class="javax.swing.JLabel" name="lblAreaFuncionario"> <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="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Área do funcionário"/> </Properties> </Component> </SubComponents> </Container> + <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="90" y="170" width="600" height="410"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="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="jScrollPane3" alignment="0" min="-2" pref="579" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" max="-2" 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="176" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jFormattedTextField1" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnNovoCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="78" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="65" max="-2" attributes="0"/> + <Component id="btnExluirCliente" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="62" max="-2" attributes="0"/> + <Component id="btnBuscarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCodigoCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodCliente" pref="68" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="133" max="-2" attributes="0"/> + <Component id="lblControleClientes" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" 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"/> + <Component id="lblCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblCodigoCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jFormattedTextField1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="17" 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"/> + <Component id="btnBuscarCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + <Component id="jScrollPane3" pref="295" 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> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarClienteActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnNovoCliente"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="cc" green="ff" red="0" type="rgb"/> + </Property> + <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="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="33" type="rgb"/> + </Property> + <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="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <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> + <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..4ee3773 100644 --- a/src/telas/areaFuncionario.java +++ b/src/telas/areaFuncionario.java @@ -4,8 +4,13 @@ */ package telas; +import static classes.Cliente.listaClientes; import classes.Funcionario; +import static classes.Funcionario.index_func; import static classes.Funcionario.listaFuncionarios; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; +import static telas.cadastros.cadastrosFlag; //import static telas.cadastrarFuncionario.listaFuncionarios; /** @@ -25,6 +30,9 @@ public areaFuncionario() { btnSalvarFuncionario.setEnabled(false); btnCancelarFuncionario.setEnabled(false); loadFuncionarioFields(); + this.setExtendedState(MAXIMIZED_BOTH); + carregarTabelaCliente(); + setLocationRelativeTo(null); } @@ -64,6 +72,32 @@ 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 +108,7 @@ public void loadFuncionarioFields(){ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + btnSair = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); lblDadosFuncionario = new javax.swing.JLabel(); lblNomeFuncionario = new javax.swing.JLabel(); @@ -90,35 +125,74 @@ private void initComponents() { btnCancelarFuncionario = new javax.swing.JButton(); btnSalvarFuncionario = new javax.swing.JButton(); lblAreaFuncionario = new javax.swing.JLabel(); + 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(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Área do funcionário"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/cavaleiro64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + btnSair.setBackground(new java.awt.Color(255, 0, 0)); + btnSair.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1650, 10, 130, 60)); - lblDadosFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + jPanel1.setBackground(new java.awt.Color(211, 181, 143)); + + lblDadosFuncionario.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N lblDadosFuncionario.setText("meus dados"); + lblNomeFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblNomeFuncionario.setText("Nome"); + lblCPFFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblCPFFuncionario.setText("CPF"); - lblEmailFuncionario.setText("e-mail"); + lblEmailFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + lblEmailFuncionario.setText("Email"); - lblSenhaFuncionario.setText("senha"); + lblSenhaFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + lblSenhaFuncionario.setText("Senha"); + lblCodFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblCodFuncionario.setText("Código de Funcionário"); + txtNomeFuncionario.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtNomeFuncionario.setToolTipText("Nome do funcionário"); + txtCPFFuncionario.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtCPFFuncionario.setToolTipText("CPF do funcionário"); + txtEmailFuncionario.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtEmailFuncionario.setToolTipText("email do funcionário"); + txtSenhaFuncionario.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtSenhaFuncionario.setToolTipText("senha do funcionário"); + txtCodigoFuncionario.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N txtCodigoFuncionario.setToolTipText("código do funcionário"); btnAlterarFuncionario.setBackground(new java.awt.Color(255, 255, 0)); - btnAlterarFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnAlterarFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N btnAlterarFuncionario.setText("Alterar"); btnAlterarFuncionario.setToolTipText("Alterar algum dado"); btnAlterarFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -128,7 +202,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); btnCancelarFuncionario.setBackground(new java.awt.Color(255, 0, 0)); - btnCancelarFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnCancelarFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N btnCancelarFuncionario.setText("Cancelar"); btnCancelarFuncionario.setToolTipText("Cancelar a operação"); btnCancelarFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -138,7 +212,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); btnSalvarFuncionario.setBackground(new java.awt.Color(102, 255, 0)); - btnSalvarFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnSalvarFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N btnSalvarFuncionario.setText("Salvar"); btnSalvarFuncionario.setToolTipText("salvar dados"); btnSalvarFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -147,7 +221,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - lblAreaFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + lblAreaFuncionario.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblAreaFuncionario.setText("Área do funcionário"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); @@ -155,92 +229,236 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { 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) - .addComponent(lblDadosFuncionario) - .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(6, 6, 6) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblCPFFuncionario) - .addComponent(lblNomeFuncionario) - .addComponent(lblEmailFuncionario) - .addComponent(lblSenhaFuncionario) - .addComponent(lblCodFuncionario)))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 24, Short.MAX_VALUE) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtEmailFuncionario) - .addComponent(txtCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGap(314, 314, 314)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(txtCPFFuncionario, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 494, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 22, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtEmailFuncionario) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblEmailFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(txtSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 486, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE))))) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(lblCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)))) .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(txtSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) - .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) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 497, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnAlterarFuncionario) + .addGap(70, 70, 70) + .addComponent(btnSalvarFuncionario) + .addGap(58, 58, 58) + .addComponent(btnCancelarFuncionario)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblDadosFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(lblAreaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 286, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblCodFuncionario))) + .addGap(0, 0, Short.MAX_VALUE)))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(lblAreaFuncionario) - .addGap(26, 26, 26) - .addComponent(lblDadosFuncionario) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblNomeFuncionario) - .addComponent(txtNomeFuncionario, 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(lblCPFFuncionario) - .addComponent(txtCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblAreaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(22, 22, 22) + .addComponent(lblDadosFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblEmailFuncionario) - .addComponent(txtEmailFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblSenhaFuncionario) - .addComponent(txtSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblEmailFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmailFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtSenhaFuncionario, 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(lblCodFuncionario) - .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnAlterarFuncionario) - .addComponent(btnSalvarFuncionario) - .addComponent(btnCancelarFuncionario)) - .addContainerGap(44, Short.MAX_VALUE)) + .addComponent(lblCodFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(104, 104, 104) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnAlterarFuncionario, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCancelarFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSalvarFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(28, 28, 28)) ); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(830, 210, 540, 700)); + + 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"); + btnBuscarCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarClienteActionPerformed(evt); + } + }); + + btnNovoCliente.setBackground(new java.awt.Color(0, 255, 204)); + 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.setBackground(new java.awt.Color(51, 255, 0)); + 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.setBackground(new java.awt.Color(102, 102, 102)); + 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() .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)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 579, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(lblNomeCliente) + .addGap(18, 18, 18) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblCPFCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jFormattedTextField1)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(btnNovoCliente) + .addGap(78, 78, 78) + .addComponent(btnSalvarCliente) + .addGap(65, 65, 65) + .addComponent(btnExluirCliente))) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(62, 62, 62) + .addComponent(btnBuscarCliente) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblCodigoCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(133, 133, 133) + .addComponent(lblControleClientes))) + .addContainerGap()) ); - 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)) + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .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) + .addComponent(lblCPFCliente) + .addComponent(lblCodigoCliente) + .addComponent(txtCodCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(17, 17, 17) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnNovoCliente) + .addComponent(btnSalvarCliente) + .addComponent(btnExluirCliente) + .addComponent(btnBuscarCliente)) + .addGap(8, 8, 8) + .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)) ); + getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 170, 600, 410)); + + 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 @@ -264,12 +482,55 @@ private void btnCancelarFuncionarioActionPerformed(java.awt.event.ActionEvent ev private void btnSalvarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarFuncionarioActionPerformed // TODO add your handling code here: + Funcionario funcionario = listaFuncionarios.get(index_func); + funcionario.setNome(txtNomeFuncionario.getText()); + funcionario.setCPF(txtCPFFuncionario.getText()); + funcionario.setEmail(txtEmailFuncionario.getText()); + funcionario.setSenha(txtSenhaFuncionario.getText()); + disableFuncionarioFields(); btnAlterarFuncionario.setEnabled(true); btnSalvarFuncionario.setEnabled(false); btnCancelarFuncionario.setEnabled(false); + JOptionPane.showMessageDialog(null, "Dados atualizados com sucesso!", "Atualização de dados", JOptionPane.INFORMATION_MESSAGE); + }//GEN-LAST:event_btnSalvarFuncionarioActionPerformed + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed + + private void btnNovoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoClienteActionPerformed + // TODO add your handling code here: + + cadastrosFlag="cliente"; + new cadastros().setVisible(true); + 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 + + private void btnBuscarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarClienteActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_btnBuscarClienteActionPerformed + /** * @param args the command line arguments */ @@ -307,19 +568,35 @@ 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 btnSair; + 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 5308d3c..4411f23 100644 --- a/src/telas/areaGerente.form +++ b/src/telas/areaGerente.form @@ -27,6 +27,9 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Área do Gerente"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/rei64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -49,6 +52,25 @@ <Property name="useNullLayout" type="boolean" value="false"/> </Layout> <SubComponents> + <Component class="javax.swing.JButton" name="btnSair"> + <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="Old London" size="48" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1780" y="10" width="130" height="60"/> + </Constraint> + </Constraints> + </Component> <Container class="javax.swing.JPanel" name="jPanel1"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> @@ -57,7 +79,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="220" width="530" height="670"/> </Constraint> </Constraints> @@ -303,7 +325,7 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="910" y="220" width="870" height="380"/> + <AbsoluteConstraints x="850" y="30" width="980" height="420"/> </Constraint> </Constraints> @@ -342,9 +364,9 @@ <Component id="lblIdFuncionario" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtCodigoFuncionario" min="-2" pref="124" max="-2" attributes="0"/> - <EmptySpace pref="59" max="32767" attributes="0"/> + <EmptySpace pref="101" max="32767" attributes="0"/> <Component id="btnBuscarFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="83" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -377,7 +399,7 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="jScrollPane1" min="-2" pref="241" max="-2" attributes="0"/> - <EmptySpace pref="7" max="32767" attributes="0"/> + <EmptySpace pref="60" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -422,12 +444,12 @@ </Component> <Component class="javax.swing.JButton" name="btnNovoFuncionario"> <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="ff" red="33" type="rgb"/> + </Property> <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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/add_icon-icons.com_74429 (2).png"/> - </Property> <Property name="text" type="java.lang.String" value="Novo"/> <Property name="toolTipText" type="java.lang.String" value="Adicionar novo funcionário"/> </Properties> @@ -443,6 +465,9 @@ <Property name="text" type="java.lang.String" value="Buscar"/> <Property name="toolTipText" type="java.lang.String" value="Buscar pelo funcionário"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarFuncionarioActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JFormattedTextField" name="ftxCPFFuncionario"> <Properties> @@ -460,9 +485,9 @@ <Properties> <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> <Table columnCount="3" rowCount="4"> - <Column editable="true" title="Cód. Funcionário" type="java.lang.String"/> - <Column editable="true" title="Nome" type="java.lang.String"/> - <Column editable="true" title="CPF" type="java.lang.String"/> + <Column editable="false" title="Cód. Funcionário" type="java.lang.String"/> + <Column editable="false" title="Nome" type="java.lang.String"/> + <Column editable="false" title="CPF" type="java.lang.String"/> </Table> </Property> <Property name="toolTipText" type="java.lang.String" value="Tabela com os dados de funcionários"/> @@ -489,17 +514,20 @@ <TableHeader reorderingAllowed="true" resizingAllowed="true"/> </Property> </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblControleFuncionariosMouseClicked"/> + </Events> </Component> </SubComponents> </Container> <Component class="javax.swing.JButton" name="btnSalvarFuncionario"> <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="Old English Text MT" size="18" style="0"/> </Property> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/Save_37110.png"/> - </Property> <Property name="text" type="java.lang.String" value="Salvar"/> <Property name="toolTipText" type="java.lang.String" value="Salvar dados do funcionário"/> </Properties> @@ -509,15 +537,18 @@ </Component> <Component class="javax.swing.JButton" name="btnExcluirFuncionario"> <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> <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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/delete_4219.png"/> - </Property> <Property name="text" type="java.lang.String" value="Excluir"/> <Property name="toolTipText" type="java.lang.String" value="excluir funcionário"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcluirFuncionarioActionPerformed"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="lblControleFuncionarios"> <Properties> @@ -537,7 +568,7 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="840" y="660" width="940" height="390"/> + <AbsoluteConstraints x="780" y="520" width="990" height="450"/> </Constraint> </Constraints> @@ -556,7 +587,10 @@ <Group type="102" attributes="0"> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane3" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="jScrollPane3" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> <Group type="102" alignment="0" attributes="0"> <Group type="103" groupAlignment="1" attributes="0"> <Component id="lblControleClientes" min="-2" max="-2" attributes="0"/> @@ -574,11 +608,11 @@ </Group> <EmptySpace max="-2" attributes="0"/> <Component id="txtCodCliente" min="-2" pref="173" max="-2" attributes="0"/> - <EmptySpace pref="59" max="32767" attributes="0"/> + <EmptySpace pref="77" max="32767" attributes="0"/> <Component id="btnBuscarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -603,7 +637,7 @@ <Component id="btnExluirCliente" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jScrollPane3" pref="272" max="32767" attributes="0"/> + <Component id="jScrollPane3" pref="332" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -655,14 +689,23 @@ </Component> <Component class="javax.swing.JButton" name="btnNovoCliente"> <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="99" green="ff" red="33" type="rgb"/> + </Property> <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="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="Old English Text MT" size="18" style="0"/> </Property> @@ -674,11 +717,17 @@ </Component> <Component class="javax.swing.JButton" name="btnExluirCliente"> <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> <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"> @@ -688,11 +737,11 @@ <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"/> + <Column editable="false" title="Código Cliente" type="java.lang.String"/> + <Column editable="false" title="Nome" type="java.lang.String"/> + <Column editable="false" title="CPF" type="java.lang.String"/> + <Column editable="false" title="Data Nascimento" type="java.lang.String"/> + <Column editable="false" title="Endereço" type="java.lang.String"/> </Table> </Property> <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor"> @@ -743,7 +792,7 @@ <Component class="javax.swing.JLabel" name="lblBackground"> <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 94582c0..8b0bec5 100644 --- a/src/telas/areaGerente.java +++ b/src/telas/areaGerente.java @@ -7,8 +7,10 @@ import static classes.Cliente.listaClientes; import static classes.Funcionario.listaFuncionarios; import classes.Gerente; +import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import static telas.cadastarGerente.listaGerente; +import static telas.cadastros.cadastrosFlag; /** * @@ -108,6 +110,7 @@ private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); + btnSair = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); lblNomeGerente = new javax.swing.JLabel(); lblCPFGerente = new javax.swing.JLabel(); @@ -168,8 +171,19 @@ private void initComponents() { setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Área do Gerente"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/rei64.png")).getImage()); getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + btnSair.setBackground(new java.awt.Color(255, 0, 0)); + btnSair.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1780, 10, 130, 60)); + jPanel1.setBackground(new java.awt.Color(211, 181, 143)); lblNomeGerente.setFont(new java.awt.Font("Old English Text MT", 1, 36)); // NOI18N @@ -323,7 +337,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, 220, 530, 670)); jPanel2.setBackground(new java.awt.Color(211, 181, 143)); @@ -345,8 +359,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + btnNovoFuncionario.setBackground(new java.awt.Color(51, 255, 153)); btnNovoFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - btnNovoFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/add_icon-icons.com_74429 (2).png"))); // NOI18N btnNovoFuncionario.setText("Novo"); btnNovoFuncionario.setToolTipText("Adicionar novo funcionário"); btnNovoFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -358,6 +372,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnBuscarFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N btnBuscarFuncionario.setText("Buscar"); btnBuscarFuncionario.setToolTipText("Buscar pelo funcionário"); + btnBuscarFuncionario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarFuncionarioActionPerformed(evt); + } + }); try { ftxCPFFuncionario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); @@ -380,12 +399,24 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class }; + boolean[] canEdit = new boolean [] { + false, false, false + }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } }); tblControleFuncionarios.setToolTipText("Tabela com os dados de funcionários"); + tblControleFuncionarios.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tblControleFuncionariosMouseClicked(evt); + } + }); jScrollPane1.setViewportView(tblControleFuncionarios); if (tblControleFuncionarios.getColumnModel().getColumnCount() > 0) { tblControleFuncionarios.getColumnModel().getColumn(0).setPreferredWidth(3); @@ -393,8 +424,8 @@ public Class getColumnClass(int columnIndex) { tblControleFuncionarios.getColumnModel().getColumn(2).setPreferredWidth(14); } + btnSalvarFuncionario.setBackground(new java.awt.Color(0, 255, 0)); btnSalvarFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - btnSalvarFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/Save_37110.png"))); // NOI18N btnSalvarFuncionario.setText("Salvar"); btnSalvarFuncionario.setToolTipText("Salvar dados do funcionário"); btnSalvarFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -403,10 +434,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + btnExcluirFuncionario.setBackground(new java.awt.Color(102, 102, 102)); btnExcluirFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - btnExcluirFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/delete_4219.png"))); // NOI18N btnExcluirFuncionario.setText("Excluir"); btnExcluirFuncionario.setToolTipText("excluir funcionário"); + btnExcluirFuncionario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirFuncionarioActionPerformed(evt); + } + }); lblControleFuncionarios.setFont(new java.awt.Font("Old English Text MT", 1, 48)); // NOI18N lblControleFuncionarios.setText("Controle de funcionários"); @@ -444,9 +480,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(lblIdFuncionario) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 101, Short.MAX_VALUE) .addComponent(btnBuscarFuncionario) - .addGap(15, 15, 15)) + .addGap(83, 83, 83)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -472,10 +508,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(btnExcluirFuncionario)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(7, Short.MAX_VALUE)) + .addContainerGap(60, Short.MAX_VALUE)) ); - getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(910, 220, 870, 380)); + getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(850, 30, 980, 420)); jPanel3.setBackground(new java.awt.Color(211, 181, 143)); @@ -494,9 +530,16 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnBuscarCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N btnBuscarCliente.setText("Buscar"); + btnNovoCliente.setBackground(new java.awt.Color(51, 255, 153)); 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.setBackground(new java.awt.Color(0, 255, 0)); btnSalvarCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N btnSalvarCliente.setText("Salvar"); btnSalvarCliente.addActionListener(new java.awt.event.ActionListener() { @@ -505,8 +548,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + btnExluirCliente.setBackground(new java.awt.Color(102, 102, 102)); 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 [][] { @@ -522,10 +571,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { Class[] types = new Class [] { java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class }; + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } }); jScrollPane3.setViewportView(tblControleClientes); if (tblControleClientes.getColumnModel().getColumnCount() > 0) { @@ -557,7 +613,9 @@ public Class getColumnClass(int columnIndex) { .addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane3) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jScrollPane3) + .addContainerGap()) .addGroup(jPanel3Layout.createSequentialGroup() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(lblControleClientes) @@ -573,9 +631,9 @@ public Class getColumnClass(int columnIndex) { .addComponent(lblCodigoCliente))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtCodCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 59, Short.MAX_VALUE) - .addComponent(btnBuscarCliente))) - .addContainerGap()) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE) + .addComponent(btnBuscarCliente) + .addGap(38, 38, 38)))) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -596,12 +654,12 @@ public Class getColumnClass(int columnIndex) { .addComponent(btnSalvarCliente) .addComponent(btnExluirCliente)) .addGap(18, 18, 18) - .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 272, Short.MAX_VALUE)) + .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)) ); - getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(840, 660, 940, 390)); + getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 520, 990, 450)); - lblBackground.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/ÁreaGerente.png"))); // NOI18N + 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)); pack(); @@ -622,9 +680,17 @@ private void btnAlterarGerenteActionPerformed(java.awt.event.ActionEvent evt) {/ private void btnSalvarGerenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarGerenteActionPerformed // TODO add your handling code here: disableGerenteFields(); + Gerente gerente1 = listaGerente.get(0); + gerente1.setNome(txtNomeGerente.getText()); + gerente1.setCPF(ftxCPFGerente.getText()); + gerente1.setEmail(txtEmailGerente.getText()); + gerente1.setSenha(txtSenhaGerente.getText()); + gerente1.setCadastroGerente(txtIdGerente.getText()); btnAlterarGerente.setEnabled(true); btnSalvarGerente.setEnabled(false); btnCancelarGerente.setEnabled(false); + JOptionPane.showMessageDialog(null, "Dados atualizados com sucesso!", "Atualização de dados", JOptionPane.INFORMATION_MESSAGE); + }//GEN-LAST:event_btnSalvarGerenteActionPerformed private void btnCancelarGerenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarGerenteActionPerformed @@ -641,18 +707,21 @@ private void btnSalvarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) disableControleFuncionariosFields(); disableControleFuncionariosButtons(); btnNovoFuncionario.setEnabled(true); - + JOptionPane.showMessageDialog(null, "Dados atualizados com sucesso!", "Atualização de dados", JOptionPane.INFORMATION_MESSAGE); + carregarTabelaFuncionario(); + //btnPesquisarFuncionario.setEnabled(true); }//GEN-LAST:event_btnSalvarFuncionarioActionPerformed private void btnNovoFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoFuncionarioActionPerformed // TODO add your handling code here: //enableControleFuncionariosFields(); + cadastrosFlag="funcionario"; disableControleFuncionariosButtons(); btnSalvarFuncionario.setEnabled(true); //btnCancelarFuncionario.setEnabled(true); - new cadastrarFuncionario().setVisible(true); + new cadastros().setVisible(true); }//GEN-LAST:event_btnNovoFuncionarioActionPerformed private void txtCodigoFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtCodigoFuncionarioActionPerformed @@ -661,9 +730,62 @@ private void txtCodigoFuncionarioActionPerformed(java.awt.event.ActionEvent evt) private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed // TODO add your handling code here: + JOptionPane.showMessageDialog(null, "Dados atualizados com sucesso!", "Atualização de dados", JOptionPane.INFORMATION_MESSAGE); + 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 btnExcluirFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirFuncionarioActionPerformed + // TODO add your handling code here: + + int i = tblControleClientes.getSelectedRow(); + + if (i>=0 && i<listaFuncionarios.size()){ + + listaFuncionarios.remove(i); + + } + carregarTabelaFuncionario(); + }//GEN-LAST:event_btnExcluirFuncionarioActionPerformed + + private void btnNovoClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoClienteActionPerformed + // TODO add your handling code here: + cadastrosFlag="cliente"; + new cadastros().setVisible(true); + btnSalvarCliente.setEnabled(true); + + }//GEN-LAST:event_btnNovoClienteActionPerformed + + private void tblControleFuncionariosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblControleFuncionariosMouseClicked + // TODO add your handling code here: + + btnExcluirFuncionario.setEnabled(true); + }//GEN-LAST:event_tblControleFuncionariosMouseClicked + + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed + + private void btnBuscarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarFuncionarioActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_btnBuscarFuncionarioActionPerformed + /** * @param args the command line arguments */ @@ -781,6 +903,7 @@ public void enableControleFuncionariosFields(){ private javax.swing.JButton btnExluirCliente; private javax.swing.JButton btnNovoCliente; private javax.swing.JButton btnNovoFuncionario; + private javax.swing.JButton btnSair; private javax.swing.JButton btnSalvarCliente; private javax.swing.JButton btnSalvarFuncionario; private javax.swing.JButton btnSalvarGerente; diff --git a/src/telas/cadastrarCliente.form b/src/telas/cadastrarCliente.form index fe416fe..c1c254a 100644 --- a/src/telas/cadastrarCliente.form +++ b/src/telas/cadastrarCliente.form @@ -27,15 +27,20 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="276" max="32767" attributes="0"/> <Component id="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="29" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="184" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel1" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="286" max="32767" attributes="0"/> + </Group> </Group> </DimensionLayout> </Layout> @@ -46,76 +51,65 @@ <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> + <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtNomeCliente" min="-2" pref="111" max="-2" attributes="0"/> + <Component id="ftxCPFCliente" min="-2" pref="73" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> - <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <Component id="txtDataCliente" min="-2" pref="106" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="ftxDataCliente" min="-2" pref="76" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="lblEmailCliente" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblSenhaCliente" min="-2" max="-2" attributes="0"/> + <Component id="lblEnderecoCliente" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtNomeCliente" min="-2" pref="111" max="-2" attributes="0"/> - <Component id="ftxCPFCliente" min="-2" pref="73" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Component id="txtDataCliente" min="-2" pref="106" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="ftxDataCliente" min="-2" pref="76" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblEmailCliente" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="lblSenhaCliente" min="-2" max="-2" attributes="0"/> - <Component id="lblEnderecoCliente" min="-2" max="-2" attributes="0"/> - <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace 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="txtSenhaCliente" min="-2" pref="125" max="-2" attributes="0"/> - </Group> - <Component id="txtEnderecoCliente" min="-2" pref="221" max="-2" attributes="0"/> - </Group> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Component id="txtSenhaCliente" min="-2" pref="125" max="-2" attributes="0"/> </Group> + <Component id="txtEnderecoCliente" min="-2" pref="221" max="-2" attributes="0"/> </Group> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + <Component id="lblTelefoneCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxTelefoneCliente" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> - <Component id="lblTelefoneCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="ftxTelefoneCliente" min="-2" 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="btnCancelarCliente" min="-2" max="-2" attributes="0"/> - <Component id="txtEmailCliente" min="-2" pref="161" max="-2" attributes="0"/> - </Group> - </Group> + <Component id="btnCancelarCliente" min="-2" max="-2" attributes="0"/> + <Component id="txtEmailCliente" min="-2" pref="161" max="-2" attributes="0"/> </Group> </Group> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="235" max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - </Group> </Group> </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="lblTeste" min="-2" max="-2" attributes="0"/> - <Component id="btnVerify" min="-2" max="-2" attributes="0"/> - </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="235" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace pref="37" max="32767" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -147,13 +141,10 @@ <Component id="lblSenhaCliente" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtSenhaCliente" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace pref="23" max="32767" attributes="0"/> - <Component id="lblTeste" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnCancelarCliente" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnSalvarCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnVerify" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> </Group> @@ -281,19 +272,6 @@ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarClienteActionPerformed"/> </Events> </Component> - <Component class="javax.swing.JLabel" name="lblTeste"> - <Properties> - <Property name="text" type="java.lang.String" value="LabelDeTeste"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnVerify"> - <Properties> - <Property name="text" type="java.lang.String" value="Verify"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnVerifyActionPerformed"/> - </Events> - </Component> </SubComponents> </Container> </SubComponents> diff --git a/src/telas/cadastrarCliente.java b/src/telas/cadastrarCliente.java index 9802e5e..e17043f 100644 --- a/src/telas/cadastrarCliente.java +++ b/src/telas/cadastrarCliente.java @@ -21,7 +21,6 @@ public cadastrarCliente() { setLocationRelativeTo(null); - lblTeste.setVisible(false); } @@ -62,8 +61,6 @@ private void initComponents() { ftxCPFCliente = new javax.swing.JFormattedTextField(); btnCancelarCliente = new javax.swing.JButton(); btnSalvarCliente = new javax.swing.JButton(); - lblTeste = new javax.swing.JLabel(); - btnVerify = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Cadastrar Cliente"); @@ -140,15 +137,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - lblTeste.setText("LabelDeTeste"); - - btnVerify.setText("Verify"); - btnVerify.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnVerifyActionPerformed(evt); - } - }); - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( @@ -197,12 +185,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel1Layout.createSequentialGroup() .addGap(235, 235, 235) .addComponent(jLabel1))) - .addContainerGap(37, Short.MAX_VALUE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(72, 72, 72) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(lblTeste) - .addComponent(btnVerify)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( @@ -230,13 +212,10 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblSenhaCliente) .addComponent(txtSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE) - .addComponent(lblTeste) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnCancelarCliente) - .addComponent(btnSalvarCliente) - .addComponent(btnVerify)) + .addComponent(btnSalvarCliente)) .addGap(37, 37, 37)) ); @@ -244,13 +223,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(276, Short.MAX_VALUE) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(29, Short.MAX_VALUE)) + .addGap(184, 184, 184)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(286, Short.MAX_VALUE)) ); pack(); @@ -258,7 +241,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed // TODO add your handling code here: - + boolean jaExiste = false; if (txtNomeCliente.getText().equals("") || ftxCPFCliente.getText().equals("") || ftxDataCliente.getText().equals("") || txtEnderecoCliente.getText().equals("") || txtSenhaCliente.getText().equals("")|| txtEmailCliente.getText().equals("") @@ -273,29 +256,29 @@ private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {// String email = txtEmailCliente.getText(); String telefone = ftxTelefoneCliente.getText(); + for(Cliente pessoa : listaClientes){ + if(pessoa.getEmail().equals(email)){ + jaExiste=true; + JOptionPane.showMessageDialog(null, "Já existe um cliente cadastrado com esse Email!", "Error ao criar conta", JOptionPane.ERROR_MESSAGE); + break; + }else{ + + } + } + if(!jaExiste){ Cliente cliente = new Cliente(nome,cpf,email,senha,endereco,nascimentoCliente,telefone); listaClientes.add(cliente); clearClienteInfo(); JOptionPane.showMessageDialog(null,"Cliente criado com sucesso!", "Mensagem",JOptionPane.PLAIN_MESSAGE); this.setVisible(false); } + } }//GEN-LAST:event_btnSalvarClienteActionPerformed private void ftxCPFClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ftxCPFClienteActionPerformed // TODO add your handling code here: }//GEN-LAST:event_ftxCPFClienteActionPerformed - private void btnVerifyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerifyActionPerformed - // TODO add your handling code here: - if(listaClientes.size()>0){ - lblTeste.setVisible(true); - }else{ - lblTeste.setVisible(false); - } - - - }//GEN-LAST:event_btnVerifyActionPerformed - private void btnCancelarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarClienteActionPerformed // TODO add your handling code here: this.setVisible(false); @@ -340,7 +323,6 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancelarCliente; private javax.swing.JButton btnSalvarCliente; - private javax.swing.JButton btnVerify; private javax.swing.JFormattedTextField ftxCPFCliente; private javax.swing.JFormattedTextField ftxDataCliente; private javax.swing.JFormattedTextField ftxTelefoneCliente; @@ -352,7 +334,6 @@ public void run() { private javax.swing.JLabel lblNomeCliente; private javax.swing.JLabel lblSenhaCliente; private javax.swing.JLabel lblTelefoneCliente; - private javax.swing.JLabel lblTeste; private javax.swing.JLabel txtDataCliente; private javax.swing.JTextField txtEmailCliente; private javax.swing.JTextField txtEnderecoCliente; diff --git a/src/telas/cadastros.form b/src/telas/cadastros.form new file mode 100644 index 0000000..0a64893 --- /dev/null +++ b/src/telas/cadastros.form @@ -0,0 +1,809 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="3"/> + </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"/> + <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,54,0,0,7,125"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanelCriarItem"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="17" green="39" red="7b" 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="700" y="530" width="950" height="410"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="16" max="-2" attributes="0"/> + <Component id="jPanel6" 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 max="-2" attributes="0"/> + <Component id="jPanel6" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="37" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel6"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="dc" green="ed" red="f8" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="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"> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel5" 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="jLabel4" 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="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnCriarNovoItem" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="txtGenero" alignment="0" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel7" 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"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel8" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" 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" alignment="0" max="32767" attributes="0"/> + <Component id="jScrollPane1" alignment="0" min="-2" pref="262" max="-2" 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> + <EmptySpace min="53" pref="192" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="228" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodigoProduto" min="-2" pref="80" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="293" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" pref="60" max="32767" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodigoProduto" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" 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="txtTitulo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPreco" 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="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" 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" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtGenero" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jScrollPane1" alignment="0" 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 max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Criar novo Produto no sistema"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Título"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="text" type="java.lang.String" value="Autor"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="Gênero"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="text" type="java.lang.String" value="Preço"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="text" type="java.lang.String" value="Quantidade Estoque"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <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="jLabel10"> + <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> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanelCliente"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="17" green="39" red="7b" 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="10" y="240" width="610" height="400"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="28" 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="15" max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="18" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="dc" green="ed" red="f8" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="195" max="-2" attributes="0"/> + <Component id="lblTelefoneCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxTelefoneCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="112" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="lblEnderecoCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEnderecoCliente" min="-2" pref="221" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxCPFCliente" min="-2" pref="73" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> + <Component id="txtNomeCliente" min="-2" pref="111" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnCancelarCliente" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Component id="lblSenhaCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Component id="txtSenhaCliente" min="-2" pref="125" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Component id="lblEmailCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmailCliente" min="-2" pref="161" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="txtDataCliente" min="-2" pref="106" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="ftxDataCliente" min="-2" pref="76" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="95" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="88" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> + <Component id="jLabel2" 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="txtDataCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ftxDataCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblEmailCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmailCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblEnderecoCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEnderecoCliente" 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="lblSenhaCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSenhaCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ftxCPFCliente" 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="lblTelefoneCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ftxTelefoneCliente" 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="btnSalvarCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelarCliente" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="111" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <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="Cadastrar Cliente"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblNomeCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEmailCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="Email"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblCPFCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="CPF"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblSenhaCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEnderecoCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="Endereço"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblTelefoneCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="Telefone"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNomeCliente"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="insira o nome do cliente"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEmailCliente"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="insira o email do cliente"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtSenhaCliente"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="defina uma senha"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEnderecoCliente"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="insira o endereço do cliente"/> + </Properties> + </Component> + <Component class="javax.swing.JFormattedTextField" name="ftxTelefoneCliente"> + <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> + <Property name="toolTipText" type="java.lang.String" value="adicione o número de telefone"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="txtDataCliente"> + <Properties> + <Property name="text" type="java.lang.String" value="Data de nascimento"/> + </Properties> + </Component> + <Component class="javax.swing.JFormattedTextField" name="ftxDataCliente"> + <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> + <Property name="toolTipText" type="java.lang.String" value="insira a data de nascimento do cliente"/> + </Properties> + </Component> + <Component class="javax.swing.JFormattedTextField" name="ftxCPFCliente"> + <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> + <Property name="toolTipText" type="java.lang.String" value="insira o CPF do cliente"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ftxCPFClienteActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarCliente"> + <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="14" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Cancelar"/> + <Property name="toolTipText" type="java.lang.String" value="cancelar a operação"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarClienteActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvarCliente"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="66" type="rgb"/> + </Property> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="14" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Salvar"/> + <Property name="toolTipText" type="java.lang.String" value="Salvar dados do cliente"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarClienteActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanelFuncionario"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="17" green="39" red="7b" 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="850" y="180" width="770" height="280"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Component id="jPanel2" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="86" 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="16" max="-2" attributes="0"/> + <Component id="jPanel2" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="20" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="dc" green="ed" red="f8" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="222" max="-2" attributes="0"/> + <Component id="lblCadastroFuncionario" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblNomeFuncionario" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="lblCPFFuncionario" 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="txtNomeFuncionario" alignment="0" min="-2" pref="158" max="-2" attributes="0"/> + <Component id="ftxCPFFuncionario" alignment="0" min="-2" pref="105" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblEmailFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmailFuncionario" min="-2" pref="146" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblSenhaFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtSenhaFuncionario" min="-2" pref="148" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="178" max="-2" attributes="0"/> + <Component id="btnSalvarFuncionario" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="31" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblCodigoFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="-2" attributes="0"/> + <Component id="txtCodigoFuncionario" min="-2" pref="155" max="-2" attributes="0"/> + </Group> + <Component id="btnCancelarFuncionario" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <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"> + <Component id="lblCadastroFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="51" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblNomeFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblEmailFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNomeFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmailFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblCodigoFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCodigoFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblSenhaFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSenhaFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ftxCPFFuncionario" 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="btnSalvarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="37" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="lblCadastroFuncionario"> + <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="Cadastro de Funcionários"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblNomeFuncionario"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblCPFFuncionario"> + <Properties> + <Property name="text" type="java.lang.String" value="CPF"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEmailFuncionario"> + <Properties> + <Property name="text" type="java.lang.String" value="E-mail"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblSenhaFuncionario"> + <Properties> + <Property name="text" type="java.lang.String" value="Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblCodigoFuncionario"> + <Properties> + <Property name="text" type="java.lang.String" value="Código Funcionário"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNomeFuncionario"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="Insira o nome do funcionário"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEmailFuncionario"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="Insira o email do funcionário"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtSenhaFuncionario"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="Defina uma senha para o funcionário"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCodigoFuncionario"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="Insira o código de funcionário"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarFuncionario"> + <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="Cancelar"/> + <Property name="toolTipText" type="java.lang.String" value="Cancelar operação"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarFuncionarioActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvarFuncionario"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="ff" red="33" 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="Criar Funcionário"/> + <Property name="toolTipText" type="java.lang.String" value="Criar novo funcionário"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarFuncionarioActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JFormattedTextField" name="ftxCPFFuncionario"> + <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> + <Property name="toolTipText" type="java.lang.String" value="Insira o CPF do funcionário"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnSair"> + <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="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1740" y="20" width="130" height="60"/> + </Constraint> + </Constraints> + </Component> + <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/Cadastro.png"/> + </Property> + <Property name="text" type="java.lang.String" value="jLabel1"/> + </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/cadastros.java b/src/telas/cadastros.java new file mode 100644 index 0000000..6d93a05 --- /dev/null +++ b/src/telas/cadastros.java @@ -0,0 +1,839 @@ +/* + * 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 classes.Cliente; +import static classes.Cliente.listaClientes; +import static classes.Estoque.estoque; +import classes.Funcionario; +import static classes.Funcionario.listaFuncionarios; +import classes.Produto; +import javax.swing.JOptionPane; +import static telas.Menu.user; + +/** + * + * @author Yuri + */ +public class cadastros extends javax.swing.JFrame { + static String cadastrosFlag=""; + + /** + * Creates new form cadastros + */ + public cadastros() { + initComponents(); + setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); + System.out.println("cadastros flag está como: "+cadastrosFlag); + desabilitarTelas(); + inicializarTelas(); + txtCodigoProduto.setEnabled(false); + txtCodigoProduto.setText(String.valueOf(estoque.size())); + } + + public void clearClienteInfo(){ + txtNomeCliente.setText(""); + ftxCPFCliente.setText(""); + ftxDataCliente.setText(""); + txtEnderecoCliente.setText(""); + txtSenhaCliente.setText(""); + txtEmailCliente.setText(""); + ftxTelefoneCliente.setText(""); + } + + public void limparCampos(){ + txtNomeFuncionario.setText(""); + ftxCPFFuncionario.setText(""); + txtEmailFuncionario.setText(""); + txtSenhaFuncionario.setText(""); + txtCodigoFuncionario.setText(String.valueOf(listaFuncionarios.size())); + } + + public void desabilitarTelas(){ + jPanelCliente.setVisible(false); + jPanelFuncionario.setVisible(false); + jPanelCriarItem.setVisible(false); + } + + public void inicializarTelas(){ + if(((user.equals("gerente")|| user.equals("funcionario")||user.equals("cadastro"))&&cadastrosFlag.equals("cliente"))){ + System.out.println("User é cliente"); + jPanelCliente.setVisible(true); + } + else if(user.equals("gerente") && cadastrosFlag.equals("funcionario")){ + System.out.println("User é funcionário"); + jPanelFuncionario.setVisible(true); + } + else if((user.equals("gerente")|| user.equals("funcionario")&&cadastrosFlag.equals("criarItem"))){ + jPanelCriarItem.setVisible(true); + }else if(user.equals("anonimo")){ + System.out.println("User é anônimo"); + jPanelCliente.setVisible(true); + } + } + + /** + * 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() { + + jPanelCriarItem = new javax.swing.JPanel(); + jPanel6 = new javax.swing.JPanel(); + 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(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = 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(); + jLabel10 = new javax.swing.JLabel(); + txtCodigoProduto = new javax.swing.JTextField(); + jPanelCliente = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + lblNomeCliente = new javax.swing.JLabel(); + lblEmailCliente = new javax.swing.JLabel(); + lblCPFCliente = new javax.swing.JLabel(); + lblSenhaCliente = new javax.swing.JLabel(); + lblEnderecoCliente = new javax.swing.JLabel(); + lblTelefoneCliente = new javax.swing.JLabel(); + txtNomeCliente = new javax.swing.JTextField(); + txtEmailCliente = new javax.swing.JTextField(); + txtSenhaCliente = new javax.swing.JTextField(); + txtEnderecoCliente = new javax.swing.JTextField(); + ftxTelefoneCliente = new javax.swing.JFormattedTextField(); + txtDataCliente = new javax.swing.JLabel(); + ftxDataCliente = new javax.swing.JFormattedTextField(); + ftxCPFCliente = new javax.swing.JFormattedTextField(); + btnCancelarCliente = new javax.swing.JButton(); + btnSalvarCliente = new javax.swing.JButton(); + jPanelFuncionario = new javax.swing.JPanel(); + jPanel2 = new javax.swing.JPanel(); + lblCadastroFuncionario = new javax.swing.JLabel(); + lblNomeFuncionario = new javax.swing.JLabel(); + lblCPFFuncionario = new javax.swing.JLabel(); + lblEmailFuncionario = new javax.swing.JLabel(); + lblSenhaFuncionario = new javax.swing.JLabel(); + lblCodigoFuncionario = new javax.swing.JLabel(); + txtNomeFuncionario = new javax.swing.JTextField(); + txtEmailFuncionario = new javax.swing.JTextField(); + txtSenhaFuncionario = new javax.swing.JTextField(); + txtCodigoFuncionario = new javax.swing.JTextField(); + btnCancelarFuncionario = new javax.swing.JButton(); + btnSalvarFuncionario = new javax.swing.JButton(); + ftxCPFFuncionario = new javax.swing.JFormattedTextField(); + btnSair = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanelCriarItem.setBackground(new java.awt.Color(123, 57, 23)); + + jPanel6.setBackground(new java.awt.Color(248, 237, 220)); + + jLabel3.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel3.setText("Criar novo Produto no sistema"); + + jLabel4.setText("Título"); + + jLabel5.setText("Autor"); + + jLabel6.setText("Gênero"); + + jLabel7.setText("Preço"); + + jLabel8.setText("Quantidade Estoque"); + + jLabel9.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); + } + }); + + jLabel10.setText("Código Produto"); + jLabel10.setToolTipText(""); + + javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6); + jPanel6.setLayout(jPanel6Layout); + jPanel6Layout.setHorizontalGroup( + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel5) + .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(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel4) + .addGap(29, 29, 29) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnCriarNovoItem) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel7) + .addGap(97, 97, 97) + .addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel8) + .addComponent(jLabel9)) + .addGap(18, 18, 18) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtQuantiaEstoque) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(195, 195, 195) + .addComponent(btnCancelar))) + .addGap(53, 192, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jLabel3) + .addGap(228, 228, 228)))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel10) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodigoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(293, 293, 293)) + ); + jPanel6Layout.setVerticalGroup( + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE) + .addGap(18, 18, 18) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel10) + .addComponent(txtCodigoProduto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(jLabel7) + .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)) + .addGap(25, 25, 25) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(jLabel8) + .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(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(jLabel9) + .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(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCriarNovoItem) + .addComponent(btnCancelar)) + .addContainerGap()) + ); + + javax.swing.GroupLayout jPanelCriarItemLayout = new javax.swing.GroupLayout(jPanelCriarItem); + jPanelCriarItem.setLayout(jPanelCriarItemLayout); + jPanelCriarItemLayout.setHorizontalGroup( + jPanelCriarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelCriarItemLayout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanelCriarItemLayout.setVerticalGroup( + jPanelCriarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelCriarItemLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(37, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanelCriarItem, new org.netbeans.lib.awtextra.AbsoluteConstraints(700, 530, 950, 410)); + + jPanelCliente.setBackground(new java.awt.Color(123, 57, 23)); + + jPanel1.setBackground(new java.awt.Color(248, 237, 220)); + + jLabel2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + jLabel2.setText("Cadastrar Cliente"); + + lblNomeCliente.setText("Nome"); + + lblEmailCliente.setText("Email"); + + lblCPFCliente.setText("CPF"); + + lblSenhaCliente.setText("Senha"); + + lblEnderecoCliente.setText("Endereço"); + + lblTelefoneCliente.setText("Telefone"); + + txtNomeCliente.setToolTipText("insira o nome do cliente"); + + txtEmailCliente.setToolTipText("insira o email do cliente"); + + txtSenhaCliente.setToolTipText("defina uma senha"); + + txtEnderecoCliente.setToolTipText("insira o endereço do cliente"); + + try { + ftxTelefoneCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + ftxTelefoneCliente.setToolTipText("adicione o número de telefone"); + + txtDataCliente.setText("Data de nascimento"); + + try { + ftxDataCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + ftxDataCliente.setToolTipText("insira a data de nascimento do cliente"); + + try { + ftxCPFCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + ftxCPFCliente.setToolTipText("insira o CPF do cliente"); + ftxCPFCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + ftxCPFClienteActionPerformed(evt); + } + }); + + btnCancelarCliente.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelarCliente.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnCancelarCliente.setText("Cancelar"); + btnCancelarCliente.setToolTipText("cancelar a operação"); + btnCancelarCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarClienteActionPerformed(evt); + } + }); + + btnSalvarCliente.setBackground(new java.awt.Color(102, 255, 0)); + btnSalvarCliente.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + btnSalvarCliente.setText("Salvar"); + btnSalvarCliente.setToolTipText("Salvar dados do cliente"); + btnSalvarCliente.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarClienteActionPerformed(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(195, 195, 195) + .addComponent(lblTelefoneCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxTelefoneCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(112, 112, 112) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblEnderecoCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEnderecoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(lblCPFCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(8, 8, 8)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblNomeCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnSalvarCliente) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(btnCancelarCliente) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(40, 40, 40) + .addComponent(lblSenhaCliente) + .addGap(12, 12, 12) + .addComponent(txtSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblEmailCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmailCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(txtDataCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(ftxDataCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap(88, Short.MAX_VALUE)))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(95, 95, 95) + .addComponent(jLabel2) + .addContainerGap()))) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(13, 13, 13) + .addComponent(jLabel2) + .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(txtDataCliente) + .addComponent(ftxDataCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblEmailCliente) + .addComponent(txtEmailCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(15, 15, 15) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblEnderecoCliente) + .addComponent(txtEnderecoCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblSenhaCliente) + .addComponent(txtSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblCPFCliente) + .addComponent(ftxCPFCliente, 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(lblTelefoneCliente) + .addComponent(ftxTelefoneCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSalvarCliente) + .addComponent(btnCancelarCliente)) + .addContainerGap(111, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout jPanelClienteLayout = new javax.swing.GroupLayout(jPanelCliente); + jPanelCliente.setLayout(jPanelClienteLayout); + jPanelClienteLayout.setHorizontalGroup( + jPanelClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelClienteLayout.createSequentialGroup() + .addGap(23, 23, 23) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(28, Short.MAX_VALUE)) + ); + jPanelClienteLayout.setVerticalGroup( + jPanelClienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelClienteLayout.createSequentialGroup() + .addGap(15, 15, 15) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(18, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanelCliente, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 240, 610, 400)); + + jPanelFuncionario.setBackground(new java.awt.Color(123, 57, 23)); + + jPanel2.setBackground(new java.awt.Color(248, 237, 220)); + + lblCadastroFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + lblCadastroFuncionario.setText("Cadastro de Funcionários"); + + lblNomeFuncionario.setText("Nome"); + + lblCPFFuncionario.setText("CPF"); + + lblEmailFuncionario.setText("E-mail"); + + lblSenhaFuncionario.setText("Senha"); + + lblCodigoFuncionario.setText("Código Funcionário"); + + txtNomeFuncionario.setToolTipText("Insira o nome do funcionário"); + + txtEmailFuncionario.setToolTipText("Insira o email do funcionário"); + + txtSenhaFuncionario.setToolTipText("Defina uma senha para o funcionário"); + + txtCodigoFuncionario.setToolTipText("Insira o código de funcionário"); + + btnCancelarFuncionario.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelarFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCancelarFuncionario.setText("Cancelar"); + btnCancelarFuncionario.setToolTipText("Cancelar operação"); + btnCancelarFuncionario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarFuncionarioActionPerformed(evt); + } + }); + + btnSalvarFuncionario.setBackground(new java.awt.Color(51, 255, 0)); + btnSalvarFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnSalvarFuncionario.setText("Criar Funcionário"); + btnSalvarFuncionario.setToolTipText("Criar novo funcionário"); + btnSalvarFuncionario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarFuncionarioActionPerformed(evt); + } + }); + + try { + ftxCPFFuncionario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + ftxCPFFuncionario.setToolTipText("Insira o CPF do funcionário"); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(222, 222, 222) + .addComponent(lblCadastroFuncionario)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblNomeFuncionario) + .addComponent(lblCPFFuncionario)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(ftxCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(30, 30, 30) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblEmailFuncionario) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmailFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblSenhaFuncionario) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(178, 178, 178) + .addComponent(btnSalvarFuncionario))) + .addGap(31, 31, 31) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblCodigoFuncionario) + .addGap(0, 0, 0) + .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(btnCancelarFuncionario)))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(lblCadastroFuncionario) + .addGap(51, 51, 51) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblNomeFuncionario) + .addComponent(lblEmailFuncionario) + .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtEmailFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblCodigoFuncionario) + .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(37, 37, 37) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblCPFFuncionario) + .addComponent(lblSenhaFuncionario) + .addComponent(txtSenhaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(ftxCPFFuncionario, 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(btnSalvarFuncionario) + .addComponent(btnCancelarFuncionario)) + .addContainerGap(37, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout jPanelFuncionarioLayout = new javax.swing.GroupLayout(jPanelFuncionario); + jPanelFuncionario.setLayout(jPanelFuncionarioLayout); + jPanelFuncionarioLayout.setHorizontalGroup( + jPanelFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelFuncionarioLayout.createSequentialGroup() + .addGap(23, 23, 23) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(86, 86, 86)) + ); + jPanelFuncionarioLayout.setVerticalGroup( + jPanelFuncionarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelFuncionarioLayout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(20, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanelFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(850, 180, 770, 280)); + + btnSair.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1740, 20, 130, 60)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/Cadastro.png"))); // NOI18N + jLabel1.setText("jLabel1"); + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void ftxCPFClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ftxCPFClienteActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_ftxCPFClienteActionPerformed + + private void btnCancelarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarClienteActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnCancelarClienteActionPerformed + + private void btnSalvarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarClienteActionPerformed + // TODO add your handling code here: + boolean jaExiste = false; + if (txtNomeCliente.getText().equals("") || ftxCPFCliente.getText().equals("") || + ftxDataCliente.getText().equals("") || txtEnderecoCliente.getText().equals("") + || txtSenhaCliente.getText().equals("")|| txtEmailCliente.getText().equals("") + || ftxTelefoneCliente.getText().equals("")){ + JOptionPane.showMessageDialog(null,"Todos os campos devem ser inseridos!", "Mensagem",JOptionPane.PLAIN_MESSAGE); + }else{ + String nome = txtNomeCliente.getText(); + String cpf = ftxCPFCliente.getText(); + String nascimentoCliente = ftxDataCliente.getText(); + String endereco = txtEnderecoCliente.getText(); + String senha = txtSenhaCliente.getText(); + String email = txtEmailCliente.getText(); + String telefone = ftxTelefoneCliente.getText(); + + for(Cliente pessoa : listaClientes){ + if(pessoa.getEmail().equals(email)){ + jaExiste=true; + JOptionPane.showMessageDialog(null, "Já existe um cliente cadastrado com esse Email!", "Error ao criar conta", JOptionPane.ERROR_MESSAGE); + break; + }else{ + + } + } + if(!jaExiste){ + Cliente cliente = new Cliente(nome,cpf,email,senha,endereco,nascimentoCliente,telefone); + listaClientes.add(cliente); + clearClienteInfo(); + JOptionPane.showMessageDialog(null,"Cliente criado com sucesso!", "Mensagem",JOptionPane.PLAIN_MESSAGE); + this.setVisible(false); + } + } + }//GEN-LAST:event_btnSalvarClienteActionPerformed + + private void btnCancelarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarFuncionarioActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnCancelarFuncionarioActionPerformed + + private void btnSalvarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarFuncionarioActionPerformed + // TODO add your handling code here: + if (txtNomeFuncionario.getText().equals("") || ftxCPFFuncionario.getText().equals("") || + txtEmailFuncionario.getText().equals("") || txtSenhaFuncionario.getText().equals("") + || txtCodigoFuncionario.getText().equals("")){ + JOptionPane.showMessageDialog(null,"Todos os campos devem ser inseridos!", "Mensagem",JOptionPane.PLAIN_MESSAGE); + }else{ + String nome = txtNomeFuncionario.getText(); + String cpf = ftxCPFFuncionario.getText(); + String email = txtEmailFuncionario.getText(); + String senha = txtSenhaFuncionario.getText(); + String idFuncionario = txtCodigoFuncionario.getText(); + + Funcionario funcionario = new Funcionario(nome,cpf,email,senha,idFuncionario); + listaFuncionarios.add(funcionario); + JOptionPane.showMessageDialog(null,"Funcionário cadastrado com sucesso!", "Mensagem",JOptionPane.PLAIN_MESSAGE); + limparCampos(); + this.setVisible(false); + + } + }//GEN-LAST:event_btnSalvarFuncionarioActionPerformed + + 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 + + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed + + /** + * @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(cadastros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(cadastros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(cadastros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(cadastros.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 cadastros().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnCancelar; + private javax.swing.JButton btnCancelarCliente; + private javax.swing.JButton btnCancelarFuncionario; + private javax.swing.JButton btnCriarNovoItem; + private javax.swing.JButton btnSair; + private javax.swing.JButton btnSalvarCliente; + private javax.swing.JButton btnSalvarFuncionario; + private javax.swing.JFormattedTextField ftxCPFCliente; + private javax.swing.JFormattedTextField ftxCPFFuncionario; + private javax.swing.JFormattedTextField ftxDataCliente; + private javax.swing.JFormattedTextField ftxTelefoneCliente; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + 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.JLabel jLabel9; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel6; + private javax.swing.JPanel jPanelCliente; + private javax.swing.JPanel jPanelCriarItem; + private javax.swing.JPanel jPanelFuncionario; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JLabel lblCPFCliente; + private javax.swing.JLabel lblCPFFuncionario; + private javax.swing.JLabel lblCadastroFuncionario; + private javax.swing.JLabel lblCodigoFuncionario; + private javax.swing.JLabel lblEmailCliente; + private javax.swing.JLabel lblEmailFuncionario; + private javax.swing.JLabel lblEnderecoCliente; + private javax.swing.JLabel lblNomeCliente; + private javax.swing.JLabel lblNomeFuncionario; + private javax.swing.JLabel lblSenhaCliente; + private javax.swing.JLabel lblSenhaFuncionario; + private javax.swing.JLabel lblTelefoneCliente; + private javax.swing.JTextArea txtAreaDescricao; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextField txtCodigoFuncionario; + private javax.swing.JTextField txtCodigoProduto; + private javax.swing.JLabel txtDataCliente; + private javax.swing.JTextField txtEmailCliente; + private javax.swing.JTextField txtEmailFuncionario; + private javax.swing.JTextField txtEnderecoCliente; + private javax.swing.JTextField txtGenero; + private javax.swing.JTextField txtNomeCliente; + private javax.swing.JTextField txtNomeFuncionario; + private javax.swing.JTextField txtPreco; + private javax.swing.JTextField txtQuantiaEstoque; + private javax.swing.JTextField txtSenhaCliente; + private javax.swing.JTextField txtSenhaFuncionario; + private javax.swing.JTextField txtTitulo; + // End of variables declaration//GEN-END:variables +} diff --git a/src/telas/carrinhosAntigos.form b/src/telas/carrinhosAntigos.form index 4658861..3478dac 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"/> diff --git a/src/telas/carrinhosAntigos.java b/src/telas/carrinhosAntigos.java index 5e5d0c3..f3b5056 100644 --- a/src/telas/carrinhosAntigos.java +++ b/src/telas/carrinhosAntigos.java @@ -4,6 +4,18 @@ */ package telas; +import classes.Carrinho; + +import javax.swing.table.DefaultTableModel; +import classes.Cliente; +import static classes.Cliente.index_cliente; +import static classes.Cliente.listaClientes; +import classes.Funcionario; +import static classes.Funcionario.index_func; +import static classes.Funcionario.listaFuncionarios; +import java.util.ArrayList; +import static telas.Menu.user; + /** * * @author Yuri @@ -18,7 +30,17 @@ public carrinhosAntigos() { setLocationRelativeTo(null); disableCarrinhoFields(); btnCancelarCarrinho.setEnabled(false); - + System.out.println("User é igual a "+user); + if(user.equals("cliente")){ + carregarTabelaCliente(); + } + if(user.equals("funcionario")){ + carregarTabelaFuncionarioPedidos(); + } + if(user.equals("gerente")){ + + } + } public void enableCarrinhoFields(){ @@ -53,6 +75,72 @@ public void disableCarrinhoFields(){ lblCodRastreio.setEnabled(false); lblTotal.setEnabled(false); } + + private void carregarTabelaCliente(){ + DefaultTableModel modeloTabelaCarrinhosAntigos = new DefaultTableModel(new Object[] {"Num.Carrinho","Data Pedido","Produtos","Total"},0); + + Cliente cliente = listaClientes.get(index_cliente); + System.out.println("Cliente passado"); + ArrayList<Carrinho> listaCarrinhoDoCliente = cliente.getListaCarrinho(); + System.out.println("Tamanho da lista: "+cliente.getListaCarrinho().size()); + System.out.println("ListaResgatada"); + + for(int i=0;i<cliente.getListaCarrinho().size();i++){ + Object linha[] = new Object[] {cliente.getListaCarrinho().get(i).getNumCarrinho(), + cliente.getListaCarrinho().get(i).getData(), + cliente.getListaCarrinho().get(i).mostarProdutos(cliente.getListaCarrinho().get(i).itensNoCarrinho), + cliente.getListaCarrinho().get(i).getTotal()}; + modeloTabelaCarrinhosAntigos.addRow(linha); + + + } + //Tabela recebe modelo de clientes + tblCliente.setModel(modeloTabelaCarrinhosAntigos); + + tblCliente.getColumnModel().getColumn(0).setPreferredWidth(3); + tblCliente.getColumnModel().getColumn(1).setPreferredWidth(50); + tblCliente.getColumnModel().getColumn(2).setPreferredWidth(14); + tblCliente.getColumnModel().getColumn(3).setPreferredWidth(10); + //tblCliente.getColumnModel().getColumn(4).setPreferredWidth(100); + + + + } + private void carregarTabelaFuncionarioPedidos(){ + System.out.println("Está acessando a função de pedidos de funcionário!"); + DefaultTableModel modeloTabelaCarrinhosAntigos = new DefaultTableModel(new Object[] {"Num.Carrinho","Data Pedido","Produtos","Total"},0); + + Funcionario funcionario = listaFuncionarios.get(index_func); + ArrayList<Carrinho> listaCarrinhoDoFuncionario = funcionario.getListaCarrinhoFuncionario(); + + + Cliente cliente = listaClientes.get(index_cliente); + System.out.println("Cliente passado"); + ArrayList<Carrinho> listaCarrinhoDoCliente = cliente.getListaCarrinho(); + System.out.println("Tamanho da lista: "+cliente.getListaCarrinho().size()); + System.out.println("ListaResgatada"); + + for(int i=0;i<cliente.getListaCarrinho().size();i++){ + Object linha[] = new Object[] {funcionario.getListaCarrinhoFuncionario().get(i).getNumCarrinho(), + funcionario.getListaCarrinhoFuncionario().get(i).getData(), + funcionario.getListaCarrinhoFuncionario().get(i).mostarProdutos(funcionario.getListaCarrinho().get(i).itensNoCarrinho), + funcionario.getListaCarrinhoFuncionario().get(i).getTotal()}; + modeloTabelaCarrinhosAntigos.addRow(linha); + + + } + //Tabela recebe modelo de clientes + tblCliente.setModel(modeloTabelaCarrinhosAntigos); + + tblCliente.getColumnModel().getColumn(0).setPreferredWidth(3); + tblCliente.getColumnModel().getColumn(1).setPreferredWidth(50); + tblCliente.getColumnModel().getColumn(2).setPreferredWidth(14); + tblCliente.getColumnModel().getColumn(3).setPreferredWidth(10); + //tblCliente.getColumnModel().getColumn(4).setPreferredWidth(100); + + + + } /** * This method is called from within the constructor to initialize the form. diff --git a/src/telas/infoProduto.form b/src/telas/infoProduto.form new file mode 100644 index 0000000..54872ef --- /dev/null +++ b/src/telas/infoProduto.form @@ -0,0 +1,330 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <NonVisualComponents> + <Container class="javax.swing.JMenuBar" name="jMenuBar1"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="true"/> + </Layout> + <SubComponents> + <Menu class="javax.swing.JMenu" name="jMenu1"> + <Properties> + <Property name="text" type="java.lang.String" value="File"/> + </Properties> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu2"> + <Properties> + <Property name="text" type="java.lang.String" value="Edit"/> + </Properties> + </Menu> + </SubComponents> + </Container> + </NonVisualComponents> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="title" type="java.lang.String" value="Ficha do Produto"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/pesquisar64.png")).getImage()" type="code"/> + </Property> + </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"/> + <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,2,-32,0,0,2,-76"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="false"/> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="33" green="5f" red="91" 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="1" y="0" width="690" height="-1"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="21" max="32767" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="b6" green="e0" red="ed" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jScrollPane1" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel6" min="-2" pref="135" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" alignment="0" min="-2" pref="95" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Component id="jLabel3" alignment="0" pref="84" max="32767" attributes="0"/> + <Component id="jLabel2" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="51" pref="51" max="-2" attributes="0"/> + <Component id="txtTitulo" min="-2" pref="359" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtPreco" alignment="1" min="-2" pref="359" max="-2" attributes="0"/> + <Component id="txtAutor" alignment="1" min="-2" pref="359" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="126" max="32767" attributes="0"/> + <Component id="txtQuantidadeEstoque" min="-2" pref="223" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel5" min="-2" pref="99" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="txtGenero" min="-2" pref="244" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="158" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="211" max="-2" attributes="0"/> + <Component id="btnFecharJanela" 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"> + <Component id="jLabel7" min="-2" pref="60" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtTitulo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" pref="45" max="-2" attributes="0"/> + <Component id="txtAutor" 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="48" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" pref="55" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtPreco" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="1" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" pref="37" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtQuantidadeEstoque" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="43" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" pref="39" max="-2" attributes="0"/> + <Component id="txtGenero" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" pref="53" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnFecharJanela" min="-2" pref="40" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Titulo"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTitulo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Autor"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Preço"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Quantidade estoque"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Gênero"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Descrição"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtAutor"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPreco"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtQuantidadeEstoque"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="0"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtGenero"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="24" style="0"/> + </Property> + </Properties> + </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="txtDescricao"> + <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="btnFecharJanela"> + <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="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Fechar Janela"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFecharJanelaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <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="Ficha do produto"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/telas/infoProduto.java b/src/telas/infoProduto.java new file mode 100644 index 0000000..3e9ef55 --- /dev/null +++ b/src/telas/infoProduto.java @@ -0,0 +1,299 @@ +/* + * 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 classes.Produto; +import java.util.Vector; +import static telas.verCarrinho.aux; +import static telas.verProdutos.auxProduto; + +/** + * + * @author Yuri + */ +public class infoProduto extends javax.swing.JFrame { + + /** + * Creates new form infoProduto + */ + public infoProduto() { + initComponents(); + loadInfoProduto(auxProduto); + setLocationRelativeTo(null); + } +public void loadInfoProduto(Vector<Produto> aux){ + Produto item = aux.get(0); + + txtTitulo.setText(item.getTitulo()); + txtAutor.setText(item.getAutor()); + txtPreco.setText(String.valueOf(item.getPreço())); + txtQuantidadeEstoque.setText(String.valueOf(item.getQuantidadeEstoque())); + txtGenero.setText(item.getGenero()); + txtDescricao.setText(item.getDescrição()); + + + + + +} + /** + * 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() { + + jMenuBar1 = new javax.swing.JMenuBar(); + jMenu1 = new javax.swing.JMenu(); + jMenu2 = new javax.swing.JMenu(); + jPanel2 = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + txtTitulo = new javax.swing.JTextField(); + 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(); + txtAutor = new javax.swing.JTextField(); + txtPreco = new javax.swing.JTextField(); + txtQuantidadeEstoque = new javax.swing.JTextField(); + txtGenero = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtDescricao = new javax.swing.JTextArea(); + btnFecharJanela = new javax.swing.JButton(); + jLabel7 = new javax.swing.JLabel(); + + jMenu1.setText("File"); + jMenuBar1.add(jMenu1); + + jMenu2.setText("Edit"); + jMenuBar1.add(jMenu2); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Ficha do Produto"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/pesquisar64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanel2.setBackground(new java.awt.Color(145, 95, 51)); + + jPanel1.setBackground(new java.awt.Color(237, 224, 182)); + + jLabel1.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel1.setText("Titulo"); + + txtTitulo.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N + + jLabel2.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel2.setText("Autor"); + + jLabel3.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel3.setText("Preço"); + + jLabel4.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel4.setText("Quantidade estoque"); + + jLabel5.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel5.setText("Gênero"); + + jLabel6.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jLabel6.setText("Descrição"); + + txtAutor.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N + + txtPreco.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N + + txtQuantidadeEstoque.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N + + txtGenero.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N + + txtDescricao.setColumns(20); + txtDescricao.setRows(5); + jScrollPane1.setViewportView(txtDescricao); + + btnFecharJanela.setBackground(new java.awt.Color(255, 0, 0)); + btnFecharJanela.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + btnFecharJanela.setText("Fechar Janela"); + btnFecharJanela.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFecharJanelaActionPerformed(evt); + } + }); + + jLabel7.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + jLabel7.setText("Ficha do produto"); + + 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(24, 24, 24) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 84, Short.MAX_VALUE) + .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(51, 51, 51) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtPreco, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtAutor, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 126, Short.MAX_VALUE) + .addComponent(txtQuantidadeEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 223, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(14, 14, 14))) + .addContainerGap()) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel7) + .addGap(158, 158, 158)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(211, 211, 211) + .addComponent(btnFecharJanela) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(53, 53, 53) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(48, 48, 48) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(1, 1, 1) + .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(txtQuantidadeEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(43, 43, 43) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(26, 26, 26) + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnFecharJanela, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(39, 39, 39)) + ); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addContainerGap(21, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(24, 24, 24)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + + getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(1, 0, 690, -1)); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnFecharJanelaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFecharJanelaActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnFecharJanelaActionPerformed + + /** + * @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(infoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(infoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(infoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(infoProduto.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 infoProduto().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnFecharJanela; + 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.JMenu jMenu1; + private javax.swing.JMenu jMenu2; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextArea txtDescricao; + private javax.swing.JTextField txtGenero; + private javax.swing.JTextField txtPreco; + private javax.swing.JTextField txtQuantidadeEstoque; + private javax.swing.JTextField txtTitulo; + // End of variables declaration//GEN-END:variables +} diff --git a/src/telas/telaLogin.form b/src/telas/telaLogin.form index aec091d..f1abaac 100644 --- a/src/telas/telaLogin.form +++ b/src/telas/telaLogin.form @@ -4,6 +4,9 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Tela de Login"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/login64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -19,84 +22,75 @@ <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,-79,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="1310" y="220" width="610" height="470"/> + </Constraint> + </Constraints> <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 min="-2" pref="21" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> <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> - </Group> - </Group> - </Group> - <Component id="txtEmail" min="-2" pref="325" max="-2" attributes="0"/> - <Component id="lblEmail" min="-2" max="-2" attributes="0"/> - </Group> + <Component id="btnEntrar" min="-2" pref="130" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="207" max="-2" attributes="0"/> + <Component id="btnCancelar" min="-2" pref="165" max="-2" attributes="0"/> </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"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="pswSenha" alignment="0" max="32767" attributes="0"/> + <Component id="lblEmail" alignment="0" min="-2" pref="128" max="-2" attributes="0"/> + <Component id="lblSenha" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="txtEmail" alignment="0" pref="502" max="32767" attributes="0"/> </Group> </Group> - <EmptySpace pref="79" max="32767" attributes="0"/> + <EmptySpace min="0" pref="87" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblCadastrarse" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="163" max="-2" attributes="0"/> + <Component id="lblLogin" 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 min="-2" pref="37" max="-2" attributes="0"/> - <Component id="lblLogin" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblEmail" min="-2" max="-2" attributes="0"/> + <Component id="lblLogin" min="-2" pref="70" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblEmail" min="-2" pref="51" 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 min="-2" pref="24" max="-2" attributes="0"/> + <Component id="lblSenha" min="-2" pref="53" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="pswSenha" 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="btnEntrar" alignment="3" min="-2" pref="48" max="-2" attributes="0"/> + <Component id="btnCancelar" alignment="3" min="-2" pref="48" max="-2" 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="39" max="32767" attributes="0"/> + <Component id="lblCadastrarse" min="-2" pref="56" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -105,13 +99,22 @@ <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="60" 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"/> + <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="48" 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> @@ -120,24 +123,28 @@ <Properties> <Property name="toolTipText" type="java.lang.String" value="Insira o email"/> </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtEmailActionPerformed"/> + </Events> </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="48" 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="36" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Entrar"/> <Property name="toolTipText" type="java.lang.String" value="fazer login"/> @@ -152,7 +159,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="36" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Cancelar"/> </Properties> @@ -162,6 +169,9 @@ </Component> <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="30" 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> @@ -171,7 +181,33 @@ <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblCadastrarseMouseClicked"/> </Events> </Component> + <Component class="javax.swing.JPasswordField" name="pswSenha"> + </Component> </SubComponents> </Container> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/logo_v3.png"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="240" y="40" width="830" height="780"/> + </Constraint> + </Constraints> + </Component> + <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 ac38ca2..9eecb34 100644 --- a/src/telas/telaLogin.java +++ b/src/telas/telaLogin.java @@ -15,6 +15,9 @@ import static telas.Menu.user; import static telas.cadastarGerente.listaGerente; //import telas.Menu.verificarLogin(); +import static telas.cadastros.cadastrosFlag; +import static classes.Cliente.usuario_tipo; +import classes.Usuario; //import static telas.cadastrarFuncionario.listaFuncionarios; @@ -30,9 +33,10 @@ public class telaLogin extends javax.swing.JFrame { public telaLogin() { initComponents(); setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); - } + } /** * 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 @@ -47,28 +51,42 @@ private void initComponents() { 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(); + jLabel3 = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Tela de Login"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/login64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanel1.setOpaque(false); - lblLogin.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - lblLogin.setText("Bem vindo"); + lblLogin.setFont(new java.awt.Font("Old London", 1, 60)); // NOI18N + lblLogin.setForeground(new java.awt.Color(255, 255, 255)); + lblLogin.setText("Bem-vindo"); + lblEmail.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + lblEmail.setForeground(new java.awt.Color(255, 255, 255)); lblEmail.setText("E-mail"); lblEmail.setToolTipText(""); txtEmail.setToolTipText("Insira o email"); + txtEmail.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtEmailActionPerformed(evt); + } + }); + lblSenha.setFont(new java.awt.Font("Old London", 0, 48)); // 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, 36)); // 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, 36)); // NOI18N btnCancelar.setText("Cancelar"); btnCancelar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -86,6 +104,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + lblCadastrarse.setFont(new java.awt.Font("Old London", 1, 30)); // 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() { @@ -99,63 +118,55 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .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))) + .addGap(21, 21, 21) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(179, 179, 179) - .addComponent(lblLogin))) - .addContainerGap(79, Short.MAX_VALUE)) + .addComponent(btnEntrar, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(207, 207, 207) + .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(pswSenha, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblEmail, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblSenha, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtEmail, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 502, Short.MAX_VALUE))) + .addGap(0, 87, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblCadastrarse) + .addGap(28, 28, 28)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(163, 163, 163) + .addComponent(lblLogin) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, 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) + .addComponent(lblLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) .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) + .addGap(24, 24, 24) + .addComponent(lblSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(pswSenha, 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(btnEntrar) - .addComponent(btnCancelar)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblCadastrarse) - .addContainerGap(38, Short.MAX_VALUE)) + .addComponent(btnEntrar, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE) + .addComponent(lblCadastrarse, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(37, 37, 37)) ); - 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(1310, 220, 610, 470)); + + jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/logo_v3.png"))); // NOI18N + getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 40, 830, 780)); + + 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 @@ -168,31 +179,62 @@ private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F private void lblCadastrarseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblCadastrarseMouseClicked // TODO add your handling code here: - new cadastrarCliente().setVisible(true); + cadastrosFlag="cliente"; + user="cadastro"; + new cadastros().setVisible(true); + user=""; }//GEN-LAST:event_lblCadastrarseMouseClicked private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEntrarActionPerformed // TODO add your handling code here: String emailInput = txtEmail.getText(); - String senhaInput = txtSenha.getText(); - + String senhaInput = String.valueOf(pswSenha.getPassword()); + Gerente gerente = null; + boolean emailCorreto = false; + boolean senhaCorreta = false; if(listaGerente.size()>0){ for(Gerente pessoa : listaGerente){ - if(pessoa.getEmail().equals(emailInput)&&pessoa.getSenha().equals(senhaInput)){ + if((pessoa.getEmail().equals(emailInput)&&!pessoa.getSenha().equals(senhaInput))){ + emailCorreto = true; + senhaCorreta = false; + }else if((!pessoa.getEmail().equals(emailInput)&&pessoa.getSenha().equals(senhaInput))){ + emailCorreto = false; + senhaCorreta = true; + + }else if(pessoa.getEmail().equals(emailInput)&&pessoa.getSenha().equals(senhaInput)){ + emailCorreto = true; + senhaCorreta = true; logado = true; - user = "gerente"; - JOptionPane.showMessageDialog(null,"Entrou como gerente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); - this.setVisible(false); - + //user = "gerente"; + //JOptionPane.showMessageDialog(null,"Entrou como gerente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); + //this.setVisible(false); break; } } + /* + if (!emailCorreto && !senhaCorreta && !logado) { + JOptionPane.showMessageDialog(null, "Email e senha incorretos!", "Erro de Login", JOptionPane.ERROR_MESSAGE); + }*/ + if(emailCorreto&&senhaCorreta&&logado){ + user="gerente"; + JOptionPane.showMessageDialog(null,"Entrou como gerente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); + this.setVisible(false); + } } if(listaFuncionarios.size()>0){ for(Funcionario item : listaFuncionarios){ - if(item.getEmail().equals(emailInput)&& item.getSenha().equals(senhaInput)){ + if((item.getEmail().equals(emailInput)&&!item.getSenha().equals(senhaInput))){ + emailCorreto = true; + senhaCorreta = false; + }else if((!item.getEmail().equals(emailInput)&&item.getSenha().equals(senhaInput))){ + emailCorreto = false; + senhaCorreta = true; + + }else if(item.getEmail().equals(emailInput)&& item.getSenha().equals(senhaInput)){ + emailCorreto = true; + senhaCorreta = true; logado = true; user = "funcionario"; JOptionPane.showMessageDialog(null,"Credenciais verificadas... pegando indice", "Notificação Login",JOptionPane.PLAIN_MESSAGE); @@ -211,8 +253,32 @@ private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR } if(!logado && listaClientes.size() > 0){ for(Cliente item:listaClientes){ + if((item.getEmail().equals(emailInput)&&!item.getSenha().equals(senhaInput))){ + emailCorreto = true; + senhaCorreta = false; + }else if((!item.getEmail().equals(emailInput)&&item.getSenha().equals(senhaInput))){ + emailCorreto = false; + senhaCorreta = true; + + }else if(item.getEmail().equals(emailInput)&&item.getSenha().equals(senhaInput)){ + emailCorreto = true; + senhaCorreta = true; + logado = true; + user = "cliente"; + JOptionPane.showMessageDialog(null,"Credenciais verificadas... pegando índice", "Notificação Login",JOptionPane.PLAIN_MESSAGE); + 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); + //user = "gerente"; + //JOptionPane.showMessageDialog(null,"Entrou como gerente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); + //this.setVisible(false); + break; + + } - if(item.getEmail().equals(emailInput)&& item.getSenha().equals(senhaInput)){ + /*if(item.getEmail().equals(emailInput)&& item.getSenha().equals(senhaInput)){ + emailCorreto = true; + senhaCorreta = true; logado = true; user = "cliente"; JOptionPane.showMessageDialog(null,"Credenciais verificadas... pegando índice", "Notificação Login",JOptionPane.PLAIN_MESSAGE); @@ -220,20 +286,32 @@ private void btnEntrarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR JOptionPane.showMessageDialog(null,"Entrou como cliente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); this.setVisible(false); - new Menu().setVisible(true); break; - } + }*/ } + if (!emailCorreto && !senhaCorreta && !logado) { + JOptionPane.showMessageDialog(null, "Email ou senha incorretos!", "Erro de Login", JOptionPane.ERROR_MESSAGE); + } + + /*if(emailCorreto&&senhaCorreta&&logado){ + user="gerente"; + JOptionPane.showMessageDialog(null,"Entrou como gerente com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); + this.setVisible(false); + }*/ } if(logado){ new Menu().setVisible(true); } if(!logado){ - JOptionPane.showMessageDialog(null, "Email ou senha incorretos.", "Erro de Login", JOptionPane.ERROR_MESSAGE); + JOptionPane.showMessageDialog(null, "Email ou senha incorretos!", "Erro de Login", JOptionPane.ERROR_MESSAGE); } }//GEN-LAST:event_btnEntrarActionPerformed + private void txtEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEmailActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtEmailActionPerformed + /** * @param args the command line arguments */ @@ -272,12 +350,14 @@ 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.JLabel jLabel3; 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..0de69e1 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 pagamento"/> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -36,20 +41,26 @@ <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 type="103" groupAlignment="0" attributes="0"> + <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 type="102" 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> - <Group type="102" alignment="1" attributes="0"> + <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="71" max="-2" attributes="0"/> - <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> </Group> </Group> </Group> </Group> - <EmptySpace pref="50" max="32767" attributes="0"/> + <EmptySpace pref="38" max="32767" attributes="0"/> </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> @@ -94,12 +105,14 @@ <Component id="rdbBoleto" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="rdbPix" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <EmptySpace max="-2" 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="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,13 +143,27 @@ </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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="rdbBoletoMouseClicked"/> + </Events> </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"/> + <Property name="toolTipText" type="java.lang.String" value="Pague no pix para 5% de desconto!"/> </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="rdbPixMouseClicked"/> + </Events> </Component> <Component class="javax.swing.JLabel" name="lblNumCarrinho"> <Properties> @@ -165,6 +192,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 +207,13 @@ <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="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="99" red="0" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Desconto de 5% no pix!"/> + </Properties> + </Component> </SubComponents> </Form> diff --git a/src/telas/telaPagamento.java b/src/telas/telaPagamento.java index e3115d0..8ecec65 100644 --- a/src/telas/telaPagamento.java +++ b/src/telas/telaPagamento.java @@ -4,6 +4,25 @@ */ package telas; +import classes.Carrinho; +//import static classes.Carrinho.listaCarrinho; +import static classes.Carrinho.listaProdutos; +import classes.Cliente; +import static classes.Cliente.index_cliente; +import static classes.Cliente.listaClientes; +import classes.Funcionario; +import static classes.Funcionario.index_func; +import static classes.Funcionario.listaFuncionarios; +import classes.Gerente; +import classes.Produto; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import javax.swing.JOptionPane; +import static telas.Menu.user; +import static telas.cadastarGerente.listaGerente; +import static telas.verCarrinho.aux; + /** * * @author Yuri @@ -16,7 +35,22 @@ public class telaPagamento extends javax.swing.JFrame { public telaPagamento() { initComponents(); setLocationRelativeTo(null); + newCarregarInfoPagamento(); + + + } + + public void newCarregarInfoPagamento(){ + Carrinho carrinhoSalvo = aux.get(0); + if(rdbPix.isSelected()){ + double desconto = 0.95*carrinhoSalvo.getTotal(); + txtValorTotal.setText(String.format("%.2f", desconto)); + }else if(rdbBoleto.isSelected()){ + txtValorTotal.setText(String.format("%.2f", carrinhoSalvo.getTotal())); + } + txtNumCarrinho.setText(String.valueOf(carrinhoSalvo.getNumCarrinho())); + txtProdutos.setText(carrinhoSalvo.mostarProdutos(carrinhoSalvo.itensNoCarrinho)); } /** @@ -25,9 +59,11 @@ public telaPagamento() { * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") + // <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 +76,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 pagamento"); lblPagamento.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N lblPagamento.setText("Pagamento"); @@ -52,9 +90,23 @@ private void initComponents() { lblFormaPagamento.setText("Forma de pagamento"); + buttonGroup1.add(rdbBoleto); + rdbBoleto.setSelected(true); rdbBoleto.setText("Boleto"); + rdbBoleto.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + rdbBoletoMouseClicked(evt); + } + }); + buttonGroup1.add(rdbPix); rdbPix.setText("Pix"); + rdbPix.setToolTipText("Pague no pix para 5% de desconto!"); + rdbPix.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + rdbPixMouseClicked(evt); + } + }); lblNumCarrinho.setText("Número do carrinho"); @@ -66,6 +118,11 @@ private void initComponents() { 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,6 +132,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + jLabel1.setForeground(new java.awt.Color(0, 153, 0)); + jLabel1.setText("Desconto de 5% no pix!"); + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( @@ -90,15 +150,19 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(btnPagar) .addComponent(lblFormaPagamento)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(71, 71, 71) + .addComponent(btnCancelar)) + .addGroup(layout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(rdbBoleto) + .addGap(33, 33, 33) + .addComponent(rdbPix))) .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)) + .addComponent(jLabel1))))) + .addContainerGap(38, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGap(72, 72, 72) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -134,11 +198,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(lblFormaPagamento) .addComponent(rdbBoleto) .addComponent(rdbPix)) - .addGap(34, 34, 34) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel1) + .addGap(18, 18, 18) .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 +215,75 @@ 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: + LocalDate today = LocalDate.now(); + + // Define a date format (e.g., "dd/MM/yyyy") + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); + + // Convert the date to a string + String formattedDate = today.format(formatter); + newCarregarInfoPagamento(); + if(listaProdutos.size()>0){ + if(user.equals("cliente")){ + Cliente cliente = listaClientes.get(index_cliente); + ArrayList listaCarrinhoDoCliente = cliente.getListaCarrinho(); + int indexCarrinho = listaCarrinhoDoCliente.size(); + + // Clone the ArrayList + ArrayList<Produto> clonedList = (ArrayList<Produto>) listaProdutos.clone(); + Carrinho carrinho1 = new Carrinho(indexCarrinho,formattedDate,clonedList); + carrinho1.setTotal(Double.parseDouble(txtValorTotal.getText())); + cliente.addCarrinhoLista(carrinho1); + + } + if(user.equals("funcionario")){ + Funcionario funcionario = listaFuncionarios.get(index_func); + ArrayList listaCarrinhoDoFuncionario = funcionario.getListaCarrinhoFuncionario(); + int indexCarrinho = listaCarrinhoDoFuncionario.size(); + + ArrayList<Produto> clonedList = (ArrayList<Produto>) listaProdutos.clone(); + Carrinho carrinho2 = new Carrinho(indexCarrinho,formattedDate,clonedList); + carrinho2.setTotal(Double.parseDouble(txtValorTotal.getText())); + + funcionario.addListaCarrinhosFuncionarios(carrinho2); + + } + if(user.equals("gerente")){ + Gerente gerente = listaGerente.get(0); + ArrayList listaCarrinhoDoGerente = gerente.getListaCarrinhoGerente(); + int indexCarrinho = listaCarrinhoDoGerente.size(); + + ArrayList<Produto> clonedList = (ArrayList<Produto>) listaProdutos.clone(); + Carrinho carrinho2 = new Carrinho(indexCarrinho,formattedDate,clonedList); + carrinho2.setTotal(Double.parseDouble(txtValorTotal.getText())); + + gerente.addListaCarrinhosGerente(carrinho2); + + } + listaProdutos.clear(); + aux.clear(); + System.out.println("Adicionado ao Histórico!"); + + } + JOptionPane.showMessageDialog(null,"Compra realizada com sucesso!","Notificação de compra!",JOptionPane.INFORMATION_MESSAGE); + this.setVisible(false); + + + //listaProdutos.clear(); + }//GEN-LAST:event_btnPagarActionPerformed + + private void rdbPixMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rdbPixMouseClicked + // TODO add your handling code here: + newCarregarInfoPagamento(); + }//GEN-LAST:event_rdbPixMouseClicked + + private void rdbBoletoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_rdbBoletoMouseClicked + // TODO add your handling code here: + newCarregarInfoPagamento(); + }//GEN-LAST:event_rdbBoletoMouseClicked + /** * @param args the command line arguments */ @@ -187,6 +322,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..04a382e 100644 --- a/src/telas/verCarrinho.form +++ b/src/telas/verCarrinho.form @@ -4,6 +4,9 @@ <Properties> <Property name="defaultCloseOperation" type="int" value="2"/> <Property name="title" type="java.lang.String" value="Visualizar meu carrinho"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/carrinho64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -19,183 +22,622 @@ <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,54,0,0,7,91"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" 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="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="27" green="53" red="63" 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="0" y="10" width="840" height="490"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="17" 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="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="13" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="53" green="ae" red="d0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="590" max="32767" attributes="0"/> + <Component id="btnVerCarrinhosAntigos" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="16" max="-2" attributes="0"/> + </Group> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" max="-2" attributes="0"> - <Group type="102" attributes="0"> - <Component id="lblProdutosCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" 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"/> + <EmptySpace min="-2" pref="264" max="-2" attributes="0"/> + <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblProdutosCarrinho" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" 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> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> <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="-2" pref="39" max="-2" attributes="0"/> + <Component id="btnVerCarrinhosAntigos" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="368" max="32767" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="71" max="-2" attributes="0"/> + <Component id="lblProdutosCarrinho" min="-2" max="-2" attributes="0"/> + <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"/> + </Group> + <EmptySpace pref="48" max="32767" attributes="0"/> + </Group> </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"/> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + + <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="false" title="Título" type="java.lang.String"/> + <Column editable="false" title="Autor" type="java.lang.String"/> + <Column editable="false" title="Preço" type="java.lang.Double"/> + <Column editable="false" title="Quantidade" type="java.lang.Integer"/> + <Column editable="false" title="Gênero" 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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblProdutosMouseClicked"/> + </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> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="btnRemoverItemMouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRemoverItemActionPerformed"/> + </Events> + </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> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEsvaziarCarrinhoActionPerformed"/> + </Events> + </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="btnVerCarrinhosAntigos"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="80" green="ff" red="5b" 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="Ver carrinhos antigos"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnVerCarrinhosAntigosActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel4"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="27" green="53" red="63" 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="860" y="390" width="1000" height="520"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" 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"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="14" max="32767" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </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.JPanel" name="jPanel5"> <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> - <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 name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="54" green="b0" red="d1" type="rgb"/> </Property> </Properties> - </Component> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel6" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="19" 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="jPanel6" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="12" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel6"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="53" green="ae" red="d0" type="rgb"/> + </Property> + </Properties> + + <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 min="-2" pref="337" 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> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" 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"/> + <EmptySpace min="-2" pref="132" max="-2" attributes="0"/> + <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="42" max="-2" 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"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="419" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="384" max="-2" attributes="0"/> + <Component id="lblCarrinhosAnteriores" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="130" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <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="24" max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="885" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="169" 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="18" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblCarrinhosAnteriores" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" pref="44" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblNumCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> + <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"/> + </Group> + <Component id="lblProdutos" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" 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> + <EmptySpace min="0" pref="1" max="32767" attributes="0"/> + </Group> + <Component id="jScrollPane3" pref="0" max="32767" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="btnPesquisarCarrinho" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelarCarrinho" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="266" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane2"> + <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.JTable" name="tblCliente"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="4" rowCount="4"> + <Column editable="false" title="NumCarrinho" type="java.lang.Integer"/> + <Column editable="false" title="Data do pedido" type="java.lang.String"/> + <Column editable="false" title="Produtos" type="java.lang.Object"/> + <Column editable="false" title="Total" type="java.lang.Double"/> + </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> + </TableColumnModel> + </Property> + <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> + <TableHeader reorderingAllowed="true" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tblClienteMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="lblCarrinhosAnteriores"> + <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="Consultar Carrinhos Antigos"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblNumCarrinho"> + <Properties> + <Property name="text" type="java.lang.String" value="NumCarrinho"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblData"> + <Properties> + <Property name="text" type="java.lang.String" value="Data"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblProdutos"> + <Properties> + <Property name="text" type="java.lang.String" value="Produtos"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblTotal"> + <Properties> + <Property name="text" type="java.lang.String" value="Total"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNumCarrinho"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="número do carrinho"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTotal"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="valor total"/> + </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(); }"> + <Format format="##/##/####" subtype="-1" type="5"/> + </Property> + <Property name="toolTipText" type="java.lang.String" value="data do pedido"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnPesquisarCarrinho"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/simbolos/searchmagnifierinterfacesymbol1_79893.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Pesquisar"/> + <Property name="toolTipText" type="java.lang.String" value="pesquisar por carrinho"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarCarrinhoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarCarrinho"> + <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="Cancelar"/> + <Property name="toolTipText" type="java.lang.String" value="cancelar operação"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarCarrinhoActionPerformed"/> + </Events> + </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="txtProdutos"> + <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="jButton1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="36" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Fechar janela"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> </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"> + <Component class="javax.swing.JButton" name="btnSair"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> + <Color blue="0" green="33" 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"/> + <Font name="Old London" size="36" style="0"/> </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"/> + <Property name="text" type="java.lang.String" value="Sair"/> </Properties> <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1540" y="50" width="-1" height="40"/> + </Constraint> + </Constraints> </Component> - <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> + <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="24" 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="Visualizar Carrinho Atual"/> + <Property name="toolTipText" type="java.lang.String" value=""/> </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> - <Component class="javax.swing.JButton" name="jButton1"> + <Container class="javax.swing.JPanel" name="jPanel3"> <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="27" green="53" red="63" type="rgb"/> </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> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="50" y="150" width="840" height="490"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="840" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="490" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + </Layout> + </Container> </SubComponents> </Form> diff --git a/src/telas/verCarrinho.java b/src/telas/verCarrinho.java index 30b3d8e..3edc076 100644 --- a/src/telas/verCarrinho.java +++ b/src/telas/verCarrinho.java @@ -4,14 +4,37 @@ */ package telas; +import classes.Carrinho; +import classes.Usuario; +//import classes.Usuario.listaCarrinho; import static classes.Carrinho.listaProdutos; +import classes.Cliente; +import static classes.Cliente.index_cliente; +import static classes.Cliente.listaClientes; +import classes.Funcionario; +import static classes.Funcionario.index_func; +import static classes.Funcionario.listaFuncionarios; +import classes.Gerente; +import classes.Produto; +import java.util.ArrayList; +import java.util.Vector; +import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; +import static telas.Menu.user; +import static telas.cadastarGerente.listaGerente; /** * * @author Yuri */ public class verCarrinho extends javax.swing.JFrame { + Cliente cliente = listaClientes.get(index_cliente);//Pegando o ID do cliente + ArrayList listaCarrinhoDoCliente = cliente.getListaCarrinho();//Pegando a lista de carrinhos do cliente + int indexCarrinho = listaCarrinhoDoCliente.size();//Pegando o tamanho da lista de carrinhos do cliente + Carrinho carrinho1 = new Carrinho(indexCarrinho,"29/08/2024");//Criando um novo carrinho vazio de itens com o índice definido na linha anterior + public static Vector<Carrinho> aux = new Vector<>(1); // Initializes a Vector with an initial capacity of 1 + + /** * Creates new form verCarrinho @@ -20,20 +43,32 @@ public verCarrinho() { initComponents(); setLocationRelativeTo(null); carregarTabelaProdutos(); - + btnRemoverItem.setEnabled(false); + this.setExtendedState(MAXIMIZED_BOTH); + jPanel4.setVisible(false); + disableCarrinhoFields(); + System.out.println("User é igual a "+user); + if(listaProdutos.size()!=0){ + btnEsvaziarCarrinho.setEnabled(true); + }else{ + btnEsvaziarCarrinho.setEnabled(false); + } + System.out.println("A quantidade comprada é:"+listaProdutos.get(0).getQuantidadeComprada()); + System.out.println("O gênero do livro comprado é:"+listaProdutos.get(0).getGenero()); } + //Carregar a tabela com os funcionários da lista private void carregarTabelaProdutos() { - DefaultTableModel modeloTabelaProdutos = new DefaultTableModel(new Object[] {"Titulo","Preço","Quantidade","Cod Produto","Descrição"},0); + DefaultTableModel modeloTabelaProdutos = new DefaultTableModel(new Object[] {"Titulo","Autor","Preço","Quantidade","Gênero"},0); for(int i=0;i<listaProdutos.size();i++){ Object linha[] = new Object[]{listaProdutos.get(i).getTitulo(), - listaProdutos.get(i).getPreço(), - listaProdutos.get(i).getQuantidadeComprada()}; - listaProdutos.get(i).getCodigoDoProduto(); - listaProdutos.get(i).getDescrição(); + listaProdutos.get(i).getAutor(), + listaProdutos.get(i).getPreço()}; + listaProdutos.get(i).getQuantidadeComprada(); + listaProdutos.get(i).getGenero(); modeloTabelaProdutos.addRow(linha); @@ -49,7 +84,145 @@ private void carregarTabelaProdutos() { } + 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(){ + 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 carregarTabelaCliente(){ + DefaultTableModel modeloTabelaCarrinhosAntigos = new DefaultTableModel(new Object[] {"Num.Carrinho","Data Pedido","Produtos","Total"},0); + + Cliente cliente = listaClientes.get(index_cliente); + System.out.println("Cliente passado"); + ArrayList<Carrinho> listaCarrinhoDoCliente = cliente.getListaCarrinho(); + System.out.println("Tamanho da lista: "+cliente.getListaCarrinho().size()); + System.out.println("ListaResgatada"); + + for(int i=0;i<cliente.getListaCarrinho().size();i++){ + Object linha[] = new Object[] {cliente.getListaCarrinho().get(i).getNumCarrinho(), + cliente.getListaCarrinho().get(i).getData(), + cliente.getListaCarrinho().get(i).mostarProdutos(cliente.getListaCarrinho().get(i).itensNoCarrinho), + cliente.getListaCarrinho().get(i).getTotal()}; + modeloTabelaCarrinhosAntigos.addRow(linha); + + + } + //Tabela recebe modelo de clientes + tblCliente.setModel(modeloTabelaCarrinhosAntigos); + + tblCliente.getColumnModel().getColumn(0).setPreferredWidth(3); + tblCliente.getColumnModel().getColumn(1).setPreferredWidth(50); + tblCliente.getColumnModel().getColumn(2).setPreferredWidth(14); + tblCliente.getColumnModel().getColumn(3).setPreferredWidth(10); + //tblCliente.getColumnModel().getColumn(4).setPreferredWidth(100); + + + } + private void carregarTabelaFuncionarioPedidos(){ + System.out.println("Está acessando a função de pedidos de funcionário!"); + DefaultTableModel modeloTabelaCarrinhosAntigos = new DefaultTableModel(new Object[] {"Num.Carrinho","Data Pedido","Produtos","Total"},0); + + Funcionario funcionario = listaFuncionarios.get(index_func); + ArrayList<Carrinho> listaCarrinhoDoFuncionario = funcionario.getListaCarrinhoFuncionario(); + + + System.out.println("Funcionário passado"); + System.out.println("Tamanho da lista: "+funcionario.getListaCarrinhoFuncionario().size()); + System.out.println("ListaResgatada"); + System.out.println("Quantidade de itens no carrinho:"+funcionario.getListaCarrinhoFuncionario().size()); + for(int i=0;i<funcionario.getListaCarrinhoFuncionario().size();i++){ + Object linha[] = new Object[] {funcionario.getListaCarrinhoFuncionario().get(i).getNumCarrinho(), + funcionario.getListaCarrinhoFuncionario().get(i).getData(), + funcionario.getListaCarrinhoFuncionario().get(i).mostarProdutos(funcionario.getListaCarrinhoFuncionario().get(i).itensNoCarrinho), + funcionario.getListaCarrinhoFuncionario().get(i).getTotal()}; + modeloTabelaCarrinhosAntigos.addRow(linha); + + + } + System.out.println("Tabela criada com sucesso"); + //Tabela recebe modelo de clientes + tblCliente.setModel(modeloTabelaCarrinhosAntigos); + System.out.println("Tabela carregada com sucesso"); + + tblCliente.getColumnModel().getColumn(0).setPreferredWidth(3); + tblCliente.getColumnModel().getColumn(1).setPreferredWidth(50); + tblCliente.getColumnModel().getColumn(2).setPreferredWidth(14); + tblCliente.getColumnModel().getColumn(3).setPreferredWidth(10); + //tblCliente.getColumnModel().getColumn(4).setPreferredWidth(100); + + + + } + private void carregarTabelaGerentePedidos(){ + System.out.println("Está acessando a função de pedidos de gerente!"); + DefaultTableModel modeloTabelaCarrinhosAntigos = new DefaultTableModel(new Object[] {"Num.Carrinho","Data Pedido","Produtos","Total"},0); + + Gerente gerente = listaGerente.get(0); + ArrayList<Carrinho> listaCarrinhoDoFuncionario = gerente.getListaCarrinhoGerente(); + + + System.out.println("Funcionário passado"); + System.out.println("Tamanho da lista: "+gerente.getListaCarrinhoGerente().size()); + System.out.println("ListaResgatada"); + System.out.println("Quantidade de itens no carrinho:"+gerente.getListaCarrinhoGerente().size()); + for(int i=0;i<gerente.getListaCarrinhoGerente().size();i++){ + Object linha[] = new Object[] {gerente.getListaCarrinhoGerente().get(i).getNumCarrinho(), + gerente.getListaCarrinhoGerente().get(i).getData(), + gerente.getListaCarrinhoGerente().get(i).mostarProdutos(gerente.getListaCarrinhoGerente().get(i).itensNoCarrinho), + gerente.getListaCarrinhoGerente().get(i).getTotal()}; + modeloTabelaCarrinhosAntigos.addRow(linha); + + + } + System.out.println("Tabela criada com sucesso"); + //Tabela recebe modelo de clientes + tblCliente.setModel(modeloTabelaCarrinhosAntigos); + System.out.println("Tabela carregada com sucesso"); + + tblCliente.getColumnModel().getColumn(0).setPreferredWidth(3); + tblCliente.getColumnModel().getColumn(1).setPreferredWidth(50); + tblCliente.getColumnModel().getColumn(2).setPreferredWidth(14); + tblCliente.getColumnModel().getColumn(3).setPreferredWidth(10); + //tblCliente.getColumnModel().getColumn(4).setPreferredWidth(100); + + + + } + private void clearCarrinhoFields(){ + txtNumCarrinho.setText(""); + txtTotal.setText(""); + txtData.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 @@ -59,6 +232,8 @@ private void carregarTabelaProdutos() { // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + jPanel2 = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); tblProdutos = new javax.swing.JTable(); btnRemoverItem = new javax.swing.JButton(); @@ -66,10 +241,37 @@ private void initComponents() { lblProdutosCarrinho = new javax.swing.JLabel(); btnConfirmarCompra = new javax.swing.JButton(); lblVisualizarCarrinho = new javax.swing.JLabel(); + btnVerCarrinhosAntigos = new javax.swing.JButton(); + jPanel4 = new javax.swing.JPanel(); + jPanel5 = new javax.swing.JPanel(); + jPanel6 = new javax.swing.JPanel(); + jScrollPane2 = new javax.swing.JScrollPane(); + tblCliente = 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(); + txtNumCarrinho = new javax.swing.JTextField(); + txtTotal = new javax.swing.JTextField(); + txtData = new javax.swing.JFormattedTextField(); + btnPesquisarCarrinho = new javax.swing.JButton(); + btnCancelarCarrinho = new javax.swing.JButton(); + jScrollPane3 = new javax.swing.JScrollPane(); + txtProdutos = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); + btnSair = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Visualizar meu carrinho"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/carrinho64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); + + jPanel2.setBackground(new java.awt.Color(99, 83, 39)); + + jPanel1.setBackground(new java.awt.Color(208, 174, 83)); tblProdutos.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -79,26 +281,53 @@ private void initComponents() { {null, null, null, null, null} }, new String [] { - "Título", "Preço", "Quantidade", "Cód. Produto", "Descrição" + "Título", "Autor", "Preço", "Quantidade", "Gênero" } ) { 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.String.class, java.lang.Double.class, java.lang.Integer.class, java.lang.String.class + }; + boolean[] canEdit = new boolean [] { + false, false, false, false, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tblProdutos.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tblProdutosMouseClicked(evt); + } }); jScrollPane1.setViewportView(tblProdutos); btnRemoverItem.setBackground(new java.awt.Color(153, 153, 153)); btnRemoverItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N btnRemoverItem.setText("Remover item"); + btnRemoverItem.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + btnRemoverItemMouseClicked(evt); + } + }); + btnRemoverItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRemoverItemActionPerformed(evt); + } + }); btnEsvaziarCarrinho.setBackground(new java.awt.Color(255, 0, 0)); btnEsvaziarCarrinho.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N btnEsvaziarCarrinho.setText("Esvaziar carrinho"); + btnEsvaziarCarrinho.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnEsvaziarCarrinhoActionPerformed(evt); + } + }); lblProdutosCarrinho.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N lblProdutosCarrinho.setText("Meus produtos no carrinho"); @@ -115,75 +344,430 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { lblVisualizarCarrinho.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N lblVisualizarCarrinho.setText("Visualizar Carrinho Atual"); - jButton1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - jButton1.setText("Ver carrinhos antigos"); + btnVerCarrinhosAntigos.setBackground(new java.awt.Color(91, 255, 128)); + btnVerCarrinhosAntigos.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnVerCarrinhosAntigos.setText("Ver carrinhos antigos"); + btnVerCarrinhosAntigos.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnVerCarrinhosAntigosActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(590, Short.MAX_VALUE) + .addComponent(btnVerCarrinhosAntigos) + .addGap(16, 16, 16)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(264, 264, 264) + .addComponent(lblVisualizarCarrinho) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblProdutosCarrinho, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.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)))) + .addContainerGap())) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblVisualizarCarrinho) + .addGap(39, 39, 39) + .addComponent(btnVerCarrinhosAntigos) + .addContainerGap(368, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(71, 71, 71) + .addComponent(lblProdutosCarrinho) + .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(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnRemoverItem) + .addComponent(btnEsvaziarCarrinho) + .addComponent(btnConfirmarCompra)) + .addContainerGap(48, Short.MAX_VALUE))) + ); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(17, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(13, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 10, 840, 490)); + + jPanel4.setBackground(new java.awt.Color(99, 83, 39)); + + jPanel5.setBackground(new java.awt.Color(209, 176, 84)); + + jPanel6.setBackground(new java.awt.Color(208, 174, 83)); + + tblCliente.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null}, + {null, null, null, null} + }, + new String [] { + "NumCarrinho", "Data do pedido", "Produtos", "Total" + } + ) { + Class[] types = new Class [] { + java.lang.Integer.class, java.lang.String.class, java.lang.Object.class, java.lang.Double.class + }; + boolean[] canEdit = new boolean [] { + false, false, false, false + }; + + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; + } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tblCliente.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tblClienteMouseClicked(evt); + } + }); + jScrollPane2.setViewportView(tblCliente); + + lblCarrinhosAnteriores.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + lblCarrinhosAnteriores.setText("Consultar Carrinhos Antigos"); + + lblNumCarrinho.setText("NumCarrinho"); + + lblData.setText("Data"); + + lblProdutos.setText("Produtos"); + + lblTotal.setText("Total"); + + txtNumCarrinho.setToolTipText("número do carrinho"); + + txtTotal.setToolTipText("valor total"); + + try { + txtData.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + txtData.setToolTipText("data do pedido"); + + btnPesquisarCarrinho.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/searchmagnifierinterfacesymbol1_79893.png"))); // NOI18N + btnPesquisarCarrinho.setText("Pesquisar"); + btnPesquisarCarrinho.setToolTipText("pesquisar por carrinho"); + btnPesquisarCarrinho.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarCarrinhoActionPerformed(evt); + } + }); + + btnCancelarCarrinho.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelarCarrinho.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCancelarCarrinho.setText("Cancelar"); + btnCancelarCarrinho.setToolTipText("cancelar operação"); + btnCancelarCarrinho.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarCarrinhoActionPerformed(evt); + } + }); + + txtProdutos.setColumns(20); + txtProdutos.setRows(5); + jScrollPane3.setViewportView(txtProdutos); + + jButton1.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + jButton1.setText("Fechar janela"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(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 jPanel6Layout = new javax.swing.GroupLayout(jPanel6); + jPanel6.setLayout(jPanel6Layout); + jPanel6Layout.setHorizontalGroup( + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(337, 337, 337) + .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)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(143, 143, 143) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(lblNumCarrinho) + .addGap(18, 18, 18) + .addComponent(txtNumCarrinho, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(132, 132, 132) + .addComponent(lblProdutos)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(42, 42, 42) + .addComponent(lblTotal) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(18, 18, 18) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 419, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(384, 384, 384) + .addComponent(lblCarrinhosAnteriores) + .addGap(130, 130, 130) + .addComponent(jButton1)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(216, 216, 216) + .addComponent(btnPesquisarCarrinho) + .addGap(239, 239, 239) + .addComponent(btnCancelarCarrinho)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(24, 24, 24) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 885, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(169, Short.MAX_VALUE)) ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addComponent(lblVisualizarCarrinho) + jPanel6Layout.setVerticalGroup( + jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblCarrinhosAnteriores) + .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)) .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) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblNumCarrinho) + .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(lblProdutos)) + .addGap(18, 18, 18) + .addGroup(jPanel6Layout.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)) + .addGap(0, 1, Short.MAX_VALUE)) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)) + .addGap(18, 18, 18) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnPesquisarCarrinho) + .addComponent(btnCancelarCarrinho)) .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)) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(28, 28, 28)) + ); + + javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); + jPanel5.setLayout(jPanel5Layout); + jPanel5Layout.setHorizontalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(19, Short.MAX_VALUE)) + ); + jPanel5Layout.setVerticalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 12, Short.MAX_VALUE)) + ); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup() + .addContainerGap(14, Short.MAX_VALUE) + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + + getContentPane().add(jPanel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(860, 390, 1000, 520)); + + btnSair.setBackground(new java.awt.Color(255, 51, 0)); + btnSair.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1540, 50, -1, 40)); + + jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/VerCarrinho.png"))); // NOI18N + jLabel1.setToolTipText(""); + getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); + + jPanel3.setBackground(new java.awt.Color(99, 83, 39)); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 840, Short.MAX_VALUE) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 490, Short.MAX_VALUE) ); + getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 150, 840, 490)); + pack(); }// </editor-fold>//GEN-END:initComponents private void btnConfirmarCompraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarCompraActionPerformed // TODO add your handling code here: - new telaPagamento().setVisible(true); + if(listaProdutos.size()>0){ + carrinho1.setItensNoCarrinho(listaProdutos); + carrinho1.contarSaldo(); + aux.add(carrinho1); + new telaPagamento().setVisible(true); + }else{ + JOptionPane.showMessageDialog(null, "Adicione algum item ao carrinho!", "Error ao acessar o pagamento", JOptionPane.ERROR_MESSAGE); + } + carregarTabelaProdutos(); + + //} + }//GEN-LAST:event_btnConfirmarCompraActionPerformed + private void btnVerCarrinhosAntigosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerCarrinhosAntigosActionPerformed + // TODO add your handling code here: + //new carrinhosAntigos().setVisible(true); + carregarTabelaProdutos(); + if(user.equals("cliente")){ + carregarTabelaCliente(); + } + if(user.equals("funcionario")){ + carregarTabelaFuncionarioPedidos(); + } + if(user.equals("gerente")){ + carregarTabelaGerentePedidos(); + } + jPanel4.setVisible(true); + }//GEN-LAST:event_btnVerCarrinhosAntigosActionPerformed + + private void btnEsvaziarCarrinhoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEsvaziarCarrinhoActionPerformed + // TODO add your handling code here: + listaProdutos.clear(); + carregarTabelaProdutos(); + + }//GEN-LAST:event_btnEsvaziarCarrinhoActionPerformed + + private void btnRemoverItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoverItemActionPerformed + // TODO add your handling code here: + int index = tblProdutos.getSelectedRow(); + listaProdutos.remove(index); + //listaProdutos.clear(); + carregarTabelaProdutos(); + + }//GEN-LAST:event_btnRemoverItemActionPerformed + + private void btnRemoverItemMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnRemoverItemMouseClicked + // TODO add your handling code here: + int indiceItem = tblProdutos.getSelectedColumn(); + if (indiceItem>=0 && indiceItem<listaProdutos.size()){ + + listaProdutos.remove(indiceItem); + + } + carregarTabelaProdutos(); + + }//GEN-LAST:event_btnRemoverItemMouseClicked + + private void tblProdutosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblProdutosMouseClicked + // TODO add your handling code here: + btnRemoverItem.setEnabled(true); + }//GEN-LAST:event_tblProdutosMouseClicked + + private void btnPesquisarCarrinhoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarCarrinhoActionPerformed + // TODO add your handling code here: + enableCarrinhoFields(); + clearCarrinhoFields(); + btnCancelarCarrinho.setEnabled(true); + btnPesquisarCarrinho.setEnabled(false); + }//GEN-LAST:event_btnPesquisarCarrinhoActionPerformed + + private void btnCancelarCarrinhoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarCarrinhoActionPerformed + // TODO add your handling code here: + disableCarrinhoFields(); + btnPesquisarCarrinho.setEnabled(true); + btnCancelarCarrinho.setEnabled(false); + }//GEN-LAST:event_btnCancelarCarrinhoActionPerformed + + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: - new carrinhosAntigos().setVisible(true); + jPanel4.setVisible(false); }//GEN-LAST:event_jButton1ActionPerformed + private void tblClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblClienteMouseClicked + // TODO add your handling code here: + //enableCarrinhoFields(); + int row = tblCliente.getSelectedRow(); + int column = tblCliente.getSelectedColumn(); + Object carrinhoPesquisado = tblCliente.getValueAt(row,0); + String inputBuscaString = String.valueOf(carrinhoPesquisado); + int inputBuscaInt = Integer.parseInt(inputBuscaString); + + String selected=""; + for(Carrinho itemCarrinho : cliente.getListaCarrinho()){ + if(itemCarrinho.getNumCarrinho()==(inputBuscaInt)){ + Carrinho carrinho = itemCarrinho; + txtNumCarrinho.setText(String.valueOf(carrinho.getNumCarrinho())); + txtData.setText(String.valueOf(carrinho.getData())); + txtTotal.setText(String.valueOf(carrinho.getTotal())); + txtProdutos.setText(carrinho.mostrarProdutos()); + + } + } + }//GEN-LAST:event_tblClienteMouseClicked + /** * @param args the command line arguments */ @@ -220,13 +804,36 @@ public void run() { } // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnCancelarCarrinho; private javax.swing.JButton btnConfirmarCompra; private javax.swing.JButton btnEsvaziarCarrinho; + private javax.swing.JButton btnPesquisarCarrinho; private javax.swing.JButton btnRemoverItem; + private javax.swing.JButton btnSair; + private javax.swing.JButton btnVerCarrinhosAntigos; private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JPanel jPanel5; + private javax.swing.JPanel jPanel6; private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JLabel lblCarrinhosAnteriores; + private javax.swing.JLabel lblData; + private javax.swing.JLabel lblNumCarrinho; + private javax.swing.JLabel lblProdutos; private javax.swing.JLabel lblProdutosCarrinho; + private javax.swing.JLabel lblTotal; private javax.swing.JLabel lblVisualizarCarrinho; + private javax.swing.JTable tblCliente; private javax.swing.JTable tblProdutos; + private javax.swing.JFormattedTextField txtData; + private javax.swing.JTextField txtNumCarrinho; + private javax.swing.JTextArea txtProdutos; + private javax.swing.JTextField txtTotal; // End of variables declaration//GEN-END:variables } diff --git a/src/telas/verProdutos.form b/src/telas/verProdutos.form index 0bc78df..243cb7a 100644 --- a/src/telas/verProdutos.form +++ b/src/telas/verProdutos.form @@ -3,6 +3,10 @@ <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="Busca por produtos"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/pesquisar64.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -18,113 +22,113 @@ <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,54,0,0,7,126"/> </AuxValues> - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="813" 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="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="463" 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="jPanel1" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - </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"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="b6" green="e0" red="ed" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="jPanel1MouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="560" y="310" width="760" height="510"/> + </Constraint> + </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="317" max="-2" attributes="0"/> - <Component id="titulo" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Component id="Tabela" min="-2" pref="653" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="89" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="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="149" max="-2" attributes="0"/> - <Component id="btnSobre" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="199" max="-2" attributes="0"/> - <Component id="btnComprar" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="299" max="-2" attributes="0"/> - <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> - </Group> <Group type="102" alignment="0" attributes="0"> <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Component id="txtTitulo" min="-2" pref="493" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="titulo" min="-2" max="-2" attributes="0"/> + <Component id="txtTitulo" min="-2" pref="493" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> <Component id="jLabel1" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtQuantidade" min="-2" pref="38" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" attributes="0"> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - <EmptySpace min="154" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="Tabela" alignment="0" min="-2" pref="653" max="-2" attributes="0"/> + <Component id="lblNome" min="-2" max="-2" attributes="0"/> + <Component id="txtAutor" alignment="0" min="-2" pref="493" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="74" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="122" max="-2" attributes="0"/> + <Component id="btnSobre" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnComprar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="85" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblAutor" min="-2" pref="57" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="172" max="-2" attributes="0"/> </Group> </Group> </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="296" max="-2" attributes="0"/> + <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> + </Group> </Group> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <EmptySpace min="-2" 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="28" max="-2" attributes="0"/> - <Component id="titulo" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtQuantidade" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> + <EmptySpace min="-2" pref="41" max="-2" attributes="0"/> + <Component id="lblNome" min="-2" pref="31" max="-2" attributes="0"/> + </Group> + <Component id="titulo" alignment="0" min="-2" pref="53" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtQuantidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="3" min="-2" pref="22" max="-2" attributes="0"/> </Group> - <Component id="txtTitulo" min="-2" max="-2" attributes="0"/> + <Component id="txtTitulo" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblAutor" alignment="3" min="-2" pref="27" max="-2" attributes="0"/> + <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtAutor" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="13" max="32767" attributes="0"/> <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="Tabela" min="-2" pref="243" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="btnComprar" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="btnSobre" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnSobre" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnComprar" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -133,14 +137,19 @@ <Component class="javax.swing.JLabel" name="titulo"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Inter" size="24" style="1"/> + <Font name="Old London" size="36" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Produtos"/> + <Property name="text" type="java.lang.String" value="Pesquisar por produtos"/> + <Property name="toolTipText" type="java.lang.String" value=""/> </Properties> </Component> <Component class="javax.swing.JButton" name="btnPesquisar"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="14" style="1"/> + </Property> <Property name="text" type="java.lang.String" value="Pesquisar"/> + <Property name="toolTipText" type="java.lang.String" value="Pesquisar por título ou autor"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/> @@ -166,27 +175,27 @@ </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"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> <Title/> <Editor/> <Renderer/> @@ -211,15 +220,18 @@ <Component class="javax.swing.JLabel" name="lblNome"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Inter" size="14" style="0"/> + <Font name="Old London" size="24" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Nome:"/> + <Property name="text" type="java.lang.String" value="Titulo:"/> </Properties> </Component> <Component class="javax.swing.JButton" name="btnSobre"> <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/information_info_1565.png"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="99" red="0" type="rgb"/> + </Property> + <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="Sobre"/> </Properties> @@ -229,8 +241,11 @@ </Component> <Component class="javax.swing.JButton" name="btnComprar"> <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/accept_icon-icons.com_74428.png"/> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="cc" red="0" type="rgb"/> + </Property> + <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="Adicionar ao carrinho"/> </Properties> @@ -240,6 +255,9 @@ </Component> <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="18" style="0"/> + </Property> <Property name="text" type="java.lang.String" value="Quantidade"/> </Properties> </Component> @@ -250,7 +268,48 @@ </Component> <Component class="javax.swing.JTextField" name="txtTitulo"> </Component> + <Component class="javax.swing.JLabel" name="lblAutor"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="24" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Autor"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtAutor"> + </Component> </SubComponents> </Container> + <Component class="javax.swing.JButton" name="btnSair"> + <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="Old London" size="48" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairActionPerformed"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="1720" y="20" width="130" height="60"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/BuscarItem.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/verProdutos.java b/src/telas/verProdutos.java index ce82268..d46f6e8 100644 --- a/src/telas/verProdutos.java +++ b/src/telas/verProdutos.java @@ -5,23 +5,31 @@ import static classes.Carrinho.listaProdutos; import static classes.Estoque.estoque; import classes.Produto; +import java.util.Vector; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; +import static telas.Menu.logado; /** * * @author v */ public class verProdutos extends javax.swing.JFrame { - + public static Vector<Produto> auxProduto = new Vector<>(1); /** * Creates new form verProdutos */ public verProdutos() { initComponents(); + setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); carregarTabelaProdutos(); txtQuantidade.setText("1"); Produto item; + btnSobre.setEnabled(false); + Produto produto1 = estoque.get(0); + auxProduto.add(produto1); + } /** @@ -70,13 +78,30 @@ private void initComponents() { jLabel1 = new javax.swing.JLabel(); txtQuantidade = new javax.swing.JTextField(); txtTitulo = new javax.swing.JTextField(); + lblAutor = new javax.swing.JLabel(); + txtAutor = new javax.swing.JTextField(); + btnSair = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Busca por produtos"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/pesquisar64.png")).getImage()); + getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - titulo.setFont(new java.awt.Font("Inter", 1, 24)); // NOI18N - titulo.setText("Produtos"); + jPanel1.setBackground(new java.awt.Color(237, 224, 182)); + jPanel1.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + jPanel1MouseClicked(evt); + } + }); + titulo.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N + titulo.setText("Pesquisar por produtos"); + titulo.setToolTipText(""); + + btnPesquisar.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N btnPesquisar.setText("Pesquisar"); + btnPesquisar.setToolTipText("Pesquisar por título ou autor"); btnPesquisar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnPesquisarActionPerformed(evt); @@ -121,13 +146,21 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { } }); Tabela.setViewportView(tabela_produtos); + if (tabela_produtos.getColumnModel().getColumnCount() > 0) { + tabela_produtos.getColumnModel().getColumn(0).setResizable(false); + tabela_produtos.getColumnModel().getColumn(1).setResizable(false); + tabela_produtos.getColumnModel().getColumn(2).setResizable(false); + tabela_produtos.getColumnModel().getColumn(3).setResizable(false); + tabela_produtos.getColumnModel().getColumn(4).setResizable(false); + } lblResultadosPesquisa.setText("Resultados da pesquisa"); - lblNome.setFont(new java.awt.Font("Inter", 0, 14)); // NOI18N - lblNome.setText("Nome:"); + lblNome.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblNome.setText("Titulo:"); - btnSobre.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/information_info_1565.png"))); // NOI18N + btnSobre.setBackground(new java.awt.Color(0, 153, 255)); + btnSobre.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N btnSobre.setText("Sobre"); btnSobre.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -135,7 +168,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - btnComprar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/accept_icon-icons.com_74428.png"))); // NOI18N + btnComprar.setBackground(new java.awt.Color(0, 204, 0)); + btnComprar.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N btnComprar.setText("Adicionar ao carrinho"); btnComprar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -143,6 +177,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + jLabel1.setFont(new java.awt.Font("Old London", 0, 18)); // NOI18N jLabel1.setText("Quantidade"); txtQuantidade.addActionListener(new java.awt.event.ActionListener() { @@ -151,133 +186,239 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); + lblAutor.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblAutor.setText("Autor"); + 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(317, 317, 317) - .addComponent(titulo) - .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(Tabela, javax.swing.GroupLayout.PREFERRED_SIZE, 653, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(89, 89, 89)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(149, 149, 149) - .addComponent(btnSobre) - .addGap(199, 199, 199) - .addComponent(btnComprar)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(299, 299, 299) - .addComponent(lblResultadosPesquisa)) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(27, 27, 27) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 493, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(63, 63, 63) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(titulo) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 493, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(txtQuantidade, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtQuantidade, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(Tabela, javax.swing.GroupLayout.PREFERRED_SIZE, 653, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblNome) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 493, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 74, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(122, 122, 122) + .addComponent(btnSobre) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnPesquisar)) + .addComponent(btnComprar) + .addGap(85, 85, 85)) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(lblNome) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))) - .addGap(38, 38, 38)) + .addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnPesquisar) + .addGap(172, 172, 172)))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(296, 296, 296) + .addComponent(lblResultadosPesquisa))) + .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(28, 28, 28) - .addComponent(titulo) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(lblNome) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnPesquisar) - .addComponent(txtQuantidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel1))) + .addGap(41, 41, 41) + .addComponent(lblNome, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(titulo, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtQuantidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(txtTitulo, 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(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 13, Short.MAX_VALUE) .addComponent(lblResultadosPesquisa) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Tabela, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(btnComprar) - .addComponent(btnSobre)) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSobre) + .addComponent(btnComprar)) + .addContainerGap()) ); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 813, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .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) - .addGap(0, 463, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(0, 0, Short.MAX_VALUE) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE))) - ); + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(560, 310, 760, 510)); + + btnSair.setBackground(new java.awt.Color(255, 0, 0)); + btnSair.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + btnSair.setText("Sair"); + btnSair.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSairActionPerformed(evt); + } + }); + getContentPane().add(btnSair, new org.netbeans.lib.awtextra.AbsoluteConstraints(1720, 20, 130, 60)); + + jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/BuscarItem.png"))); // NOI18N + getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); pack(); }// </editor-fold>//GEN-END:initComponents private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed // TODO add your handling code here: + if (estoque == null || estoque.isEmpty()) { + JOptionPane.showMessageDialog(this, "O estoque está vazio ou não foi carregado.", "Erro", JOptionPane.ERROR_MESSAGE); + return; + } + + String tituloPesquisado = txtTitulo.getText().toLowerCase().trim(); + String autorPesquisado = txtAutor.getText().toLowerCase().trim(); + String tituloPesquisadoPuro = txtTitulo.getText(); + String autorPesquisadoPuro = txtAutor.getText(); + if (tituloPesquisado.isEmpty()&& autorPesquisado.isEmpty()) { + JOptionPane.showMessageDialog(this, "Por favor, insira um título ou autor para pesquisar.", "Aviso", JOptionPane.WARNING_MESSAGE); + carregarTabelaProdutos(); + return; + } + + + DefaultTableModel modeloTabelaProdutos = new DefaultTableModel(new Object[] {"Titulo", "Autor", "Gênero", "Valor", "Quant.Estoque"}, 0); + + boolean produtoEncontrado = false; + + boolean tituloVazio = tituloPesquisado.isBlank(); + boolean autorVazio = autorPesquisado.isBlank(); + for (Produto produto : estoque) { + if (produto != null && produto.getTitulo() != null && produto.getAutor() != null) { + boolean matchesTitle = tituloPesquisado.isBlank() || produto.getTitulo().toLowerCase().contains(tituloPesquisado); + boolean matchesAuthor = autorPesquisado.isBlank() || produto.getAutor().toLowerCase().contains(autorPesquisado); + + if (matchesTitle && matchesAuthor) { + Object novalinha[] = new Object[]{ + produto.getTitulo(), + produto.getAutor(), + produto.getGenero(), + produto.getPreço(), + produto.getQuantidadeEstoque() + }; + modeloTabelaProdutos.addRow(novalinha); + produtoEncontrado = true; + } + } + } +if (produtoEncontrado) { + tabela_produtos.setModel(modeloTabelaProdutos); + // Ajusta a largura das colunas + tabela_produtos.getColumnModel().getColumn(0).setPreferredWidth(100); + tabela_produtos.getColumnModel().getColumn(1).setPreferredWidth(50); + tabela_produtos.getColumnModel().getColumn(2).setPreferredWidth(14); + tabela_produtos.getColumnModel().getColumn(3).setPreferredWidth(8); + tabela_produtos.getColumnModel().getColumn(4).setPreferredWidth(3); +}else{ + if(autorPesquisado.isEmpty()){ + JOptionPane.showMessageDialog(this, "Nenhum produto encontrado com o título: " + tituloPesquisadoPuro, "Resultado da pesquisa", JOptionPane.INFORMATION_MESSAGE); + carregarTabelaProdutos(); // Load all products if no matches found + } + if(tituloPesquisado.isEmpty()){ + JOptionPane.showMessageDialog(this, "Nenhum produto encontrado com o autor: " + autorPesquisadoPuro, "Resultado da pesquisa", JOptionPane.INFORMATION_MESSAGE); + carregarTabelaProdutos(); + } + if((!tituloPesquisado.isEmpty())&&(!autorPesquisado.isEmpty())){ + JOptionPane.showMessageDialog(this, "Nenhum produto encontrado com o título: " + tituloPesquisadoPuro +" e autor: "+autorPesquisadoPuro, "Resultado da pesquisa", JOptionPane.INFORMATION_MESSAGE); + carregarTabelaProdutos(); + } + +} + + }//GEN-LAST:event_btnPesquisarActionPerformed private void btnSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSobreActionPerformed // TODO add your handling code here: + int row = tabela_produtos.getSelectedRow(); + int column = tabela_produtos.getSelectedColumn(); + Object produtoPesquisado = tabela_produtos.getValueAt(row,0); + String inputBusca = String.valueOf(produtoPesquisado); + String selected=""; + for(Produto itemEstoque : estoque){ + if(itemEstoque.getTitulo().equals(inputBusca)){ + Produto item = itemEstoque; + selected = item.getTitulo(); + auxProduto.set(0,item); + } + } + new infoProduto().setVisible(true); + }//GEN-LAST:event_btnSobreActionPerformed private void btnComprarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnComprarActionPerformed // TODO add your handling code here: - int i = tabela_produtos.getSelectedRow(); + //int i = tabela_produtos.getSelectedRow(); + if(!logado){ + JOptionPane.showMessageDialog(null, "Entre com uma conta para poder adicionar ao carrinho!", "Erro ao adicionar para carrinho", JOptionPane.ERROR_MESSAGE); + }else{ + + int row = tabela_produtos.getSelectedRow(); + int column = tabela_produtos.getSelectedColumn(); + Object produtoPesquisado = tabela_produtos.getValueAt(row,0); + System.out.println("Value selected at: "+produtoPesquisado); + String inputBusca = String.valueOf(produtoPesquisado); + txtTitulo.setText(inputBusca); + System.out.println("Item do inputBusca a ser aparecido na caixa de texto"+inputBusca); String selected=""; - System.out.println(i); + //System.out.println(i); + for(Produto itemEstoque : estoque){ + if(itemEstoque.getTitulo().equals(inputBusca)){ + Produto item = itemEstoque; + selected = item.getTitulo(); + System.out.println(item.getTitulo()); + txtTitulo.setText(item.getTitulo()); + } + } + /* 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); - Carrinho carrinho1 = new Carrinho(1,"27/08/2024"); - 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); + // 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); + //JOptionPane.showMessageDialog(null,"Item Encontrado!", "Notificação Adicionar item ao carrinho",JOptionPane.PLAIN_MESSAGE); itemComprado = itemBusca; - if(Integer.parseInt(txtQuantidade.getText())<itemComprado.getQuantidadeEstoque()){ + 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); + }else if(itemComprado.getQuantidadeEstoque()==0){ + JOptionPane.showMessageDialog(null, "Não há mais estoque para este item", "Erro ao adicionar item ao carrinho", JOptionPane.ERROR_MESSAGE); + }else if(Integer.parseInt(txtQuantidade.getText())>itemComprado.getQuantidadeEstoque()){ + JOptionPane.showMessageDialog(null, "Quantidade inserida acima da disponível!", "Erro ao adicionar item ao carrinho", JOptionPane.ERROR_MESSAGE); } } } +} + carregarTabelaProdutos(); }//GEN-LAST:event_btnComprarActionPerformed @@ -292,16 +433,28 @@ private void txtQuantidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN 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()); - } + int row = tabela_produtos.getSelectedRow(); + int column = tabela_produtos.getSelectedColumn(); + Object produtoPesquisado = tabela_produtos.getValueAt(row,0); + System.out.println("Value selected at: "+produtoPesquisado); + String inputBusca = String.valueOf(produtoPesquisado); + //txtTitulo.setText(inputBusca); + System.out.println("Item do inputBusca a ser aparecido na caixa de texto"+inputBusca); + btnSobre.setEnabled(true); }//GEN-LAST:event_tabela_produtosMouseClicked + private void btnSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnSairActionPerformed + + private void jPanel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanel1MouseClicked + // TODO add your handling code here: + btnSobre.setEnabled(false); + tabela_produtos.clearSelection(); + }//GEN-LAST:event_jPanel1MouseClicked + public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> @@ -339,13 +492,17 @@ public void run() { private javax.swing.JScrollPane Tabela; private javax.swing.JButton btnComprar; private javax.swing.JButton btnPesquisar; + private javax.swing.JButton btnSair; private javax.swing.JButton btnSobre; private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; private javax.swing.JPanel jPanel1; + private javax.swing.JLabel lblAutor; private javax.swing.JLabel lblNome; private javax.swing.JLabel lblResultadosPesquisa; private javax.swing.JTable tabela_produtos; private javax.swing.JLabel titulo; + private javax.swing.JTextField txtAutor; private javax.swing.JTextField txtQuantidade; private javax.swing.JTextField txtTitulo; // End of variables declaration//GEN-END:variables