diff --git a/README.md b/README.md index 8d834e2..716475b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,33 @@ -# BookStockManager - +# BookStockManager + +Bem-vindo ao **BookStockManager**, um software desenvolvido em Java com foco em programação orientada a objetos, ideal para gerenciar pequenas livrarias de forma eficiente e intuitiva. + +## Funcionalidades + +O **BookStockManager** oferece uma ampla gama de funcionalidades para facilitar a administração da sua livraria: + +### Gerenciamento de Estoque +- **Adicionar** novos produtos ao catálogo. +- **Remover** produtos obsoletos ou indesejados. +- **Editar** a quantidade de itens em estoque. +- **Excluir** produtos específicos do sistema. + +### Gerenciamento de Funcionários e Clientes +- **Acesso completo** à lista de funcionários e clientes cadastrados. +- **Adicionar e remover** funcionários que trabalham na livraria. +- Visualizar dados detalhados de cadastro e informações organizadas em tabelas. + +### Gerenciamento de Compras +- Realizar **pedidos diretamente no sistema**. +- Estoque atualizado automaticamente após a confirmação da compra. + +## Requisitos do Sistema +- **Java**: É necessário ter a versão mais recente instalada para executar o aplicativo. + +## Como Executar +1. Acesse a pasta `dist` do projeto. +2. Baixe e execute o arquivo `BookStockManager.jar`. + +Com o **BookStockManager**, a administração da sua livraria será prática, eficiente e organizada. + +--- diff --git a/build/classes/.netbeans_automatic_build b/build/classes/.netbeans_automatic_build deleted file mode 100644 index e69de29..0000000 diff --git a/build/classes/.netbeans_update_resources b/build/classes/.netbeans_update_resources deleted file mode 100644 index e69de29..0000000 diff --git a/build/classes/Compra/Produto.class b/build/classes/Compra/Produto.class deleted file mode 100644 index 4616f08..0000000 Binary files a/build/classes/Compra/Produto.class and /dev/null differ diff --git a/build/classes/bookstockmanager/BookStockManager.class b/build/classes/bookstockmanager/BookStockManager.class deleted file mode 100644 index 24dc125..0000000 Binary files a/build/classes/bookstockmanager/BookStockManager.class and /dev/null differ diff --git a/build/classes/classes/Carrinho.class b/build/classes/classes/Carrinho.class index dcfd33a..df84bd4 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..f747da4 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 2f2447b..3f2c815 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..caf8963 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 a4433e6..9ed6fe0 100644 Binary files a/build/classes/classes/Gerente.class and b/build/classes/classes/Gerente.class differ diff --git a/build/classes/classes/Pagamento.class b/build/classes/classes/Pagamento.class index 418b0db..83d9277 100644 Binary files a/build/classes/classes/Pagamento.class and b/build/classes/classes/Pagamento.class differ diff --git a/build/classes/classes/Pedido.class b/build/classes/classes/Pedido.class index 5e13cb6..f56401e 100644 Binary files a/build/classes/classes/Pedido.class and b/build/classes/classes/Pedido.class differ diff --git a/build/classes/classes/Produto.class b/build/classes/classes/Produto.class index 0234dc6..3b903d7 100644 Binary files a/build/classes/classes/Produto.class and b/build/classes/classes/Produto.class differ diff --git a/build/classes/classes/Usuario.class b/build/classes/classes/Usuario.class index 21ee251..83945b9 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 81945ef..e4e68da 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 b1e8627..7791d31 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 d9aaa48..981c599 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 e565802..7c2f1cf 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 bc3ab9f..ba2a29f 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 34f778c..5fbf54a 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 312c213..90cd014 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 1b4814f..31a92f7 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 aed4bfe..6af63dd 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 deleted file mode 100644 index b2c096d..0000000 --- a/build/classes/telas/Menu.form +++ /dev/null @@ -1,296 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/classes/telas/areaCliente$1.class b/build/classes/telas/areaCliente$1.class index 3697381..7a3c1aa 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 a5a56bc..6b3612d 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 e1012e9..4304a97 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 3f2c341..0489f96 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 5738189..fb5d8e5 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$6.class b/build/classes/telas/areaCliente$6.class deleted file mode 100644 index a42d6a8..0000000 Binary files a/build/classes/telas/areaCliente$6.class and /dev/null differ diff --git a/build/classes/telas/areaCliente$7.class b/build/classes/telas/areaCliente$7.class deleted file mode 100644 index 33ec6a1..0000000 Binary files a/build/classes/telas/areaCliente$7.class and /dev/null differ diff --git a/build/classes/telas/areaCliente$8.class b/build/classes/telas/areaCliente$8.class deleted file mode 100644 index 6b0c8c1..0000000 Binary files a/build/classes/telas/areaCliente$8.class and /dev/null differ diff --git a/build/classes/telas/areaCliente$9.class b/build/classes/telas/areaCliente$9.class deleted file mode 100644 index f23c9ef..0000000 Binary files a/build/classes/telas/areaCliente$9.class and /dev/null differ diff --git a/build/classes/telas/areaCliente.class b/build/classes/telas/areaCliente.class index dff690b..2294e92 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 deleted file mode 100644 index 9eeb4a5..0000000 --- a/build/classes/telas/areaCliente.form +++ /dev/null @@ -1,337 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/classes/telas/areaFuncionario$1.class b/build/classes/telas/areaFuncionario$1.class index 388717d..625ee3f 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..b22ee24 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..24c25c9 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..0a62700 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..645b32a 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 deleted file mode 100644 index 9618935..0000000 --- a/build/classes/telas/areaFuncionario.form +++ /dev/null @@ -1,255 +0,0 @@ - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/classes/telas/areaGerente$1.class b/build/classes/telas/areaGerente$1.class index be1de62..b4cef17 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 e3b0d8a..3b72ade 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 f9ecdec..0050c70 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 4316089..bafb2c8 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 04b3235..07acc41 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 c7725c2..48d6918 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 f8a9adf..51fa807 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 8562f17..0d58506 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 e878e23..5bd7c77 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 6e3f4e3..ad9714f 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 deleted file mode 100644 index 5d716f0..0000000 --- a/build/classes/telas/areaGerente.form +++ /dev/null @@ -1,695 +0,0 @@ - - -
- - - - - - - - - - - - - - - - -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> - <Title/> - <Editor/> - <Renderer/> - </Column> - </TableColumnModel> - </Property> - <Property name="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> - <TableHeader reorderingAllowed="true" resizingAllowed="true"/> - </Property> - </Properties> - </Component> - </SubComponents> - </Container> - <Component class="javax.swing.JButton" name="btnSalvarFuncionario"> - <Properties> - <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> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarFuncionarioActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JButton" name="btnExcluirFuncionario"> - <Properties> - <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> - </Component> - <Component class="javax.swing.JLabel" name="lblControleFuncionarios"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="48" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Controle de funcionários"/> - </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="850" y="670" width="940" height="390"/> - </Constraint> - </Constraints> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="253" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jTextField1" min="-2" pref="225" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> - <Component id="jLabel4" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jTextField2" min="-2" pref="109" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel5" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jTextField3" min="-2" pref="173" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="jButton1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="104" max="-2" attributes="0"/> - <Component id="jButton2" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="213" max="-2" attributes="0"/> - <Component id="jButton3" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> - <Component id="jButton4" 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="jLabel2" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="0" pref="293" 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="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="jLabel3"> - <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="jTextField1"> - </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 English Text MT" size="18" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="CPF"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="jTextField2"> - </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 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="jTextField3"> - </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 English Text MT" size="18" style="0"/> - </Property> - <Property name="text" type="java.lang.String" value="Buscar"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton2"> - <Properties> - <Property name="text" type="java.lang.String" value="Novo"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton3"> - <Properties> - <Property name="text" type="java.lang.String" value="Salvar"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton4"> - <Properties> - <Property name="text" type="java.lang.String" value="Excluir"/> - </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/ÁreaGerente.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="-30" width="1920" height="1140"/> - </Constraint> - </Constraints> - </Component> - </SubComponents> -</Form> diff --git a/build/classes/telas/cadastarGerente$1.class b/build/classes/telas/cadastarGerente$1.class index 8c6380a..e8b7901 100644 Binary files a/build/classes/telas/cadastarGerente$1.class and b/build/classes/telas/cadastarGerente$1.class differ diff --git a/build/classes/telas/cadastarGerente$2.class b/build/classes/telas/cadastarGerente$2.class index 54ba980..5815bb3 100644 Binary files a/build/classes/telas/cadastarGerente$2.class and b/build/classes/telas/cadastarGerente$2.class differ diff --git a/build/classes/telas/cadastarGerente.class b/build/classes/telas/cadastarGerente.class index ef75a61..eb9bd87 100644 Binary files a/build/classes/telas/cadastarGerente.class and b/build/classes/telas/cadastarGerente.class differ diff --git a/build/classes/telas/cadastarGerente.form b/build/classes/telas/cadastarGerente.form deleted file mode 100644 index 446b855..0000000 --- a/build/classes/telas/cadastarGerente.form +++ /dev/null @@ -1,211 +0,0 @@ -<?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="2"/> - <Property name="title" type="java.lang.String" value="Cadastro de Gerentes"/> - <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> - <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/customer_person_people_man_you_1625.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,1,5,0,0,2,-64"/> - </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="jPanel1"> - <Constraints> - <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="20" y="0" width="670" height="220"/> - </Constraint> - </Constraints> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - <Component id="jLabel6" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Component id="lblNomeGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtNomeGerente" min="-2" pref="212" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblEmailGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtEmailGerente" pref="127" max="32767" attributes="0"/> - </Group> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblCadastroGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtCadastroGerente" min="-2" pref="137" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblCPFGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="txtCPFGerente" min="-2" pref="78" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> - <Component id="lblSenhaGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="txtSenhaGerente" max="32767" attributes="0"/> - <EmptySpace min="-2" pref="231" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="105" max="-2" attributes="0"/> - <Component id="btnSalvarGerente" min="-2" pref="85" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnCancelarGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="127" 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="jLabel6" min="-2" max="-2" 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="lblNomeGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblEmailGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblCadastroGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtEmailGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCadastroGerente" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <Component id="txtNomeGerente" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblCPFGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblSenhaGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtCPFGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtSenhaGerente" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace pref="43" max="32767" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnSalvarGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnCancelarGerente" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="57" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="lblNomeGerente"> - <Properties> - <Property name="text" type="java.lang.String" value="Nome"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblCPFGerente"> - <Properties> - <Property name="text" type="java.lang.String" value="CPF"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblEmailGerente"> - <Properties> - <Property name="text" type="java.lang.String" value="E-mail"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblSenhaGerente"> - <Properties> - <Property name="text" type="java.lang.String" value="senha"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblCadastroGerente"> - <Properties> - <Property name="text" type="java.lang.String" value="Cadastro Gerente"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtNomeGerente"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="Insira o nome do gerente"/> - </Properties> - </Component> - <Component class="javax.swing.JFormattedTextField" name="txtCPFGerente"> - <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="inserir o CPF do gerente"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtEmailGerente"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="Inserir o e-mail do gerente"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtSenhaGerente"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="definir uma senha para o gerente"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtCadastroGerente"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="Inserir o cadastro do gerente"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnSalvarGerente"> - <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="Salvar"/> - <Property name="toolTipText" type="java.lang.String" value="salvar dados do gerente"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSalvarGerenteActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JButton" name="btnCancelarGerente"> - <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="btnCancelarGerenteActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="jLabel6"> - <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="Cadastro de Gerentes"/> - </Properties> - </Component> - </SubComponents> - </Container> - </SubComponents> -</Form> diff --git a/build/classes/telas/cadastrarCliente$1.class b/build/classes/telas/cadastrarCliente$1.class index d382efa..9432546 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 ee62643..a1b93b3 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 4f990d2..8b2d3b4 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 deleted file mode 100644 index fe416fe..0000000 --- a/build/classes/telas/cadastrarCliente.form +++ /dev/null @@ -1,300 +0,0 @@ -<?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="2"/> - <Property name="title" type="java.lang.String" value="Cadastrar Cliente"/> - <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> - <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/person_user_customer_man_male_man_boy_people_1687 (1).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"/> - </AuxValues> - - <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 pref="29" max="32767" 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> - </DimensionLayout> - </Layout> - <SubComponents> - <Container class="javax.swing.JPanel" name="jPanel1"> - - <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="35" 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"/> - </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> - </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"> - <Component id="btnCancelarCliente" min="-2" max="-2" attributes="0"/> - <Component id="txtEmailCliente" min="-2" pref="161" max="-2" attributes="0"/> - </Group> - </Group> - </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> - </Group> - <EmptySpace pref="37" 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="jLabel1" 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="txtDataCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="ftxDataCliente" 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"/> - </Group> - <EmptySpace min="-2" pref="43" 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"/> - <Component id="lblCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="ftxCPFCliente" 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 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"/> - </Group> - <EmptySpace pref="23" max="32767" attributes="0"/> - <Component id="lblTeste" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" 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> - </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="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> - <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> -</Form> diff --git a/build/classes/telas/cadastrarFuncionario$1.class b/build/classes/telas/cadastrarFuncionario$1.class index 6f9db5c..59de5fc 100644 Binary files a/build/classes/telas/cadastrarFuncionario$1.class and b/build/classes/telas/cadastrarFuncionario$1.class differ diff --git a/build/classes/telas/cadastrarFuncionario$2.class b/build/classes/telas/cadastrarFuncionario$2.class index 4579f3c..abfa257 100644 Binary files a/build/classes/telas/cadastrarFuncionario$2.class and b/build/classes/telas/cadastrarFuncionario$2.class differ diff --git a/build/classes/telas/cadastrarFuncionario.class b/build/classes/telas/cadastrarFuncionario.class index ae7a605..28e0bf6 100644 Binary files a/build/classes/telas/cadastrarFuncionario.class and b/build/classes/telas/cadastrarFuncionario.class differ diff --git a/build/classes/telas/cadastrarFuncionario.form b/build/classes/telas/cadastrarFuncionario.form deleted file mode 100644 index 118b8dc..0000000 --- a/build/classes/telas/cadastrarFuncionario.form +++ /dev/null @@ -1,245 +0,0 @@ -<?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="2"/> - <Property name="title" type="java.lang.String" value="Cadastro de funcionários"/> - <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> - <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/technicalsupport_support_representative_person_people_man_1641.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"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel1" alignment="0" max="32767" attributes="0"/> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <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> - </Layout> - <SubComponents> - <Container class="javax.swing.JPanel" name="jPanel1"> - - <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" attributes="0"> - <Component id="btnSairFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="137" 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" attributes="0"> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="lblNomeFuncionario" min="-2" max="-2" attributes="0"/> - <Component id="lblCPFFuncionario" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="txtNomeFuncionario" min="-2" pref="158" max="-2" attributes="0"/> - <Component id="ftxCPFFuncionario" min="-2" 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" 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" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </Group> - <EmptySpace pref="34" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblCadastroFuncionario" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="btnSairFuncionario" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace min="-2" pref="31" 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="Salvar"/> - <Property name="toolTipText" type="java.lang.String" value="Salvar 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.JButton" name="btnSairFuncionario"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/exit_icon-icons.com_70975.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Sair"/> - <Property name="toolTipText" type="java.lang.String" value="Sair do cadastro de funcionário"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairFuncionarioActionPerformed"/> - </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> -</Form> diff --git a/build/classes/telas/telaLogin$1.class b/build/classes/telas/telaLogin$1.class index 4d04b30..f98f220 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 159644d..757a4c8 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 deleted file mode 100644 index aec091d..0000000 --- a/build/classes/telas/telaLogin.form +++ /dev/null @@ -1,177 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="2"/> - <Property name="title" type="java.lang.String" value="Tela de Login"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" 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> - <SubComponents> - <Container class="javax.swing.JPanel" name="jPanel1"> - - <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="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> - </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> - </Group> - <EmptySpace pref="79" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> - <Component id="lblLogin" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblEmail" min="-2" max="-2" attributes="0"/> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="txtEmail" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblSenha" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="5" max="-2" attributes="0"/> - <Component id="txtSenha" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnEntrar" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnCancelar" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblCadastrarse" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="38" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <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"/> - </Property> - <Property name="text" type="java.lang.String" value="Bem vindo"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblEmail"> - <Properties> - <Property name="text" type="java.lang.String" value="E-mail"/> - <Property name="toolTipText" type="java.lang.String" value=""/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtEmail"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="Insira o email"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblSenha"> - <Properties> - <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"/> - </Property> - <Property name="text" type="java.lang.String" value="Entrar"/> - <Property name="toolTipText" type="java.lang.String" value="fazer login"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEntrarActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JButton" name="btnCancelar"> - <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"/> - </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="lblCadastrarse"> - <Properties> - <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="66" green="66" red="ff" type="rgb"/> - </Property> - <Property name="text" type="java.lang.String" value="Não tem uma conta? Cadastrar-se como cliente."/> - </Properties> - <Events> - <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblCadastrarseMouseClicked"/> - </Events> - </Component> - </SubComponents> - </Container> - </SubComponents> -</Form> diff --git a/build/classes/telas/telaPagamento$1.class b/build/classes/telas/telaPagamento$1.class index 0341d92..305fb24 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..4599b21 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 deleted file mode 100644 index 59498b9..0000000 --- a/build/classes/telas/telaPagamento.form +++ /dev/null @@ -1,181 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="2"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="167" max="-2" attributes="0"/> - <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> - <Group type="103" groupAlignment="1" attributes="0"> - <Component id="btnPagar" min="-2" max="-2" attributes="0"/> - <Component id="lblFormaPagamento" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="rdbBoleto" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> - <Component id="rdbPix" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace min="-2" pref="71" max="-2" attributes="0"/> - <Component id="btnCancelar" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - </Group> - </Group> - <EmptySpace pref="50" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblValorTotal" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblNumCarrinho" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblProduto" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="txtValorTotal" pref="136" max="32767" attributes="0"/> - <Component id="txtNumCarrinho" max="32767" attributes="0"/> - <Component id="txtProdutos" max="32767" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="txtValorTotal" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblValorTotal" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" 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"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblProduto" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtProdutos" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblFormaPagamento" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="rdbBoleto" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="rdbPix" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="34" 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"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="lblPagamento"> - <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="Pagamento"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblValorTotal"> - <Properties> - <Property name="text" type="java.lang.String" value="Valor Total"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtValorTotal"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="valor total"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblFormaPagamento"> - <Properties> - <Property name="text" type="java.lang.String" value="Forma de pagamento"/> - </Properties> - </Component> - <Component class="javax.swing.JRadioButton" name="rdbBoleto"> - <Properties> - <Property name="text" type="java.lang.String" value="Boleto"/> - </Properties> - </Component> - <Component class="javax.swing.JRadioButton" name="rdbPix"> - <Properties> - <Property name="text" type="java.lang.String" value="Pix"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblNumCarrinho"> - <Properties> - <Property name="text" type="java.lang.String" value="Número do carrinho"/> - </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.JLabel" name="lblProduto"> - <Properties> - <Property name="text" type="java.lang.String" value="Produtos"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtProdutos"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="seus produtos"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnPagar"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/3440914-bag-basket-cart-ecommerce-pay-shopping-store_107519.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Pagar"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnCancelar"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/cancel_77947.png"/> - </Property> - <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> - </SubComponents> -</Form> diff --git a/build/classes/telas/verCarrinho$1.class b/build/classes/telas/verCarrinho$1.class index 3c36fce..c46d62d 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 06284c9..42a48b7 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 fecd84f..67ffbf8 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 deleted file mode 100644 index baaf9d5..0000000 --- a/build/classes/telas/verCarrinho.form +++ /dev/null @@ -1,201 +0,0 @@ -<?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="2"/> - <Property name="title" type="java.lang.String" value="Visualizar meu carrinho"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" 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"/> - </Group> - <Component id="jScrollPane1" min="-2" pref="762" max="-2" attributes="0"/> - </Group> - </Group> - </Group> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="250" max="-2" attributes="0"/> - <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace pref="48" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblVisualizarCarrinho" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblProdutosCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="jScrollPane1" min="-2" pref="270" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnRemoverItem" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnEsvaziarCarrinho" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnConfirmarCompra" alignment="3" min="-2" max="-2" attributes="0"/> - </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"/> - <SubComponents> - <Component class="javax.swing.JTable" name="tblProdutos"> - <Properties> - <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> - <Table columnCount="5" rowCount="4"> - <Column editable="true" title="Título" type="java.lang.String"/> - <Column editable="true" title="Preço" type="java.lang.Double"/> - <Column editable="true" title="Quantidade" type="java.lang.Integer"/> - <Column editable="true" title="Cód. Produto" type="java.lang.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> - </Properties> - </Component> - </SubComponents> - </Container> - <Component class="javax.swing.JButton" name="btnRemoverItem"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="99" green="99" red="99" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Remover item"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnEsvaziarCarrinho"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Esvaziar carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblProdutosCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Meus produtos no carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnConfirmarCompra"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="ff" red="0" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Confirmar compra"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConfirmarCompraActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="lblVisualizarCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="24" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Visualizar Carrinho Atual"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton1"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Ver carrinhos antigos"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> - </Events> - </Component> - </SubComponents> -</Form> diff --git a/build/classes/telas/verProdutos$1.class b/build/classes/telas/verProdutos$1.class index be364af..82d0d12 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 ed2c5b3..e201e97 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 59be3f6..036821c 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 da93a77..9fca55a 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 e935a1a..891cb99 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 deleted file mode 100644 index 6c661da..0000000 --- a/build/classes/telas/verProdutos.form +++ /dev/null @@ -1,213 +0,0 @@ -<?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="2"/> - </Properties> - <SyntheticProperties> - <SyntheticProperty name="formSizePolicy" type="int" value="1"/> - <SyntheticProperty name="generateCenter" type="boolean" value="false"/> - </SyntheticProperties> - <AuxValues> - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> - </AuxValues> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <EmptySpace min="0" pref="789" 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> - <SubComponents> - <Container class="javax.swing.JPanel" name="jPanel1"> - - <Layout> - <DimensionLayout dim="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="0" attributes="0"> - <EmptySpace min="-2" pref="58" max="-2" attributes="0"/> - <Component id="jScrollPane1" min="-2" pref="483" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="70" max="-2" attributes="0"/> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - </Group> - <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> - <EmptySpace pref="150" max="32767" attributes="0"/> - </Group> - <Group type="102" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="317" 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="40" max="-2" attributes="0"/> - <Component id="jScrollPane2" min="-2" pref="653" max="-2" attributes="0"/> - </Group> - </Group> - <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="0" attributes="0"> - <EmptySpace min="-2" pref="28" max="-2" attributes="0"/> - <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="0" min="-2" pref="38" max="-2" attributes="0"/> - <Component id="btnPesquisar" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane2" 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> - <EmptySpace max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <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="Pesquisa"> - <Properties> - <Property name="columns" type="int" value="20"/> - <Property name="rows" type="int" value="5"/> - </Properties> - </Component> - </SubComponents> - </Container> - <Component class="javax.swing.JLabel" name="lblProdutos"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Inter" size="24" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Produtos"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnPesquisar"> - <Properties> - <Property name="text" type="java.lang.String" value="Pesquisar"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnPesquisarActionPerformed"/> - </Events> - </Component> - <Container class="javax.swing.JScrollPane" name="jScrollPane2"> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTable" name="tabela_produtos"> - <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="Autor" type="java.lang.String"/> - <Column editable="true" title="Gênero" type="java.lang.String"/> - <Column editable="true" title="Valor" type="java.lang.Float"/> - <Column editable="true" title="quant. estoque" type="java.lang.Integer"/> - </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.JLabel" name="lblResultadosPesquisa"> - <Properties> - <Property name="text" type="java.lang.String" value="Resultados da pesquisa"/> - </Properties> - </Component> - <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"/> - </Property> - <Property name="text" type="java.lang.String" value="Nome:"/> - </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> - <Property name="text" type="java.lang.String" value="Sobre"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSobreActionPerformed"/> - </Events> - </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> - <Property name="text" type="java.lang.String" value="Comprar"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnComprarActionPerformed"/> - </Events> - </Component> - </SubComponents> - </Container> - </SubComponents> -</Form> diff --git a/dist/BookStockManager.jar b/dist/BookStockManager.jar new file mode 100644 index 0000000..19e6190 Binary files /dev/null and b/dist/BookStockManager.jar differ diff --git a/dist/README.TXT b/dist/README.TXT new file mode 100644 index 0000000..ea2bd49 --- /dev/null +++ b/dist/README.TXT @@ -0,0 +1,32 @@ +======================== +BUILD OUTPUT DESCRIPTION +======================== + +When you build an Java application project that has a main class, the IDE +automatically copies all of the JAR +files on the projects classpath to your projects dist/lib folder. The IDE +also adds each of the JAR files to the Class-Path element in the application +JAR files manifest file (MANIFEST.MF). + +To run the project from the command line, go to the dist folder and +type the following: + +java -jar "BookStockManager.jar" + +To distribute this project, zip up the dist folder (including the lib folder) +and distribute the ZIP file. + +Notes: + +* If two JAR files on the project classpath have the same name, only the first +JAR file is copied to the lib folder. +* Only JAR files are copied to the lib folder. +If the classpath contains other types of files or folders, these files (folders) +are not copied. +* If a library on the projects classpath also has a Class-Path element +specified in the manifest,the content of the Class-Path element has to be on +the projects runtime path. +* To set a main class in a standard Java project, right-click the project node +in the Projects window and choose Properties. Then click Run and enter the +class name in the Main Class field. Alternatively, you can manually type the +class name in the manifest Main-Class element. diff --git a/dist/lib/AbsoluteLayout.jar b/dist/lib/AbsoluteLayout.jar new file mode 100644 index 0000000..2a1e92c Binary files /dev/null and b/dist/lib/AbsoluteLayout.jar differ diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties index ac05a3b..af2817e 100644 --- a/nbproject/private/private.properties +++ b/nbproject/private/private.properties @@ -1,2 +1,8 @@ compile.on.save=true +do.depend=false +do.jar=true +do.jlink=false +javac.debug=true +javadoc.preview=true +jlink.strip=false user.properties.file=C:\\Users\\Yuri\\AppData\\Roaming\\NetBeans\\22\\build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index edbd425..d6085e2 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -3,25 +3,36 @@ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <group> - <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/cadastarGerente.java</file> - <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/teste.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/Menu.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/cadastrarCliente.java</file> - <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/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/telas/ControleClientes.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaCliente.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaFuncionario.java</file> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/telaPagamento.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/classes/Produto.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/CriarNovoProduto.java</file> + <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/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/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> <file>file:/E:/@Meus%20Documentos/Documents/NetBeansProjects/BookStockManager/BookStockManager/src/telas/areaGerente.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/telas/carrinhosAntigos.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/Compra.java</file> </group> </open-files> </project-private> diff --git a/nbproject/project.properties b/nbproject/project.properties index df9a095..2c8b41f 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,9 +1,10 @@ annotation.processing.enabled=true annotation.processing.enabled.in.editor=false -annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=BookStockManager +application.vendor=v build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: @@ -32,6 +33,7 @@ dist.jar=${dist.dir}/BookStockManager.jar dist.javadoc.dir=${dist.dir}/javadoc dist.jlink.dir=${dist.dir}/jlink dist.jlink.output=${dist.jlink.dir}/BookStockManager +endorsed.classpath= excludes= includes=** jar.compress=false @@ -72,7 +74,7 @@ jlink.additionalmodules= jlink.additionalparam= jlink.launcher=true jlink.launcher.name=BookStockManager -main.class=bookstockmanager.BookStockManager +main.class=telas.Menu manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false diff --git a/src/bookstockmanager/BookStockManager.java b/src/bookstockmanager/BookStockManager.java deleted file mode 100644 index f6233a3..0000000 --- a/src/bookstockmanager/BookStockManager.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license - * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template - */ -package bookstockmanager; - -/** - * - * @author Yuri - */ -public class BookStockManager { - - /** - * @param args the command line arguments - */ - public static void main(String[] args) { - // TODO code application logic here - } - -} diff --git a/src/classes/Carrinho.java b/src/classes/Carrinho.java index f40f442..67ccf68 100644 --- a/src/classes/Carrinho.java +++ b/src/classes/Carrinho.java @@ -1,26 +1,81 @@ package classes; +import java.util.ArrayList; import java.util.List; import java.util.Date; public class Carrinho { //Declaração de atributos protegidos do carrinho protected int numCarrinho; - protected Date data; + protected String data; protected double total; - protected List<String> produtos; + //lista stática com a lista de produtos no carrinho + public static ArrayList<Produto> listaProdutos = new ArrayList(); + //ArrayList de produtos que vai ser clonado da lista de Produtos. Ele serve para guardar os itens que foram comprados nesse carrinho na parte de carrinhos anteriores + public ArrayList<Produto> itensNoCarrinho = new ArrayList(); + private Pedido pedido = new Pedido(); + private Pagamento pagamento; + //Construtor de carrinho. Um vazio e outro com os atributos dados public Carrinho() { } + + public Carrinho(int numCarrinho, String data) { + this.numCarrinho = numCarrinho; + this.data = data; + } - public Carrinho(int numCarrinho, Date data, double total, List<String> produtos) { + + + public Carrinho(int numCarrinho, String data,ArrayList<Produto> itensNoCarrinho) { this.numCarrinho = numCarrinho; this.data = data; - this.total = total; - this.produtos = produtos; + this.itensNoCarrinho = itensNoCarrinho; + this.total = 0; + double saldo = 0; + for(Produto item : itensNoCarrinho){ + saldo += item.getPreço()*item.getQuantidadeComprada(); + + } + this.total=saldo; } + //Contabiliza o saldo total do carrinho com base nos produtos na lista + public void contarSaldo(){ + double saldo = 0; + for(Produto item : itensNoCarrinho){ + saldo += item.getPreço()*item.getQuantidadeComprada(); + + } + this.total=saldo; + + } + public void addItem(Produto item){ + itensNoCarrinho.add(item); + } + public void removeItem(int i){ + itensNoCarrinho.remove(i); + } + public void clearLista(){ + listaProdutos.clear(); + } + + public String mostarProdutos(ArrayList<Produto> itensNoCarrinho){ + StringBuilder resumo = new StringBuilder(); + for (Produto item : itensNoCarrinho) { + resumo.append(item.getTitulo()).append("*").append(item.getQuantidadeComprada()).append("\n"); + } + return resumo.toString(); + + } + public String mostrarProdutos(){ + StringBuilder resumo = new StringBuilder(); + for (Produto item : this.itensNoCarrinho) { + resumo.append(item.getTitulo()).append("*").append(item.getQuantidadeComprada()).append("\n"); + } + return resumo.toString(); + } //Métodos getters e setters para cada um dos atributos public int getNumCarrinho() { @@ -31,13 +86,6 @@ public void setNumCarrinho(int numCarrinho) { this.numCarrinho = numCarrinho; } - public Date getData() { - return data; - } - - public void setData(Date data) { - this.data = data; - } public double getTotal() { return total; @@ -47,13 +95,39 @@ public void setTotal(double total) { this.total = total; } - public List<String> getProdutos() { - return produtos; + public void setData(String data) { + this.data = data; } - public void setProdutos(List<String> produtos) { - this.produtos = produtos; + public String getData() { + return data; } - - + + + public ArrayList<Produto> getItensNoCarrinho() { + return itensNoCarrinho; + } + + public void setItensNoCarrinho(ArrayList<Produto> itensNoCarrinho) { + this.itensNoCarrinho = itensNoCarrinho; + } + + public Pedido getPedido() { + return pedido; + } + + public void setPedido(Pedido pedido) { + this.pedido = pedido; + } + + public Pagamento getPagamento() { + return pagamento; + } + + public void setPagamento(Pagamento pagamento) { + this.pagamento = pagamento; + } + + + } diff --git a/src/classes/Cliente.java b/src/classes/Cliente.java index 87704b9..ee1faee 100644 --- a/src/classes/Cliente.java +++ b/src/classes/Cliente.java @@ -4,23 +4,27 @@ */ package classes; +import static classes.Estoque.estoque; import java.util.ArrayList; +import javax.swing.JOptionPane; /** * * @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(); + //Esse index serve para que a lista de clientes seja acessada na hora do login e o cliente certo seja buscado + //MUITO IMPORTANTE. public static int index_cliente; @@ -37,6 +41,64 @@ public Cliente(String nome, String CPF, String email, String senha) { super(nome, CPF, email, senha); this.idCliente = "0"; } + //Método de login que é implementado pelo OperadorSistema + @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; + + } + //Método de logout que é implementado pelo OperadorSistema + @Override + public boolean logout() { + return logado=false; + } + //Método de pesquisar que é implementado pelo OperadorSistema. + @Override + public void pesquisar(String titulo) { + for(Produto produto:estoque){ + if(produto.getTitulo().equals(titulo)){ + System.out.println("Produto Encontrado"); + } + } + + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + //Serve para retornar o email do cliente + @Override + public String consultarEmail(String cpf,String nome) { + boolean found = false; + for(Cliente cli:listaClientes){ + if(cli.getCPF().equals(cpf) && cli.getNome().equals(nome)){ + found = true; + return this.getEmail(); + } + } + if(!found){ + JOptionPane.showMessageDialog(null, "Email não encontrado como cliente no sistema!", "Busca por email", JOptionPane.ERROR_MESSAGE); + return "Email não encontrado"; + }else{ + JOptionPane.showMessageDialog(null, "Email encontrado com sucesso!", "Busca por email", JOptionPane.INFORMATION_MESSAGE); + return this.getEmail(); + } +} + //Permite que o cliente redefina a sua senha + @Override + public void esqueciSenha(String email, String cpf, String novaSenha) { + for(Cliente cliente : listaClientes){ + if((cliente.getCPF().equals(cpf))&&(cliente.getEmail().equals(email))){ + cliente.setSenha(novaSenha); + } + } + } + public void Comprar(String produto,int Quantidade){ + System.out.println("Item adicionado ao carrinho!"); + +} @@ -66,14 +128,6 @@ public void setCelular(String celular) { this.celular = celular; } - public ArrayList getCarrinho() { - return carrinho; - } - - public void setCarrinho(ArrayList carrinho) { - this.carrinho = carrinho; - } - public Cliente() { } @@ -83,10 +137,7 @@ public ArrayList getListaClientes() { - public void Comprar(String produto,int Quantidade){ - System.out.println("Item adicionado ao carrinho!"); - -} + public String getIdCliente() { return idCliente; @@ -98,6 +149,18 @@ public static int getIndex_cliente() { } + + public ArrayList<Carrinho> getListaCarrinho() { + return listaCarrinho; + } + + + public void addCarrinhoLista(Carrinho carrinho){ + listaCarrinho.add(carrinho); + } + + + } diff --git a/src/classes/Compra.java b/src/classes/Compra.java index e3fb6d8..c6de05d 100644 --- a/src/classes/Compra.java +++ b/src/classes/Compra.java @@ -1,7 +1,10 @@ package classes; - +//Classe compra que é uma associação terciária entre Usuário, Carrinho e Produto public class Compra { + //Relaciona um usuário private Usuario usuario; + //Um carrinho private Carrinho carrinho; + //E vários produtos private Produto[] produto; } diff --git a/src/classes/Estoque.java b/src/classes/Estoque.java index 2269cdf..92a03c0 100644 --- a/src/classes/Estoque.java +++ b/src/classes/Estoque.java @@ -10,21 +10,29 @@ * * @author Yuri */ +//Classe de estoque que serve para armazernar todos os produtos em estoque public class Estoque { - private ArrayList estoque; + public static ArrayList<Produto> estoque = new ArrayList(); - public static ArrayList<Cliente> listaClientes = new ArrayList(); - /** * * @param produto */ + //Adicionar produto ao estoque public void addEstoque(Produto produto){ estoque.add(produto); } - + //Remover produto do estoque public void removeEstoque(Produto produto){ estoque.remove(produto); } + //Retornar o tamanho da lista de Estoque + public int retornarTamanhoEstoque(){ + return estoque.size(); + } + //Limpar totalmente o estoque + public void limparEstoque(){ + estoque.clear(); + } } diff --git a/src/classes/Funcionario.java b/src/classes/Funcionario.java index ea2dacf..4ae68eb 100644 --- a/src/classes/Funcionario.java +++ b/src/classes/Funcionario.java @@ -4,23 +4,31 @@ */ package classes; +import static classes.Cliente.listaClientes; +import static classes.Estoque.estoque; import java.util.ArrayList; /** * * @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(); + + //Construtor vazio de funcionário + public Funcionario() { + } - //Construtor de Funcionário + //Construtor de Funcionário com vários atributos public Funcionario(String nome, String CPF, String email, String senha) { super(nome, CPF, email, senha); - this.cadastroFuncionario= "0"; + this.cadastroFuncionario= String.valueOf(listaFuncionarios.size()); //this.cadastroFuncionario=String.valueOf(listaFuncionarios.size()); } @@ -30,17 +38,79 @@ public Funcionario(String nome, String CPF, String email, String senha,String ca this.cadastroFuncionario = cadastroFuncionario; } - public String getCadastroFuncionario() { - return cadastroFuncionario; + //Método toString que retorna o funcionário com seu cadastro + @Override + public String toString() { + return "Funcionario{" + "cadastroFuncionario=" + cadastroFuncionario + '}'; + } + //Método de login que é implementado pela interface + @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; + } + //Método de logout + @Override + public boolean logout() { + return logado=false; } - public void setCadastroFuncionario(String cadastroFuncionario) { - this.cadastroFuncionario = cadastroFuncionario; + //Pesquisar por um produto em específico + @Override + public void pesquisar(String titulo) { + for(Produto produto:estoque){ + if(produto.getTitulo().equals(titulo)){ + System.out.println("Produto Encontrado"); + } + } } + //Consulta por emails @Override - public String toString() { - return "Funcionario{" + "cadastroFuncionario=" + cadastroFuncionario + '}'; + public String consultarEmail(String cpf,String nome) { + boolean encontrado = false; + for(Funcionario func: listaFuncionarios){ + if(func.getCPF().equals(cpf)&&(func.getNome().equals(nome))){ + encontrado = true; + return func.getEmail(); + } + }if(!encontrado){ + return "Email não encontrado"; + }else{ + return this.getEmail(); + } + } + //Método de esquecer a senha que permite o usuário redefinir a sua senha com uma nova + @Override + public void esqueciSenha(String email, String cpf, String novaSenha) { + for(Funcionario func : listaFuncionarios){ + if((func.getCPF().equals(cpf))&&(func.getEmail().equals(email))){ + func.setSenha(novaSenha); + } + } + } + //Métodos Getters e Setters para listas de carrinhos + public void addListaCarrinhosFuncionarios(Carrinho carrinho2) { + listaCarrinhoFuncionario.add(carrinho2); + } + + public ArrayList<Carrinho> getListaCarrinhoFuncionario() { + return listaCarrinhoFuncionario; + } + + public void setListaCarrinhoFuncionario(ArrayList<Carrinho> listaCarrinhoFuncionario) { + this.listaCarrinhoFuncionario = listaCarrinhoFuncionario; + } + + public String getCadastroFuncionario() { + return cadastroFuncionario; + } + + public void setCadastroFuncionario(String cadastroFuncionario) { + this.cadastroFuncionario = cadastroFuncionario; } diff --git a/src/classes/Gerente.java b/src/classes/Gerente.java index 7467f07..f603ae2 100644 --- a/src/classes/Gerente.java +++ b/src/classes/Gerente.java @@ -4,18 +4,27 @@ */ 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) { super(nome, CPF, email, senha); + this.cadastroGerente = "0"; + } + //construtor para Gerente, sem atributos + public Gerente() { } + //Construtor para Gernete com os atributos de usuário + gerente public Gerente(String nome, String CPF, String email, String senha, String cadastroGerente ) { @@ -23,14 +32,64 @@ public Gerente(String nome, String CPF, String email, String senha, String cadas this.cadastroGerente = cadastroGerente; } + //metodo de login herdado da interface OperadorSistema + @Override + public boolean login(String email, String senha) { + if(super.email.equals(email) && super.senha.equals(senha)){ + return true; + } + return false; + + } + // adicionar o carrinhos de compra do gerente + public void addListaCarrinhosGerente(Carrinho carrinho2) { + listaCarrinhoGerente.add(carrinho2); + } + + //metodo de logout, herdado da interface OperadorSistema + @Override + public boolean logout() { + return logado = false; + } + + //metodo de pesquisar, herdado da interface OperadorSistema + @Override + public void pesquisar(String titulo) { + + throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody + } + + //metodo de consultar e-mail, herdado da interface OperadorSistema + @Override + public String consultarEmail(String cpf,String nome) { + return"admin@gmail.com"; + } + + //metodo de esqueci a senha, herdado da interface OperadorSistema + @Override + public void esqueciSenha(String email, String cpf, String novaSenha) { + if((this.getCPF().equals(cpf))&&(this.getEmail().equals(email))){ + this.setSenha(novaSenha); + } + } + + //pega o carrinho de compras do usuário: gerente + public ArrayList<Carrinho> getListaCarrinhoGerente() { + return listaCarrinhoGerente; + } + + //cria o carrinho de compras do usuário: gerente + public void setListaCarrinhoGerente(ArrayList<Carrinho> listaCarrinhoGerente) { + this.listaCarrinhoGerente = listaCarrinhoGerente; + } + + //pega o cadastro do usuário: Gerente public String getCadastroGerente() { return cadastroGerente; } + //cria o cadastro do usuário: Gerente public void setCadastroGerente(String cadastroGerente) { this.cadastroGerente = cadastroGerente; } - - - -} + } \ No newline at end of file diff --git a/src/classes/OperadorSistema.java b/src/classes/OperadorSistema.java new file mode 100644 index 0000000..135180f --- /dev/null +++ b/src/classes/OperadorSistema.java @@ -0,0 +1,18 @@ +/* + * 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 + */ +//Definição da Interface: operador do sistema +public interface OperadorSistema { + boolean login(String email,String senha); + boolean logout(); + void pesquisar(String titulo); + void esqueciSenha(String email,String cpf,String novaSenha); + String consultarEmail(String cpf,String nome); +} diff --git a/src/classes/Pagamento.java b/src/classes/Pagamento.java index 203e869..d889cd5 100644 --- a/src/classes/Pagamento.java +++ b/src/classes/Pagamento.java @@ -3,38 +3,31 @@ import java.util.Date; import java.util.List; +//classe de finalização do pagamento public class Pagamento extends Carrinho{ private String formaPagamento; private String senha; - private Pedido pedido; + private Pedido pedido = new Pedido(); - public Pagamento(String formaPagamento, String senha, int numCarrinho, Date data, double total, List<String> produtos) { - super(numCarrinho, data, total, produtos); - this.formaPagamento = formaPagamento; - this.senha = senha; - } - - - public String getFormaPagamento() { - return formaPagamento; + //construtor do pagamento sem argumentos + public Pagamento() { + this.formaPagamento="nada"; } - - public void setFormaPagamento(String formaPagamento) { + + + //construtor do pagamento com entradas + public Pagamento(String formaPagamento, String senha, int numCarrinho, Date data, double total, List<String> produtos) { + //super(numCarrinho, data, total, produtos); this.formaPagamento = formaPagamento; - } - - public String getSenha() { - return senha; - } - - public void setSenha(String senha) { this.senha = senha; } - + //método para alterar a forma de pagamento public void MudarFormaDePagamento(String formaPagamento){ this.formaPagamento = formaPagamento; } + + //método para efetuar o pagamento public boolean Pagar(String senha){ if(senha == this.senha){ System.out.println("Pagamento aprovado"); @@ -45,4 +38,29 @@ public boolean Pagar(String senha){ } } -} + // método para pegar o pedido + public Pedido getPedido() { + return pedido; + } + + //método para pegar a forma de pagamento + public String getFormaPagamento() { + return formaPagamento; + } + + //método para setar a forma de pagamento + public void setFormaPagamento(String formaPagamento) { + this.formaPagamento = formaPagamento; + } + + //método para pegar a senha + public String getSenha() { + return senha; + } + + //método para setar uma nova senha + public void setSenha(String senha) { + this.senha = senha; + } + +} \ No newline at end of file diff --git a/src/classes/Pedido.java b/src/classes/Pedido.java index 2c383cb..2e8a81f 100644 --- a/src/classes/Pedido.java +++ b/src/classes/Pedido.java @@ -6,6 +6,11 @@ public class Pedido { private int codRastreio; private Pagamento pagamento; + public Pedido() { + } + + + public Pedido(int codPedido, int codRastreio) { this.codPedido = codPedido; this.codRastreio = codRastreio; diff --git a/src/classes/Produto.java b/src/classes/Produto.java index 0aed7ef..83a69c4 100644 --- a/src/classes/Produto.java +++ b/src/classes/Produto.java @@ -1,21 +1,28 @@ package classes; - +//classe do produto public class Produto { - public String titulo; - public double preço; - public int quantidadeEstoque; - public String codigoDoProduto; - public String descrição; - - public Produto(String titulo, double preço, int quantidadeEstoque, String codigoDoProduto, String descrição){ + private String titulo; + private double preço; + private int quantidadeEstoque; + private String codigoDoProduto; + private String descrição; + private String genero; + private String autor; + private int quantidadeComprada; + + //método construtor do produto passando todos os argumentos mínimos necessários + public Produto(String titulo,String autor,String genero, double preço, int quantidadeEstoque, String codigoDoProduto, String descrição){ this.titulo = titulo; + this.autor = autor; + this.genero = genero; this.preço = preço; this.quantidadeEstoque = quantidadeEstoque; this.codigoDoProduto = codigoDoProduto; this.descrição = descrição; } + //método equivalente ao ToString dos produtos public void MostraDados(){ System.out.println(titulo); System.out.println(preço); @@ -24,43 +31,83 @@ public void MostraDados(){ System.out.println(descrição); } + //método para pegar o título do produto public String getTitulo() { return titulo; } + //método para setar o título do produto public void setTitulo(String titulo) { this.titulo = titulo; } + //método para pegar o preço do produto public double getPreço() { return preço; } + //método para setar o preço do produto public void setPreço(double preço) { this.preço = preço; } + //método para pegar a quantidade do produto em estoque public int getQuantidadeEstoque() { return quantidadeEstoque; } + //método para setar a quantidade do produto public void setQuantidadeEstoque(int quantidadeEstoque) { this.quantidadeEstoque = quantidadeEstoque; } + //método para pegar o código do produto public String getCodigoDoProduto() { return codigoDoProduto; } + //método para setar o código do produto public void setCodigoDoProduto(String codigoDoProduto) { this.codigoDoProduto = codigoDoProduto; } - + + //método para pegar a descrição do produto public String getDescrição() { return descrição; } + //método para setar a descrição do produto public void setDescrição(String descrição) { this.descrição = descrição; } -} + + //método para pegar o gênero do produto + public String getGenero() { + return genero; + } + + //método para setar o gênero do produto + public void setGenero(String genero) { + this.genero = genero; + } + + //método para pegar o nome do autor do produto + public String getAutor() { + return autor; + } + + //método para setar o nome do autor do produto + public void setAutor(String autor) { + this.autor = autor; + } + + //método para pegar a quantidade comprada do produto + public int getQuantidadeComprada() { + return quantidadeComprada; + } + + //método para setar a quantidade comprada de: produto + public void setQuantidadeComprada(int quantidadeComprada) { + this.quantidadeComprada = quantidadeComprada; + } +} \ No newline at end of file diff --git a/src/classes/Usuario.java b/src/classes/Usuario.java index d2d51fc..d4e33cd 100644 --- a/src/classes/Usuario.java +++ b/src/classes/Usuario.java @@ -10,8 +10,8 @@ * * @author Yuri */ -abstract class Usuario { - //Definição da classe abstrata Usuário +//Definição da classe abstrata Usuário +public abstract class Usuario implements OperadorSistema{ //Definição de atributos protegidos para a classe abstrata usuário protected String nome; @@ -19,11 +19,17 @@ abstract class Usuario { protected String email; protected String senha; static ArrayList<Cliente> listaClientes = new ArrayList(); // Definição de um ArrayList para Clientes + public ArrayList<Carrinho> listaCarrinho = new ArrayList(); // Definição de um ArrayLista para os carrinhos do usuário + private Carrinho carrinho; + public static boolean logado = false; + public static String user ="anonimo"; // seta o usuário padrão como anônimo + + //método construtor do usuário sem argumentos de entrada (não usado na versão final) public Usuario(){ this.listaClientes = new ArrayList(); - } + //Definição de construtor para Usuário public Usuario(String nome,String CPF,String email,String senha){ this.listaClientes = new ArrayList(); @@ -33,8 +39,22 @@ public Usuario(String nome,String CPF,String email,String senha){ this.senha = senha; } + //método toString sobrescrito da versão herdada + @Override + public String toString() { + return "Usuario{" + "nome=" + nome + ", CPF=" + CPF + ", email=" + email + ", senha=" + senha + '}'; + } + + //método para a redefinição da senha + public void esqueciSenha(String CPF,String senhanova){ + //verifica se o cpf está correto + if (CPF.equals(this.CPF)){ + this.senha = senhanova; + System.out.println("Senha atualizada com sucesso!"); + } + } + //Definição de Getters e Setters para o Usuário, com seus respectivos atributos - public String getNome() { return nome; } @@ -67,23 +87,9 @@ public void setSenha(String senha) { this.senha = senha; } - public String Consultar(String titulo){ - return titulo; - } - - //Override com o toString - @Override - public String toString() { - return "Usuario{" + "nome=" + nome + ", CPF=" + CPF + ", email=" + email + ", senha=" + senha + '}'; - } - - public void esqueciSenha(String CPF,String senhanova){ - if (CPF.equals(this.CPF)){ - this.senha = senhanova; - System.out.println("Senha atualizada com sucesso!"); - - } + //método para pegar a lista de carrinhos do cliente + public ArrayList<Carrinho> getListaCarrinho() { + return listaCarrinho; } - -} +} \ No newline at end of file diff --git a/src/imagens/AreaGerenteNew.png b/src/imagens/AreaGerenteNew.png new file mode 100644 index 0000000..33e7429 Binary files /dev/null and b/src/imagens/AreaGerenteNew.png differ 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/adicionar.png b/src/imagens/simbolos/adicionar.png new file mode 100644 index 0000000..60186a0 Binary files /dev/null and b/src/imagens/simbolos/adicionar.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/imagens/simbolos/sacola.png b/src/imagens/simbolos/sacola.png new file mode 100644 index 0000000..2acccde Binary files /dev/null and b/src/imagens/simbolos/sacola.png differ diff --git a/src/old_london/OldLondon.ttf b/src/old_london/OldLondon.ttf new file mode 100644 index 0000000..f24a340 Binary files /dev/null and b/src/old_london/OldLondon.ttf differ diff --git a/src/old_london/OldLondonAlternate.ttf b/src/old_london/OldLondonAlternate.ttf new file mode 100644 index 0000000..6010ffd Binary files /dev/null and b/src/old_london/OldLondonAlternate.ttf differ diff --git a/src/old_london/Olondon_.otf b/src/old_london/Olondon_.otf new file mode 100644 index 0000000..9a68b20 Binary files /dev/null and b/src/old_london/Olondon_.otf differ diff --git a/src/old_london/Olondona.otf b/src/old_london/Olondona.otf new file mode 100644 index 0000000..56161c8 Binary files /dev/null and b/src/old_london/Olondona.otf differ diff --git a/src/telas/AreaGerenteTeste.form b/src/telas/AreaGerenteTeste.form deleted file mode 100644 index 667ac14..0000000 --- a/src/telas/AreaGerenteTeste.form +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" ?> - -<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> - <Properties> - <Property name="defaultCloseOperation" type="int" value="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"/> - </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="jPanel1"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="3d" green="50" red="76" 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="0" width="-1" height="-1"/> - </Constraint> - </Constraints> - - <Layout> - <DimensionLayout dim="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="179" max="-2" attributes="0"/> - <Component id="jLabel1" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="306" 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" pref="353" max="-2" attributes="0"/> - <EmptySpace min="0" pref="888" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <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/AreaGerente2.png"/> - </Property> - </Properties> - </Component> - </SubComponents> - </Container> - </SubComponents> -</Form> diff --git a/src/telas/AreaGerenteTeste.java b/src/telas/AreaGerenteTeste.java deleted file mode 100644 index a0ec55d..0000000 --- a/src/telas/AreaGerenteTeste.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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; - -/** - * - * @author Yuri - */ -public class AreaGerenteTeste extends javax.swing.JFrame { - - /** - * Creates new form AreaGerenteTeste - */ - public AreaGerenteTeste() { - initComponents(); - } - - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents - private void initComponents() { - - jPanel1 = new javax.swing.JPanel(); - jLabel1 = new javax.swing.JLabel(); - - setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); - getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout()); - - jPanel1.setBackground(new java.awt.Color(118, 80, 61)); - - jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/AreaGerente2.png"))); // NOI18N - - javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); - jPanel1.setLayout(jPanel1Layout); - jPanel1Layout.setHorizontalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(179, 179, 179) - .addComponent(jLabel1) - .addContainerGap(306, Short.MAX_VALUE)) - ); - jPanel1Layout.setVerticalGroup( - jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 353, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 888, Short.MAX_VALUE)) - ); - - getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1)); - - pack(); - }// </editor-fold>//GEN-END:initComponents - - /** - * @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(AreaGerenteTeste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (InstantiationException ex) { - java.util.logging.Logger.getLogger(AreaGerenteTeste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (IllegalAccessException ex) { - java.util.logging.Logger.getLogger(AreaGerenteTeste.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); - } catch (javax.swing.UnsupportedLookAndFeelException ex) { - java.util.logging.Logger.getLogger(AreaGerenteTeste.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 AreaGerenteTeste().setVisible(true); - } - }); - } - - // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JLabel jLabel1; - private javax.swing.JPanel jPanel1; - // End of variables declaration//GEN-END:variables -} diff --git a/src/telas/ControleEstoque.form b/src/telas/ControleEstoque.form index 68831a7..18be8be 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,335 +22,828 @@ <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> + <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="cc" 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="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="1760" y="30" width="-1" height="40"/> + </Constraint> + </Constraints> + </Component> <Container class="javax.swing.JPanel" name="jPanel2"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="af" green="37" red="13" 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="120" width="910" height="620"/> + </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"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanelAlterarItem" max="32767" attributes="0"/> + <EmptySpace 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 max="32767" attributes="0"/> - <Component id="jButton1" 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="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"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jPanelAlterarItem" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="15" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanelAlterarItem"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="a4" green="a4" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="47" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblControleEstoque" min="-2" pref="529" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="165" 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"/> - <Component id="txtCodigoEstoque" min="-2" pref="115" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblDescricaoEstoque" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="btnAlterarItem" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="59" max="-2" attributes="0"/> + <Component id="btnSalvarItem" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="124" max="-2" attributes="0"/> + <Component id="btnCancelarItem" min="-2" pref="110" max="-2" attributes="0"/> + </Group> </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"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="79" max="-2" attributes="0"/> + <Component id="btnPesquisarItem" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="257" max="-2" attributes="0"/> + </Group> </Group> + <EmptySpace min="-2" pref="64" max="-2" attributes="0"/> </Group> - <EmptySpace max="-2" attributes="0"/> </Group> </Group> - <Group type="103" groupAlignment="1" 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"/> - </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="19" max="-2" attributes="0"/> <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 type="102" alignment="1" attributes="0"> + <Component id="lblCodigoEstoque" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="92" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblPrecoEstoque" alignment="0" min="-2" pref="60" max="-2" attributes="0"/> + <Component id="txtPrecoEstoque" alignment="0" min="-2" pref="138" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="303" max="-2" attributes="0"/> + <Component id="btnBuscar" min="-2" pref="120" max="-2" attributes="0"/> + </Group> + <Component id="lblQuantiaEstoque" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="151" 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 type="103" alignment="1" groupAlignment="0" attributes="0"> + <Component id="jScrollPane1" min="-2" pref="820" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="txtCodigoEstoque" min="-2" pref="123" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblAutor" min="-2" pref="60" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtAutor" min="-2" pref="97" max="-2" attributes="0"/> + <EmptySpace min="15" pref="15" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblTituloEstoque" min="-2" pref="66" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtTituloEstoque" min="-2" pref="112" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="62" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Component id="lblGeneroEstoque" min="-2" pref="99" max="-2" attributes="0"/> + </Group> + <Component id="txtQuantiaEstoque" pref="171" max="32767" attributes="0"/> + <Component id="txtGeneroEstoque" alignment="0" max="32767" attributes="0"/> + </Group> + </Group> </Group> </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnPesquisarItem" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="62" max="-2" attributes="0"/> </Group> - </Group> - </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"> - <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"/> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblControleEstoque" min="-2" pref="58" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="36" max="-2" attributes="0"/> + <Component id="txtPrecoEstoque" min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="1" max="-2" attributes="0"/> + <Component id="lblQuantiaEstoque" min="-2" pref="39" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtQuantiaEstoque" min="-2" pref="25" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblGeneroEstoque" min="-2" pref="33" 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"/> + <Group type="102" attributes="0"> + <Component id="jScrollPane2" min="-2" pref="93" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="31" max="-2" attributes="0"/> + <Component id="btnBuscar" min="-2" max="-2" attributes="0"/> </Group> </Group> - <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblDescricaoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtDescricaoEstoque" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="btnBuscar" min="-2" max="-2" attributes="0"/> - </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtGeneroEstoque" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </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="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblTituloEstoque" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="txtTituloEstoque" alignment="3" max="32767" attributes="0"/> + <Component id="lblPrecoEstoque" alignment="3" min="-2" pref="33" max="-2" attributes="0"/> + <Component id="lblDescricaoEstoque" alignment="3" min="-2" pref="39" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblAutor" alignment="3" min="-2" pref="36" max="-2" attributes="0"/> + <Component id="txtAutor" alignment="3" min="-2" pref="34" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblCodigoEstoque" min="-2" pref="36" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodigoEstoque" min="-2" pref="36" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="54" max="-2" 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 type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="btnSalvarItem" alignment="3" max="32767" attributes="0"/> + <Component id="btnAlterarItem" alignment="3" min="-2" pref="30" 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 type="103" groupAlignment="3" attributes="0"> + <Component id="btnPesquisarItem" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> + <Component id="btnCancelarItem" alignment="3" max="32767" attributes="0"/> </Group> </Group> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="217" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JTextField" name="txtTituloEstoque"> + <Properties> + <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="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JTextField" name="txtQuantiaEstoque"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="insira a quantia em estoque"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnPesquisarItem"> + <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="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.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.JLabel" name="lblPrecoEstoque"> + <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="Preço"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnSalvarItem"> + <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 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.JButton" name="btnBuscar"> + <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"/> + <Property name="toolTipText" type="java.lang.String" value="aperte para buscar pelo item"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnAlterarItem"> + <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="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="lblTituloEstoque"> + <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="Titulo"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPrecoEstoque"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="insira o preço do produto"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPrecoEstoqueActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtCodigoEstoque"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="insira o código do produto"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarItem"> + <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="0"/> + </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="btnCancelarItemActionPerformed"/> + </Events> + </Component> + <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> + <Component class="javax.swing.JTextField" name="txtAutor"> + </Component> + <Component class="javax.swing.JLabel" name="lblGeneroEstoque"> + <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="Gênero"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtGeneroEstoque"> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="f" green="5b" red="c1" 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="940" y="150" width="960" height="590"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="960" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="10" max="32767" attributes="0"/> + <Component id="jPanelAdicaoItem" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="10" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <EmptySpace min="0" pref="590" max="32767" attributes="0"/> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jPanelAdicaoItem" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> </Group> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> - <Component class="javax.swing.JTextField" name="txtTituloEstoque"> - <Properties> - <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> - <Component class="javax.swing.JTextField" name="txtQuantiaEstoque"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira a quantia em estoque"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtDescricaoEstoque"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira a descrição"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtPrecoEstoque"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira o preço do produto"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtCodigoEstoque"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="insira o código do produto"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblTituloEstoque"> - <Properties> - <Property name="text" type="java.lang.String" value="Titulo"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblPrecoEstoque"> - <Properties> - <Property name="text" type="java.lang.String" value="Preço"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblQuantiaEstoque"> - <Properties> - <Property name="text" type="java.lang.String" value="Quantia em estoque"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblCodigoEstoque"> - <Properties> - <Property name="text" type="java.lang.String" value="Código de produto"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblDescricaoEstoque"> - <Properties> - <Property name="text" type="java.lang.String" value="Descrição"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnBuscar"> - <Properties> - <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.JButton" name="btnAlterarItem"> + <Container class="javax.swing.JPanel" name="jPanelAdicaoItem"> <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"/> - </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.JButton" name="btnCancelarItem"> - <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="btnCancelarItemActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JButton" name="btnSalvarItem"> - <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="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.JButton" name="btnPesquisarItem"> - <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"/> - </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.JButton" name="btnExcluirItem"> - <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"/> + <Color blue="33" green="99" red="ff" type="rgb"/> </Property> - <Property name="text" type="java.lang.String" value="Excluir"/> - <Property name="toolTipText" type="java.lang.String" value="Excluir algum produto do estoque"/> </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="Segoe UI" size="24" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Controle do estoque"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="jButton1"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Criar Item"/> - </Properties> - </Component> + + <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> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnCriar1" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblTituloAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtTituloAdicao" min="-2" pref="150" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" 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="117" max="-2" attributes="0"/> + <Component id="btnCancelarItemAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="61" max="32767" attributes="0"/> + <Component id="btnExcluirItemAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="58" max="-2" attributes="0"/> + <Component id="btnPesquisarItem1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="lblAutorAdicao" min="-2" pref="63" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + <Component id="txtAutorAdicao" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblCodigoProdutoAdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCodigoProdutoAdicao" min="-2" pref="99" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnBuscarAdicao" min="-2" pref="101" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane3" max="32767" attributes="0"/> + <EmptySpace 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" 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="lblCodigoProdutoAdicao" alignment="3" min="-2" pref="30" max="-2" attributes="0"/> + <Component id="lblAutorAdicao" alignment="3" min="-2" pref="32" max="-2" attributes="0"/> + <Component id="txtAutorAdicao" 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" max="-2" attributes="0"> + <Component id="btnBuscarAdicao" min="-2" pref="33" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="txtCodigoProdutoAdicao" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Component id="lblTituloAdicao" alignment="0" min="-2" pref="33" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="16" max="-2" attributes="0"/> + <Component id="txtTituloAdicao" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <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="332" 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="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="2b" green="bd" 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="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="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="btnSalvarItemAdicaoActionPerformed"/> + </Events> + </Component> + <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="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="btnPesquisarItem1ActionPerformed"/> + </Events> + </Component> + <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="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="lblControleAdicao"> + <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 - Adição/Remoção de item"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblTituloAdicao"> + <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="Titulo"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTituloAdicao"> + </Component> + <Component class="javax.swing.JLabel" name="lblCodigoProdutoAdicao"> + <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="txtCodigoProdutoAdicao"> + </Component> + <Component class="javax.swing.JButton" name="btnBuscarAdicao"> + <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> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarAdicaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="lblAutorAdicao"> + <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="txtAutorAdicao"> + </Component> + </SubComponents> + </Container> </SubComponents> </Container> - <Container class="javax.swing.JScrollPane" name="jScrollPane1"> + <Component class="javax.swing.JLabel" name="jLabel1"> <Properties> - <Property name="toolTipText" type="java.lang.String" value="tabela com os produtos em estoque"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/Telas/ControleEstoque.png"/> + </Property> </Properties> - - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> - <SubComponents> - <Component class="javax.swing.JTable" name="jTable1"> - <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="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="tableHeader" type="javax.swing.table.JTableHeader" editor="org.netbeans.modules.form.editors2.JTableHeaderEditor"> - <TableHeader reorderingAllowed="true" resizingAllowed="true"/> - </Property> - </Properties> - </Component> - </SubComponents> - </Container> + <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 4de618d..513ddd3 100644 --- a/src/telas/ControleEstoque.java +++ b/src/telas/ControleEstoque.java @@ -4,6 +4,12 @@ */ package telas; +import static classes.Estoque.estoque; +import classes.Produto; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; +import static telas.cadastros.cadastrosFlag; + /** * * @author Yuri @@ -18,19 +24,35 @@ public ControleEstoque() { disableEstoqueFields(); disableEstoqueButtons(); + disableEstoqueAdicaoFields(); + carregarTabelaProdutos(); + carregarTabelaProdutosAdicao(); + disableEstoqueAdicaoButtons(); //btnAddItem.setEnabled(true); btnPesquisarItem.setEnabled(true); + txtCodigoEstoque.setEnabled(false); + this.setExtendedState(MAXIMIZED_BOTH); + setLocationRelativeTo(null); + btnPesquisarItem.setEnabled(true); + txtCodigoEstoque.setEnabled(false); + lblCodigoEstoque.setEnabled(true); + txtGeneroEstoque.setEnabled(false); + lblGeneroEstoque.setEnabled(false); setLocationRelativeTo(null); } public void disableEstoqueFields(){ + lblAutor.setEnabled(false); + txtAutor.setEnabled(false); txtTituloEstoque.setEnabled(false); txtPrecoEstoque.setEnabled(false); txtQuantiaEstoque.setEnabled(false); txtCodigoEstoque.setEnabled(false); txtDescricaoEstoque.setEnabled(false); + txtGeneroEstoque.setEnabled(false); + lblTituloEstoque.setEnabled(false); lblPrecoEstoque.setEnabled(false); @@ -54,17 +76,122 @@ public void enableEstoqueFields(){ lblDescricaoEstoque.setEnabled(true); } + public void enableEstoqueAdicaoFields(){ + txtTituloAdicao.setEnabled(true); + txtAutorAdicao.setEnabled(true); + txtCodigoProdutoAdicao.setEnabled(true); + lblCodigoProdutoAdicao.setEnabled(true); + lblTituloAdicao.setEnabled(true); + lblAutorAdicao.setEnabled(true); + } + public void disableEstoqueAdicaoFields(){ + txtTituloAdicao.setEnabled(false); + txtAutorAdicao.setEnabled(false); + txtCodigoProdutoAdicao.setEnabled(false); + lblCodigoProdutoAdicao.setEnabled(false); + lblTituloAdicao.setEnabled(false); + lblAutorAdicao.setEnabled(false); + } 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()); + txtAutor.setText(item.getAutor()); + txtGeneroEstoque.setText(item.getGenero()); + } + + } + public void clearEstoqueFields(){ + txtTituloEstoque.setText(""); + txtPrecoEstoque.setText(""); + txtQuantiaEstoque.setText(""); + txtCodigoEstoque.setText(""); + txtDescricaoEstoque.setText(""); + txtAutor.setText(""); + } + + + private void carregarTabelaProdutos(){ + DefaultTableModel modeloTabelaProdutos = new DefaultTableModel(new Object[] {"Título","Autor","Gênero","Preço","Quantia Estoque","Código Produto","Descrição"},0); + + for(int i=0;i<estoque.size();i++){ + Object linha[] = new Object[] {estoque.get(i).getTitulo(), + estoque.get(i).getAutor(), + estoque.get(i).getGenero(), + estoque.get(i).getPreço(), + estoque.get(i).getQuantidadeEstoque(), + estoque.get(i).getCodigoDoProduto(), + estoque.get(i).getDescrição()}; + modeloTabelaProdutos.addRow(linha); + + } + tblMostraProdutos.setModel(modeloTabelaProdutos); + + tblMostraProdutos.getColumnModel().getColumn(0).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(1).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(2).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(3).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(4).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(5).setPreferredWidth(WIDTH); + tblMostraProdutos.getColumnModel().getColumn(6).setPreferredWidth(WIDTH); + + + } + 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); + + + } + private void clearControleAdicao(){ + txtTituloAdicao.setText(""); + txtAutorAdicao.setText(""); + txtCodigoProdutoAdicao.setText(""); + } /** * This method is called from within the constructor to initialize the form. @@ -75,30 +202,69 @@ public void disableEstoqueButtons(){ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { + btnSair = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); + 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(); + lblAutor = new javax.swing.JLabel(); 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(); - jButton1 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); - jTable1 = new javax.swing.JTable(); + tblMostraProdutos = new javax.swing.JTable(); + txtAutor = new javax.swing.JTextField(); + lblGeneroEstoque = new javax.swing.JLabel(); + txtGeneroEstoque = new javax.swing.JTextField(); + jPanel1 = new javax.swing.JPanel(); + 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(); + lblTituloAdicao = new javax.swing.JLabel(); + txtTituloAdicao = new javax.swing.JTextField(); + lblCodigoProdutoAdicao = new javax.swing.JLabel(); + txtCodigoProdutoAdicao = new javax.swing.JTextField(); + btnBuscarAdicao = new javax.swing.JButton(); + lblAutorAdicao = new javax.swing.JLabel(); + txtAutorAdicao = 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.setBackground(new java.awt.Color(204, 0, 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(1760, 30, -1, 40)); + + jPanel2.setBackground(new java.awt.Color(19, 55, 175)); + + jPanelAlterarItem.setBackground(new java.awt.Color(0, 164, 164)); txtTituloEstoque.setToolTipText("insira o título do produto"); txtTituloEstoque.addActionListener(new java.awt.event.ActionListener() { @@ -107,29 +273,49 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - txtQuantiaEstoque.setToolTipText("insira a quantia em estoque"); - - txtDescricaoEstoque.setToolTipText("insira a descrição"); + txtDescricaoEstoque.setColumns(20); + txtDescricaoEstoque.setRows(5); + jScrollPane2.setViewportView(txtDescricaoEstoque); - txtPrecoEstoque.setToolTipText("insira o preço do produto"); + txtQuantiaEstoque.setToolTipText("insira a quantia em estoque"); - txtCodigoEstoque.setToolTipText("insira o código do produto"); + 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); + } + }); - lblTituloEstoque.setText("Titulo"); + lblAutor.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblAutor.setText("Autor"); + 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"); + btnBuscar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarActionPerformed(evt); + } + }); 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() { @@ -138,8 +324,26 @@ 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.setToolTipText("insira o preço do produto"); + txtPrecoEstoque.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPrecoEstoqueActionPerformed(evt); + } + }); + + 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() { @@ -148,177 +352,414 @@ 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); + lblDescricaoEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblDescricaoEstoque.setText("Descrição"); + + 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"); + + tblMostraProdutos.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 + }; - 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); + public Class getColumnClass(int columnIndex) { + return types [columnIndex]; } - }); - 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"); + 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) { + tblMostraProdutos.getColumnModel().getColumn(0).setPreferredWidth(50); + tblMostraProdutos.getColumnModel().getColumn(1).setPreferredWidth(20); + tblMostraProdutos.getColumnModel().getColumn(2).setPreferredWidth(15); + tblMostraProdutos.getColumnModel().getColumn(3).setPreferredWidth(8); + tblMostraProdutos.getColumnModel().getColumn(4).setPreferredWidth(3); + tblMostraProdutos.getColumnModel().getColumn(5).setPreferredWidth(5); + tblMostraProdutos.getColumnModel().getColumn(6).setPreferredWidth(100); + } - lblControleEstoque.setFont(new java.awt.Font("Segoe UI", 1, 24)); // NOI18N - lblControleEstoque.setText("Controle do estoque"); + lblGeneroEstoque.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblGeneroEstoque.setText("Gênero"); - jButton1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - jButton1.setText("Criar Item"); + javax.swing.GroupLayout jPanelAlterarItemLayout = new javax.swing.GroupLayout(jPanelAlterarItem); + jPanelAlterarItem.setLayout(jPanelAlterarItemLayout); + jPanelAlterarItemLayout.setHorizontalGroup( + jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addContainerGap(47, Short.MAX_VALUE) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(lblControleEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 529, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(165, 165, 165)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblDescricaoEstoque) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(btnAlterarItem) + .addGap(59, 59, 59) + .addComponent(btnSalvarItem) + .addGap(124, 124, 124) + .addComponent(btnCancelarItem, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(79, 79, 79) + .addComponent(btnPesquisarItem)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(64, 64, 64)))) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(19, 19, 19) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(lblCodigoEstoque) + .addGap(92, 92, 92) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(303, 303, 303) + .addComponent(btnBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblQuantiaEstoque)) + .addGap(151, 151, 151)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 820, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(15, 15, 15)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(lblTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(62, 62, 62) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(lblGeneroEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE) + .addComponent(txtGeneroEstoque))))) + .addGap(0, 0, Short.MAX_VALUE)) + ); + jPanelAlterarItemLayout.setVerticalGroup( + jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(lblControleEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 58, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGap(36, 36, 36) + .addComponent(txtPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(1, 1, 1) + .addComponent(lblQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtQuantiaEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblGeneroEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(31, 31, 31) + .addComponent(btnBuscar))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtGeneroEstoque, 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)) + .addGroup(jPanelAlterarItemLayout.createSequentialGroup() + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblTituloEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtTituloEstoque) + .addComponent(lblPrecoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblDescricaoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodigoEstoque, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(54, 54, 54))) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSalvarItem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnAlterarItem, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanelAlterarItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnPesquisarItem, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnCancelarItem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGap(35, 35, 35) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); 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(jButton1) - .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)) + .addContainerGap() + .addComponent(jPanelAlterarItem, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) ); 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(jButton1))) - .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))))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanelAlterarItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(15, Short.MAX_VALUE)) ); - jScrollPane1.setToolTipText("tabela com os produtos em estoque"); + getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 120, 910, 620)); + + jPanel1.setBackground(new java.awt.Color(193, 91, 15)); + + jPanelAdicaoItem.setBackground(new java.awt.Color(255, 153, 51)); - jTable1.setModel(new javax.swing.table.DefaultTableModel( + 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, null, null, null, null, null, null}, + {null, null, null, null, null, null, null}, + {null, null, null, null, null, null, null} }, new String [] { - "Título", "Preço", "Qnt. Estoque", "Cód. Prod.", "Descrição" + "Título", "Autor", "Gênero", "Preço", "Qnt. Estoque", "Cód. Prod.", "Descrição" } ) { 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.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]; + } }); - jScrollPane1.setViewportView(jTable1); - - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(0, 0, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGap(79, 79, 79) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 820, javax.swing.GroupLayout.PREFERRED_SIZE) + 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.setBackground(new java.awt.Color(255, 189, 43)); + btnCriar1.setFont(new java.awt.Font("Old London", 0, 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"); + + lblTituloAdicao.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblTituloAdicao.setText("Titulo"); + + lblCodigoProdutoAdicao.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblCodigoProdutoAdicao.setText("Codigo de Produto"); + + btnBuscarAdicao.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + btnBuscarAdicao.setText("Buscar"); + btnBuscarAdicao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarAdicaoActionPerformed(evt); + } + }); + + lblAutorAdicao.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N + lblAutorAdicao.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)) - ); - 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) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addGap(15, 15, 15) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnCriar1) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(lblTituloAdicao) + .addGap(18, 18, 18) + .addComponent(txtTituloAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE) - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanelAdicaoItemLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(btnSalvarItemAdicao) + .addGap(117, 117, 117) + .addComponent(btnCancelarItemAdicao) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 61, Short.MAX_VALUE) + .addComponent(btnExcluirItemAdicao) + .addGap(58, 58, 58) + .addComponent(btnPesquisarItem1)) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(lblAutorAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(37, 37, 37) + .addComponent(txtAutorAdicao) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblCodigoProdutoAdicao) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCodigoProdutoAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnBuscarAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(24, 24, 24)) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane3) + .addContainerGap()) + ); + 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(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(lblCodigoProdutoAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblAutorAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtAutorAdicao, 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, false) + .addComponent(btnBuscarAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addComponent(txtCodigoProdutoAdicao) + .addGap(9, 9, 9)))) + .addComponent(lblTituloAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanelAdicaoItemLayout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(txtTituloAdicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(40, 40, 40) + .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, 332, Short.MAX_VALUE) + .addContainerGap()) ); + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 960, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(10, Short.MAX_VALUE) + .addComponent(jPanelAdicaoItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(10, Short.MAX_VALUE))) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 590, 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) + .addComponent(jPanelAdicaoItem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + ); + + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(940, 150, 960, 590)); + + 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 @@ -332,13 +773,30 @@ private void btnCancelarItemActionPerformed(java.awt.event.ActionEvent evt) {//G disableEstoqueFields(); disableEstoqueButtons(); //btnAddItem.setEnabled(true); + carregarCamposProduto(); + tblMostraProdutos.clearSelection(); btnPesquisarItem.setEnabled(true); + txtGeneroEstoque.setEnabled(false); }//GEN-LAST:event_btnCancelarItemActionPerformed private void btnSalvarItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarItemActionPerformed // 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()); + produto.setAutor(txtAutor.getText()); + produto.setQuantidadeEstoque(Integer.parseInt(txtQuantiaEstoque.getText())); + produto.setCodigoDoProduto(txtCodigoEstoque.getText()); + produto.setDescrição(txtDescricaoEstoque.getText()); + produto.setGenero(txtGeneroEstoque.getText()); + + carregarTabelaProdutos(); + carregarTabelaProdutosAdicao(); //btnAddItem.setEnabled(true); btnPesquisarItem.setEnabled(true); }//GEN-LAST:event_btnSalvarItemActionPerformed @@ -347,17 +805,271 @@ private void btnPesquisarItemActionPerformed(java.awt.event.ActionEvent evt) {// // TODO add your handling code here: disableEstoqueFields(); disableEstoqueButtons(); + clearEstoqueFields(); btnCancelarItem.setEnabled(true); lblTituloEstoque.setEnabled(true); txtTituloEstoque.setEnabled(true); + txtGeneroEstoque.setEnabled(true); + txtAutor.setEnabled(true); + lblAutor.setEnabled(true); + txtCodigoEstoque.setEnabled(true); + lblCodigoEstoque.setEnabled(true); + lblGeneroEstoque.setEnabled(true); btnBuscar.setEnabled(true); txtTituloEstoque.requestFocus(); + }//GEN-LAST:event_btnPesquisarItemActionPerformed private void btnAlterarItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAlterarItemActionPerformed // TODO add your handling code here: + btnSalvarItem.setEnabled(true); + enableEstoqueFields(); + txtCodigoEstoque.setEnabled(true); + txtAutor.setEnabled(true); + lblAutor.setEnabled(true); + txtGeneroEstoque.setEnabled(true); + lblGeneroEstoque.setEnabled(true); + }//GEN-LAST:event_btnAlterarItemActionPerformed + private void tblMostraProdutosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblMostraProdutosMouseClicked + // TODO add your handling code here: + 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); + int i = tblMostraProdutosAdicao.getSelectedRow(); + int row = tblMostraProdutosAdicao.getSelectedRow(); + int column = tblMostraProdutosAdicao.getSelectedColumn(); + Object produtoPesquisado = tblMostraProdutosAdicao.getValueAt(row,0); + System.out.println("Value selected at: "+produtoPesquisado); + for (Produto item : estoque) { + if (item.getTitulo().equals(produtoPesquisado)) { + // Use the matched Produto item directly + txtTituloAdicao.setText(item.getTitulo()); + txtAutorAdicao.setText(item.getAutor()); + txtCodigoProdutoAdicao.setText(item.getCodigoDoProduto()); + + // Break the loop as you have found the item + break; + } + } + Produto produtoPegado = (Produto)produtoPesquisado; + String inputBusca = String.valueOf(produtoPesquisado); + System.out.println("Item do inputBusca a ser aparecido na caixa de texto"+inputBusca); + + }//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_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: + enableEstoqueAdicaoFields(); + clearControleAdicao(); + }//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(); + + // Ensure that a row is selected + if (index == -1) { + // Handle the case where no row is selected (optional) + JOptionPane.showMessageDialog(this, "Please select a product to remove."); + return; + } + + // Retrieve the product title from the selected row + Object itemPesquisado = tblMostraProdutosAdicao.getValueAt(index, 0); + String inputBusca = String.valueOf(itemPesquisado); + + // Search for the item in the stock and remove it + for (Produto itemEstoque : estoque) { + if (itemEstoque.getTitulo().equals(inputBusca)) { + estoque.remove(itemEstoque); + break; // Exit the loop after removing the item + } + } + carregarTabelaProdutosAdicao(); + carregarTabelaProdutos(); + + + }//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 + + private void btnBuscarAdicaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarAdicaoActionPerformed + // TODO add your handling code here: + String tituloPesquisado = txtTituloAdicao.getText().toLowerCase().trim(); + String autorPesquisado = txtAutorAdicao.getText().toLowerCase().trim(); + String numCodigoPesquisado = txtCodigoProdutoAdicao.getText().toLowerCase().trim(); + String tituloPesquisadoPuro = txtTituloAdicao.getText(); + String autorPesquisadoPuro = txtAutorAdicao.getText(); + String numCodigoPesquisadoPuro = txtCodigoProdutoAdicao.getText(); + if (tituloPesquisado.isEmpty()&& autorPesquisado.isEmpty()&&numCodigoPesquisado.isEmpty()) { + JOptionPane.showMessageDialog(this, "Por favor, insira um título ou autor ou código de produto para pesquisar.", "Aviso", JOptionPane.WARNING_MESSAGE); + carregarTabelaProdutosAdicao(); + 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(); + boolean codigoVazio = numCodigoPesquisado.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); + boolean matchesCodigo = numCodigoPesquisado.isBlank() || produto.getCodigoDoProduto().toLowerCase().contains(numCodigoPesquisado); + + if (matchesTitle && matchesAuthor && matchesCodigo) { + Object novalinha[] = new Object[]{ + produto.getTitulo(), + produto.getAutor(), + produto.getGenero(), + produto.getPreço(), + produto.getQuantidadeEstoque() + }; + modeloTabelaProdutos.addRow(novalinha); + produtoEncontrado = true; + } + } + } +if (produtoEncontrado) { + tblMostraProdutosAdicao.setModel(modeloTabelaProdutos); + // Ajusta a largura das colunas + tblMostraProdutosAdicao.getColumnModel().getColumn(0).setPreferredWidth(100); + tblMostraProdutosAdicao.getColumnModel().getColumn(1).setPreferredWidth(50); + tblMostraProdutosAdicao.getColumnModel().getColumn(2).setPreferredWidth(14); + tblMostraProdutosAdicao.getColumnModel().getColumn(3).setPreferredWidth(8); + tblMostraProdutosAdicao.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); + carregarTabelaProdutosAdicao(); // 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); + carregarTabelaProdutosAdicao(); + } + 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); + carregarTabelaProdutosAdicao(); + } + +} + }//GEN-LAST:event_btnBuscarAdicaoActionPerformed + + private void txtPrecoEstoqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPrecoEstoqueActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPrecoEstoqueActionPerformed + + private void btnBuscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarActionPerformed + // TODO add your handling code here: + txtPrecoEstoque.setEnabled(false); + txtQuantiaEstoque.setEnabled(false); + txtDescricaoEstoque.setEnabled(false); + + String tituloPesquisado = txtTituloEstoque.getText().toLowerCase().trim(); + String autorPesquisado = txtAutor.getText().toLowerCase().trim(); + String numCodigoPesquisado = txtCodigoEstoque.getText().toLowerCase().trim(); + String tituloPesquisadoPuro = txtTituloEstoque.getText(); + String autorPesquisadoPuro = txtAutor.getText(); + String numCodigoPesquisadoPuro = txtCodigoEstoque.getText(); + if (tituloPesquisado.isEmpty()&& autorPesquisado.isEmpty()&&numCodigoPesquisado.isEmpty()) { + JOptionPane.showMessageDialog(this, "Por favor, insira um título ou autor ou código de produto 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(); + boolean codigoVazio = numCodigoPesquisado.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); + boolean matchesCodigo = numCodigoPesquisado.isBlank() || produto.getCodigoDoProduto().toLowerCase().contains(numCodigoPesquisado); + + if (matchesTitle && matchesAuthor && matchesCodigo) { + Object novalinha[] = new Object[]{ + produto.getTitulo(), + produto.getAutor(), + produto.getGenero(), + produto.getPreço(), + produto.getQuantidadeEstoque() + }; + modeloTabelaProdutos.addRow(novalinha); + produtoEncontrado = true; + } + } + } +if (produtoEncontrado) { + tblMostraProdutos.setModel(modeloTabelaProdutos); + // Ajusta a largura das colunas + tblMostraProdutos.getColumnModel().getColumn(0).setPreferredWidth(100); + tblMostraProdutos.getColumnModel().getColumn(1).setPreferredWidth(50); + tblMostraProdutos.getColumnModel().getColumn(2).setPreferredWidth(14); + tblMostraProdutos.getColumnModel().getColumn(3).setPreferredWidth(8); + tblMostraProdutos.getColumnModel().getColumn(4).setPreferredWidth(3); +}else{ + if(autorPesquisado.isEmpty()&&numCodigoPesquisado.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()&&numCodigoPesquisado.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 código: " + numCodigoPesquisadoPuro, "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_btnBuscarActionPerformed + /** * @param args the command line arguments */ @@ -396,24 +1108,47 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnAlterarItem; private javax.swing.JButton btnBuscar; + private javax.swing.JButton btnBuscarAdicao; private javax.swing.JButton btnCancelarItem; - 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.JButton jButton1; + private javax.swing.JButton btnSalvarItemAdicao; + private javax.swing.JLabel jLabel1; + private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanelAdicaoItem; + private javax.swing.JPanel jPanelAlterarItem; private javax.swing.JScrollPane jScrollPane1; - private javax.swing.JTable jTable1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JLabel lblAutor; + private javax.swing.JLabel lblAutorAdicao; private javax.swing.JLabel lblCodigoEstoque; + private javax.swing.JLabel lblCodigoProdutoAdicao; + private javax.swing.JLabel lblControleAdicao; private javax.swing.JLabel lblControleEstoque; private javax.swing.JLabel lblDescricaoEstoque; + private javax.swing.JLabel lblGeneroEstoque; private javax.swing.JLabel lblPrecoEstoque; private javax.swing.JLabel lblQuantiaEstoque; + private javax.swing.JLabel lblTituloAdicao; private javax.swing.JLabel lblTituloEstoque; + private javax.swing.JTable tblMostraProdutos; + private javax.swing.JTable tblMostraProdutosAdicao; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextField txtAutorAdicao; private javax.swing.JTextField txtCodigoEstoque; - private javax.swing.JTextField txtDescricaoEstoque; + private javax.swing.JTextField txtCodigoProdutoAdicao; + private javax.swing.JTextArea txtDescricaoEstoque; + private javax.swing.JTextField txtGeneroEstoque; private javax.swing.JTextField txtPrecoEstoque; private javax.swing.JTextField txtQuantiaEstoque; + private javax.swing.JTextField txtTituloAdicao; private javax.swing.JTextField txtTituloEstoque; // End of variables declaration//GEN-END:variables } diff --git a/src/telas/CriarNovoProduto.form b/src/telas/CriarNovoProduto.form new file mode 100644 index 0000000..59592ba --- /dev/null +++ b/src/telas/CriarNovoProduto.form @@ -0,0 +1,251 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <AuxValues> + <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> + <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> + <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> + <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> + <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> + </AuxValues> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" 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 max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" 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"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="txtAutor" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Component id="txtTitulo" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnCriarNovoItem" min="-2" max="-2" attributes="0"/> + <Component id="txtGenero" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" 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> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </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> + </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"/> + <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> + </SubComponents> +</Form> diff --git a/src/telas/CriarNovoProduto.java b/src/telas/CriarNovoProduto.java new file mode 100644 index 0000000..ffacbc6 --- /dev/null +++ b/src/telas/CriarNovoProduto.java @@ -0,0 +1,290 @@ +/* + * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license + * Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this template + */ +package telas; + +import static classes.Estoque.estoque; +import classes.Produto; +import javax.swing.JOptionPane; + +/** + * + * @author Yuri + */ +public class CriarNovoProduto extends javax.swing.JFrame { + + /** + * Creates new form CriarNovoProduto + */ + public CriarNovoProduto() { + initComponents(); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents + private void initComponents() { + + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + txtTitulo = new javax.swing.JTextField(); + txtAutor = new javax.swing.JTextField(); + txtGenero = new javax.swing.JTextField(); + txtPreco = new javax.swing.JTextField(); + txtQuantiaEstoque = new javax.swing.JTextField(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtAreaDescricao = new javax.swing.JTextArea(); + btnCriarNovoItem = new javax.swing.JButton(); + btnCancelar = new javax.swing.JButton(); + jLabel8 = new javax.swing.JLabel(); + txtCodigoProduto = new javax.swing.JTextField(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + + jLabel1.setText("Criar novo Produto no sistema"); + + jLabel2.setText("Título"); + + jLabel3.setText("Autor"); + + jLabel4.setText("Gênero"); + + jLabel5.setText("Preço"); + + jLabel6.setText("Quantidade Estoque"); + + jLabel7.setText("Descrição"); + + txtTitulo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtTituloActionPerformed(evt); + } + }); + + txtAreaDescricao.setColumns(20); + txtAreaDescricao.setRows(5); + jScrollPane1.setViewportView(txtAreaDescricao); + + btnCriarNovoItem.setText("Criar novo Item"); + btnCriarNovoItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCriarNovoItemActionPerformed(evt); + } + }); + + btnCancelar.setText("Cancelar"); + btnCancelar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarActionPerformed(evt); + } + }); + + jLabel8.setText("Código Produto"); + jLabel8.setToolTipText(""); + + javax.swing.GroupLayout 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() + .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() + .addContainerGap() + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(350, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void txtTituloActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTituloActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtTituloActionPerformed + + private void btnCriarNovoItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCriarNovoItemActionPerformed + // TODO add your handling code here: + + String titulo = txtTitulo.getText(); + String autor = txtAutor.getText(); + String genero = txtGenero.getText(); + double preco = Double.parseDouble(txtPreco.getText()); + int qntEstoque = Integer.parseInt(txtQuantiaEstoque.getText()); + String codigoProduto = txtCodigoProduto.getText(); + String descricao = txtAreaDescricao.getText(); + + Produto produto1 = new Produto(titulo,autor,genero,preco,qntEstoque,codigoProduto,descricao); + + estoque.add(produto1); + JOptionPane.showMessageDialog(null,"Item cadastrado com sucesso!", "Novo produto criado!",JOptionPane.PLAIN_MESSAGE); + this.setVisible(false); + + + + }//GEN-LAST:event_btnCriarNovoItemActionPerformed + + private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnCancelarActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(CriarNovoProduto.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new CriarNovoProduto().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnCancelar; + private javax.swing.JButton btnCriarNovoItem; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JTextArea txtAreaDescricao; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextField txtCodigoProduto; + private javax.swing.JTextField txtGenero; + private javax.swing.JTextField txtPreco; + private javax.swing.JTextField txtQuantiaEstoque; + private javax.swing.JTextField txtTitulo; + // End of variables declaration//GEN-END:variables +} diff --git a/src/telas/Menu.form b/src/telas/Menu.form index b2c096d..acbed56 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,15 +39,12 @@ <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="6" max="32767" attributes="0"/> - </Group> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jPanel1" min="-2" pref="1081" max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> </Group> </DimensionLayout> </Layout> @@ -61,146 +58,137 @@ <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="570" y="60" 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="horizontalAlignment" type="int" value="0"/> + <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="1630" y="210" width="-1" height="-1"/> + <AbsoluteConstraints x="500" y="0" 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="1270" y="700" 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="1270" y="410" 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="750" y="410" 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="250" y="700" width="400" height="130"/> + <AbsoluteConstraints x="110" y="630" 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="750" y="700" 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="250" y="410" width="400" height="130"/> + <AbsoluteConstraints x="130" y="400" width="400" height="130"/> </Constraint> </Constraints> </Component> @@ -223,7 +211,7 @@ </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="290" y="50" width="200" height="70"/> + <AbsoluteConstraints x="10" y="10" width="200" height="70"/> </Constraint> </Constraints> </Component> @@ -246,47 +234,56 @@ </Events> <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="200" height="70"/> + <AbsoluteConstraints x="10" y="10" width="200" height="70"/> </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"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="alignmentY" type="float" value="0.0"/> + <Property name="horizontalTextPosition" type="int" value="0"/> </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="1650" y="250" width="-1" height="-1"/> + <AbsoluteConstraints x="1715" y="20" width="160" height="60"/> </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="1490" y="10" 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/background_resize.jpg"/> + <Image iconType="3" name="/imagens/Telas/Menu.png"/> </Property> </Properties> + <AccessibilityProperties> + <Property name="AccessibleContext.accessibleName" type="java.lang.String" value=""/> + </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="1920" height="1080"/> + <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 c5fe0d7..583475e 100644 --- a/src/telas/Menu.java +++ b/src/telas/Menu.java @@ -6,11 +6,17 @@ import classes.Cliente; import static classes.Cliente.listaClientes; +import classes.Estoque; +import static classes.Estoque.estoque; import classes.Funcionario; import static classes.Funcionario.listaFuncionarios; import classes.Gerente; +import classes.Produto; +import static classes.Usuario.logado; +import static classes.Usuario.user; import javax.swing.JOptionPane; import static telas.cadastarGerente.listaGerente; +import static telas.cadastros.cadastrosFlag; //import static telas.cadastrarCliente.listaClientes; //import static telas.cadastrarFuncionario.listaFuncionarios; @@ -22,9 +28,127 @@ public class Menu extends javax.swing.JFrame { - static boolean logado = false; - static String user;// 'gerente','funcionario','cliente' - public void verificarLogin(boolean logado){ + //static boolean logado = false; + //static String user="anonimo";// 'gerente','funcionario','cliente' + Estoque estoqueLoja = new Estoque(); + public static int historicoCarrinhosTotais = 0; + + + + /** + * Creates new form Menu + */ + public Menu() { + initComponents(); + System.out.println("logado:"+logado); + System.out.println("user:"+user); + setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); + verificarLogin(logado, user); + criarContasIniciais(); + atualizarBotoes(); + } + /** + * 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") + public void criarContasIniciais(){ + if(listaFuncionarios.size()==0 & listaClientes.size()==0 & estoque.size()==0){ + Gerente gerente; + gerente = new Gerente("admin","000.000.000-00","admin@gmail.com","admin"); + listaGerente.add(gerente); + Funcionario funcionario; + funcionario = new Funcionario("func","000.000.000-00","func@gmail.com","func"); + listaFuncionarios.add(funcionario); + Funcionario funcionario1= new Funcionario("Carlos","111.111.111-11","carlos@gmail.com","carlos"); + listaFuncionarios.add(funcionario1); + Funcionario funcionario10 = new Funcionario("Ana", "222.222.222-22", "ana@gmail.com", "ana123"); + listaFuncionarios.add(funcionario10); + + Funcionario funcionario2 = new Funcionario("Bruno", "333.333.333-33", "bruno@gmail.com", "bruno123"); + listaFuncionarios.add(funcionario2); + + Funcionario funcionario3 = new Funcionario("Camila", "444.444.444-44", "camila@gmail.com", "camila123"); + listaFuncionarios.add(funcionario3); + + Funcionario funcionario4 = new Funcionario("Diego", "555.555.555-55", "diego@gmail.com", "diego123"); + listaFuncionarios.add(funcionario4); + + Funcionario funcionario5 = new Funcionario("Elisa", "666.666.666-66", "elisa@gmail.com", "elisa123"); + listaFuncionarios.add(funcionario5); + 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); + Cliente cliente10 = new Cliente("Alice", "777.777.777-77", "alice@gmail.com", "alice123", "Rua A, 123", "01/01/1985", "(11) 98765-4321"); + listaClientes.add(cliente10); + + Cliente cliente2 = new Cliente("Bernardo", "888.888.888-88", "bernardo@gmail.com", "bernardo123", "Avenida B, 456", "02/02/1990", "(21) 99876-5432"); + listaClientes.add(cliente2); + + Cliente cliente3 = new Cliente("Cecília", "999.999.999-99", "cecilia@gmail.com", "cecilia123", "Praça C, 789", "03/03/1995", "(31) 90987-6543"); + listaClientes.add(cliente3); + + Cliente cliente4 = new Cliente("Daniel", "000.000.000-00", "daniel@gmail.com", "daniel123", "Travessa D, 101", "04/04/1980", "(41) 91234-5678"); + listaClientes.add(cliente4); + + Cliente cliente5 = new Cliente("Eva", "111.111.111-11", "eva@gmail.com", "eva123", "Rua E, 202", "05/05/1988", "(51) 92345-6789"); + listaClientes.add(cliente5); + + + Produto produto1 = new Produto("Eragon","Christopher Paolini","Aventura",15.69,3,"1","Eragon se torna um cavaleiro de Dragão"); + 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); + Produto produto6 = new Produto("O Senhor dos Anéis: A Sociedade do Anel", "J.R.R. Tolkien", "Fantasia", 29.99, 4, "6", "A primeira parte da épica trilogia de O Senhor dos Anéis"); + estoqueLoja.addEstoque(produto6); + + Produto produto7 = new Produto("O Hobbit", "J.R.R. Tolkien", "Fantasia", 19.99, 7, "7", "A jornada de Bilbo Bolseiro até a Montanha Solitária"); + estoqueLoja.addEstoque(produto7); + + Produto produto8 = new Produto("1984", "George Orwell", "Ficção Distópica", 22.50, 10, "8", "Uma visão perturbadora de um futuro totalitário"); + estoqueLoja.addEstoque(produto8); + + Produto produto9 = new Produto("A Revolução dos Bichos", "George Orwell", "Fábula Política", 14.90, 8, "9", "Uma sátira ao regime soviético"); + estoqueLoja.addEstoque(produto9); + + Produto produto10 = new Produto("Harry Potter e a Pedra Filosofal", "J.K. Rowling", "Fantasia", 35.00, 12, "10", "O início da jornada mágica de Harry Potter"); + estoqueLoja.addEstoque(produto10); + + Produto produto11 = new Produto("O Código Da Vinci", "Dan Brown", "Suspense", 25.99, 9, "11", "Robert Langdon desvenda segredos antigos em uma trama cheia de mistério"); + estoqueLoja.addEstoque(produto11); + + Produto produto12 = new Produto("Orgulho e Preconceito", "Jane Austen", "Romance", 17.99, 5, "12", "Uma crítica à sociedade inglesa do século XIX através de uma história de amor"); + estoqueLoja.addEstoque(produto12); + + Produto produto13 = new Produto("A Arte da Guerra", "Sun Tzu", "Estratégia", 12.80, 15, "13", "Um clássico sobre estratégias militares e de liderança"); + estoqueLoja.addEstoque(produto13); + + Produto produto14 = new Produto("O Pequeno Príncipe", "Antoine de Saint-Exupéry", "Infantil", 18.50, 10, "14", "Uma fábula sobre amor, perda e amizade"); + estoqueLoja.addEstoque(produto14); + + Produto produto15 = new Produto("O Nome do Vento", "Patrick Rothfuss", "Fantasia", 28.00, 6, "15", "A história de Kvothe, um mago lendário"); + estoqueLoja.addEstoque(produto15); + + Produto produto16 = new Produto("Bleach:TYBW","Tite Kubo","Ação",32.00,10,"16","Yhwach, o rei Quincy selado há 1000 anos recupera seu poder e ataca a Soul Society"); + estoqueLoja.addEstoque(produto16); + + Produto produto17 = new Produto("Bleach: Arrankar","Tite Kubo","Fantasia",30.00,12,"17","Aizen cria os Espadas e domina o Hueco Mundo"); + estoqueLoja.addEstoque(produto17); + + + + } + } + public void verificarLogin(boolean logado, String user){ // Habilitar/desabilitar botão de Logout if(logado==true){ btnLogout.setVisible(true); @@ -44,37 +168,76 @@ public void verificarLogin(boolean logado){ btnLogin.setVisible(true); lblLogin.setVisible(false); } - } + public void atualizarLogin(){ + // Habilitar/desabilitar botão de Logout + if(logado==true){ + btnLogout.setVisible(true); + btnLogin.setVisible(false); + if(user.equals("cliente")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como cliente!"); + }else if(user.equals("funcionario")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como funcionário"); + }else if(user.equals("gerente")){ + lblLogin.setVisible(true); + lblLogin.setText("Você entrou como gerente"); + } + }else{ + btnLogout.setVisible(false); + btnLogin.setVisible(true); + lblLogin.setVisible(false); + } + } + public void atualizarBotoes(){ + if(logado==true){ + if(user.equals("")){ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.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); - - /** - * Creates new form Menu - */ - public Menu() { - initComponents(); - - setLocationRelativeTo(null); - this.setExtendedState(MAXIMIZED_BOTH); - verificarLogin(logado); - Gerente gerente; - gerente = new Gerente("admin","admin","admin@gmail.com","admin"); - listaGerente.add(gerente); - lblLogin.setVisible(false); - Funcionario funcionario; - funcionario = new Funcionario("func","func","func@gmail.com","func"); - listaFuncionarios.add(funcionario); - Cliente cliente = new Cliente("user","111-111","user@gmail.com","user","Pernambuco","10/05/1990","999-9999"); - listaClientes.add(cliente); - - + } + + }else{ + btnCliente.setText("Criar conta de Cliente"); + btnFuncionario.setEnabled(false); + btnGerente.setEnabled(false); + btnAtualizarEstoque.setEnabled(false); + btnVerCarrinho.setEnabled(false); + + } } - /** - * This method is called from within the constructor to initialize the form. - * WARNING: Do NOT modify this code. The content of this method is always - * regenerated by the Form Editor. - */ - @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { @@ -82,7 +245,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(); @@ -91,7 +253,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(); @@ -101,79 +263,81 @@ 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.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lblLogin.setText("Você entrou como cliente"); - jPanel1.add(lblLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(570, 60, -1, -1)); - - 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(1630, 210, -1, -1)); + jPanel1.add(lblLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 0, 1060, 100)); - 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(1270, 700, 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(1270, 410, 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(750, 410, 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(250, 700, 400, 130)); + jPanel1.add(btnFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(110, 630, 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(750, 700, 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(250, 410, 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 @@ -185,7 +349,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnLogoutActionPerformed(evt); } }); - jPanel1.add(btnLogout, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 50, 200, 70)); + jPanel1.add(btnLogout, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 200, 70)); btnLogin.setFont(new java.awt.Font("Segoe UI", 1, 36)); // NOI18N btnLogin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/login-square-arrow-button-outline_icon-icons.com_73220_64.png"))); // NOI18N @@ -197,30 +361,37 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnLoginActionPerformed(evt); } }); - jPanel1.add(btnLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 50, 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(1650, 250, -1, -1)); + jPanel1.add(btnLogin, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 200, 70)); + + jButton1.setBackground(new java.awt.Color(255, 0, 0)); + jButton1.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + jButton1.setText("Fechar"); + jButton1.setToolTipText(""); + jButton1.setAlignmentY(0.0F); + jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER); + 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, 60)); - lblLogo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/livro01.png"))); // NOI18N - jPanel1.add(lblLogo, new org.netbeans.lib.awtextra.AbsoluteConstraints(1490, 10, 390, 210)); + 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/background_resize.jpg"))); // NOI18N - jPanel1.add(lblImagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 1920, 1080)); + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/Telas/Menu.png"))); // NOI18N + jPanel1.add(lblImagem, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 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) - .addGap(0, 6, 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) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 1081, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); pack(); @@ -230,8 +401,10 @@ private void btnLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIR // TODO add your handling code here: logado=false; user=""; - verificarLogin(logado); - JOptionPane.showMessageDialog(null,"Você acabou de sair do sistema", "Mensagem",JOptionPane.PLAIN_MESSAGE); + verificarLogin(logado,user); + JOptionPane.showMessageDialog(null,"Você acabou de sair do sistema", "Mensagem",JOptionPane.INFORMATION_MESSAGE); + atualizarBotoes(); + }//GEN-LAST:event_btnLogoutActionPerformed @@ -245,28 +418,35 @@ private void btnLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRS tela.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosed(java.awt.event.WindowEvent windowEvent) { - verificarLogin(logado); + verificarLogin(logado,user); } }); - + this.setVisible(false); }//GEN-LAST:event_btnLoginActionPerformed private void btnClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClienteActionPerformed // TODO add your handling code here: - verificarLogin(logado); + verificarLogin(logado,user); 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); + } - new cadastrarCliente().setVisible(true); + //new cadastrarCliente().setVisible(true); } }//GEN-LAST:event_btnClienteActionPerformed @@ -278,13 +458,18 @@ private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN- private void btnFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFuncionarioActionPerformed // TODO add your handling code here: - verificarLogin(logado); + verificarLogin(logado,user); 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{ @@ -298,7 +483,7 @@ private void btnFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GE private void btnGerenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGerenteActionPerformed // TODO add your handling code here: - verificarLogin(logado); + verificarLogin(logado,user); if(logado==true){ if(user.equals("gerente")){ new areaGerente().setVisible(true); @@ -316,7 +501,7 @@ private void btnGerenteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FI private void btnVerCarrinhoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVerCarrinhoActionPerformed // TODO add your handling code here: //Verifica se o usuário está logado no sistema - verificarLogin(logado); + verificarLogin(logado,user); if(logado==true){ new verCarrinho().setVisible(true); @@ -327,7 +512,8 @@ private void btnVerCarrinhoActionPerformed(java.awt.event.ActionEvent evt) {//GE private void btnAtualizarEstoqueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAtualizarEstoqueActionPerformed // TODO add your handling code here: - verificarLogin(logado); + verificarLogin(logado,user); + System.out.println("User é "+user); if(logado==true){ if(user.equals("funcionario") || user.equals("gerente") ){ new ControleEstoque().setVisible(true); @@ -340,6 +526,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 */ @@ -384,11 +575,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 9eeb4a5..d3adabd 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,221 +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 max="-2" attributes="0"/> - <Component id="btnSairCliente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="171" 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"> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnSairCliente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblAreaCliente" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <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="280" 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="380" 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="210" 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="460" 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="430" width="550" height="40"/> + </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="260" width="550" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JButton" name="btnSalvarCliente"> <Properties> @@ -241,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"/> @@ -249,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> @@ -256,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"/> @@ -264,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> @@ -271,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"/> @@ -279,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="560" width="160" height="50"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JFormattedTextField" name="ftxNascimentoCliente"> <Properties> @@ -291,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="510" width="550" height="50"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JFormattedTextField" name="ftxTelefone"> <Properties> @@ -299,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="620" width="560" height="40"/> + </Constraint> + </Constraints> </Component> <Component class="javax.swing.JFormattedTextField" name="txtCPFCliente"> <Properties> @@ -307,31 +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="340" width="560" height="50"/> + </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.JButton" name="btnSairCliente"> + <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/simbolos/exit_icon-icons.com_70975.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Sair"/> - <Property name="toolTipText" type="java.lang.String" value="Sair da área do cliente"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairClienteActionPerformed"/> - </Events> - </Component> - <Component class="javax.swing.JLabel" name="lblAreaCliente"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> + <Image iconType="3" name="/imagens/Telas/ÁreaCliente.png"/> </Property> - <Property name="text" type="java.lang.String" value="Área do Cliente"/> </Properties> - </Component> - <Component class="javax.swing.JSeparator" name="jSeparator1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="0" width="-1" height="-1"/> + </Constraint> + </Constraints> </Component> </SubComponents> </Form> diff --git a/src/telas/areaCliente.java b/src/telas/areaCliente.java index 2f21e46..d5bae14 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(); @@ -104,43 +110,87 @@ private void initComponents() { ftxNascimentoCliente = new javax.swing.JFormattedTextField(); ftxTelefone = new javax.swing.JFormattedTextField(); txtCPFCliente = new javax.swing.JFormattedTextField(); - btnSairCliente = new javax.swing.JButton(); lblAreaCliente = new javax.swing.JLabel(); jSeparator1 = new javax.swing.JSeparator(); + jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Área do cliente"); + 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, 280, 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, 380, 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, 210, 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, 460, 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, 430, 550, 40)); + 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, 260, 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() { @@ -148,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() { @@ -158,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() { @@ -168,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, 560, 160, 50)); try { ftxNascimentoCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####"))); @@ -177,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, 510, 550, 50)); try { ftxTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-####"))); @@ -184,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, 620, 560, 40)); try { txtCPFCliente.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); @@ -191,146 +250,23 @@ 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, 340, 560, 50)); - 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)) - ); - - btnSairCliente.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/exit_icon-icons.com_70975.png"))); // NOI18N - btnSairCliente.setText("Sair"); - btnSairCliente.setToolTipText("Sair da área do cliente"); - btnSairCliente.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnSairClienteActionPerformed(evt); - } - }); - - 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)); - 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() - .addComponent(btnSairCliente) - .addGap(171, 171, 171) - .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() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnSairCliente) - .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()) - ); + jSeparator1.setForeground(new java.awt.Color(150, 114, 69)); + jPanel1.add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 60, 610, 10)); - pack(); - }// </editor-fold>//GEN-END:initComponents + getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(788, 100, 610, 810)); - private void btnSairClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairClienteActionPerformed - // TODO add your handling code here: - this.setVisible(false); + 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)); - }//GEN-LAST:event_btnSairClienteActionPerformed + pack(); + }// </editor-fold>//GEN-END:initComponents private void txtNomeClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeClienteActionPerformed // TODO add your handling code here: @@ -355,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 */ @@ -399,10 +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 btnSairCliente; + 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..f8f87ea 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> - <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> - <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="txtNomeFuncionario" min="-2" pref="44" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCPFFuncionario" min="-2" pref="50" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCPFFuncionario" min="-2" pref="37" 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" pref="40" 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" pref="44" max="-2" attributes="0"/> + <EmptySpace 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" pref="42" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="56" 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="58" 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,231 @@ <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" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNomeCliente" min="-2" pref="176" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCPFCliente" min="-2" pref="90" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnNovoCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="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"/> + </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" 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 min="-2" pref="12" 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="txtCPFCliente" 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="300" 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 London" size="20" 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 London" size="20" 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 London" size="20" 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 London" size="20" 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="txtCPFCliente"> + <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..5017419 100644 --- a/src/telas/areaFuncionario.java +++ b/src/telas/areaFuncionario.java @@ -4,8 +4,14 @@ */ package telas; +import classes.Cliente; +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 +31,9 @@ public areaFuncionario() { btnSalvarFuncionario.setEnabled(false); btnCancelarFuncionario.setEnabled(false); loadFuncionarioFields(); + this.setExtendedState(MAXIMIZED_BOTH); + carregarTabelaCliente(); + setLocationRelativeTo(null); } @@ -64,6 +73,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 +109,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 +126,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(); + txtCPFCliente = 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)); + + jPanel1.setBackground(new java.awt.Color(211, 181, 143)); - lblDadosFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + 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 +203,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 +213,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 +222,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 +230,235 @@ 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) + .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(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) - .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) + .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 44, 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)) - .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)) - .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(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, 37, 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, 40, 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, 44, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .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, 42, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(56, 56, 56) + .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(58, 58, 58)) ); - 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 London", 0, 20)); // 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 London", 0, 20)); // 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 London", 0, 20)); // 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 London", 0, 20)); // 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 { + txtCPFCliente.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) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(lblNomeCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblCPFCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)) + .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)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblCodigoCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCodCliente)))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(133, 133, 133) + .addComponent(lblControleClientes))) + .addGap(12, 12, 12)) ); - 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(txtCPFCliente, 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, 300, 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 @@ -258,18 +476,79 @@ private void btnCancelarFuncionarioActionPerformed(java.awt.event.ActionEvent ev btnAlterarFuncionario.setEnabled(true); btnSalvarFuncionario.setEnabled(false); btnCancelarFuncionario.setEnabled(false); + loadFuncionarioFields(); }//GEN-LAST:event_btnCancelarFuncionarioActionPerformed 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: + String nomePesquisado = txtNomeCliente.getText(); + String cpfPesquisado = txtCPFCliente.getText(); + String codPesquisado = txtCodCliente.getText(); + Cliente cli; + for(Cliente cliente : listaClientes){ + if(cliente.getNome().equals(nomePesquisado) || + cliente.getCPF().equals(cpfPesquisado) || + cliente.getIdCliente().equals(codPesquisado)){ + cli = cliente; + txtNomeCliente.setText(cli.getNome()); + txtCPFCliente.setText(cli.getCPF()); + txtCodCliente.setText(cli.getIdCliente()); + int rowIndex = Integer.parseInt(cli.getIdCliente()); + tblControleClientes.setRowSelectionInterval(rowIndex, rowIndex); + break; + } + } + }//GEN-LAST:event_btnBuscarClienteActionPerformed + /** * @param args the command line arguments */ @@ -307,19 +586,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.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.JFormattedTextField txtCPFCliente; private javax.swing.JTextField txtCPFFuncionario; + private javax.swing.JTextField txtCodCliente; private javax.swing.JTextField txtCodigoFuncionario; private javax.swing.JTextField txtEmailFuncionario; + private javax.swing.JTextField txtNomeCliente; private javax.swing.JTextField txtNomeFuncionario; private javax.swing.JTextField txtSenhaFuncionario; // End of variables declaration//GEN-END:variables diff --git a/src/telas/areaGerente.form b/src/telas/areaGerente.form index 5d716f0..76cc8e7 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"/> @@ -42,23 +45,29 @@ <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,64,0,0,7,127"/> + <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,52,0,0,7,127"/> </AuxValues> <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> <Property name="useNullLayout" type="boolean" value="false"/> </Layout> <SubComponents> - <Component class="javax.swing.JLabel" name="lblAreaGerente"> + <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 English Text MT" size="48" style="1"/> + <Font name="Old London" size="48" style="0"/> </Property> - <Property name="text" type="java.lang.String" value="Dados do Gerente"/> + <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="280" y="160" width="-1" height="-1"/> + <AbsoluteConstraints x="1780" y="10" width="130" height="60"/> </Constraint> </Constraints> </Component> @@ -70,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> @@ -79,16 +88,8 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="1" attributes="0"> <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <Component id="lblCPFGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="218" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="1" attributes="0"> - <Component id="lblEmailGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="209" max="-2" attributes="0"/> - </Group> - </Group> + <Component id="lblEmailGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="209" max="-2" attributes="0"/> </Group> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> @@ -96,41 +97,52 @@ <Component id="txtEmailGerente" alignment="1" max="32767" attributes="0"/> <Component id="ftxCPFGerente" alignment="1" max="32767" attributes="0"/> <Component id="txtNomeGerente" alignment="0" max="32767" attributes="0"/> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="213" max="-2" attributes="0"/> - <Component id="lblNomeGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> - </Group> <Component id="txtIdGerente" alignment="0" max="32767" attributes="0"/> - <Group type="102" attributes="0"> + </Group> + <EmptySpace 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 min="-2" pref="109" max="-2" attributes="0"/> + <Component id="lblAreaGerente" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="190" max="-2" attributes="0"/> + <Component id="lblIdGerente" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnAlterarGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="136" max="-2" attributes="0"/> + <Component id="btnSalvarGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="67" max="32767" attributes="0"/> + <Component id="btnCancelarGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="217" max="-2" attributes="0"/> - <Component id="lblSenhaGerente" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblNomeGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="215" max="-2" attributes="0"/> </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="184" max="-2" attributes="0"/> - <Component id="lblIdGerente" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblCPFGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="220" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblSenhaGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="220" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace min="0" pref="0" max="32767" attributes="0"/> </Group> </Group> - <EmptySpace max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="btnAlterarGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="136" max="-2" attributes="0"/> - <Component id="btnSalvarGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="btnCancelarGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> - <Component id="lblDadosGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace pref="35" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -138,32 +150,32 @@ <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> <EmptySpace max="-2" attributes="0"/> - <Component id="lblDadosGerente" min="-2" max="-2" attributes="0"/> + <Component id="lblAreaGerente" min="-2" pref="61" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="lblNomeGerente" min="-2" max="-2" attributes="0"/> + <Component id="lblNomeGerente" min="-2" pref="42" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtNomeGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="lblCPFGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCPFGerente" min="-2" pref="37" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="ftxCPFGerente" min="-2" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/> - <Component id="lblEmailGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> + <Component id="lblEmailGerente" min="-2" pref="44" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Component id="txtEmailGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> - <Component id="lblSenhaGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblSenhaGerente" min="-2" pref="41" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Component id="txtSenhaGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> - <Component id="lblIdGerente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblIdGerente" min="-2" pref="40" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtIdGerente" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <EmptySpace pref="41" max="32767" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="btnAlterarGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnSalvarGerente" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="btnCancelarGerente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnAlterarGerente" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> + <Component id="btnSalvarGerente" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> + <Component id="btnCancelarGerente" alignment="3" min="-2" pref="35" max="-2" attributes="0"/> </Group> <EmptySpace min="-2" pref="102" max="-2" attributes="0"/> </Group> @@ -174,7 +186,7 @@ <Component class="javax.swing.JLabel" name="lblNomeGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="36" style="1"/> + <Font name="Old London" size="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Nome"/> </Properties> @@ -182,7 +194,7 @@ <Component class="javax.swing.JLabel" name="lblCPFGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="36" style="0"/> + <Font name="Old London" size="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="CPF"/> </Properties> @@ -190,7 +202,7 @@ <Component class="javax.swing.JLabel" name="lblEmailGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="36" style="0"/> + <Font name="Old London" size="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="E-mail"/> </Properties> @@ -198,7 +210,7 @@ <Component class="javax.swing.JLabel" name="lblSenhaGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="36" style="0"/> + <Font name="Old London" size="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Senha"/> </Properties> @@ -206,7 +218,7 @@ <Component class="javax.swing.JLabel" name="lblIdGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="36" style="0"/> + <Font name="Old London" size="36" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Id Gerente"/> </Properties> @@ -214,7 +226,7 @@ <Component class="javax.swing.JTextField" name="txtNomeGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="24" style="0"/> + <Font name="Segoe UI" size="18" style="0"/> </Property> <Property name="toolTipText" type="java.lang.String" value="insira o nome"/> </Properties> @@ -225,20 +237,23 @@ <Component class="javax.swing.JTextField" name="txtEmailGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="24" style="0"/> + <Font name="Segoe UI" size="18" style="0"/> </Property> <Property name="toolTipText" type="java.lang.String" value="insira o e-mail"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtSenhaGerente"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="0"/> + </Property> <Property name="toolTipText" type="java.lang.String" value="defina uma senha"/> </Properties> </Component> <Component class="javax.swing.JTextField" name="txtIdGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="24" style="0"/> + <Font name="Segoe UI" size="18" style="0"/> </Property> <Property name="toolTipText" type="java.lang.String" value="defina um Id Gerente"/> </Properties> @@ -249,12 +264,15 @@ <Format format="###.###.###-##" subtype="-1" type="5"/> </Property> <Property name="toolTipText" type="java.lang.String" value="insira o CPF"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="0"/> + </Property> </Properties> </Component> - <Component class="javax.swing.JLabel" name="lblDadosGerente"> + <Component class="javax.swing.JLabel" name="lblAreaGerente"> <Properties> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Old English Text MT" size="60" style="1"/> + <Font name="Old London" size="48" style="0"/> </Property> <Property name="text" type="java.lang.String" value="Dados do Gerente"/> </Properties> @@ -265,7 +283,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="24" style="1"/> </Property> <Property name="text" type="java.lang.String" value="Alterar"/> <Property name="toolTipText" type="java.lang.String" value="alterar os dados já existentes"/> @@ -280,7 +298,7 @@ <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"/> + <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"/> @@ -295,7 +313,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="1"/> </Property> <Property name="text" type="java.lang.String" value="Cancelar"/> <Property name="toolTipText" type="java.lang.String" value="Cancelar a operação"/> @@ -314,7 +332,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="430"/> + <AbsoluteConstraints x="850" y="30" width="980" height="420"/> </Constraint> </Constraints> @@ -345,17 +363,17 @@ <Component id="lblNomeFuncionario" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Component id="txtNomeFuncionario" min="-2" pref="186" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="30" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Component id="lblCPFFuncionario" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxCPFFuncionario" min="-2" pref="111" max="-2" attributes="0"/> <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="ftxCPFFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> <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> @@ -368,26 +386,27 @@ <Group type="103" groupAlignment="0" max="-2" attributes="0"> <Group type="103" groupAlignment="3" attributes="0"> <Component id="lblNomeFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="ftxCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="lblIdFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="txtCodigoFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnBuscarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <Group type="102" attributes="0"> - <Component id="txtNomeFuncionario" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtNomeFuncionario" alignment="3" max="32767" attributes="0"/> + <Component id="lblCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ftxCPFFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> <EmptySpace min="1" pref="1" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> <Component id="btnNovoFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnSalvarFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnExcluirFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane1" pref="286" max="32767" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="241" max="-2" attributes="0"/> + <EmptySpace pref="60" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> @@ -432,8 +451,11 @@ </Component> <Component class="javax.swing.JButton" name="btnNovoFuncionario"> <Properties> - <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 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"/> <Property name="toolTipText" type="java.lang.String" value="Adicionar novo funcionário"/> @@ -450,6 +472,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> @@ -463,41 +488,29 @@ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> - <Component class="javax.swing.JTable" name="tblControleFuncionariosx"> + <Component class="javax.swing.JTable" name="tblControleFuncionarios"> <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="Nome" type="java.lang.String"/> - <Column editable="true" title="CPF" type="java.lang.String"/> - <Column editable="true" title="E-mail" type="java.lang.String"/> - <Column editable="true" title="Senha" type="java.lang.String"/> - <Column editable="true" title="Cód. Funcionário" type="java.lang.String"/> + <Table columnCount="3" rowCount="4"> + <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"/> <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="3" resizable="true"> <Title/> <Editor/> <Renderer/> </Column> - <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="true"> + <Column maxWidth="-1" minWidth="-1" prefWidth="50" 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"> + <Column maxWidth="-1" minWidth="-1" prefWidth="14" resizable="true"> <Title/> <Editor/> <Renderer/> @@ -508,13 +521,19 @@ <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="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/Save_37110.png"/> + <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="text" type="java.lang.String" value="Salvar"/> <Property name="toolTipText" type="java.lang.String" value="Salvar dados do funcionário"/> @@ -525,12 +544,18 @@ </Component> <Component class="javax.swing.JButton" name="btnExcluirFuncionario"> <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/delete_4219.png"/> + <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"/> <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> @@ -550,73 +575,75 @@ </Properties> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> - <AbsoluteConstraints x="850" y="670" width="940" height="390"/> + <AbsoluteConstraints x="780" y="520" width="990" height="450"/> </Constraint> </Constraints> <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="1" attributes="0"> - <EmptySpace max="32767" attributes="0"/> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="253" max="-2" attributes="0"/> - </Group> <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="jLabel3" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jTextField1" min="-2" pref="225" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> - <Component id="jLabel4" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jTextField2" min="-2" pref="109" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="jLabel5" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - <Component id="jTextField3" min="-2" pref="173" max="-2" attributes="0"/> - <EmptySpace max="32767" attributes="0"/> - <Component id="jButton1" min="-2" max="-2" attributes="0"/> - <EmptySpace max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="104" max="-2" attributes="0"/> - <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="169" max="-2" attributes="0"/> + <Component id="btnNovoCliente" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="213" max="-2" attributes="0"/> - <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> <EmptySpace min="-2" pref="143" max="-2" attributes="0"/> - <Component id="jButton4" min="-2" max="-2" attributes="0"/> + <Component id="btnExluirCliente" min="-2" max="-2" attributes="0"/> <EmptySpace max="32767" attributes="0"/> </Group> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="lblControleClientes" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtNomeCliente" min="-2" pref="225" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCPFCliente" min="-2" pref="115" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblCodigoCliente" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCodCliente" min="-2" pref="173" max="-2" 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> + <Component id="jScrollPane3" alignment="1" max="32767" attributes="0"/> </Group> </DimensionLayout> <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <Component id="lblControleClientes" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton1" alignment="3" min="-2" max="-2" 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="btnBuscarCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCPFCliente" alignment="3" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="3" attributes="0"> - <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="jButton4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnNovoCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnExluirCliente" alignment="3" min="-2" max="-2" attributes="0"/> </Group> - <EmptySpace min="0" pref="293" max="32767" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane3" pref="332" max="32767" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> - <Component class="javax.swing.JLabel" name="jLabel2"> + <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"/> @@ -624,7 +651,7 @@ <Property name="text" type="java.lang.String" value="Controle de Clientes"/> </Properties> </Component> - <Component class="javax.swing.JLabel" name="jLabel3"> + <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"/> @@ -632,9 +659,9 @@ <Property name="text" type="java.lang.String" value="Nome"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField1"> + <Component class="javax.swing.JTextField" name="txtNomeCliente"> </Component> - <Component class="javax.swing.JLabel" name="jLabel4"> + <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"/> @@ -642,9 +669,7 @@ <Property name="text" type="java.lang.String" value="CPF"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField2"> - </Component> - <Component class="javax.swing.JLabel" name="jLabel5"> + <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"/> @@ -652,37 +677,125 @@ <Property name="text" type="java.lang.String" value="Código de Cliente"/> </Properties> </Component> - <Component class="javax.swing.JTextField" name="jTextField3"> + <Component class="javax.swing.JTextField" name="txtCodCliente"> </Component> - <Component class="javax.swing.JButton" name="jButton1"> + <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="jButton2"> + <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="jButton3"> + <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> <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="jButton4"> + <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="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"> + <TableColumnModel selectionModel="0"> + <Column maxWidth="-1" minWidth="-1" prefWidth="3" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="50" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="14" resizable="true"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="10" 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> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JFormattedTextField" name="txtCPFCliente"> + <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"> + <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 7877159..b1d6e8c 100644 --- a/src/telas/areaGerente.java +++ b/src/telas/areaGerente.java @@ -4,8 +4,15 @@ */ package telas; +import classes.Cliente; +import static classes.Cliente.listaClientes; +import classes.Funcionario; +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; /** * @@ -20,9 +27,15 @@ public areaGerente() { initComponents(); setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); + disableGerenteFields(); disableControleFuncionariosButtons(); disableControleFuncionariosFields(); + carregarTabelaFuncionario(); + carregarTabelaCliente(); + enableFuncionarioInfo(); + btnCancelarGerente.setEnabled(false); btnSalvarGerente.setEnabled(false); @@ -38,6 +51,12 @@ public areaGerente() { * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ + public void enableFuncionarioInfo(){ + txtNomeFuncionario.setEnabled(true); + ftxCPFFuncionario.setEnabled(true); + txtCodigoFuncionario.setEnabled(true); + btnBuscarFuncionario.setEnabled(true); + } public void loadGerenteInfo(){ Gerente gerente1 = listaGerente.get(0); @@ -47,13 +66,60 @@ public void loadGerenteInfo(){ txtSenhaGerente.setText(gerente1.getSenha()); txtIdGerente.setText(gerente1.getCadastroGerente()); } + + //Carregar a tabela com os funcionários da lista + private void carregarTabelaFuncionario() { + DefaultTableModel modeloTabela = new DefaultTableModel(new Object[] {"Cod.Funcionário","Nome","CPF"},0); + + for(int i=0;i<listaFuncionarios.size();i++){ + Object linha[] = new Object[]{listaFuncionarios.get(i).getCadastroFuncionario(), + listaFuncionarios.get(i).getNome(), + listaFuncionarios.get(i).getCPF()}; + modeloTabela.addRow(linha); + + } + //Tabela recebe modelo + tblControleFuncionarios.setModel(modeloTabela); + + tblControleFuncionarios.getColumnModel().getColumn(0).setPreferredWidth(3); + tblControleFuncionarios.getColumnModel().getColumn(1).setPreferredWidth(50); + tblControleFuncionarios.getColumnModel().getColumn(2).setPreferredWidth(14); + + + } + + 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); + + + + } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); - lblAreaGerente = new javax.swing.JLabel(); + btnSair = new javax.swing.JButton(); jPanel1 = new javax.swing.JPanel(); lblNomeGerente = new javax.swing.JLabel(); lblCPFGerente = new javax.swing.JLabel(); @@ -65,7 +131,7 @@ private void initComponents() { txtSenhaGerente = new javax.swing.JTextField(); txtIdGerente = new javax.swing.JTextField(); ftxCPFGerente = new javax.swing.JFormattedTextField(); - lblDadosGerente = new javax.swing.JLabel(); + lblAreaGerente = new javax.swing.JLabel(); btnAlterarGerente = new javax.swing.JButton(); btnSalvarGerente = new javax.swing.JButton(); btnCancelarGerente = new javax.swing.JButton(); @@ -79,23 +145,25 @@ private void initComponents() { btnBuscarFuncionario = new javax.swing.JButton(); ftxCPFFuncionario = new javax.swing.JFormattedTextField(); jScrollPane1 = new javax.swing.JScrollPane(); - tblControleFuncionariosx = new javax.swing.JTable(); + tblControleFuncionarios = new javax.swing.JTable(); btnSalvarFuncionario = new javax.swing.JButton(); btnExcluirFuncionario = new javax.swing.JButton(); lblControleFuncionarios = new javax.swing.JLabel(); jPanel3 = new javax.swing.JPanel(); - jLabel2 = new javax.swing.JLabel(); - jLabel3 = new javax.swing.JLabel(); - jTextField1 = new javax.swing.JTextField(); - jLabel4 = new javax.swing.JLabel(); - jTextField2 = new javax.swing.JTextField(); - jLabel5 = new javax.swing.JLabel(); - jTextField3 = new javax.swing.JTextField(); - jButton1 = new javax.swing.JButton(); - jButton2 = new javax.swing.JButton(); - jButton3 = new javax.swing.JButton(); - jButton4 = new javax.swing.JButton(); - jLabel1 = new javax.swing.JLabel(); + 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(); + txtCPFCliente = new javax.swing.JFormattedTextField(); + lblBackground = new javax.swing.JLabel(); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { @@ -112,30 +180,37 @@ 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()); - lblAreaGerente.setFont(new java.awt.Font("Old English Text MT", 1, 48)); // NOI18N - lblAreaGerente.setText("Dados do Gerente"); - getContentPane().add(lblAreaGerente, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 160, -1, -1)); + 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 + lblNomeGerente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblNomeGerente.setText("Nome"); - lblCPFGerente.setFont(new java.awt.Font("Old English Text MT", 0, 36)); // NOI18N + lblCPFGerente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblCPFGerente.setText("CPF"); - lblEmailGerente.setFont(new java.awt.Font("Old English Text MT", 0, 36)); // NOI18N + lblEmailGerente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblEmailGerente.setText("E-mail"); - lblSenhaGerente.setFont(new java.awt.Font("Old English Text MT", 0, 36)); // NOI18N + lblSenhaGerente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblSenhaGerente.setText("Senha"); - lblIdGerente.setFont(new java.awt.Font("Old English Text MT", 0, 36)); // NOI18N + lblIdGerente.setFont(new java.awt.Font("Old London", 0, 36)); // NOI18N lblIdGerente.setText("Id Gerente"); - txtNomeGerente.setFont(new java.awt.Font("Old English Text MT", 0, 24)); // NOI18N + txtNomeGerente.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N txtNomeGerente.setToolTipText("insira o nome"); txtNomeGerente.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -143,12 +218,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - txtEmailGerente.setFont(new java.awt.Font("Segoe UI", 0, 24)); // NOI18N + txtEmailGerente.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N txtEmailGerente.setToolTipText("insira o e-mail"); + txtSenhaGerente.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N txtSenhaGerente.setToolTipText("defina uma senha"); - txtIdGerente.setFont(new java.awt.Font("Old English Text MT", 0, 24)); // NOI18N + txtIdGerente.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N txtIdGerente.setToolTipText("defina um Id Gerente"); try { @@ -157,12 +233,13 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { ex.printStackTrace(); } ftxCPFGerente.setToolTipText("insira o CPF"); + ftxCPFGerente.setFont(new java.awt.Font("Segoe UI", 0, 18)); // NOI18N - lblDadosGerente.setFont(new java.awt.Font("Old English Text MT", 1, 60)); // NOI18N - lblDadosGerente.setText("Dados do Gerente"); + lblAreaGerente.setFont(new java.awt.Font("Old London", 0, 48)); // NOI18N + lblAreaGerente.setText("Dados do Gerente"); btnAlterarGerente.setBackground(new java.awt.Color(255, 255, 0)); - btnAlterarGerente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnAlterarGerente.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N btnAlterarGerente.setText("Alterar"); btnAlterarGerente.setToolTipText("alterar os dados já existentes"); btnAlterarGerente.addActionListener(new java.awt.event.ActionListener() { @@ -172,7 +249,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); btnSalvarGerente.setBackground(new java.awt.Color(0, 255, 0)); - btnSalvarGerente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnSalvarGerente.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N btnSalvarGerente.setText("Salvar"); btnSalvarGerente.setToolTipText("Salvar os dados"); btnSalvarGerente.addActionListener(new java.awt.event.ActionListener() { @@ -182,7 +259,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { }); btnCancelarGerente.setBackground(new java.awt.Color(255, 0, 0)); - btnCancelarGerente.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCancelarGerente.setFont(new java.awt.Font("Old London", 1, 24)); // NOI18N btnCancelarGerente.setText("Cancelar"); btnCancelarGerente.setToolTipText("Cancelar a operação"); btnCancelarGerente.addActionListener(new java.awt.event.ActionListener() { @@ -197,81 +274,82 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(lblCPFGerente) - .addGap(218, 218, 218)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() - .addComponent(lblEmailGerente) - .addGap(209, 209, 209)))) + .addComponent(lblEmailGerente) + .addGap(209, 209, 209)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txtSenhaGerente, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtEmailGerente, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(ftxCPFGerente, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(txtNomeGerente) + .addComponent(txtIdGerente)) + .addContainerGap()) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(213, 213, 213) - .addComponent(lblNomeGerente) - .addGap(0, 0, Short.MAX_VALUE)) - .addComponent(txtIdGerente) + .addGap(109, 109, 109) + .addComponent(lblAreaGerente)) .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(217, 217, 217) - .addComponent(lblSenhaGerente)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(184, 184, 184) - .addComponent(lblIdGerente))) - .addGap(0, 0, Short.MAX_VALUE))) - .addContainerGap()) + .addGap(190, 190, 190) + .addComponent(lblIdGerente))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(btnAlterarGerente) - .addGap(136, 136, 136) - .addComponent(btnSalvarGerente) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(btnCancelarGerente) - .addGap(20, 20, 20)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(34, 34, 34) - .addComponent(lblDadosGerente) - .addContainerGap(35, Short.MAX_VALUE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(btnAlterarGerente) + .addGap(136, 136, 136) + .addComponent(btnSalvarGerente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE) + .addComponent(btnCancelarGerente) + .addGap(20, 20, 20)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(lblNomeGerente) + .addGap(215, 215, 215)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(lblCPFGerente) + .addGap(220, 220, 220)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addComponent(lblSenhaGerente) + .addGap(220, 220, 220)))))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(lblDadosGerente) + .addComponent(lblAreaGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(lblNomeGerente) + .addComponent(lblNomeGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtNomeGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(lblCPFGerente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblCPFGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(ftxCPFGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(lblEmailGerente) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblEmailGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtEmailGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(9, 9, 9) - .addComponent(lblSenhaGerente) - .addGap(18, 18, 18) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblSenhaGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtSenhaGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(21, 21, 21) - .addComponent(lblIdGerente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblIdGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtIdGerente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(30, 30, 30) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 41, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(btnAlterarGerente) - .addComponent(btnSalvarGerente) - .addComponent(btnCancelarGerente)) + .addComponent(btnAlterarGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSalvarGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnCancelarGerente, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .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)); @@ -293,7 +371,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - btnNovoFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/add_icon-icons.com_74429 (2).png"))); // NOI18N + btnNovoFuncionario.setBackground(new java.awt.Color(51, 255, 153)); + btnNovoFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N btnNovoFuncionario.setText("Novo"); btnNovoFuncionario.setToolTipText("Adicionar novo funcionário"); btnNovoFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -305,6 +384,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("###.###.###-##"))); @@ -313,29 +397,47 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } ftxCPFFuncionario.setToolTipText("insira o CPF do funcionário"); - tblControleFuncionariosx.setModel(new javax.swing.table.DefaultTableModel( + tblControleFuncionarios.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, null}, + {null, null, null} }, new String [] { - "Nome", "CPF", "E-mail", "Senha", "Cód. Funcionário" + "Cód. Funcionário", "Nome", "CPF" } ) { Class[] types = new Class [] { - java.lang.String.class, java.lang.String.class, java.lang.String.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 }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } }); - tblControleFuncionariosx.setToolTipText("Tabela com os dados de funcionários"); - jScrollPane1.setViewportView(tblControleFuncionariosx); + 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); + tblControleFuncionarios.getColumnModel().getColumn(1).setPreferredWidth(50); + tblControleFuncionarios.getColumnModel().getColumn(2).setPreferredWidth(14); + } - btnSalvarFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/Save_37110.png"))); // NOI18N + btnSalvarFuncionario.setBackground(new java.awt.Color(0, 255, 0)); + btnSalvarFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N btnSalvarFuncionario.setText("Salvar"); btnSalvarFuncionario.setToolTipText("Salvar dados do funcionário"); btnSalvarFuncionario.addActionListener(new java.awt.event.ActionListener() { @@ -344,9 +446,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - btnExcluirFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/delete_4219.png"))); // NOI18N + btnExcluirFuncionario.setBackground(new java.awt.Color(102, 102, 102)); + btnExcluirFuncionario.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // 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"); @@ -376,17 +484,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(lblNomeFuncionario) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txtNomeFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(30, 30, 30) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblCPFFuncionario) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) - .addComponent(ftxCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(29, 29, 29) .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) @@ -397,107 +505,175 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblNomeFuncionario) - .addComponent(lblCPFFuncionario) - .addComponent(ftxCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblIdFuncionario) .addComponent(txtCodigoFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnBuscarFuncionario)) .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(txtNomeFuncionario) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtNomeFuncionario) + .addComponent(lblCPFFuncionario) + .addComponent(ftxCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(1, 1, 1))) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnNovoFuncionario) .addComponent(btnSalvarFuncionario) .addComponent(btnExcluirFuncionario)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 286, Short.MAX_VALUE) - .addContainerGap()) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(60, Short.MAX_VALUE)) ); - getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(910, 220, 870, 430)); + getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(850, 30, 980, 420)); jPanel3.setBackground(new java.awt.Color(211, 181, 143)); - jLabel2.setFont(new java.awt.Font("Old English Text MT", 1, 36)); // NOI18N - jLabel2.setText("Controle de Clientes"); + lblControleClientes.setFont(new java.awt.Font("Old English Text MT", 1, 36)); // NOI18N + lblControleClientes.setText("Controle de Clientes"); - jLabel3.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - jLabel3.setText("Nome"); + lblNomeCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + lblNomeCliente.setText("Nome"); - jLabel4.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - jLabel4.setText("CPF"); + lblCPFCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + lblCPFCliente.setText("CPF"); - jLabel5.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - jLabel5.setText("Código de Cliente"); + lblCodigoCliente.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N + lblCodigoCliente.setText("Código de Cliente"); - jButton1.setFont(new java.awt.Font("Old English Text MT", 0, 18)); // NOI18N - jButton1.setText("Buscar"); + 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); + } + }); - jButton2.setText("Novo"); + 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); + } + }); - jButton3.setText("Salvar"); + 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() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarClienteActionPerformed(evt); + } + }); - jButton4.setText("Excluir"); + 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 + }; + 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) { + tblControleClientes.getColumnModel().getColumn(0).setPreferredWidth(3); + tblControleClientes.getColumnModel().getColumn(1).setPreferredWidth(50); + tblControleClientes.getColumnModel().getColumn(2).setPreferredWidth(14); + tblControleClientes.getColumnModel().getColumn(3).setPreferredWidth(10); + tblControleClientes.getColumnModel().getColumn(4).setPreferredWidth(100); + } + + try { + txtCPFCliente.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(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jLabel2) - .addGap(253, 253, 253)) .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap() - .addComponent(jLabel3) - .addGap(18, 18, 18) - .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(48, 48, 48) - .addComponent(jLabel4) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton1) - .addContainerGap()) - .addGroup(jPanel3Layout.createSequentialGroup() - .addGap(104, 104, 104) - .addComponent(jButton2) + .addGap(169, 169, 169) + .addComponent(btnNovoCliente) .addGap(213, 213, 213) - .addComponent(jButton3) + .addComponent(btnSalvarCliente) .addGap(143, 143, 143) - .addComponent(jButton4) + .addComponent(btnExluirCliente) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblControleClientes) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(lblNomeCliente) + .addGap(18, 18, 18) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(lblCPFCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .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, 77, Short.MAX_VALUE) + .addComponent(btnBuscarCliente) + .addGap(38, 38, 38)) + .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING) ); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel2) + .addComponent(lblControleClientes) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jLabel3) - .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel4) - .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jLabel5) - .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(jButton1)) + .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(btnBuscarCliente) + .addComponent(txtCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(jButton2) - .addComponent(jButton3) - .addComponent(jButton4)) - .addGap(0, 293, Short.MAX_VALUE)) + .addComponent(btnNovoCliente) + .addComponent(btnSalvarCliente) + .addComponent(btnExluirCliente)) + .addGap(18, 18, 18) + .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)) ); - getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(850, 670, 940, 390)); + getContentPane().add(jPanel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(780, 520, 990, 450)); - jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/ÁreaGerente.png"))); // NOI18N - getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -30, 1920, 1140)); + 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(); }// </editor-fold>//GEN-END:initComponents @@ -517,14 +693,23 @@ 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 // TODO add your handling code here: disableGerenteFields(); + loadGerenteInfo(); btnAlterarGerente.setEnabled(true); btnSalvarGerente.setEnabled(false); btnCancelarGerente.setEnabled(false); @@ -535,22 +720,125 @@ 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 // TODO add your handling code here: }//GEN-LAST:event_txtCodigoFuncionarioActionPerformed + 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: + System.out.println(listaFuncionarios); + int i = tblControleFuncionarios.getSelectedRow(); + System.out.println("indice da lista:"+i); + + if (i>=0 && i<listaFuncionarios.size()){ + + listaFuncionarios.remove(i); + + } + System.out.println(listaFuncionarios); + 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: + String nomePesquisado = txtNomeFuncionario.getText(); + String cpfPesquisado = ftxCPFFuncionario.getText(); + String codPesquisado = txtCodigoFuncionario.getText(); + Funcionario func; + for(Funcionario funcionario : listaFuncionarios){ + if(funcionario.getNome().equals(nomePesquisado) || + funcionario.getCPF().equals(cpfPesquisado) || + funcionario.getCadastroFuncionario().equals(codPesquisado)){ + func = funcionario; + txtNomeFuncionario.setText(func.getNome()); + ftxCPFFuncionario.setText(func.getCPF()); + txtCodigoFuncionario.setText(func.getCadastroFuncionario()); + int rowIndex = Integer.parseInt(func.getCadastroFuncionario()); + tblControleFuncionarios.setRowSelectionInterval(rowIndex, rowIndex); + break; + } + } + }//GEN-LAST:event_btnBuscarFuncionarioActionPerformed + + private void btnBuscarClienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarClienteActionPerformed + // TODO add your handling code here: + String nomePesquisado = txtNomeCliente.getText(); + String cpfPesquisado = txtCPFCliente.getText(); + String codPesquisado = txtCodCliente.getText(); + Cliente cli; + for(Cliente cliente : listaClientes){ + if(cliente.getNome().equals(nomePesquisado) || + cliente.getCPF().equals(cpfPesquisado) || + cliente.getIdCliente().equals(codPesquisado)){ + cli = cliente; + txtNomeCliente.setText(cli.getNome()); + txtCPFCliente.setText(cli.getCPF()); + txtCodCliente.setText(cli.getIdCliente()); + int rowIndex = Integer.parseInt(cli.getIdCliente()); + tblControleClientes.setRowSelectionInterval(rowIndex, rowIndex); + break; + } + } + }//GEN-LAST:event_btnBuscarClienteActionPerformed + /** * @param args the command line arguments */ @@ -661,49 +949,52 @@ public void enableControleFuncionariosFields(){ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnAlterarGerente; + private javax.swing.JButton btnBuscarCliente; private javax.swing.JButton btnBuscarFuncionario; private javax.swing.JButton btnCancelarGerente; private javax.swing.JButton btnExcluirFuncionario; + 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; private javax.swing.JFormattedTextField ftxCPFFuncionario; private javax.swing.JFormattedTextField ftxCPFGerente; - private javax.swing.JButton jButton1; - private javax.swing.JButton jButton2; - private javax.swing.JButton jButton3; - private javax.swing.JButton jButton4; - 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.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JScrollPane jScrollPane3; private javax.swing.JTable jTable1; - private javax.swing.JTextField jTextField1; - private javax.swing.JTextField jTextField2; - private javax.swing.JTextField jTextField3; private javax.swing.JLabel lblAreaGerente; + private javax.swing.JLabel lblBackground; + private javax.swing.JLabel lblCPFCliente; private javax.swing.JLabel lblCPFFuncionario; private javax.swing.JLabel lblCPFGerente; + private javax.swing.JLabel lblCodigoCliente; + private javax.swing.JLabel lblControleClientes; private javax.swing.JLabel lblControleFuncionarios; - private javax.swing.JLabel lblDadosGerente; private javax.swing.JLabel lblEmailGerente; private javax.swing.JLabel lblIdFuncionario; private javax.swing.JLabel lblIdGerente; + private javax.swing.JLabel lblNomeCliente; private javax.swing.JLabel lblNomeFuncionario; private javax.swing.JLabel lblNomeGerente; private javax.swing.JLabel lblSenhaGerente; - private javax.swing.JTable tblControleFuncionariosx; + private javax.swing.JTable tblControleClientes; + private javax.swing.JTable tblControleFuncionarios; + private javax.swing.JFormattedTextField txtCPFCliente; + private javax.swing.JTextField txtCodCliente; private javax.swing.JTextField txtCodigoFuncionario; private javax.swing.JTextField txtEmailGerente; private javax.swing.JTextField txtIdGerente; + private javax.swing.JTextField txtNomeCliente; private javax.swing.JTextField txtNomeFuncionario; private javax.swing.JTextField txtNomeGerente; private javax.swing.JTextField txtSenhaGerente; // End of variables declaration//GEN-END:variables + } diff --git a/src/telas/cadastarGerente.java b/src/telas/cadastarGerente.java index c635205..3a71790 100644 --- a/src/telas/cadastarGerente.java +++ b/src/telas/cadastarGerente.java @@ -21,7 +21,7 @@ public class cadastarGerente extends javax.swing.JFrame { */ public cadastarGerente() { initComponents(); - + getRootPane().setDefaultButton(btnSalvarGerente); setLocationRelativeTo(null); limparCampos(); } @@ -196,6 +196,7 @@ private void btnSalvarGerenteActionPerformed(java.awt.event.ActionEvent evt) {// Gerente gerente = new Gerente(nome,cpf,email,senha,idGerente); JOptionPane.showMessageDialog(null,"Gerente cadastrado com sucesso!", "Mensagem",JOptionPane.PLAIN_MESSAGE); + listaGerente.add(gerente); } 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 872c649..7039f0f 100644 --- a/src/telas/cadastrarCliente.java +++ b/src/telas/cadastrarCliente.java @@ -1,13 +1,10 @@ -/* - * 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 java.util.ArrayList; import javax.swing.JOptionPane; + /** * @@ -21,10 +18,9 @@ public class cadastrarCliente extends javax.swing.JFrame { */ public cadastrarCliente() { initComponents(); - + getRootPane().setDefaultButton(btnSalvarCliente); setLocationRelativeTo(null); - lblTeste.setVisible(false); } @@ -65,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"); @@ -143,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( @@ -200,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( @@ -233,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)) ); @@ -247,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(); @@ -261,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("") @@ -276,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); @@ -332,6 +312,7 @@ public static void main(String args[]) { //</editor-fold> /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new cadastrarCliente().setVisible(true); @@ -342,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; @@ -354,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/cadastrarFuncionario.form b/src/telas/cadastrarFuncionario.form index 118b8dc..af23a6c 100644 --- a/src/telas/cadastrarFuncionario.form +++ b/src/telas/cadastrarFuncionario.form @@ -49,8 +49,7 @@ <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" attributes="0"> - <Component id="btnSairFuncionario" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="137" max="-2" 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"> @@ -63,7 +62,7 @@ <EmptySpace type="separate" max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> <Component id="txtNomeFuncionario" min="-2" pref="158" max="-2" attributes="0"/> - <Component id="ftxCPFFuncionario" min="-2" max="-2" attributes="0"/> + <Component id="ftxCPFFuncionario" 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"> @@ -102,14 +101,8 @@ <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblCadastroFuncionario" min="-2" max="-2" attributes="0"/> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="btnSairFuncionario" min="-2" max="-2" attributes="0"/> - </Group> - </Group> - <EmptySpace min="-2" pref="31" max="-2" 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"/> @@ -212,25 +205,13 @@ <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="Salvar"/> - <Property name="toolTipText" type="java.lang.String" value="Salvar funcionário"/> + <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.JButton" name="btnSairFuncionario"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/exit_icon-icons.com_70975.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Sair"/> - <Property name="toolTipText" type="java.lang.String" value="Sair do cadastro de funcionário"/> - </Properties> - <Events> - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSairFuncionarioActionPerformed"/> - </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(); }"> diff --git a/src/telas/cadastrarFuncionario.java b/src/telas/cadastrarFuncionario.java index 117fb39..a811b20 100644 --- a/src/telas/cadastrarFuncionario.java +++ b/src/telas/cadastrarFuncionario.java @@ -26,6 +26,7 @@ public cadastrarFuncionario() { setLocationRelativeTo(null); limparCampos(); txtCodigoFuncionario.setEnabled(false); + getRootPane().setDefaultButton(btnSalvarFuncionario); } public void limparCampos(){ txtNomeFuncionario.setText(""); @@ -57,7 +58,6 @@ private void initComponents() { txtCodigoFuncionario = new javax.swing.JTextField(); btnCancelarFuncionario = new javax.swing.JButton(); btnSalvarFuncionario = new javax.swing.JButton(); - btnSairFuncionario = new javax.swing.JButton(); ftxCPFFuncionario = new javax.swing.JFormattedTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); @@ -97,23 +97,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { btnSalvarFuncionario.setBackground(new java.awt.Color(51, 255, 0)); btnSalvarFuncionario.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N - btnSalvarFuncionario.setText("Salvar"); - btnSalvarFuncionario.setToolTipText("Salvar funcionário"); + 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); } }); - btnSairFuncionario.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/exit_icon-icons.com_70975.png"))); // NOI18N - btnSairFuncionario.setText("Sair"); - btnSairFuncionario.setToolTipText("Sair do cadastro de funcionário"); - btnSairFuncionario.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(java.awt.event.ActionEvent evt) { - btnSairFuncionarioActionPerformed(evt); - } - }); - try { ftxCPFFuncionario.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); } catch (java.text.ParseException ex) { @@ -129,8 +120,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addComponent(btnSairFuncionario) - .addGap(137, 137, 137) + .addGap(222, 222, 222) .addComponent(lblCadastroFuncionario)) .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -141,7 +131,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGap(18, 18, 18) .addGroup(jPanel1Layout.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, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(ftxCPFFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(30, 30, 30) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jPanel1Layout.createSequentialGroup() @@ -167,12 +157,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblCadastroFuncionario) - .addGroup(jPanel1Layout.createSequentialGroup() - .addContainerGap() - .addComponent(btnSairFuncionario))) - .addGap(31, 31, 31) + .addComponent(lblCadastroFuncionario) + .addGap(51, 51, 51) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblNomeFuncionario) .addComponent(lblEmailFuncionario) @@ -209,11 +195,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { pack(); }// </editor-fold>//GEN-END:initComponents - private void btnSairFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSairFuncionarioActionPerformed - // TODO add your handling code here: - this.setVisible(false); - }//GEN-LAST:event_btnSairFuncionarioActionPerformed - 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("") || @@ -230,6 +211,8 @@ private void btnSalvarFuncionarioActionPerformed(java.awt.event.ActionEvent evt) 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 @@ -276,7 +259,6 @@ public void run() { // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCancelarFuncionario; - private javax.swing.JButton btnSairFuncionario; private javax.swing.JButton btnSalvarFuncionario; private javax.swing.JFormattedTextField ftxCPFFuncionario; private javax.swing.JPanel jPanel1; diff --git a/src/telas/cadastros.form b/src/telas/cadastros.form new file mode 100644 index 0000000..31b936f --- /dev/null +++ b/src/telas/cadastros.form @@ -0,0 +1,1181 @@ +<?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="2"/> + <Property name="title" type="java.lang.String" value="Tela de cadastros"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/adicionar.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,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="620" y="480" width="840" 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 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 max="-2" attributes="0"/> + <Component id="jPanel6" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="28" 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"/> + <Component id="txtGenero" min="-2" pref="262" max="-2" attributes="0"/> + </Group> + </Group> + <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> + <EmptySpace min="53" pref="68" 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 type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="172" max="-2" attributes="0"/> + <Component id="btnCriarNovoItem" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="195" max="-2" attributes="0"/> + <Component id="btnCancelar" 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="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 type="separate" 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="-2" pref="20" 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="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 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="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"/> + </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="30" y="30" width="640" 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" pref="589" 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" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="207" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="151" max="-2" attributes="0"/> + <Component id="btnSalvarCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="78" max="-2" attributes="0"/> + <Component id="btnCancelarCliente" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="lblTelefoneCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxTelefoneCliente" min="-2" pref="107" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblNomeCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNomeCliente" min="-2" pref="111" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="165" 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 min="-2" pref="83" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" 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="lblCPFCliente" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="ftxCPFCliente" min="-2" pref="73" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" 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="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"/> + </Group> + </Group> + <EmptySpace min="-2" pref="50" max="-2" attributes="0"/> + </Group> + </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 min="-2" pref="9" 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"/> + <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 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 min="-2" pref="58" 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="1110" y="110" 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="19" max="-2" attributes="0"/> + <Component id="jPanel2" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="17" 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> + <Container class="javax.swing.JPanel" name="jPanelEsqueciSenha"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="17" green="39" red="7b" 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> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="740" y="40" width="300" height="370"/> + </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" pref="287" max="-2" attributes="0"/> + <EmptySpace pref="7" 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="32767" attributes="0"/> + <Component id="jPanel5" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="187" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel5"> + <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"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel12" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel13" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel14" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <Component id="pswNovaSenha" min="-2" pref="179" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmail" min="-2" pref="179" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="89" max="-2" attributes="0"/> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="116" max="32767" attributes="0"/> + <Component id="ftxCPFEsqueci" min="-2" pref="179" max="-2" attributes="0"/> + <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"> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="44" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="pswNovaSenha" min="-2" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel12" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> + <Component id="jLabel14" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="68" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="55" max="-2" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="76" max="-2" attributes="0"/> + <Component id="ftxCPFEsqueci" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="258" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel11"> + <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="Esqueci Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel12"> + <Properties> + <Property name="text" type="java.lang.String" value="CPF"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="text" type="java.lang.String" value="Email"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Nova senha"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEmail"> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <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="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Alterar Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <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"/> + </Properties> + </Component> + <Component class="javax.swing.JPasswordField" name="pswNovaSenha"> + </Component> + <Component class="javax.swing.JFormattedTextField" name="ftxCPFEsqueci"> + <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> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanelConsultarEmail"> + <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="70" y="580" width="-1" height="-1"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace pref="16" max="32767" attributes="0"/> + <Component id="jPanel7" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="16" 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="jPanel7" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="20" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel7"> + <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="1" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel17" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Component id="txtEmailConsulta" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnConsultarEmail" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="44" max="32767" attributes="0"/> + <Component id="btnCancelarEmail" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel16" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="ftxCPFConsulta" max="32767" attributes="0"/> + <Component id="txtNomeConsulta" pref="213" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jLabel15" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="91" 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="jLabel15" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="ftxCPFConsulta" 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="jLabel18" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNomeConsulta" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="28" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnConsultarEmail" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnCancelarEmail" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmailConsulta" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="106" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel15"> + <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 Email"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="text" type="java.lang.String" value="CPF"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel17"> + <Properties> + <Property name="text" type="java.lang.String" value="Email"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnConsultarEmail"> + <Properties> + <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="18" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="Consultar Email"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnConsultarEmailActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarEmail"> + <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"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelarEmailActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtEmailConsulta"> + </Component> + <Component class="javax.swing.JFormattedTextField" name="ftxCPFConsulta"> + <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> + <Component class="javax.swing.JLabel" name="jLabel18"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNomeConsulta"> + </Component> + </SubComponents> + </Container> + </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/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..5776fbb --- /dev/null +++ b/src/telas/cadastros.java @@ -0,0 +1,1134 @@ +/* + * 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.Gerente; +import classes.Produto; +import static classes.Usuario.user; +import javax.swing.JOptionPane; + +/** + * + * @author Yuri + */ +public class cadastros extends javax.swing.JFrame { + static String cadastrosFlag=""; + Cliente cli = new Cliente(); + Funcionario func = new Funcionario(); + Gerente ger = new Gerente(); + + /** + * 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())); + txtCodigoFuncionario.setEnabled(false); + txtCodigoFuncionario.setText(String.valueOf(listaFuncionarios.size())); + jPanelEsqueciSenha.setVisible(false); + jPanelConsultarEmail.setVisible(false); + } + + 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(); + jPanelEsqueciSenha = new javax.swing.JPanel(); + jPanel5 = new javax.swing.JPanel(); + jLabel11 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + txtEmail = new javax.swing.JTextField(); + jButton1 = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + pswNovaSenha = new javax.swing.JPasswordField(); + ftxCPFEsqueci = new javax.swing.JFormattedTextField(); + jPanelConsultarEmail = new javax.swing.JPanel(); + jPanel7 = new javax.swing.JPanel(); + jLabel15 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + jLabel17 = new javax.swing.JLabel(); + btnConsultarEmail = new javax.swing.JButton(); + btnCancelarEmail = new javax.swing.JButton(); + txtEmailConsulta = new javax.swing.JTextField(); + ftxCPFConsulta = new javax.swing.JFormattedTextField(); + jLabel18 = new javax.swing.JLabel(); + txtNomeConsulta = new javax.swing.JTextField(); + jLabel1 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Tela de cadastros"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/adicionar.png")).getImage()); + 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.setBackground(new java.awt.Color(51, 255, 0)); + btnCriarNovoItem.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCriarNovoItem.setText("Criar novo Item"); + btnCriarNovoItem.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCriarNovoItemActionPerformed(evt); + } + }); + + btnCancelar.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelar.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + 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) + .addComponent(txtGenero, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE))) + .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)))) + .addGap(53, 68, 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)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(172, 172, 172) + .addComponent(btnCriarNovoItem) + .addGap(195, 195, 195) + .addComponent(btnCancelar) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + 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(18, 18, 18) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCriarNovoItem) + .addComponent(btnCancelar)) + .addGap(20, 20, 20)) + ); + + 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(28, 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(28, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanelCriarItem, new org.netbeans.lib.awtextra.AbsoluteConstraints(620, 480, 840, 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() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(207, 207, 207) + .addComponent(jLabel2)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(151, 151, 151) + .addComponent(btnSalvarCliente) + .addGap(78, 78, 78) + .addComponent(btnCancelarCliente))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblTelefoneCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxTelefoneCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblNomeCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNomeCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(165, 165, 165) + .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) + .addGap(83, 83, 83)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .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(lblCPFCliente) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(ftxCPFCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblSenhaCliente) + .addGap(12, 12, 12) + .addComponent(txtSenhaCliente, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)) + .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(50, 50, 50))))) + ); + 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)) + .addGap(9, 9, 9) + .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) + .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)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .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)) + .addGap(58, 58, 58) + .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, 589, 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(30, 30, 640, 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(19, 19, 19) + .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(17, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanelFuncionario, new org.netbeans.lib.awtextra.AbsoluteConstraints(1110, 110, 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)); + + jPanelEsqueciSenha.setBackground(new java.awt.Color(123, 57, 23)); + jPanelEsqueciSenha.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jPanel5.setBackground(new java.awt.Color(248, 237, 220)); + + jLabel11.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + jLabel11.setText("Esqueci Senha"); + + jLabel12.setText("CPF"); + + jLabel13.setText("Email"); + + jLabel14.setText("Nova senha"); + + jButton1.setBackground(new java.awt.Color(51, 204, 0)); + jButton1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + jButton1.setText("Alterar Senha"); + + jButton2.setBackground(new java.awt.Color(255, 0, 0)); + jButton2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + jButton2.setText("Cancelar"); + + try { + ftxCPFEsqueci.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); + jPanel5.setLayout(jPanel5Layout); + jPanel5Layout.setHorizontalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup() + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel12) + .addComponent(jLabel13) + .addComponent(jLabel14)) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addGap(38, 38, 38) + .addComponent(pswNovaSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel5Layout.createSequentialGroup() + .addComponent(jButton1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton2)))) + .addGroup(jPanel5Layout.createSequentialGroup() + .addGap(89, 89, 89) + .addComponent(jLabel11))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup() + .addContainerGap(116, Short.MAX_VALUE) + .addComponent(ftxCPFEsqueci, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap())) + ); + jPanel5Layout.setVerticalGroup( + jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addComponent(jLabel11) + .addGap(44, 44, 44) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(pswNovaSenha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel5Layout.createSequentialGroup() + .addComponent(jLabel12) + .addGap(38, 38, 38) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel13) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(40, 40, 40) + .addComponent(jLabel14))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 68, Short.MAX_VALUE) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jButton1) + .addComponent(jButton2)) + .addGap(55, 55, 55)) + .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel5Layout.createSequentialGroup() + .addGap(76, 76, 76) + .addComponent(ftxCPFEsqueci, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(258, Short.MAX_VALUE))) + ); + + javax.swing.GroupLayout jPanelEsqueciSenhaLayout = new javax.swing.GroupLayout(jPanelEsqueciSenha); + jPanelEsqueciSenha.setLayout(jPanelEsqueciSenhaLayout); + jPanelEsqueciSenhaLayout.setHorizontalGroup( + jPanelEsqueciSenhaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelEsqueciSenhaLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 287, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(7, Short.MAX_VALUE)) + ); + jPanelEsqueciSenhaLayout.setVerticalGroup( + jPanelEsqueciSenhaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelEsqueciSenhaLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(187, 187, 187)) + ); + + getContentPane().add(jPanelEsqueciSenha, new org.netbeans.lib.awtextra.AbsoluteConstraints(740, 40, 300, 370)); + + jPanelConsultarEmail.setBackground(new java.awt.Color(123, 57, 23)); + + jPanel7.setBackground(new java.awt.Color(248, 237, 220)); + + jLabel15.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + jLabel15.setText("Consultar Email"); + + jLabel16.setText("CPF"); + + jLabel17.setText("Email"); + + btnConsultarEmail.setBackground(new java.awt.Color(0, 204, 0)); + btnConsultarEmail.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnConsultarEmail.setText("Consultar Email"); + btnConsultarEmail.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnConsultarEmailActionPerformed(evt); + } + }); + + btnCancelarEmail.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelarEmail.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnCancelarEmail.setText("Cancelar"); + btnCancelarEmail.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarEmailActionPerformed(evt); + } + }); + + try { + ftxCPFConsulta.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + jLabel18.setText("Nome"); + + javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7); + jPanel7.setLayout(jPanel7Layout); + jPanel7Layout.setHorizontalGroup( + jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel7Layout.createSequentialGroup() + .addComponent(jLabel17) + .addGap(39, 39, 39) + .addComponent(txtEmailConsulta)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup() + .addContainerGap() + .addComponent(btnConsultarEmail) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE) + .addComponent(btnCancelarEmail)) + .addGroup(jPanel7Layout.createSequentialGroup() + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel16) + .addGroup(jPanel7Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel18))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(ftxCPFConsulta) + .addComponent(txtNomeConsulta, javax.swing.GroupLayout.DEFAULT_SIZE, 213, Short.MAX_VALUE)))) + .addGap(26, 26, 26)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jLabel15) + .addGap(91, 91, 91)) + ); + jPanel7Layout.setVerticalGroup( + jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel7Layout.createSequentialGroup() + .addComponent(jLabel15) + .addGap(32, 32, 32) + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel16) + .addComponent(ftxCPFConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel18) + .addComponent(txtNomeConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE) + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnConsultarEmail) + .addComponent(btnCancelarEmail)) + .addGap(53, 53, 53) + .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel17) + .addComponent(txtEmailConsulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(106, 106, 106)) + ); + + javax.swing.GroupLayout jPanelConsultarEmailLayout = new javax.swing.GroupLayout(jPanelConsultarEmail); + jPanelConsultarEmail.setLayout(jPanelConsultarEmailLayout); + jPanelConsultarEmailLayout.setHorizontalGroup( + jPanelConsultarEmailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelConsultarEmailLayout.createSequentialGroup() + .addContainerGap(16, Short.MAX_VALUE) + .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(16, 16, 16)) + ); + jPanelConsultarEmailLayout.setVerticalGroup( + jPanelConsultarEmailLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanelConsultarEmailLayout.createSequentialGroup() + .addGap(16, 16, 16) + .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(20, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanelConsultarEmail, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 580, -1, -1)); + + 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 + + private void btnCancelarEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarEmailActionPerformed + // TODO add your handling code here: + this.setVisible(false); + }//GEN-LAST:event_btnCancelarEmailActionPerformed + + private void btnConsultarEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConsultarEmailActionPerformed + // TODO add your handling code here: + /* + String cpf = ftxCPFConsulta.getText(); + String nome = txtNomeConsulta.getText(); + String ans=""; + ans = cli.consultarEmail(cpf,nome); + if(ans.equals("Email não encontrado")){ + ans = func.consultarEmail(cpf,nome); + txtEmailConsulta.setText(ans);//É func; + + + }else{ + txtEmailConsulta.setText(ans);//É cliente + } + */ + }//GEN-LAST:event_btnConsultarEmailActionPerformed + + /** + * @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 btnCancelarEmail; + private javax.swing.JButton btnCancelarFuncionario; + private javax.swing.JButton btnConsultarEmail; + 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 ftxCPFConsulta; + private javax.swing.JFormattedTextField ftxCPFEsqueci; + private javax.swing.JFormattedTextField ftxCPFFuncionario; + private javax.swing.JFormattedTextField ftxDataCliente; + private javax.swing.JFormattedTextField ftxTelefoneCliente; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton2; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel 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 jPanel5; + private javax.swing.JPanel jPanel6; + private javax.swing.JPanel jPanel7; + private javax.swing.JPanel jPanelCliente; + private javax.swing.JPanel jPanelConsultarEmail; + private javax.swing.JPanel jPanelCriarItem; + private javax.swing.JPanel jPanelEsqueciSenha; + 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.JPasswordField pswNovaSenha; + 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 txtEmail; + private javax.swing.JTextField txtEmailCliente; + private javax.swing.JTextField txtEmailConsulta; + private javax.swing.JTextField txtEmailFuncionario; + private javax.swing.JTextField txtEnderecoCliente; + private javax.swing.JTextField txtGenero; + private javax.swing.JTextField txtNomeCliente; + private javax.swing.JTextField txtNomeConsulta; + 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..18b7354 100644 --- a/src/telas/carrinhosAntigos.java +++ b/src/telas/carrinhosAntigos.java @@ -4,6 +4,19 @@ */ 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 static classes.Usuario.user; +import java.util.ArrayList; +//import static telas.Menu.user; + /** * * @author Yuri @@ -18,7 +31,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 +76,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..e802db8 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,93 @@ <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"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblEmail" min="-2" pref="128" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblConsultarEmail" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblSenha" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblEsqueciSenha" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> + </Group> + <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"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="lblEmail" min="-2" pref="51" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="lblConsultarEmail" max="32767" attributes="0"/> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + </Group> + </Group> <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"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblSenha" alignment="3" min="-2" pref="53" max="-2" attributes="0"/> + <Component id="lblEsqueciSenha" alignment="3" min="-2" pref="33" max="-2" attributes="0"/> + </Group> + <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 +117,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="text" type="java.lang.String" value="Bem vindo"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="ff" red="ff" type="rgb"/> + </Property> + <Property name="text" type="java.lang.String" value="Bem-vindo"/> </Properties> </Component> <Component class="javax.swing.JLabel" name="lblEmail"> <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="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 +141,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 +177,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 +187,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 +199,61 @@ <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> + <Component class="javax.swing.JLabel" name="lblEsqueciSenha"> + <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> + <Property name="text" type="java.lang.String" value="Esqueci a senha"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblEsqueciSenhaMouseClicked"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="lblConsultarEmail"> + <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> + <Property name="text" type="java.lang.String" value="Consultar Email"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="lblConsultarEmailMouseClicked"/> + </Events> + </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 a96db05..0da41f7 100644 --- a/src/telas/telaLogin.java +++ b/src/telas/telaLogin.java @@ -11,10 +11,15 @@ import classes.Gerente; import javax.swing.JOptionPane; //import static telas.cadastrarCliente.listaClientes; -import static telas.Menu.logado; -import static telas.Menu.user; +//import static telas.Menu.logado; +//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 classes.Usuario.user; +import static classes.Usuario.logado; //import static telas.cadastrarFuncionario.listaFuncionarios; @@ -30,9 +35,12 @@ public class telaLogin extends javax.swing.JFrame { public telaLogin() { initComponents(); setLocationRelativeTo(null); + this.setExtendedState(MAXIMIZED_BOTH); + getRootPane().setDefaultButton(btnEntrar); + lblConsultarEmail.setVisible(false); + lblEsqueciSenha.setVisible(false); } - /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -47,28 +55,44 @@ 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(); + lblEsqueciSenha = new javax.swing.JLabel(); + lblConsultarEmail = new javax.swing.JLabel(); + 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 +102,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 +110,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() { @@ -94,68 +119,91 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { } }); + lblEsqueciSenha.setFont(new java.awt.Font("Old London", 1, 30)); // NOI18N + lblEsqueciSenha.setForeground(new java.awt.Color(255, 102, 102)); + lblEsqueciSenha.setText("Esqueci a senha"); + lblEsqueciSenha.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + lblEsqueciSenhaMouseClicked(evt); + } + }); + + lblConsultarEmail.setFont(new java.awt.Font("Old London", 1, 30)); // NOI18N + lblConsultarEmail.setForeground(new java.awt.Color(255, 102, 102)); + lblConsultarEmail.setText("Consultar Email"); + lblConsultarEmail.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + lblConsultarEmailMouseClicked(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() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(21, 21, 21) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .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))) - .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) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() + .addComponent(lblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblConsultarEmail)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup() + .addComponent(lblSenha) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblEsqueciSenha) + .addGap(13, 13, 13)) + .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) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(lblEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblConsultarEmail, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGap(6, 6, 6))) .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) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblEsqueciSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 33, 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 @@ -163,41 +211,76 @@ public void mouseClicked(java.awt.event.MouseEvent evt) { private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed // TODO add your handling code here: this.setVisible(false); + new Menu().setVisible(true); }//GEN-LAST:event_btnCancelarActionPerformed 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); Funcionario.index_func=Integer.parseInt(item.getCadastroFuncionario());//Problema AQUI!!! -> Consertado. Bastou inicializar um índice 0 como string em cadastro Func. JOptionPane.showMessageDialog(null,"Entrou como funcionário com sucesso!", "Notificação Login",JOptionPane.PLAIN_MESSAGE); this.setVisible(false); + + + //verificarLogin(logado); @@ -207,28 +290,77 @@ 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); 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); - new Menu().setVisible(true); - JPanel panel = new JPanel(); - panel.repaint(); - panel.revalidate(); + 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 + + private void lblConsultarEmailMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblConsultarEmailMouseClicked + // TODO add your handling code here: + cadastrosFlag = "consultarEmail"; + new cadastros().setVisible(true); + }//GEN-LAST:event_lblConsultarEmailMouseClicked + + private void lblEsqueciSenhaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lblEsqueciSenhaMouseClicked + // TODO add your handling code here: + cadastrosFlag = "esqueciSenha"; + new cadastros().setVisible(true); + }//GEN-LAST:event_lblEsqueciSenhaMouseClicked + /** * @param args the command line arguments */ @@ -267,12 +399,16 @@ 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 lblConsultarEmail; private javax.swing.JLabel lblEmail; + private javax.swing.JLabel lblEsqueciSenha; 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..638b75a 100644 --- a/src/telas/telaPagamento.form +++ b/src/telas/telaPagamento.form @@ -1,8 +1,16 @@ <?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"/> + <Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection code="new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/sacola.png")).getImage()" type="code"/> + </Property> </Properties> <SyntheticProperties> <SyntheticProperty name="formSizePolicy" type="int" value="1"/> @@ -23,159 +31,269 @@ <Layout> <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jPanel2" alignment="0" max="32767" attributes="0"/> + </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="17" green="39" red="7b" 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="17" max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="29" 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 pref="20" max="32767" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="16" max="-2" 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="8f" green="b5" red="d3" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" attributes="0"> - <EmptySpace min="-2" pref="167" max="-2" attributes="0"/> - <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> - </Group> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="1" attributes="0"> <Component id="btnPagar" min="-2" max="-2" attributes="0"/> <Component id="lblFormaPagamento" min="-2" max="-2" attributes="0"/> </Group> <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="rdbBoleto" min="-2" max="-2" attributes="0"/> - <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> - <Component id="rdbPix" min="-2" max="-2" attributes="0"/> + <Group type="103" alignment="0" 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" alignment="0" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="rdbBoleto" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Component id="rdbPix" min="-2" max="-2" attributes="0"/> + </Group> </Group> - <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> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblProduto" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblValorTotal" min="-2" max="-2" attributes="0"/> + <Component id="lblNumCarrinho" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="33" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace pref="332" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="txtValorTotal" max="32767" attributes="0"/> + <Component id="txtNumCarrinho" max="32767" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> </Group> </Group> - <EmptySpace pref="50" max="32767" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="72" max="-2" attributes="0"/> + </DimensionLayout> + <DimensionLayout dim="1"> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="lblValorTotal" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblNumCarrinho" alignment="0" min="-2" max="-2" attributes="0"/> - <Component id="lblProduto" alignment="0" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="32767" attributes="0"/> - <Group type="103" groupAlignment="0" max="-2" attributes="0"> - <Component id="txtValorTotal" pref="136" max="32767" attributes="0"/> - <Component id="txtNumCarrinho" max="32767" attributes="0"/> - <Component id="txtProdutos" max="32767" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - <DimensionLayout dim="1"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace max="-2" attributes="0"/> - <Component id="lblPagamento" min="-2" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="txtValorTotal" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="lblValorTotal" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace max="-2" 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"/> - </Group> - <EmptySpace max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblProduto" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="txtProdutos" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> - <Group type="103" groupAlignment="3" attributes="0"> - <Component id="lblFormaPagamento" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="rdbBoleto" alignment="3" min="-2" max="-2" attributes="0"/> - <Component id="rdbPix" alignment="3" min="-2" max="-2" attributes="0"/> - </Group> - <EmptySpace min="-2" pref="34" 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 type="102" alignment="0" attributes="0"> + <Component id="lblPagamento" min="-2" pref="42" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblValorTotal" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace type="unrelated" max="32767" attributes="0"/> + <Component id="lblNumCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="lblProduto" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="99" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblFormaPagamento" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="rdbBoleto" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="rdbPix" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <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 min="-2" pref="53" max="-2" attributes="0"/> + </Group> + <Group type="103" rootIndex="1" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <Component id="txtValorTotal" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNumCarrinho" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="283" max="32767" attributes="0"/> + </Group> + </Group> </Group> - <EmptySpace pref="63" max="32767" attributes="0"/> - </Group> - </Group> - </DimensionLayout> - </Layout> - <SubComponents> - <Component class="javax.swing.JLabel" name="lblPagamento"> - <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="Pagamento"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblValorTotal"> - <Properties> - <Property name="text" type="java.lang.String" value="Valor Total"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtValorTotal"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="valor total"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblFormaPagamento"> - <Properties> - <Property name="text" type="java.lang.String" value="Forma de pagamento"/> - </Properties> - </Component> - <Component class="javax.swing.JRadioButton" name="rdbBoleto"> - <Properties> - <Property name="text" type="java.lang.String" value="Boleto"/> - </Properties> - </Component> - <Component class="javax.swing.JRadioButton" name="rdbPix"> - <Properties> - <Property name="text" type="java.lang.String" value="Pix"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblNumCarrinho"> - <Properties> - <Property name="text" type="java.lang.String" value="Número do carrinho"/> - </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.JLabel" name="lblProduto"> - <Properties> - <Property name="text" type="java.lang.String" value="Produtos"/> - </Properties> - </Component> - <Component class="javax.swing.JTextField" name="txtProdutos"> - <Properties> - <Property name="toolTipText" type="java.lang.String" value="seus produtos"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnPagar"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/3440914-bag-basket-cart-ecommerce-pay-shopping-store_107519.png"/> - </Property> - <Property name="text" type="java.lang.String" value="Pagar"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnCancelar"> - <Properties> - <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> - <Image iconType="3" name="/imagens/simbolos/cancel_77947.png"/> - </Property> - <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> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="lblPagamento"> + <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="Pagamento"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblValorTotal"> + <Properties> + <Property name="text" type="java.lang.String" value="Valor Total"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtValorTotal"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value="valor total"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblFormaPagamento"> + <Properties> + <Property name="text" type="java.lang.String" value="Forma de pagamento"/> + </Properties> + </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> + <Property name="text" type="java.lang.String" value="Número do carrinho"/> + </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.JLabel" name="lblProduto"> + <Properties> + <Property name="text" type="java.lang.String" value="Produtos"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnPagar"> + <Properties> + <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="18" style="1"/> + </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> + <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"/> + </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="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> + <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="txtProdutos"> + <Properties> + <Property name="columns" type="int" value="20"/> + <Property name="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> + </Container> </SubComponents> </Form> diff --git a/src/telas/telaPagamento.java b/src/telas/telaPagamento.java index e3115d0..6589695 100644 --- a/src/telas/telaPagamento.java +++ b/src/telas/telaPagamento.java @@ -4,11 +4,37 @@ */ 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.Pagamento; +import classes.Pedido; +import classes.Produto; +import static classes.Usuario.user; +//import static classes.Usuario.historicoCarrinhosTotais; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import javax.swing.JOptionPane; +import static telas.Menu.historicoCarrinhosTotais; +//import static telas.Menu.user; +import static telas.cadastarGerente.listaGerente; +import static telas.verCarrinho.aux; + /** * * @author Yuri */ public class telaPagamento extends javax.swing.JFrame { + Pedido pedido = new Pedido(); + Pagamento pagamento = new Pagamento(); /** * Creates new form telaPagamento @@ -16,7 +42,28 @@ 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)); + pagamento.setFormaPagamento("Pix"); + }else if(rdbBoleto.isSelected()){ + txtValorTotal.setText(String.format("%.2f", carrinhoSalvo.getTotal())); + pagamento.setFormaPagamento("Boleto"); + + } + txtNumCarrinho.setText(String.valueOf(carrinhoSalvo.getNumCarrinho())); + txtProdutos.setText(carrinhoSalvo.mostarProdutos(carrinhoSalvo.itensNoCarrinho)); + carrinhoSalvo.setPagamento(pagamento); + System.out.println("Carrinho Salvo tem o pagamento de:"+pagamento.getFormaPagamento()); + System.out.println("Carrinho salvo tem o pedido de:"+pedido.getCodPedido()); } /** @@ -25,9 +72,13 @@ 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(); + jPanel2 = new javax.swing.JPanel(); + jPanel1 = new javax.swing.JPanel(); lblPagamento = new javax.swing.JLabel(); lblValorTotal = new javax.swing.JLabel(); txtValorTotal = new javax.swing.JTextField(); @@ -37,13 +88,21 @@ private void initComponents() { lblNumCarrinho = new javax.swing.JLabel(); txtNumCarrinho = new javax.swing.JTextField(); lblProduto = new javax.swing.JLabel(); - txtProdutos = new javax.swing.JTextField(); btnPagar = new javax.swing.JButton(); btnCancelar = new javax.swing.JButton(); + jLabel1 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtProdutos = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Tela pagamento"); + setIconImage(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/sacola.png")).getImage()); + + jPanel2.setBackground(new java.awt.Color(123, 57, 23)); - lblPagamento.setFont(new java.awt.Font("Segoe UI", 1, 14)); // NOI18N + jPanel1.setBackground(new java.awt.Color(211, 181, 143)); + + lblPagamento.setFont(new java.awt.Font("Old London", 0, 24)); // NOI18N lblPagamento.setText("Pagamento"); lblValorTotal.setText("Valor Total"); @@ -52,9 +111,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"); @@ -62,12 +135,17 @@ private void initComponents() { lblProduto.setText("Produtos"); - txtProdutos.setToolTipText("seus produtos"); - - btnPagar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/simbolos/3440914-bag-basket-cart-ecommerce-pay-shopping-store_107519.png"))); // NOI18N + btnPagar.setBackground(new java.awt.Color(0, 204, 0)); + btnPagar.setFont(new java.awt.Font("Segoe UI", 1, 18)); // 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.setBackground(new java.awt.Color(255, 0, 0)); + btnCancelar.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N btnCancelar.setText("Cancelar"); btnCancelar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -75,70 +153,118 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { } }); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(167, 167, 167) - .addComponent(lblPagamento)) - .addGroup(layout.createSequentialGroup() - .addGap(53, 53, 53) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(btnPagar) - .addComponent(lblFormaPagamento)) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(18, 18, 18) - .addComponent(rdbBoleto) - .addGap(33, 33, 33) - .addComponent(rdbPix)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(71, 71, 71) - .addComponent(btnCancelar))))) - .addContainerGap(50, Short.MAX_VALUE)) - .addGroup(layout.createSequentialGroup() - .addGap(72, 72, 72) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(lblValorTotal) - .addComponent(lblNumCarrinho) - .addComponent(lblProduto)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(txtValorTotal, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE) - .addComponent(txtNumCarrinho) - .addComponent(txtProdutos)) - .addGap(38, 38, 38)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() + jLabel1.setForeground(new java.awt.Color(0, 153, 0)); + jLabel1.setText("Desconto de 5% no pix!"); + + txtProdutos.setColumns(20); + txtProdutos.setRows(5); + jScrollPane1.setViewportView(txtProdutos); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() - .addComponent(lblPagamento) - .addGap(18, 18, 18) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addComponent(lblValorTotal)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.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)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) - .addComponent(lblProduto) - .addComponent(txtProdutos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(btnPagar) + .addComponent(lblFormaPagamento)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addGap(71, 71, 71) + .addComponent(btnCancelar)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(rdbBoleto) + .addGap(33, 33, 33) + .addComponent(rdbPix))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(71, 71, 71) + .addComponent(jLabel1))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addGap(21, 21, 21) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblProduto) + .addComponent(lblValorTotal) + .addComponent(lblNumCarrinho)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblPagamento) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap()) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap(332, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtValorTotal) + .addComponent(txtNumCarrinho)) + .addContainerGap())) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblPagamento, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblValorTotal) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblNumCarrinho) + .addGap(18, 18, 18) + .addComponent(lblProduto) + .addGap(99, 99, 99)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(35, 35, 35) + .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))) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lblFormaPagamento) .addComponent(rdbBoleto) .addComponent(rdbPix)) - .addGap(34, 34, 34) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel1) + .addGap(18, 18, 18) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnPagar) .addComponent(btnCancelar)) - .addContainerGap(63, Short.MAX_VALUE)) + .addGap(53, 53, 53)) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(38, 38, 38) + .addComponent(txtValorTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNumCarrinho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(283, 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() + .addGap(17, 17, 17) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(29, Short.MAX_VALUE)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addContainerGap(20, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(16, 16, 16)) + ); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); @@ -149,6 +275,99 @@ 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(); + historicoCarrinhosTotais+=1; + System.out.println(historicoCarrinhosTotais); + 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())); + carrinho1.setPagamento(pagamento); + cliente.addCarrinhoLista(carrinho1); + //pagamento.setPedido(pedido); + //pedido.setCodPedido(historicoCarrinhosTotais); + //pagamento.setPedido(pedido); + pedido.setCodPedido(historicoCarrinhosTotais); + pagamento.setPedido(pedido); + carrinho1.setPagamento(pagamento); + + + } + 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())); + carrinho2.setPagamento(pagamento); + + funcionario.addListaCarrinhosFuncionarios(carrinho2); + //pagamento.setPedido(pedido); + pedido.setCodPedido(historicoCarrinhosTotais); + pagamento.setPedido(pedido); + carrinho2.setPagamento(pagamento); + + } + 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())); + System.out.println("Lista de carrinhos do gerente é de tamanho:"+gerente.getListaCarrinhoGerente().size()); + carrinho2.setPagamento(pagamento); + + + gerente.addListaCarrinhosGerente(carrinho2); + System.out.println("Adicionado. Tamanho agora é:"+gerente.getListaCarrinhoGerente()); + pedido.setCodPedido(historicoCarrinhosTotais); + pagamento.setPedido(pedido); + carrinho2.setPagamento(pagamento); + + } + System.out.println(); + + 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 +406,11 @@ 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.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JScrollPane jScrollPane1; private javax.swing.JLabel lblFormaPagamento; private javax.swing.JLabel lblNumCarrinho; private javax.swing.JLabel lblPagamento; @@ -195,7 +419,7 @@ public void run() { private javax.swing.JRadioButton rdbBoleto; private javax.swing.JRadioButton rdbPix; private javax.swing.JTextField txtNumCarrinho; - private javax.swing.JTextField txtProdutos; + private javax.swing.JTextArea txtProdutos; private javax.swing.JTextField txtValorTotal; // End of variables declaration//GEN-END:variables } diff --git a/src/telas/verCarrinho.form b/src/telas/verCarrinho.form index baaf9d5..f592aa6 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,582 @@ <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="true" 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" pref="488" 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="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="24" max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="885" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="lblTotal" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtTotal" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="175" max="-2" attributes="0"/> + <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="419" max="-2" attributes="0"/> + </Group> + <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="70" max="-2" attributes="0"/> + <Component id="lblData" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtData" min="-2" pref="80" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <EmptySpace pref="229" 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="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> + <EmptySpace type="unrelated" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="lblProdutos" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblTotal" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTotal" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jScrollPane3" alignment="0" min="-2" pref="63" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="63" 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="5" 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"/> + <Column editable="false" title="Forma Pagamento" 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="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> + <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"> - <Properties> - <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> - <Color blue="0" green="0" red="ff" type="rgb"/> - </Property> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Esvaziar carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JLabel" name="lblProdutosCarrinho"> - <Properties> - <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> - <Font name="Segoe UI" size="18" style="1"/> - </Property> - <Property name="text" type="java.lang.String" value="Meus produtos no carrinho"/> - </Properties> - </Component> - <Component class="javax.swing.JButton" name="btnConfirmarCompra"> + <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="ff" red="0" 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="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 d80c428..404f458 100644 --- a/src/telas/verCarrinho.java +++ b/src/telas/verCarrinho.java @@ -4,11 +4,41 @@ */ 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 static classes.Estoque.estoque; +import classes.Funcionario; +import static classes.Funcionario.index_func; +import static classes.Funcionario.listaFuncionarios; +import classes.Gerente; +import classes.Produto; +import static classes.Usuario.user; +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 + Funcionario funcionario = listaFuncionarios.get(index_func); + Gerente gerente = listaGerente.get(0); + 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 @@ -16,9 +46,202 @@ public class verCarrinho extends javax.swing.JFrame { 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); + } + carregarTabelaCliente(); + + } + + + //Carregar a tabela com os funcionários da lista + private void carregarTabelaProdutos() { + 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).getAutor(), + listaProdutos.get(i).getPreço(), + listaProdutos.get(i).getQuantidadeComprada(), + listaProdutos.get(i).getGenero()}; + + modeloTabelaProdutos.addRow(linha); + + } + //Tabela recebe modelo + tblProdutos.setModel(modeloTabelaProdutos); + + tblProdutos.getColumnModel().getColumn(0).setPreferredWidth(50); + tblProdutos.getColumnModel().getColumn(1).setPreferredWidth(5); + tblProdutos.getColumnModel().getColumn(2).setPreferredWidth(3); + tblProdutos.getColumnModel().getColumn(3).setPreferredWidth(3); + tblProdutos.getColumnModel().getColumn(4).setPreferredWidth(100); + + } + 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","Forma Pagamento"},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(), + cliente.getListaCarrinho().get(i).getPagamento().getFormaPagamento(), + //cliente.getListaCarrinho().get(i).getPedido().getCodPedido(), + + + }; + 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","Forma Pagamento"},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(), + funcionario.getListaCarrinhoFuncionario().get(i).getPagamento().getFormaPagamento() + }; + 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","Forma Pagamento"},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(), + gerente.getListaCarrinhoGerente().get(i).getPagamento().getFormaPagamento() + }; + 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(""); + } + private void preencherCamposCarrinho(Carrinho carrinho) { + txtNumCarrinho.setText(String.valueOf(carrinho.getNumCarrinho())); + txtData.setText(String.valueOf(carrinho.getData())); + txtTotal.setText(String.valueOf(carrinho.getTotal())); + txtProdutos.setText(carrinho.mostrarProdutos()); +} /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always @@ -28,6 +251,8 @@ public verCarrinho() { // <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(); @@ -35,10 +260,35 @@ 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(); + 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 [][] { @@ -48,26 +298,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, true, 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"); @@ -84,75 +361,455 @@ 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"); - jButton1.addActionListener(new java.awt.event.ActionListener() { + 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) { - jButton1ActionPerformed(evt); + btnVerCarrinhosAntigosActionPerformed(evt); } }); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) - .addGroup(layout.createSequentialGroup() - .addComponent(lblProdutosCarrinho) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addComponent(jButton1)) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addGap(6, 6, 6) - .addComponent(btnRemoverItem) - .addGap(136, 136, 136) - .addComponent(btnEsvaziarCarrinho) - .addGap(106, 106, 106) - .addComponent(btnConfirmarCompra)) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 762, javax.swing.GroupLayout.PREFERRED_SIZE))))) - .addGroup(layout.createSequentialGroup() - .addGap(250, 250, 250) - .addComponent(lblVisualizarCarrinho))) - .addContainerGap(48, Short.MAX_VALUE)) + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .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())) ); - layout.setVerticalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addContainerGap() + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(lblVisualizarCarrinho) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .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) - .addComponent(jButton1)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 270, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.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, null, null, null, null} + }, + new String [] { + "NumCarrinho", "Data do pedido", "Produtos", "Total", "Forma Pagamento" + } + ) { + Class[] types = new Class [] { + java.lang.Integer.class, java.lang.String.class, java.lang.Object.class, java.lang.Double.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]; + } + }); + 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"); + + 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 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(384, 384, 384) + .addComponent(lblCarrinhosAnteriores) + .addGap(130, 130, 130) + .addComponent(jButton1)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(24, 24, 24) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 885, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addGap(35, 35, 35) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(lblTotal) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(175, 175, 175) + .addComponent(lblProdutos) + .addGap(18, 18, 18) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 419, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(lblNumCarrinho) + .addGap(18, 18, 18) + .addComponent(txtNumCarrinho, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(70, 70, 70) + .addComponent(lblData) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtData, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addContainerGap(229, Short.MAX_VALUE)) + ); + 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(btnRemoverItem) - .addComponent(btnEsvaziarCarrinho) - .addComponent(btnConfirmarCompra)) - .addContainerGap(63, Short.MAX_VALUE)) + .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)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblProdutos) + .addComponent(lblTotal) + .addComponent(txtTotal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(63, 63, 63) + .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, 488, 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 + // Get the total number of rows in the table + int rowCount = tblProdutos.getRowCount(); + + for (int row = 0; row < rowCount; row++) { // Loop until rowCount - 1 + // Get the name of the product from the current row + Object produtoPesquisado = tblProdutos.getValueAt(row, 0); + String inputBusca = String.valueOf(produtoPesquisado); + + // Get the quantity of the product from the current row + Object quantPesquisado = tblProdutos.getValueAt(row, 3); + + if (quantPesquisado == null) { + continue; // Skip this row if quantity is null + } + + String quantBuscastr = String.valueOf(quantPesquisado); + int quantBusca = Integer.parseInt(quantBuscastr); + + // Find the corresponding item in stock and update the quantity + for (Produto itemEstoque : estoque) { + if (itemEstoque.getTitulo().equals(inputBusca)) { + itemEstoque.setQuantidadeEstoque(itemEstoque.getQuantidadeEstoque() + quantBusca); + } + } + } + + // Clear the list of products + listaProdutos.clear(); + + // Reload the product table + carregarTabelaProdutos(); + }//GEN-LAST:event_btnEsvaziarCarrinhoActionPerformed + + private void btnRemoverItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoverItemActionPerformed + // TODO add your handling code here: + int row = tblProdutos.getSelectedRow(); + + //pega o nome do produto + Object produtoPesquisado = tblProdutos.getValueAt(row,0); + String inputBusca = String.valueOf(produtoPesquisado); + //pega a quantidade do produto + Object quantPesquisado = tblProdutos.getValueAt(row,3); + String quantBuscastr = String.valueOf(quantPesquisado); + int quantBusca = Integer.parseInt(quantBuscastr); + + for(Produto itemEstoque : estoque){ + if(itemEstoque.getTitulo().equals(inputBusca)){ + Produto item = itemEstoque; + item.setQuantidadeEstoque(item.getQuantidadeEstoque()+quantBusca); + } + } + listaProdutos.remove(row); + //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 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); + System.out.println("item encontrado pela busca foi:"+inputBuscaString); + System.out.println("O tipo de usuário é:"+user); + String selected=""; + if(user.equals("cliente")){ + 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()); + + } + } + } + if(user.equals("funcionario")){ + for(Carrinho itemCarrinho : funcionario.getListaCarrinhoFuncionario()){ + 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()); + + } + } + }if(user.equals("gerente")){ + System.out.println("Entrou na função de gerente"); + System.out.println("Tamanho da lista de gerente é:"+gerente.getListaCarrinhoGerente().size()); + for(Carrinho itemCarrinho : gerente.getListaCarrinhoGerente()){ + System.out.println("Iniciou o for loop"); + if(itemCarrinho.getNumCarrinho()==(inputBuscaInt)){ + System.out.println("Encontrou o carrinho"); + Carrinho carrinho = itemCarrinho; + System.out.println("Definiu a cópia"); + txtNumCarrinho.setText(String.valueOf(carrinho.getNumCarrinho())); + System.out.println("Começou a definir os parametros de texto"); + 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 */ @@ -192,10 +849,31 @@ public void run() { private javax.swing.JButton btnConfirmarCompra; private javax.swing.JButton btnEsvaziarCarrinho; 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 6c661da..350a318 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,139 +22,142 @@ <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="789" 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"> - <Group type="103" groupAlignment="0" attributes="0"> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="58" max="-2" attributes="0"/> - <Component id="jScrollPane1" min="-2" pref="483" max="-2" attributes="0"/> - <EmptySpace type="separate" max="-2" attributes="0"/> - <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> - </Group> - <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="70" max="-2" attributes="0"/> - <Component id="lblNome" min="-2" max="-2" attributes="0"/> - </Group> - <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> - <EmptySpace pref="150" max="32767" attributes="0"/> - </Group> <Group type="102" attributes="0"> <Group type="103" groupAlignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="317" max="-2" attributes="0"/> - <Component id="lblProdutos" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="27" max="-2" 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="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"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <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 min="-2" pref="199" max="-2" attributes="0"/> + <Component id="btnComprar" min="-2" max="-2" attributes="0"/> + </Group> + <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"> + <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="142" max="-2" attributes="0"/> + </Group> + </Group> </Group> <Group type="102" alignment="0" attributes="0"> - <EmptySpace min="-2" pref="40" max="-2" attributes="0"/> - <Component id="jScrollPane2" min="-2" pref="653" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="296" max="-2" attributes="0"/> + <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> </Group> </Group> - <EmptySpace min="0" pref="0" max="32767" 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="lblProdutos" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <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"/> - <Component id="lblNome" min="-2" 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" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> <EmptySpace max="-2" attributes="0"/> <Group type="103" groupAlignment="0" attributes="0"> - <Component id="jScrollPane1" alignment="0" min="-2" pref="38" max="-2" attributes="0"/> - <Component id="btnPesquisar" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblAutor" min="-2" pref="27" max="-2" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> </Group> <EmptySpace max="-2" attributes="0"/> + <Component id="txtAutor" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> <Component id="lblResultadosPesquisa" min="-2" max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/> - <Component id="jScrollPane2" min="-2" pref="243" 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> - <EmptySpace max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> </Group> </Group> </DimensionLayout> </Layout> <SubComponents> - <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="Pesquisa"> - <Properties> - <Property name="columns" type="int" value="20"/> - <Property name="rows" type="int" value="5"/> - </Properties> - </Component> - </SubComponents> - </Container> - <Component class="javax.swing.JLabel" name="lblProdutos"> + <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"/> </Events> </Component> - <Container class="javax.swing.JScrollPane" name="jScrollPane2"> + <Container class="javax.swing.JScrollPane" name="Tabela"> + <Events> + <EventHandler event="focusGained" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="TabelaFocusGained"/> + </Events> <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> <SubComponents> @@ -158,17 +165,49 @@ <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="Autor" type="java.lang.String"/> - <Column editable="true" title="Gênero" type="java.lang.String"/> - <Column editable="true" title="Valor" type="java.lang.Float"/> - <Column editable="true" title="quant. estoque" type="java.lang.Integer"/> + <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="Valor" type="java.lang.Float"/> + <Column editable="false" title="quant. estoque" type="java.lang.Integer"/> </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="false"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> + <Title/> + <Editor/> + <Renderer/> + </Column> + <Column maxWidth="-1" minWidth="-1" prefWidth="-1" resizable="false"> + <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="tabela_produtosMouseClicked"/> + </Events> </Component> </SubComponents> </Container> @@ -180,15 +219,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="cc" green="66" 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="Sobre"/> </Properties> @@ -198,16 +240,72 @@ </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="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="Comprar"/> + <Property name="text" type="java.lang.String" value="Adicionar ao carrinho"/> </Properties> <Events> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnComprarActionPerformed"/> </Events> </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Old London" size="18" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Quantidade"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtQuantidade"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtQuantidadeActionPerformed"/> + </Events> + </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="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 7d8494e..6201a62 100644 --- a/src/telas/verProdutos.java +++ b/src/telas/verProdutos.java @@ -1,20 +1,36 @@ -/* - * 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.Carrinho; +import static classes.Carrinho.listaProdutos; +import static classes.Estoque.estoque; +import classes.Produto; +import static classes.Usuario.logado; +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); + getRootPane().setDefaultButton(btnPesquisar); + this.setExtendedState(MAXIMIZED_BOTH); + carregarTabelaProdutos(); + txtQuantidade.setText("1"); + Produto item; + btnSobre.setEnabled(false); + Produto produto1 = estoque.get(0); + auxProduto.add(produto1); } /** @@ -22,38 +38,83 @@ public verProdutos() { * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ + private void carregarTabelaProdutos(){ + DefaultTableModel modeloTabelaProdutos = new DefaultTableModel(new Object[] {"Titulo","Autor","Gênero","Valor","Quant.Estoque"},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()}; + modeloTabelaProdutos.addRow(linha); + + + } + //Tabela recebe modelo de produtos do estoque + tabela_produtos.setModel(modeloTabelaProdutos); + + 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); + + + + } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); - jScrollPane1 = new javax.swing.JScrollPane(); - Pesquisa = new javax.swing.JTextArea(); - lblProdutos = new javax.swing.JLabel(); + titulo = new javax.swing.JLabel(); btnPesquisar = new javax.swing.JButton(); - jScrollPane2 = new javax.swing.JScrollPane(); + Tabela = new javax.swing.JScrollPane(); tabela_produtos = new javax.swing.JTable(); lblResultadosPesquisa = new javax.swing.JLabel(); lblNome = new javax.swing.JLabel(); btnSobre = new javax.swing.JButton(); btnComprar = new javax.swing.JButton(); + 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()); - Pesquisa.setColumns(20); - Pesquisa.setRows(5); - jScrollPane1.setViewportView(Pesquisa); + 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); + } + }); - lblProdutos.setFont(new java.awt.Font("Inter", 1, 24)); // NOI18N - lblProdutos.setText("Produtos"); + 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); } }); + Tabela.addFocusListener(new java.awt.event.FocusAdapter() { + public void focusGained(java.awt.event.FocusEvent evt) { + TabelaFocusGained(evt); + } + }); + tabela_produtos.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {null, null, null, null, null}, @@ -68,19 +129,39 @@ 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.Float.class, java.lang.Integer.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]; + } }); - jScrollPane2.setViewportView(tabela_produtos); + tabela_produtos.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabela_produtosMouseClicked(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, 102, 204)); + btnSobre.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N btnSobre.setText("Sobre"); btnSobre.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { @@ -88,14 +169,27 @@ 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.setText("Comprar"); + btnComprar.setBackground(new java.awt.Color(51, 204, 0)); + btnComprar.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + btnComprar.setText("Adicionar ao carrinho"); btnComprar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnComprarActionPerformed(evt); } }); + jLabel1.setFont(new java.awt.Font("Old London", 0, 18)); // NOI18N + jLabel1.setText("Quantidade"); + + txtQuantidade.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtQuantidadeActionPerformed(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( @@ -103,93 +197,256 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel1Layout.createSequentialGroup() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(58, 58, 58) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 483, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(btnPesquisar)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(70, 70, 70) - .addComponent(lblNome)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(149, 149, 149) - .addComponent(btnSobre) - .addGap(199, 199, 199) - .addComponent(btnComprar)) + .addGap(27, 27, 27) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .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)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(122, 122, 122) + .addComponent(btnSobre) + .addGap(199, 199, 199) + .addComponent(btnComprar)) + .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() + .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(142, 142, 142)))) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(299, 299, 299) + .addGap(296, 296, 296) .addComponent(lblResultadosPesquisa))) - .addContainerGap(150, Short.MAX_VALUE)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(317, 317, 317) - .addComponent(lblProdutos)) - .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(40, 40, 40) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 653, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 0, Short.MAX_VALUE)) + .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() - .addGap(28, 28, 28) - .addComponent(lblProdutos) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .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) - .addComponent(lblNome) + .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)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) + .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, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(lblResultadosPesquisa) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE) + .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)) + .addContainerGap()) ); - javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); - getContentPane().setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGap(0, 789, 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.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(); + if(!logado){ + JOptionPane.showMessageDialog(null, "Entre com uma conta para poder adicionar ao carrinho!", "Erro ao adicionar para carrinho", JOptionPane.ERROR_MESSAGE); + return; + } + + int row = tabela_produtos.getSelectedRow(); + if(row == -1) { + JOptionPane.showMessageDialog(null, "Por favor, selecione um produto na tabela.", "Erro ao adicionar para carrinho", JOptionPane.ERROR_MESSAGE); + return; + } + + Object produtoPesquisado = tabela_produtos.getValueAt(row, 0); + String inputBusca = String.valueOf(produtoPesquisado); + txtTitulo.setText(inputBusca); + System.out.println("Item do inputBusca a ser aparecido na caixa de texto: " + inputBusca); + + String selected = ""; + for(Produto itemEstoque : estoque){ + if(itemEstoque.getTitulo().equals(inputBusca)){ + selected = itemEstoque.getTitulo(); + txtTitulo.setText(itemEstoque.getTitulo()); + System.out.println(itemEstoque.getTitulo()); + break; + } + } + + System.out.println("Item selecionado para compra foi: " + selected); + for(Produto itemBusca : estoque){ + if(itemBusca.getTitulo().equals(selected)){ + int quantidadeDesejada = Integer.parseInt(txtQuantidade.getText()); + + if(quantidadeDesejada <= itemBusca.getQuantidadeEstoque()){ + itemBusca.setQuantidadeComprada(quantidadeDesejada); + listaProdutos.add(itemBusca); + itemBusca.setQuantidadeEstoque(itemBusca.getQuantidadeEstoque() - quantidadeDesejada); + JOptionPane.showMessageDialog(null, "Item adicionado ao carrinho com sucesso!", "Notificação Adicionar item ao carrinho", JOptionPane.PLAIN_MESSAGE); + } else if(itemBusca.getQuantidadeEstoque() == 0){ + JOptionPane.showMessageDialog(null, "Não há mais estoque para este item", "Erro ao adicionar item ao carrinho", JOptionPane.ERROR_MESSAGE); + } else { + JOptionPane.showMessageDialog(null, "Quantidade inserida acima da disponível!", "Erro ao adicionar item ao carrinho", JOptionPane.ERROR_MESSAGE); + } + break; + } + } + + carregarTabelaProdutos(); + }//GEN-LAST:event_btnComprarActionPerformed - /** - * @param args the command line arguments - */ + private void TabelaFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_TabelaFocusGained + + }//GEN-LAST:event_TabelaFocusGained + + private void txtQuantidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtQuantidadeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtQuantidadeActionPerformed + + private void tabela_produtosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabela_produtosMouseClicked + // TODO add your handling code here: + int i = tabela_produtos.getSelectedRow(); + 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); + 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) "> @@ -218,21 +475,27 @@ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new verProdutos().setVisible(true); + } }); } // Variables declaration - do not modify//GEN-BEGIN:variables - private javax.swing.JTextArea Pesquisa; + 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.JScrollPane jScrollPane1; - private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JLabel lblAutor; private javax.swing.JLabel lblNome; - private javax.swing.JLabel lblProdutos; 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 }