commit 4db7fd17813dfac2b273b6535ad490c3816992cf Author: flashlan Date: Wed Jan 4 12:20:47 2023 -0300 removed postgres installer diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1492eb8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store +# node_modules/ +._* \ No newline at end of file diff --git a/GoldenOwl.app/config/DBPAss b/GoldenOwl.app/config/DBPAss new file mode 100644 index 0000000..568e37d --- /dev/null +++ b/GoldenOwl.app/config/DBPAss @@ -0,0 +1 @@ +goldenowl \ No newline at end of file diff --git a/GoldenOwl.app/config/DBUser b/GoldenOwl.app/config/DBUser new file mode 100644 index 0000000..93ca142 --- /dev/null +++ b/GoldenOwl.app/config/DBUser @@ -0,0 +1 @@ +root \ No newline at end of file diff --git a/GoldenOwl.app/config/ipserver b/GoldenOwl.app/config/ipserver new file mode 100644 index 0000000..d18580b --- /dev/null +++ b/GoldenOwl.app/config/ipserver @@ -0,0 +1 @@ +localhost \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..1316877 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,18 @@ +pipeline { + agent { label 'Ubuntu18-openjdk1.8'} + + stages { + stage('Do nothing') { + steps { + sh '/bin/true' + } + } + stage('build') { + steps { + sh 'ant -version' + sh 'java -version' + sh 'mkdir ~/test_jenkins_mkdir' + } + } +} +} \ No newline at end of file diff --git a/LoggedIn b/LoggedIn new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/LoggedIn @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/Microsoft XPS Document Writer b/Microsoft XPS Document Writer new file mode 100644 index 0000000..ed18357 --- /dev/null +++ b/Microsoft XPS Document Writer @@ -0,0 +1,168 @@ +========================================== + Nome da empresa +=========================================== +********** NAO E DOCUMENTO FISCAL ********* +=========================================== +PRODUTO QTDE VALOR UN. VALOR +=========================================== + INFORMACOES PARA FECHAMENTO DE CONTA +=========================================== + GARCOM CONTA.DIV. VAL.PESS. COVER DESC. + garcom dividirconta vlpessoa cover desconto +=========================================== +SubTotal 10,00 + ------------------------ +Total 10,00 +=========================================== + MENSAGEM DA EMPRESA VAI AQUI + INFORMACOES PARA FECHAMENTO DE CONTA + + + + + + + + + + +========================================== + Nome da empresa +=========================================== +********** NAO E DOCUMENTO FISCAL ********* +=========================================== +PRODUTO QTDE VALOR UN. VALOR +=========================================== + INFORMACOES PARA FECHAMENTO DE CONTA +=========================================== + GARCOM CONTA.DIV. VAL.PESS. COVER DESC. + garcom dividirconta vlpessoa cover desconto +=========================================== +SubTotal 10,00 + ------------------------ +Total 10,00 +=========================================== + MENSAGEM DA EMPRESA VAI AQUI + INFORMACOES PARA FECHAMENTO DE CONTA + + + + + + + + + + +========================================== + Nome da empresa +=========================================== +********** NAO E DOCUMENTO FISCAL ********* +=========================================== +PRODUTO QTDE VALOR UN. VALOR +=========================================== + INFORMACOES PARA FECHAMENTO DE CONTA +=========================================== + GARCOM CONTA.DIV. VAL.PESS. COVER DESC. + garcom dividirconta vlpessoa cover desconto +=========================================== +SubTotal 10,00 + ------------------------ +Total 10,00 +=========================================== + MENSAGEM DA EMPRESA VAI AQUI + INFORMACOES PARA FECHAMENTO DE CONTA + + + + + + + + + + +========================================== + Nome da empresa +=========================================== +********** NAO E DOCUMENTO FISCAL ********* +=========================================== +PRODUTO QTDE VALOR UN. VALOR +=========================================== + INFORMACOES PARA FECHAMENTO DE CONTA +=========================================== + GARCOM CONTA.DIV. VAL.PESS. COVER DESC. + garcom dividirconta vlpessoa cover desconto +=========================================== +SubTotal 10,00 + ------------------------ +Total 10,00 +=========================================== + MENSAGEM DA EMPRESA VAI AQUI + INFORMACOES PARA FECHAMENTO DE CONTA + + + + + + + + + + +========================================== + Nome da empresa +=========================================== +********** NAO E DOCUMENTO FISCAL ********* +=========================================== +PRODUTO QTDE VALOR UN. VALOR +=========================================== + INFORMACOES PARA FECHAMENTO DE CONTA +=========================================== + GARCOM CONTA.DIV. VAL.PESS. COVER DESC. + garcom dividirconta vlpessoa cover desconto +=========================================== +SubTotal 10,00 + ------------------------ +Total 10,00 +=========================================== + MENSAGEM DA EMPRESA VAI AQUI + INFORMACOES PARA FECHAMENTO DE CONTA + + + + + + + + + + +========================================== + Nome da empresa +=========================================== +********** NAO E DOCUMENTO FISCAL ********* +=========================================== +PRODUTO QTDE VALOR UN. VALOR +=========================================== + INFORMACOES PARA FECHAMENTO DE CONTA +=========================================== + GARCOM CONTA.DIV. VAL.PESS. COVER DESC. + garcom dividirconta vlpessoa cover desconto +=========================================== +SubTotal 10,00 + ------------------------ +Total 10,00 +=========================================== + MENSAGEM DA EMPRESA VAI AQUI + INFORMACOES PARA FECHAMENTO DE CONTA + + + + + + + + + + diff --git a/MyQRCode.png b/MyQRCode.png new file mode 100644 index 0000000..ae722a8 Binary files /dev/null and b/MyQRCode.png differ diff --git a/POS-58 b/POS-58 new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md new file mode 100644 index 0000000..307ab53 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +### Clone this repository + +HTTPS: https://git.librography.org/flashlan/Librography.git + +SSH: git@git.librography.org:flashlan/Librography.git + + + +### Creating a new repository on the command line + +``` +touch README.md +git init + +git add README.md +git commit -m "first commit" +git remote add origin https://git.librography.com/flashlan/Librography.git +git push -u origin master +``` + +### Pushing an existing repository from the command line + +``` +git remote add origin https://git.librography.com/flashlan/Librography.git +git push -u origin master +``` + +## GoldenOwl + +--------- + +Library Manager System writen in Java-Swing available for Windows, Linux and MacOs. + +------- + +**TODO:** + +* implementar busca de capas de livros +* modulo pago de conslta por protocolo z39.50; +* Licensa de Software +* Modulo de serial key. +* Botao "Sobre"; +* modulo de registro de isbn +* Procurar/setar Instalador do Windows +* Procurar instalador MacOS +* pasta de configuracoes em "~/.goldenOwl"/ criado por script Pacote deb, rpm +* App fist run para ver os e crair pastas de acordo +* ~~instalador mysql + script criação banco de dados em first run (create if no exits)~~ +* ON CONFLICT DO NOTHING import xlsx em janela de opcoes de importacao +* relatorios de emprestimos e devolucoes +* limitar consultas de select * para especificas nos códigos. +* suporte a internacionalização +* build for ant +* convert syntax: mysql to postgresql -> sqlite + +--- +**BUGS:** + +* remover mensagens terminal (aparecem no linux) +* remover VISIBLE e linha com create table if no exist +* carateres estranhios mysql +* Regra de negocio emprestimo? atrasado mas marca como dias restantes e ta gerando multa(com mais de 15 dias) +* livro cadastro dublica se alterar isbn. +* Botão salver em cartao faz nada (abrir explorer na url). + +--- +Softwares: +https://cloud.librography.org/index.php/s/3kQZ9DkmAGaCWw6 + diff --git a/Requires.txt b/Requires.txt new file mode 100644 index 0000000..d9702e7 --- /dev/null +++ b/Requires.txt @@ -0,0 +1,6 @@ +programs Onedrive: + +https://1drv.ms/u/s!Asa0dgo7peGpvgAlXM91A1YRd9V_?e=GcIWh9 + +Windows : +php 7.3.27 / MySql 5.0.12-dev / PhpMyAdmin 5.1.0 / Apacha 2.4.46 / Java Jdk 8 / netbeans 8.2 \ No newline at end of file diff --git a/Setup-Linux/DBType b/Setup-Linux/DBType new file mode 100644 index 0000000..0d46ca3 --- /dev/null +++ b/Setup-Linux/DBType @@ -0,0 +1 @@ +mysql \ No newline at end of file diff --git a/Setup-Linux/Librography.desktop b/Setup-Linux/Librography.desktop new file mode 100644 index 0000000..55ce97e --- /dev/null +++ b/Setup-Linux/Librography.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +#Name[en_US]=Librography +Name=Librography +Comment=Librography Library Manager +#Exec=command arguments +Exec= sh /opt/Librography/Librography.sh +Categories=Application;Office;Education; +Type=Application +#Icon=/path/to/custom/icon \ No newline at end of file diff --git a/Setup-Linux/Librography.sh b/Setup-Linux/Librography.sh new file mode 100644 index 0000000..90aab84 --- /dev/null +++ b/Setup-Linux/Librography.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +pwd +java -jar /opt/Librography/Librography.jar \ No newline at end of file diff --git a/Setup-Linux/cleanup-linux.sh b/Setup-Linux/cleanup-linux.sh new file mode 100644 index 0000000..6edfb81 --- /dev/null +++ b/Setup-Linux/cleanup-linux.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +sudo mv /var/lib/mysql /var/lib/mysql_old +sudo mv /etc/mysql /etc/mysql_backup +mv ~/.librography ~/.librography_backup +sudo apt remove mariadb +sudo apt remove mariadb-server +sudo apt remove mariadb-client +sudo apt remove openjdk-8-jdk diff --git a/Setup-Linux/createmysql.sh b/Setup-Linux/createmysql.sh new file mode 100644 index 0000000..edcb46e --- /dev/null +++ b/Setup-Linux/createmysql.sh @@ -0,0 +1,138 @@ +#!/bin/bash + +<<<<<<< HEAD +echo "Now we will need update your system and install dependencies, do you want to proceed? " +PS3='Choose a option ' +options=("proceed" "Quit") +select opt in "${options[@]}" +do + case $opt in + "proceed") + +======= +# echo "$(openssl rand -base64 12)" + +>>>>>>> e6b92619aca86245c4e77e357cbd326edf2cda46 + +########################## temporario #################### +#sudo apt update +#sudo apt upgrade +#sudo apt install openjdk-8-jdk + + echo "What is the current configuration for this machine?" + PS3='Choose a option ' + options=("server" "client" "Quit") + select opt in "${options[@]}" + do + case $opt in + "server") + echo "proceed to install server" + + if [ -d /var/lib/mysql/mysql ] ; then + echo "mysql already installed, skipping!" + else + sudo apt install mariadb-server + echo "now we will proceed with the secure installation and configuration of the database" + #echo "first you will choose the password for Mysql server" + echo "Next you can answer in order: n - y - y - y - y " + read -p "Press enter to continue" + sudo mysql_secure_installation + fi + + if [ -d /var/lib/mysql/gowl ] ; then + echo " database gowl exist! skipping " + else + rm ~/.librography/IPSERVER + touch ~/.librography/IPSERVER + touch ~/.librography/DefaultPrinter + + mkdir ~/.librography + rm ~/.librography/DBUSER + touch ~/.librography/DBUSER + DBUSER=gowl + echo $DBUSER >> ~/.librography/DBUSER + + rm ~/.librography/DBPASS + touch ~/.librography/DBPASS + echo "Entre com a senha para o usuario do banco de dados: " + read DBPASS + echo $DBPASS >> ~/.librography/DBPASS + + sudo mysql <> ~/.librography/IPSERVER + + echo "-------- Installation finished! ------------" + echo " DataBase Url/ip: $IPSERVER" + echo " DataBase Username : $DBUSER" + echo " DataBase Password : $DBPASS" + + break + ;; + "client") + echo "proceed to install a cliente" + sudo apt install mariadb-client + mkdir ~/.librography + rm ~/.librography/IPSERVER + touch ~/.librography/IPSERVER + touch ~/.librography/DefaultPrinter + echo "Enter the database server ip: " + read IPSERVER + echo $IPSERVER >> ~/.librography/IPSERVER + + rm ~/.librography/DBUSER + touch ~/.librography/DBUSER + DBUSER=gowl + echo $DBUSER >> ~/.librography/DBUSER + + rm ~/.librography/DBPASS + touch ~/.librography/DBPASS + echo "Entre com a senha do usuario do banco de dados: " + read DBPASS + echo $DBPASS >> ~/.librography/DBPASS + + echo "-------- Installation finished! ------------" + echo " DataBase Url/ip: $IPSERVER" + echo " DataBase Username : $DBUSER" + echo " DataBase Password : $DBPASS" + + break + ;; + "Quit") + break + ;; + *) echo "invalid option $REPLY";; + esac + done + + break + ;; + "Quit") + break + ;; + *) echo "invalid option $REPLY";; + esac +done + +<<<<<<< HEAD +# create shortcut on desktop +======= +# is the mysql already configured? + + +#PASS=`pwgen -s 40 1` +#PASS= dbpass + +>>>>>>> e6b92619aca86245c4e77e357cbd326edf2cda46 + diff --git a/Setup-Linux/script.sql b/Setup-Linux/script.sql new file mode 100644 index 0000000..a501516 --- /dev/null +++ b/Setup-Linux/script.sql @@ -0,0 +1,319 @@ +-- MySQL Script generated by MySQL Workbench +-- 11/01/21 23:54:12 +-- Model: New Model Version: 1.0 +-- MySQL Workbench Forward Engineering + +SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; +SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; + +-- ----------------------------------------------------- +-- Schema applibrography +-- ----------------------------------------------------- + +-- ----------------------------------------------------- +-- Schema applibrography +-- ----------------------------------------------------- +CREATE SCHEMA IF NOT EXISTS `applibrography` DEFAULT CHARACTER SET utf8 ; +USE `applibrography` ; + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_leitores` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_leitores` ( + `id` INT(8) ZEROFILL NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NULL, + `rg` VARCHAR(30) NULL DEFAULT NULL, + `cpf` VARCHAR(20) NULL DEFAULT NULL, + `email` VARCHAR(200) NULL DEFAULT NULL, + `telefone` VARCHAR(30) NULL DEFAULT NULL, + `celular` VARCHAR(30) NULL DEFAULT NULL, + `cep` VARCHAR(100) NULL DEFAULT NULL, + `endereco` VARCHAR(255) NULL DEFAULT NULL, + `numero` VARCHAR(50) NULL DEFAULT NULL, + `complemento` VARCHAR(200) NULL DEFAULT NULL, + `bairro` VARCHAR(100) NULL DEFAULT NULL, + `cidade` VARCHAR(100) NULL DEFAULT NULL, + `estado` VARCHAR(2) NULL DEFAULT NULL, + `tipo` VARCHAR(15) NULL, + `is_locked` TINYINT NULL, + `curso` VARCHAR(45) NULL, + `curso_ano` VARCHAR(45) NULL, + `qtd_emprestimos` INT(3) NULL, + `emprestmax` INT NULL, + `observacoes` VARCHAR(225) NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +AUTO_INCREMENT = 00000100 +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_fornecedores` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_fornecedores` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NULL DEFAULT NULL, + `cnpj` VARCHAR(100) NULL DEFAULT NULL, + `email` VARCHAR(200) NULL DEFAULT NULL, + `telefone` VARCHAR(30) NULL DEFAULT NULL, + `celular` VARCHAR(30) NULL DEFAULT NULL, + `cep` VARCHAR(100) NULL DEFAULT NULL, + `endereco` VARCHAR(255) NULL DEFAULT NULL, + `numero` VARCHAR(50) NULL DEFAULT NULL, + `complemento` VARCHAR(200) NULL DEFAULT NULL, + `bairro` VARCHAR(100) NULL DEFAULT NULL, + `cidade` VARCHAR(100) NULL DEFAULT NULL, + `estado` VARCHAR(2) NULL DEFAULT NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_funcionarios` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_funcionarios` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NOT NULL, + `rg` VARCHAR(30) NULL, + `cpf` VARCHAR(20) NULL, + `email` VARCHAR(200) NULL, + `senha` VARCHAR(10) NOT NULL, + `cargo` VARCHAR(100) NOT NULL, + `nivel_acesso` VARCHAR(50) NOT NULL, + `telefone` VARCHAR(30) NULL, + `celular` VARCHAR(30) NULL, + `cep` VARCHAR(100) NOT NULL, + `endereco` VARCHAR(255) NULL, + `numero` VARCHAR(50) NULL, + `complemento` VARCHAR(200) NULL, + `bairro` VARCHAR(100) NULL, + `cidade` VARCHAR(100) NOT NULL, + `estado` VARCHAR(2) NOT NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_livros` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_livros` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `titulo` VARCHAR(100) NOT NULL, + `autor` VARCHAR(45) NOT NULL, + `editora` VARCHAR(45) NOT NULL, + `isbn` VARCHAR(13) NOT NULL, + `ano` VARCHAR(4) NOT NULL, + `serie` VARCHAR(45) NULL, + `edicao` VARCHAR(45) NULL, + `idioma` VARCHAR(25) NOT NULL, + `tb_fornecedores_id` INT(8) NULL, + `piso` VARCHAR(45) NULL, + `corredor` VARCHAR(45) NULL, + `posicao` VARCHAR(45) NULL, + `secao` VARCHAR(45) NULL, + `disponibilidade` VARCHAR(15) NOT NULL, + `observacoes` VARCHAR(225) NULL, + `is_emprestado` TINYINT NULL, + PRIMARY KEY (`id`), + INDEX `fk_tb_livros_tb_fornecedores1_idx` (`tb_fornecedores_id` ASC), + CONSTRAINT `fk_tb_livros_tb_fornecedores1` + FOREIGN KEY (`tb_fornecedores_id`) + REFERENCES `applibrography`.`tb_fornecedores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_emprestimos` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_emprestimos` ( + `id` INT(8) ZEROFILL NOT NULL AUTO_INCREMENT, + `data_emprestimo` DATETIME NULL, + `data_devolucao` DATETIME NULL DEFAULT NULL, + `observacoes` TEXT NULL DEFAULT NULL, + `tb_funcionarios_id` INT(8) NULL, + `tb_livros_id` INT(8) NULL, + `tb_livros_tb_fornecedores_id` INT(8) NULL, + `tb_leitores_id` INT(8) ZEROFILL NULL, + `data_entrega_agendada` DATETIME NULL, + `tb_funcionarios_iddevol` INT(8) NULL, + `static_id_emprestimo` INT(8) NULL, + PRIMARY KEY (`id`), + INDEX `fk_tb_emprestimos_tb_funcionarios1_idx` (`tb_funcionarios_id` ASC), + INDEX `fk_tb_emprestimos_tb_livros1_idx` (`tb_livros_id` ASC, `tb_livros_tb_fornecedores_id` ASC), + INDEX `fk_tb_emprestimos_tb_leitores1_idx` (`tb_leitores_id` ASC), + INDEX `fk_tb_emprestimos_tb_funcionarios2_idx` (`tb_funcionarios_iddevol` ASC), + CONSTRAINT `fk_tb_emprestimos_tb_funcionarios1` + FOREIGN KEY (`tb_funcionarios_id`) + REFERENCES `applibrography`.`tb_funcionarios` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_livros1` + FOREIGN KEY (`tb_livros_id`) + REFERENCES `applibrography`.`tb_livros` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_leitores1` + FOREIGN KEY (`tb_leitores_id`) + REFERENCES `applibrography`.`tb_leitores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_funcionarios2` + FOREIGN KEY (`tb_funcionarios_iddevol`) + REFERENCES `applibrography`.`tb_funcionarios` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB +AUTO_INCREMENT = 10000000 +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_multa` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_multa` ( + `idmulta` INT(8) NOT NULL AUTO_INCREMENT, + `dias_atraso` INT(6) NOT NULL, + `valor_multa` DECIMAL(10,2) NULL, + `esta_pago` TINYINT NULL, + `tb_leitores_id` INT(8) ZEROFILL NOT NULL, + `tb_emprestimos_id` INT(8) ZEROFILL NOT NULL, + PRIMARY KEY (`idmulta`, `tb_emprestimos_id`), + INDEX `fk_multa_tb_leitores1_idx` (`tb_leitores_id` ASC), + INDEX `fk_tb_multa_tb_emprestimos1_idx` (`tb_emprestimos_id` ASC), + CONSTRAINT `fk_multa_tb_leitores1` + FOREIGN KEY (`tb_leitores_id`) + REFERENCES `applibrography`.`tb_leitores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_multa_tb_emprestimos1` + FOREIGN KEY (`tb_emprestimos_id`) + REFERENCES `applibrography`.`tb_emprestimos` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_opcoes` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_opcoes` ( + `id` INT NOT NULL AUTO_INCREMENT, + `data` VARCHAR(45) NOT NULL, + `parentid` INT NULL, + PRIMARY KEY (`id`), + INDEX `fk_Opcoes_Opcoes1_idx` (`parentid` ASC), + CONSTRAINT `fk_Opcoes_Opcoes1` + FOREIGN KEY (`parentid`) + REFERENCES `applibrography`.`tb_opcoes` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_recibos` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_recibos` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `emprestimo_id` INT(8) NULL, + `data_emprestimo` VARCHAR(45) NULL, + `data_devolucao_agendada` VARCHAR(45) NULL, + `data_entrega` VARCHAR(45) NULL, + `livro` VARCHAR(45) NULL, + `usuario` VARCHAR(45) NULL, + `tipo` VARCHAR(45) NULL, + `multa` VARCHAR(45) NULL, + `status` VARCHAR(45) NULL, + `funcionario` VARCHAR(45) NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB; + + +SET SQL_MODE=@OLD_SQL_MODE; +SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; +SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_leitores` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_leitores` (`id`, `nome`, `rg`, `cpf`, `email`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`, `tipo`, `is_locked`, `curso`, `curso_ano`, `qtd_emprestimos`, `emprestmax`, `observacoes`) VALUES (00000101, 'Leitor Teste', '5.432.234-1', '099.999.345-23', 'leitor@mail.com', '(42)98877-2299', '(42)98877-2299', '854670-000', 'Rua 1 de abril', '13', 'casa', 'Centro', 'Mallet', 'PR', 'Estudante', 0, 'Letras', '1', 0, 123, 'Ok'); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_fornecedores` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_fornecedores` (`id`, `nome`, `cnpj`, `email`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`) VALUES (1, 'Fornecedor Teste', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_funcionarios` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_funcionarios` (`id`, `nome`, `rg`, `cpf`, `email`, `senha`, `cargo`, `nivel_acesso`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`) VALUES (1, 'Administrador', NULL, NULL, 'admin@admin', 'admin', 'Administrador', 'Administrador', NULL, NULL, '84570-000', NULL, NULL, NULL, NULL, 'Mallet', 'PR'); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_livros` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_livros` (`id`, `titulo`, `autor`, `editora`, `isbn`, `ano`, `serie`, `edicao`, `idioma`, `tb_fornecedores_id`, `piso`, `corredor`, `posicao`, `secao`, `disponibilidade`, `observacoes`, `is_emprestado`) VALUES (1, 'Alice no Pis das maravilhas', 'Lewis Carrol', 'Nope', '1231231231231', '1894', '1', '1', 'Portugues', 1, NULL, NULL, NULL, 'Literatura Universal', '5', 'ok', 0); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_opcoes` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (1, 'piso', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (2, 'corredor', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (3, 'secao', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (4, 'posicao', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (5, 'disponibilidade', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (6, 'printerurl', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (7, 'instituicaonome', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (8, 'instiuicaoendereco', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (17, 'piso 1', 1); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (20, 'corredor 1', 2); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (21, '1A', 3); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (22, 'Literatura Universal', 4); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (13, '0', 5); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (14, '3', 5); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (15, 'Biblioteca de Hogwarts', 7); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (16, 'Rua Epsilon, 888, Cidade Imaginaria, LA ', 8); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (9, 'tiposdeusuarios', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (18, 'Estudante', 9); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (19, 'Professor', 9); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (10, 'server url', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (11, 'libraryname', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (12, 'libraryAddress', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (23, '127.0.0.1', 12); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (24, 'Nome da Biblioteca', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (25, 'valor_multa', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (26, '300', 25); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (27, 'MsgReceipt', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (28, 'Obrigado!!', 27); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (29, 'theme', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (30, 'dark', 29); + +COMMIT; + diff --git a/Setup-Linux/setup-arch.sh b/Setup-Linux/setup-arch.sh new file mode 100644 index 0000000..e69de29 diff --git a/Setup-Linux/setup-files.sh b/Setup-Linux/setup-files.sh new file mode 100644 index 0000000..823ef0c --- /dev/null +++ b/Setup-Linux/setup-files.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +sudo rm -rf /opt/Librography +mkdir /opt +sudo pacman -S p7zip +sudo 7z x ../setup/data -o/opt/ -aoa +sudo chown root -R /opt/Librography +sudo chmod 777 -R /opt/Librography +cp DBType /opt/Librography/ +#touch /opt/Librography/DBType +#echo "mysql" >> /opt/Librography/DBType +#sed -i 's/^[^0-9]*//' /opt/Librography/DBType +cp ../dist/Librography.jar /opt/Librography/ +cp Librography.sh /opt/Librography/ +sudo chmod a+rx /opt/Librography/Librography.jar + +#pause diff --git a/Setup-Linux/setup-mariadb-arch.sh b/Setup-Linux/setup-mariadb-arch.sh new file mode 100644 index 0000000..7f27fa5 --- /dev/null +++ b/Setup-Linux/setup-mariadb-arch.sh @@ -0,0 +1,39 @@ +#!/bin/sh + + +echo "Script is executed as : `whoami`" + +#var0=$(who am i | awk '{print $1}') +#echo "var0 is $var0" + +server=127.0.0.1 +dbname=applibrography +dbuser=applibrography +dbuserpassword=gowl + + +if nc -z $server 3306 2>/dev/null; then + echo "$server ✓ - MariaDB Server is installed!" + echo "Proceeding to configuration:" + sudo mysql -uroot --execute="CREATE DATABASE $dbname"; #change to variables + sudo mysql -uroot --execute="CREATE USER '$dbuser'@'localhost' IDENTIFIED BY '$dbuserpassword';" + sudo mysql -uroot --execute="GRANT ALL PRIVILEGES ON $dbuser.* TO '$dbuser'@'localhost';" + sudo mysql -uroot --execute="FLUSH PRIVILEGES;" + sudo mysql -uroot --execute="source script.sql" +else + echo "$server ✗ - MariaDb is not Installed!!" + echo "Do tou wanto to install?" + # if else aqui com resposta"" + sudo pacman -Syu + sudo pacman -S mariadb + sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql + sudo systemctl start mariadb.service + sudo systemctl enable mariadb.service +fi + + + +# PS3='Choose your firewal profile: ' + + +#mysql -uroot -p%rootpassword% --execute="CREATE DATABASE %dbname%;" diff --git a/Setup-Linux/setupMysql.bat b/Setup-Linux/setupMysql.bat new file mode 100644 index 0000000..3210d7a --- /dev/null +++ b/Setup-Linux/setupMysql.bat @@ -0,0 +1,56 @@ +@echo off +:start +netstat -o -n -a | findstr 3306 +if %ERRORLEVEL% equ 0 goto FOUND +echo MySql not found or not usisng default port 3306... +ECHO Do you wanto open open browser to download it? +ECHO 1. yes +ECHO 2. no +set /p choice=Choose your option. +if '%choice%'=='' ECHO "%choice%" is not valid please try again +if '%choice%'=='1' goto open +if '%choice%'=='2' goto FIN +ECHO. +goto start +:open +echo opening the Mysql download link.... +pause +START Https://dev.mysql.com/downloads/installer/ +ECHO you can download the setup fromlink now and after install it we will continue the setup +ECHO choose the default options on setup and don`t forget to take a note of the root password +pause +Rem :continue +Rem echo ok +goto start +Rem goto FIN +:FOUND +echo port found. It mean the Mysql is installed +echo we can continue the setup... +pause +:FIN + +echo . +echo . +@echo off +rem ------------------------------------------------ +echo Creating access to user. Waiting ... +echo Enter the MySql root password: +set /p rootpassword= +set dbname=applibrography +set dbuser=applibrography +set userpassword=gowl +Rem "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" "-uroot" "-p" +SET PATH=%PATH%;C:\Program Files\MySQL\MySQL Server 5.7\bin +mysql -uroot -p%rootpassword% --execute="CREATE DATABASE %dbname%;" +mysql -uroot -p%rootpassword% --execute="CREATE USER '%dbuser%'@'localhost' IDENTIFIED BY '%userpassword%';" +mysql -uroot -p%rootpassword% --execute="GRANT ALL PRIVILEGES ON %dbuser%.* TO '%dbuser%'@'localhost';" + +mysql -uroot -p%rootpassword% --execute="FLUSH PRIVILEGES;" +mysql -uroot -p%rootpassword% --execute="source script.sql" +echo Done. +echo "MySQL user created." +echo "Username: %dbuser%" +echo "Password: %userpassword%" +rem ------------------------------------------------ +echo . +echo . diff --git a/Setup-Windows/7z.dll b/Setup-Windows/7z.dll new file mode 100644 index 0000000..928fe61 Binary files /dev/null and b/Setup-Windows/7z.dll differ diff --git a/Setup-Windows/7z.exe b/Setup-Windows/7z.exe new file mode 100644 index 0000000..37b8514 Binary files /dev/null and b/Setup-Windows/7z.exe differ diff --git a/Setup-Windows/Install_Files/InnoScript-Win_0.1-beta.iss b/Setup-Windows/Install_Files/InnoScript-Win_0.1-beta.iss new file mode 100644 index 0000000..36b7699 --- /dev/null +++ b/Setup-Windows/Install_Files/InnoScript-Win_0.1-beta.iss @@ -0,0 +1,49 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Librography" +#define MyAppVersion "0.1-beta" +#define MyAppPublisher "FlashInformatics, Inc." +#define MyAppURL "https://www.librography.site/" +#define MyAppExeName "Librography.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{EAC392A1-AC02-4CE1-9B71-18B555A85097} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName=C:\{#MyAppName} +DisableDirPage=yes +DisableProgramGroupPage=yes +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +OutputDir=F:\Desktop\goldenowl\Installers\InnoSetupFiles +OutputBaseFilename=LibrographyInstaller_0.1-beta +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "C:\Librography\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "C:\Librography\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/Setup-Windows/Install_Files/mysql _install.bat b/Setup-Windows/Install_Files/mysql _install.bat new file mode 100644 index 0000000..efbc5e1 --- /dev/null +++ b/Setup-Windows/Install_Files/mysql _install.bat @@ -0,0 +1,58 @@ +@echo off + +echo Criando a pasta data, utilizadas pelo MySQL + +set mypath=C:\Librography + +net stop MySql + +set mysqlpath=%mypath%\mysql + +if not exist "%mysqlpath%\data" mkdir "%mysqlpath%\data" + +echo Inicializando o MySQL. Criando o conteúdo da pasta data + +"%mysqlpath%/bin/mysqld.exe" --initialize-insecure --user=mysql --basedir="%mysqlpath%" --datadir="%mysqlpath%\data" + +echo Definindo o MySQL como um serviço + +"%mysqlpath%\bin\mysqld.exe" --install MySQL + +echo Iniciando o serviço criado + +sc start MySQL + +echo Verificando se o serviço esta ativo + +:INITDATA +sc query "MySQL" | find "RUNNING" +if "%ERRORLEVEL%"=="0" ( + echo Serviço ativo ... + + echo Configurando a base de dados... + + + + + echo Definindo uma senha para o usuário root... + + :: "%mysqlpath%\bin\mysql.exe" -u root --skip-password -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'goldenowl';" + + :: echo Criando o usuário utilizado pela aplicação e atribuindo as permissões dele + + :: "%mysqlpath%\bin\mysql.exe" -u root -p goldenowl -e "CREATE USER 'appLibrography'@'localhost' IDENTIFIED BY 'app1Librography';GRANT CREATE, SELECT, INSERT, UPDATE, DELETE ON *.* TO 'appLibrography'@'localhost';FLUSH PRIVILEGES;" + + ::echo Criando o banco de dados da aplicação + + ::"%mysqlpath%\bin\mysql.exe" -u appLibrography -p app1Librography -e "CREATE DATABASE appLibrography;" + + :: echo Criando a tabela utilizada pela a aplicação + + :: "%mysqlpath%\bin\mysql.exe" -i C:\Librography\Install_Files\CreateDBScript.sql + + +) else ( + echo Serviço ainda não iniciado, aguardando 5 segundos + ping 127.0.0.1 -n 6 > nul + goto INITDATA +) diff --git a/Setup-Windows/Librography.bat b/Setup-Windows/Librography.bat new file mode 100644 index 0000000..6b7935d --- /dev/null +++ b/Setup-Windows/Librography.bat @@ -0,0 +1 @@ +java -jar Librography.jar \ No newline at end of file diff --git a/Setup-Windows/License.txt b/Setup-Windows/License.txt new file mode 100644 index 0000000..b6ff3de --- /dev/null +++ b/Setup-Windows/License.txt @@ -0,0 +1,90 @@ + 7-Zip + ~~~~~ + License for use and distribution + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + 7-Zip Copyright (C) 1999-2019 Igor Pavlov. + + The licenses for files are: + + 1) 7z.dll: + - The "GNU LGPL" as main license for most of the code + - The "GNU LGPL" with "unRAR license restriction" for some code + - The "BSD 3-clause License" for some code + 2) All other files: the "GNU LGPL". + + Redistributions in binary form must reproduce related license information from this file. + + Note: + You can use 7-Zip on any computer, including a computer in a commercial + organization. You don't need to register or pay for 7-Zip. + + + GNU LGPL information + -------------------- + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You can receive a copy of the GNU Lesser General Public License from + http://www.gnu.org/ + + + + + BSD 3-clause License + -------------------- + + The "BSD 3-clause License" is used for the code in 7z.dll that implements LZFSE data decompression. + That code was derived from the code in the "LZFSE compression library" developed by Apple Inc, + that also uses the "BSD 3-clause License": + + ---- + Copyright (c) 2015-2016, Apple Inc. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder(s) nor the names of any contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ---- + + + + + unRAR license restriction + ------------------------- + + The decompression engine for RAR archives was developed using source + code of unRAR program. + All copyrights to original unRAR code are owned by Alexander Roshal. + + The license for original unRAR code has the following restriction: + + The unRAR sources cannot be used to re-create the RAR compression algorithm, + which is proprietary. Distribution of modified unRAR sources in separate form + or as a part of other software is permitted, provided that it is clearly + stated in the documentation and source comments that the code may + not be used to develop a RAR (WinRAR) compatible archiver. + + + -- + Igor Pavlov diff --git a/Setup-Windows/copyJarToC.bat b/Setup-Windows/copyJarToC.bat new file mode 100644 index 0000000..bce55c2 --- /dev/null +++ b/Setup-Windows/copyJarToC.bat @@ -0,0 +1,2 @@ +copy ..\dist\Librography.jar C:\Librography\ +copy Librography.bat C:\Librography\ \ No newline at end of file diff --git a/Setup-Windows/packData.bat b/Setup-Windows/packData.bat new file mode 100644 index 0000000..fc99007 --- /dev/null +++ b/Setup-Windows/packData.bat @@ -0,0 +1,8 @@ +@echo off + +copy ..\dist\Librography.jar C:\Librography\ +copy Librography.bat C:\Librography\ + +7z.exe a -tZip ../setup/data C:\Librography\ + +rename data.zip data \ No newline at end of file diff --git a/Setup-Windows/script-postgresql.sql b/Setup-Windows/script-postgresql.sql new file mode 100644 index 0000000..a0f05c1 --- /dev/null +++ b/Setup-Windows/script-postgresql.sql @@ -0,0 +1,354 @@ +-- SQLINES DEMO *** rated by MySQL Workbench +-- 11/01/21 23:54:12 +-- SQLINES DEMO *** Version: 1.0 +-- SQLINES DEMO *** orward Engineering + +/* SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; */ +/* SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; */ +/* SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; */ + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy +-- SQLINES DEMO *** ------------------------------------ + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy +-- SQLINES DEMO *** ------------------------------------ +CREATE SCHEMA IF NOT EXISTS "applibrography"; +-- TEMPLATE = template0 +-- WITH OWNER "applibrography" +-- ENCODING 'UTF8' LC_COLLATE = +-- 'en_US.UTF-8' +-- LC_CTYPE = 'en_US.UTF-8'; + +SET SCHEMA 'applibrography' ; + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_leitores` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_leitores_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_leitores ( + id INT ZEROFILL NOT NULL DEFAULT NEXTVAL ('applibrography.tb_leitores_seq'), + nome VARCHAR(100) NULL, + rg VARCHAR(30) NULL DEFAULT NULL, + cpf VARCHAR(20) NULL DEFAULT NULL, + email VARCHAR(200) NULL DEFAULT NULL, + telefone VARCHAR(30) NULL DEFAULT NULL, + celular VARCHAR(30) NULL DEFAULT NULL, + cep VARCHAR(100) NULL DEFAULT NULL, + endereco VARCHAR(255) NULL DEFAULT NULL, + numero VARCHAR(50) NULL DEFAULT NULL, + complemento VARCHAR(200) NULL DEFAULT NULL, + bairro VARCHAR(100) NULL DEFAULT NULL, + cidade VARCHAR(100) NULL DEFAULT NULL, + estado VARCHAR(2) NULL DEFAULT NULL, + tipo VARCHAR(15) NULL, + is_locked SMALLINT NULL, + curso VARCHAR(45) NULL, + curso_ano VARCHAR(45) NULL, + qtd_emprestimos INT NULL, + emprestmax INT NULL, + observacoes VARCHAR(225) NULL, + PRIMARY KEY (id)) +; + +ALTER SEQUENCE applibrography.tb_leitores_seq RESTART WITH 00000100; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_fornecedores` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_fornecedores_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_fornecedores ( + id INT NOT NULL DEFAULT NEXTVAL ('applibrography.tb_fornecedores_seq'), + nome VARCHAR(100) NULL DEFAULT NULL, + cnpj VARCHAR(100) NULL DEFAULT NULL, + email VARCHAR(200) NULL DEFAULT NULL, + telefone VARCHAR(30) NULL DEFAULT NULL, + celular VARCHAR(30) NULL DEFAULT NULL, + cep VARCHAR(100) NULL DEFAULT NULL, + endereco VARCHAR(255) NULL DEFAULT NULL, + numero VARCHAR(50) NULL DEFAULT NULL, + complemento VARCHAR(200) NULL DEFAULT NULL, + bairro VARCHAR(100) NULL DEFAULT NULL, + cidade VARCHAR(100) NULL DEFAULT NULL, + estado VARCHAR(2) NULL DEFAULT NULL, + PRIMARY KEY (id)) +; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_funcionarios` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_funcionarios_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_funcionarios ( + id INT NOT NULL DEFAULT NEXTVAL ('applibrography.tb_funcionarios_seq'), + nome VARCHAR(100) NOT NULL, + rg VARCHAR(30) NULL, + cpf VARCHAR(20) NULL, + email VARCHAR(200) NULL, + senha VARCHAR(10) NOT NULL, + cargo VARCHAR(100) NOT NULL, + nivel_acesso VARCHAR(50) NOT NULL, + telefone VARCHAR(30) NULL, + celular VARCHAR(30) NULL, + cep VARCHAR(100) NOT NULL, + endereco VARCHAR(255) NULL, + numero VARCHAR(50) NULL, + complemento VARCHAR(200) NULL, + bairro VARCHAR(100) NULL, + cidade VARCHAR(100) NOT NULL, + estado VARCHAR(2) NOT NULL, + PRIMARY KEY (id)) +; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_livros` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_livros_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_livros ( + id INT NOT NULL DEFAULT NEXTVAL ('applibrography.tb_livros_seq'), + titulo VARCHAR(100) NOT NULL, + autor VARCHAR(45) NOT NULL, + editora VARCHAR(45) NOT NULL, + isbn VARCHAR(13) NOT NULL, + ano VARCHAR(4) NOT NULL, + serie VARCHAR(45) NULL, + edicao VARCHAR(45) NULL, + idioma VARCHAR(25) NOT NULL, + tb_fornecedores_id INT NULL, + piso VARCHAR(45) NULL, + corredor VARCHAR(45) NULL, + posicao VARCHAR(45) NULL, + secao VARCHAR(45) NULL, + disponibilidade VARCHAR(15) NOT NULL, + observacoes VARCHAR(225) NULL, + is_emprestado SMALLINT NULL, + PRIMARY KEY (id) + , + CONSTRAINT fk_tb_livros_tb_fornecedores1 + FOREIGN KEY (tb_fornecedores_id) + REFERENCES applibrography.tb_fornecedores (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +; + +CREATE INDEX fk_tb_livros_tb_fornecedores1_idx ON applibrography.tb_livros (tb_fornecedores_id ASC); + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_emprestimos` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_emprestimos_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_emprestimos ( + id INT ZEROFILL NOT NULL DEFAULT NEXTVAL ('applibrography.tb_emprestimos_seq'), + data_emprestimo TIMESTAMP(0) NULL, + data_devolucao TIMESTAMP(0) NULL DEFAULT NULL, + observacoes TEXT NULL DEFAULT NULL, + tb_funcionarios_id INT NULL, + tb_livros_id INT NULL, + tb_livros_tb_fornecedores_id INT NULL, + tb_leitores_id INT ZEROFILL NULL, + data_entrega_agendada TIMESTAMP(0) NULL, + tb_funcionarios_iddevol INT NULL, + static_id_emprestimo INT NULL, + PRIMARY KEY (id) + , + CONSTRAINT fk_tb_emprestimos_tb_funcionarios1 + FOREIGN KEY (tb_funcionarios_id) + REFERENCES applibrography.tb_funcionarios (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT fk_tb_emprestimos_tb_livros1 + FOREIGN KEY (tb_livros_id) + REFERENCES applibrography.tb_livros (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT fk_tb_emprestimos_tb_leitores1 + FOREIGN KEY (tb_leitores_id) + REFERENCES applibrography.tb_leitores (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT fk_tb_emprestimos_tb_funcionarios2 + FOREIGN KEY (tb_funcionarios_iddevol) + REFERENCES applibrography.tb_funcionarios (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +; + +ALTER SEQUENCE applibrography.tb_emprestimos_seq RESTART WITH 10000000; + +CREATE INDEX fk_tb_emprestimos_tb_funcionarios1_idx ON applibrography.tb_emprestimos (tb_funcionarios_id ASC); +CREATE INDEX fk_tb_emprestimos_tb_livros1_idx ON applibrography.tb_emprestimos (tb_livros_id ASC, tb_livros_tb_fornecedores_id ASC); +CREATE INDEX fk_tb_emprestimos_tb_leitores1_idx ON applibrography.tb_emprestimos (tb_leitores_id ASC); +CREATE INDEX fk_tb_emprestimos_tb_funcionarios2_idx ON applibrography.tb_emprestimos (tb_funcionarios_iddevol ASC); + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_multa` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_multa_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_multa ( + idmulta INT NOT NULL DEFAULT NEXTVAL ('applibrography.tb_multa_seq'), + dias_atraso INT NOT NULL, + valor_multa DECIMAL(10,2) NULL, + esta_pago SMALLINT NULL, + tb_leitores_id INT ZEROFILL NOT NULL, + tb_emprestimos_id INT ZEROFILL NOT NULL, + PRIMARY KEY (idmulta, tb_emprestimos_id) + , + CONSTRAINT fk_multa_tb_leitores1 + FOREIGN KEY (tb_leitores_id) + REFERENCES applibrography.tb_leitores (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT fk_tb_multa_tb_emprestimos1 + FOREIGN KEY (tb_emprestimos_id) + REFERENCES applibrography.tb_emprestimos (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +; + +CREATE INDEX fk_multa_tb_leitores1_idx ON applibrography.tb_multa (tb_leitores_id ASC); +CREATE INDEX fk_tb_multa_tb_emprestimos1_idx ON applibrography.tb_multa (tb_emprestimos_id ASC); + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_opcoes` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_opcoes_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_opcoes ( + id INT NOT NULL DEFAULT NEXTVAL ('applibrography.tb_opcoes_seq'), + data VARCHAR(45) NOT NULL, + parentid INT NULL, + PRIMARY KEY (id) + , + CONSTRAINT fk_Opcoes_Opcoes1 + FOREIGN KEY (parentid) + REFERENCES applibrography.tb_opcoes (id) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +; + +CREATE INDEX fk_Opcoes_Opcoes1_idx ON applibrography.tb_opcoes (parentid ASC); + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** aphy`.`tb_recibos` +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES LICENSE FOR EVALUATION USE ONLY +CREATE SEQUENCE applibrography.tb_recibos_seq; + +CREATE TABLE IF NOT EXISTS applibrography.tb_recibos ( + id INT NOT NULL DEFAULT NEXTVAL ('applibrography.tb_recibos_seq'), + emprestimo_id INT NULL, + data_emprestimo VARCHAR(45) NULL, + data_devolucao_agendada VARCHAR(45) NULL, + data_entrega VARCHAR(45) NULL, + livro VARCHAR(45) NULL, + usuario VARCHAR(45) NULL, + tipo VARCHAR(45) NULL, + multa VARCHAR(45) NULL, + status VARCHAR(45) NULL, + funcionario VARCHAR(45) NULL, + PRIMARY KEY (id)) +; + + +/* SET SQL_MODE=@OLD_SQL_MODE; */ +/* SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; */ +/* SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; */ + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** pplibrography`.`tb_leitores` +-- SQLINES DEMO *** ------------------------------------ +START TRANSACTION; +SET SCHEMA 'applibrography'; +INSERT INTO applibrography.tb_leitores (id, nome, rg, cpf, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado, tipo, is_locked, curso, curso_ano, qtd_emprestimos, emprestmax, observacoes) VALUES (00000101, 'Leitor Teste', '5.432.234-1', '099.999.345-23', 'leitor@mail.com', '(42)98877-2299', '(42)98877-2299', '854670-000', 'Rua 1 de abril', '13', 'casa', 'Centro', 'Mallet', 'PR', 'Estudante', 0, 'Letras', '1', 0, 123, 'Ok'); + +COMMIT; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** pplibrography`.`tb_fornecedores` +-- SQLINES DEMO *** ------------------------------------ +START TRANSACTION; +SET SCHEMA 'applibrography'; +INSERT INTO applibrography.tb_fornecedores (id, nome, cnpj, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado) VALUES (1, 'Fornecedor Teste', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +COMMIT; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** pplibrography`.`tb_funcionarios` +-- SQLINES DEMO *** ------------------------------------ +START TRANSACTION; +SET SCHEMA 'applibrography'; +INSERT INTO applibrography.tb_funcionarios (id, nome, rg, cpf, email, senha, cargo, nivel_acesso, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado) VALUES (1, 'Administrador', NULL, NULL, 'admin@admin', 'admin', 'Administrador', 'Administrador', NULL, NULL, '84570-000', NULL, NULL, NULL, NULL, 'Mallet', 'PR'); + +COMMIT; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** pplibrography`.`tb_livros` +-- SQLINES DEMO *** ------------------------------------ +START TRANSACTION; +SET SCHEMA 'applibrography'; +INSERT INTO applibrography.tb_livros (id, titulo, autor, editora, isbn, ano, serie, edicao, idioma, tb_fornecedores_id, piso, corredor, posicao, secao, disponibilidade, observacoes, is_emprestado) VALUES (1, 'Alice no Pis das maravilhas', 'Lewis Carrol', 'Nope', '1231231231231', '1894', '1', '1', 'Portugues', 1, NULL, NULL, NULL, 'Literatura Universal', '5', 'ok', 0); + +COMMIT; + + +-- SQLINES DEMO *** ------------------------------------ +-- SQLINES DEMO *** pplibrography`.`tb_opcoes` +-- SQLINES DEMO *** ------------------------------------ +START TRANSACTION; +SET SCHEMA 'applibrography'; +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (1, 'piso', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (2, 'corredor', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (3, 'secao', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (4, 'posicao', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (5, 'disponibilidade', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (6, 'printerurl', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (7, 'instituicaonome', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (8, 'instiuicaoendereco', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (17, 'piso 1', 1); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (20, 'corredor 1', 2); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (21, '1A', 3); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (22, 'Literatura Universal', 4); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (13, '0', 5); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (14, '3', 5); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (15, 'Biblioteca de Hogwarts', 7); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (16, 'Rua Epsilon, 888, Cidade Imaginaria, LA ', 8); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (9, 'tiposdeusuarios', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (18, 'Estudante', 9); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (19, 'Professor', 9); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (10, 'server url', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (11, 'libraryname', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (12, 'libraryAddress', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (23, '127.0.0.1', 12); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (24, 'Nome da Biblioteca', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (25, 'valor_multa', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (26, '300', 25); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (27, 'MsgReceipt', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (28, 'Obrigado!!', 27); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (29, 'theme', NULL); +INSERT INTO applibrography.tb_opcoes (id, data, parentid) VALUES (30, 'dark', 29); + +COMMIT; + diff --git a/Setup-Windows/script.sql b/Setup-Windows/script.sql new file mode 100644 index 0000000..a501516 --- /dev/null +++ b/Setup-Windows/script.sql @@ -0,0 +1,319 @@ +-- MySQL Script generated by MySQL Workbench +-- 11/01/21 23:54:12 +-- Model: New Model Version: 1.0 +-- MySQL Workbench Forward Engineering + +SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; +SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; + +-- ----------------------------------------------------- +-- Schema applibrography +-- ----------------------------------------------------- + +-- ----------------------------------------------------- +-- Schema applibrography +-- ----------------------------------------------------- +CREATE SCHEMA IF NOT EXISTS `applibrography` DEFAULT CHARACTER SET utf8 ; +USE `applibrography` ; + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_leitores` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_leitores` ( + `id` INT(8) ZEROFILL NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NULL, + `rg` VARCHAR(30) NULL DEFAULT NULL, + `cpf` VARCHAR(20) NULL DEFAULT NULL, + `email` VARCHAR(200) NULL DEFAULT NULL, + `telefone` VARCHAR(30) NULL DEFAULT NULL, + `celular` VARCHAR(30) NULL DEFAULT NULL, + `cep` VARCHAR(100) NULL DEFAULT NULL, + `endereco` VARCHAR(255) NULL DEFAULT NULL, + `numero` VARCHAR(50) NULL DEFAULT NULL, + `complemento` VARCHAR(200) NULL DEFAULT NULL, + `bairro` VARCHAR(100) NULL DEFAULT NULL, + `cidade` VARCHAR(100) NULL DEFAULT NULL, + `estado` VARCHAR(2) NULL DEFAULT NULL, + `tipo` VARCHAR(15) NULL, + `is_locked` TINYINT NULL, + `curso` VARCHAR(45) NULL, + `curso_ano` VARCHAR(45) NULL, + `qtd_emprestimos` INT(3) NULL, + `emprestmax` INT NULL, + `observacoes` VARCHAR(225) NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +AUTO_INCREMENT = 00000100 +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_fornecedores` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_fornecedores` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NULL DEFAULT NULL, + `cnpj` VARCHAR(100) NULL DEFAULT NULL, + `email` VARCHAR(200) NULL DEFAULT NULL, + `telefone` VARCHAR(30) NULL DEFAULT NULL, + `celular` VARCHAR(30) NULL DEFAULT NULL, + `cep` VARCHAR(100) NULL DEFAULT NULL, + `endereco` VARCHAR(255) NULL DEFAULT NULL, + `numero` VARCHAR(50) NULL DEFAULT NULL, + `complemento` VARCHAR(200) NULL DEFAULT NULL, + `bairro` VARCHAR(100) NULL DEFAULT NULL, + `cidade` VARCHAR(100) NULL DEFAULT NULL, + `estado` VARCHAR(2) NULL DEFAULT NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_funcionarios` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_funcionarios` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NOT NULL, + `rg` VARCHAR(30) NULL, + `cpf` VARCHAR(20) NULL, + `email` VARCHAR(200) NULL, + `senha` VARCHAR(10) NOT NULL, + `cargo` VARCHAR(100) NOT NULL, + `nivel_acesso` VARCHAR(50) NOT NULL, + `telefone` VARCHAR(30) NULL, + `celular` VARCHAR(30) NULL, + `cep` VARCHAR(100) NOT NULL, + `endereco` VARCHAR(255) NULL, + `numero` VARCHAR(50) NULL, + `complemento` VARCHAR(200) NULL, + `bairro` VARCHAR(100) NULL, + `cidade` VARCHAR(100) NOT NULL, + `estado` VARCHAR(2) NOT NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_livros` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_livros` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `titulo` VARCHAR(100) NOT NULL, + `autor` VARCHAR(45) NOT NULL, + `editora` VARCHAR(45) NOT NULL, + `isbn` VARCHAR(13) NOT NULL, + `ano` VARCHAR(4) NOT NULL, + `serie` VARCHAR(45) NULL, + `edicao` VARCHAR(45) NULL, + `idioma` VARCHAR(25) NOT NULL, + `tb_fornecedores_id` INT(8) NULL, + `piso` VARCHAR(45) NULL, + `corredor` VARCHAR(45) NULL, + `posicao` VARCHAR(45) NULL, + `secao` VARCHAR(45) NULL, + `disponibilidade` VARCHAR(15) NOT NULL, + `observacoes` VARCHAR(225) NULL, + `is_emprestado` TINYINT NULL, + PRIMARY KEY (`id`), + INDEX `fk_tb_livros_tb_fornecedores1_idx` (`tb_fornecedores_id` ASC), + CONSTRAINT `fk_tb_livros_tb_fornecedores1` + FOREIGN KEY (`tb_fornecedores_id`) + REFERENCES `applibrography`.`tb_fornecedores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_emprestimos` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_emprestimos` ( + `id` INT(8) ZEROFILL NOT NULL AUTO_INCREMENT, + `data_emprestimo` DATETIME NULL, + `data_devolucao` DATETIME NULL DEFAULT NULL, + `observacoes` TEXT NULL DEFAULT NULL, + `tb_funcionarios_id` INT(8) NULL, + `tb_livros_id` INT(8) NULL, + `tb_livros_tb_fornecedores_id` INT(8) NULL, + `tb_leitores_id` INT(8) ZEROFILL NULL, + `data_entrega_agendada` DATETIME NULL, + `tb_funcionarios_iddevol` INT(8) NULL, + `static_id_emprestimo` INT(8) NULL, + PRIMARY KEY (`id`), + INDEX `fk_tb_emprestimos_tb_funcionarios1_idx` (`tb_funcionarios_id` ASC), + INDEX `fk_tb_emprestimos_tb_livros1_idx` (`tb_livros_id` ASC, `tb_livros_tb_fornecedores_id` ASC), + INDEX `fk_tb_emprestimos_tb_leitores1_idx` (`tb_leitores_id` ASC), + INDEX `fk_tb_emprestimos_tb_funcionarios2_idx` (`tb_funcionarios_iddevol` ASC), + CONSTRAINT `fk_tb_emprestimos_tb_funcionarios1` + FOREIGN KEY (`tb_funcionarios_id`) + REFERENCES `applibrography`.`tb_funcionarios` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_livros1` + FOREIGN KEY (`tb_livros_id`) + REFERENCES `applibrography`.`tb_livros` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_leitores1` + FOREIGN KEY (`tb_leitores_id`) + REFERENCES `applibrography`.`tb_leitores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_funcionarios2` + FOREIGN KEY (`tb_funcionarios_iddevol`) + REFERENCES `applibrography`.`tb_funcionarios` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB +AUTO_INCREMENT = 10000000 +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_multa` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_multa` ( + `idmulta` INT(8) NOT NULL AUTO_INCREMENT, + `dias_atraso` INT(6) NOT NULL, + `valor_multa` DECIMAL(10,2) NULL, + `esta_pago` TINYINT NULL, + `tb_leitores_id` INT(8) ZEROFILL NOT NULL, + `tb_emprestimos_id` INT(8) ZEROFILL NOT NULL, + PRIMARY KEY (`idmulta`, `tb_emprestimos_id`), + INDEX `fk_multa_tb_leitores1_idx` (`tb_leitores_id` ASC), + INDEX `fk_tb_multa_tb_emprestimos1_idx` (`tb_emprestimos_id` ASC), + CONSTRAINT `fk_multa_tb_leitores1` + FOREIGN KEY (`tb_leitores_id`) + REFERENCES `applibrography`.`tb_leitores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_multa_tb_emprestimos1` + FOREIGN KEY (`tb_emprestimos_id`) + REFERENCES `applibrography`.`tb_emprestimos` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_opcoes` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_opcoes` ( + `id` INT NOT NULL AUTO_INCREMENT, + `data` VARCHAR(45) NOT NULL, + `parentid` INT NULL, + PRIMARY KEY (`id`), + INDEX `fk_Opcoes_Opcoes1_idx` (`parentid` ASC), + CONSTRAINT `fk_Opcoes_Opcoes1` + FOREIGN KEY (`parentid`) + REFERENCES `applibrography`.`tb_opcoes` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_recibos` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_recibos` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `emprestimo_id` INT(8) NULL, + `data_emprestimo` VARCHAR(45) NULL, + `data_devolucao_agendada` VARCHAR(45) NULL, + `data_entrega` VARCHAR(45) NULL, + `livro` VARCHAR(45) NULL, + `usuario` VARCHAR(45) NULL, + `tipo` VARCHAR(45) NULL, + `multa` VARCHAR(45) NULL, + `status` VARCHAR(45) NULL, + `funcionario` VARCHAR(45) NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB; + + +SET SQL_MODE=@OLD_SQL_MODE; +SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; +SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_leitores` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_leitores` (`id`, `nome`, `rg`, `cpf`, `email`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`, `tipo`, `is_locked`, `curso`, `curso_ano`, `qtd_emprestimos`, `emprestmax`, `observacoes`) VALUES (00000101, 'Leitor Teste', '5.432.234-1', '099.999.345-23', 'leitor@mail.com', '(42)98877-2299', '(42)98877-2299', '854670-000', 'Rua 1 de abril', '13', 'casa', 'Centro', 'Mallet', 'PR', 'Estudante', 0, 'Letras', '1', 0, 123, 'Ok'); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_fornecedores` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_fornecedores` (`id`, `nome`, `cnpj`, `email`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`) VALUES (1, 'Fornecedor Teste', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_funcionarios` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_funcionarios` (`id`, `nome`, `rg`, `cpf`, `email`, `senha`, `cargo`, `nivel_acesso`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`) VALUES (1, 'Administrador', NULL, NULL, 'admin@admin', 'admin', 'Administrador', 'Administrador', NULL, NULL, '84570-000', NULL, NULL, NULL, NULL, 'Mallet', 'PR'); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_livros` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_livros` (`id`, `titulo`, `autor`, `editora`, `isbn`, `ano`, `serie`, `edicao`, `idioma`, `tb_fornecedores_id`, `piso`, `corredor`, `posicao`, `secao`, `disponibilidade`, `observacoes`, `is_emprestado`) VALUES (1, 'Alice no Pis das maravilhas', 'Lewis Carrol', 'Nope', '1231231231231', '1894', '1', '1', 'Portugues', 1, NULL, NULL, NULL, 'Literatura Universal', '5', 'ok', 0); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_opcoes` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (1, 'piso', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (2, 'corredor', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (3, 'secao', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (4, 'posicao', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (5, 'disponibilidade', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (6, 'printerurl', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (7, 'instituicaonome', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (8, 'instiuicaoendereco', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (17, 'piso 1', 1); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (20, 'corredor 1', 2); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (21, '1A', 3); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (22, 'Literatura Universal', 4); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (13, '0', 5); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (14, '3', 5); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (15, 'Biblioteca de Hogwarts', 7); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (16, 'Rua Epsilon, 888, Cidade Imaginaria, LA ', 8); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (9, 'tiposdeusuarios', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (18, 'Estudante', 9); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (19, 'Professor', 9); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (10, 'server url', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (11, 'libraryname', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (12, 'libraryAddress', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (23, '127.0.0.1', 12); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (24, 'Nome da Biblioteca', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (25, 'valor_multa', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (26, '300', 25); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (27, 'MsgReceipt', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (28, 'Obrigado!!', 27); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (29, 'theme', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (30, 'dark', 29); + +COMMIT; + diff --git a/Setup-Windows/setup.bat b/Setup-Windows/setup.bat new file mode 100644 index 0000000..e8d2bdf --- /dev/null +++ b/Setup-Windows/setup.bat @@ -0,0 +1,59 @@ + +@echo off + +Rem cls +:start +ECHO What do you want to do? +ECHO 1. Click 1 to setup a Server machine +ECHO 2. Click 2 to setup a Client Machine +ECHO 3. Click 3 to setup a Student Terminal +ECHO 4. Click 4 to cancel and quit +set /p choice=Type the number to proceed to setup. +rem if not '%choice%'=='' set choice=%choice:~0;1% ( don`t use this command, because it takes only first digit in the case you type more digits. After that for example choice 23455666 is choice 2 and you get "bye" +if '%choice%'=='' ECHO "%choice%" is not valid please try again +if '%choice%'=='1' goto server +if '%choice%'=='2' goto client +if '%choice%'=='3' goto terminal +if '%choice%'=='4' goto quit +ECHO. +goto start +:server +ECHO Starting installing and setup the server.... +ECHO ------------------------------------------------- +ECHO First take a note of your ip number shown above. +ECHO You will need this to install the clients and terminals: +for /f "delims=[] tokens=2" %%a in ('ping -4 -n 1 %ComputerName% ^| findstr [') do set NetworkIP=%%a +echo Network IP: +ECHO ------------------------------------------------------ +ECHO %NetworkIP% +ECHO ------------------------------------------------------ +pause +call setupFiles.bat +ECHO ok +ECHO ------------------------------------------------------- +echo localhost>C:\Librography\ipserver +call setupJava.bat +call setupMysql.bat +ECHO +goto end +:client +ECHO Starting installing and setup the client.... +ECHO ------------------------------------------------- +call setupFiles.bat +Rem setup server ip +echo Enter the server ip : +set /p ipserver= +echo The server ip is %ipserver% +echo %ipserver%>C:\Librography\ipserver +call setupJava.bat +ECHO BYE +goto end +:terminal +ECHO TEST +goto end +:quit +ECHO Bye +goto end +:end +pause +Rem exit \ No newline at end of file diff --git a/Setup-Windows/setupFiles.bat b/Setup-Windows/setupFiles.bat new file mode 100644 index 0000000..2e2436b --- /dev/null +++ b/Setup-Windows/setupFiles.bat @@ -0,0 +1,7 @@ + + +Rem extract files +7z.exe x ../setup/data -oC:\ -aoa + + +pause \ No newline at end of file diff --git a/Setup-Windows/setupJava.bat b/Setup-Windows/setupJava.bat new file mode 100644 index 0000000..20ca218 --- /dev/null +++ b/Setup-Windows/setupJava.bat @@ -0,0 +1,42 @@ +Rem check java version +@echo off +cls +setlocal ENABLEEXTENSIONS +set KEY_NAME="HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" +set VALUE_NAME=CurrentVersion +:: +:: get the current version +:: +FOR /F "usebackq skip=2 tokens=3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( + set ValueValue=%%A +) +if defined ValueValue ( + @echo the current Java runtime is %ValueValue% +) else ( + @echo %KEY_NAME%\%VALUE_NAME% not found. + goto end +) +set JAVA_CURRENT="HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\%ValueValue%" +set JAVA_HOME=JavaHome +:: +:: get the javahome +:: +FOR /F "usebackq skip=2 tokens=3*" %%A IN (`REG QUERY %JAVA_CURRENT% /v %JAVA_HOME% 2^>nul`) DO ( + set JAVA_PATH=%%A %%B +) +echo the path of the current Java JVM according to the registry is +echo %JAVA_PATH% +echo. +echo now if we try it : +"%JAVA_PATH%\bin\java.exe" -version +:end + +Rem if %ValueValue% ==1.8 + + +if %ValueValue%==1.8 ( + echo "Java 8 encontrado" + pause) else (echo Java versão 8 não encontrado: você quer abrir a página de download? + START Https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html + pause) + diff --git a/Setup-Windows/setupMysql.bat b/Setup-Windows/setupMysql.bat new file mode 100644 index 0000000..7e174fe --- /dev/null +++ b/Setup-Windows/setupMysql.bat @@ -0,0 +1,58 @@ +@echo off +:start +PATH=C:\Program Files\MySQL\MySQL Server 5.7\bin;%path% +netstat -o -n -a | findstr 3306 +if %ERRORLEVEL% equ 0 goto FOUND +echo MySql not found or not usisng default port 3306... +ECHO Do you wanto open open browser to download it? +ECHO 1. yes +ECHO 2. no +set /p choice=Choose your option. +if '%choice%'=='' ECHO "%choice%" is not valid please try again +if '%choice%'=='1' goto open +if '%choice%'=='2' goto FIN +ECHO. +goto start +:open +echo opening the Mysql download link.... +pause +START Https://downloads.mysql.com/archives/get/p/25/file/mysql-installer-web-community-5.7.15.0.msi +ECHO 1 - Download the setup from link opening on browser and after install and then we will continue the setup +ECHO 2 - Install with optiion "Only Server" and setup a root password +ECHO 3 - take a note of the root password, fisnish the installer and continue this setup +pause +Rem :continue +Rem echo ok +goto start +Rem goto FIN +:FOUND +echo port found. It mean the Mysql is installed +echo we can continue the setup... +pause +:FIN + +echo . +echo . +@echo off +rem ------------------------------------------------ +echo Creating access to user. Waiting ... +echo Enter the MySql root password: +set /p rootpassword= +set dbname=applibrography +set dbuser=applibrography +set userpassword=gowl +Rem "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" "-uroot" "-p" +SET PATH=%PATH%;C:\Program Files\MySQL\MySQL Server 5.7\bin +mysql -uroot -p%rootpassword% --execute="CREATE DATABASE %dbname%;" +mysql -uroot -p%rootpassword% --execute="CREATE USER '%dbuser%'@'localhost' IDENTIFIED BY '%userpassword%';" +mysql -uroot -p%rootpassword% --execute="GRANT ALL PRIVILEGES ON %dbuser%.* TO '%dbuser%'@'localhost';" + +mysql -uroot -p%rootpassword% --execute="FLUSH PRIVILEGES;" +mysql -uroot -p%rootpassword% --execute="source script.sql" +echo Done. +echo "MySQL user created." +echo "Username: %dbuser%" +echo "Password: %userpassword%" +rem ------------------------------------------------ +echo . +echo . diff --git a/Setup-Windows/setupPostgres.bat b/Setup-Windows/setupPostgres.bat new file mode 100644 index 0000000..f44e837 --- /dev/null +++ b/Setup-Windows/setupPostgres.bat @@ -0,0 +1,62 @@ +@echo off +:start + + +PATH=C:\Librography_data\postgres\bin;%path% +netstat -o -n -a | findstr 5432 +if %ERRORLEVEL% equ 0 goto FOUND +echo Postgresql not found or not usisng default port 5432... +ECHO Do you wanto open open browser to download it? +ECHO 1. yes +ECHO 2. no +set /p choice=Choose your option. +if '%choice%'=='' ECHO "%choice%" is not valid please try again +if '%choice%'=='1' goto open +if '%choice%'=='2' goto FIN +ECHO. +goto start +:open +echo opening the Postgresql download link.... +pause +START Https://www.enterprisedb.com/postgresql-tutorial-resources-training?uuid=ea5c8104-3940-4ed1-b427-81cf19781581&campaignId=70138000000rYFmAAM +ECHO 1 - Download the setup from link opening on browser and after install and then we will continue the setup +ECHO 2 - Install with optiion "Only Server" and setup a root password +ECHO 3 - take a note of the root password, fisnish the installer and continue this setup +Rem %Downloads%/postgresql-10.19-1-windows-x64.exe --mode unattended --unattendedmodeui minimal --superpassword MIRANDA --prefix C:\Librography_data\postgres --datadir C:\Librography_data\postgres\data +pause +Rem :continue +Rem echo ok +goto start +Rem goto FIN +:FOUND +echo port found. It mean the Postgresql is installed +echo we can continue the setup... +pause +:FIN + +echo . +echo . +@echo off +rem ------------------------------------------------ +echo Creating access to user. Waiting ... +echo Enter the Postgresql user password: +set /p rootpassword= +set dbname=applibrography +set dbuser=applibrography +set userpassword=gowl +set PGPASSWORD=MIRANDA +Rem "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql.exe" "--defaults-file=C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" "-uroot" "-p" +SET PATH=%PATH%;C:\Librography_data\postgres\bin +psql -U postgres -c "CREATE DATABASE %dbname%;" +psql -U postgres -c "CREATE USER '%dbuser%'@'localhost' IDENTIFIED BY '%userpassword%';" +psql -U postgres -c "GRANT ALL PRIVILEGES ON %dbuser%.* TO '%dbuser%'@'localhost';" + +psql -U postgres -c "FLUSH PRIVILEGES;" +psql -U postgres -c "source script-posgresql.sql" +echo Done. +echo "Postgresql user created." +echo "Username: %dbuser%" +echo "Password: %userpassword%" +rem ------------------------------------------------ +echo . +echo . diff --git a/USB001 b/USB001 new file mode 100644 index 0000000..e69de29 diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..03d0ff3 --- /dev/null +++ b/build.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + Builds, tests, and runs the project Librography. + + + diff --git a/build/built-jar.properties b/build/built-jar.properties new file mode 100644 index 0000000..7596598 --- /dev/null +++ b/build/built-jar.properties @@ -0,0 +1,4 @@ +#Sun, 05 Dec 2021 03:42:23 -0200 + + +/home/sandman/Desktop/Librography= diff --git a/build/classes/.metadata/.log b/build/classes/.metadata/.log new file mode 100644 index 0000000..31609e9 --- /dev/null +++ b/build/classes/.metadata/.log @@ -0,0 +1,76 @@ +!SESSION 2021-06-16 21:34:24.616 ----------------------------------------------- +eclipse.buildId=unknown +java.version=11.0.8 +java.vendor=AdoptOpenJDK +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR +Command-line arguments: -os win32 -ws win32 -arch x86_64 -data @noDefault + +!ENTRY com.jaspersoft.studio 1 0 2021-06-16 21:34:32.703 +!MESSAGE Starting JaspersoftStudio bundle - Version: 6.17.0.final + +!ENTRY org.eclipse.egit.ui 2 0 2021-06-16 21:34:35.566 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\flash'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jface 2 0 2021-06-16 21:48:06.852 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-06-16 21:48:06.852 +!MESSAGE A conflict occurred for CTRL+SHIFT+K: +Binding(CTRL+SHIFT+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findPrevious,Find Previous, + Find previous item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1343b038, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findPrevious,Find Previous, + Find previous item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1343b038, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.xtext.ui.embeddedTextEditorScope,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2021-06-16 21:48:06.853 +!MESSAGE A conflict occurred for CTRL+K: +Binding(CTRL+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findNext,Find Next, + Find next item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6551611e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findNext,Find Next, + Find next item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6551611e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.xtext.ui.embeddedTextEditorScope,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2021-06-16 21:48:06.853 +!MESSAGE A conflict occurred for F2: +Binding(F2, + ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename, + Rename the selected item, + Category(org.eclipse.ui.category.file,File,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@295cab5d, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(F2, + ParameterizedCommand(Command(org.eclipse.ui.edit.text.showInformation,Show Tooltip Description, + Displays information for the current caret location in a focused hover, + Category(org.eclipse.ui.category.textEditor,Text Editing,Text Editing Commands,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7af59617, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.xtext.ui.embeddedTextEditorScope,,,system) + +!ENTRY org.eclipse.core.resources 2 10035 2021-06-16 22:46:17.042 +!MESSAGE The workspace will exit with unsaved changes in this session. diff --git a/build/classes/.metadata/.plugins/com.jaspersoft.studio.data.sql.ui/dialog_settings.xml b/build/classes/.metadata/.plugins/com.jaspersoft.studio.data.sql.ui/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/build/classes/.metadata/.plugins/com.jaspersoft.studio.data.sql.ui/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_0 b/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_0 new file mode 100644 index 0000000..9d02367 --- /dev/null +++ b/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_0 @@ -0,0 +1 @@ +One Empty Record1 \ No newline at end of file diff --git a/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_1 b/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_1 new file mode 100644 index 0000000..ee432f3 --- /dev/null +++ b/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_1 @@ -0,0 +1 @@ +Sample DBorg.hsqldb.jdbcDriversatruejdbc:hsqldb:res:/defaults/hsqldb/test \ No newline at end of file diff --git a/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_2 b/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_2 new file mode 100644 index 0000000..a961fc7 --- /dev/null +++ b/build/classes/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_2 @@ -0,0 +1 @@ +MySqlLocalHostcom.mysql.jdbc.Driverrootgoldenowltruejdbc:mysql://localhost/applibrographyC:\Program Files\NetBeans 8.2\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar \ No newline at end of file diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.history/19/c0e0efac05cf001b1a2ac2f9dbdf4288 b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.history/19/c0e0efac05cf001b1a2ac2f9dbdf4288 new file mode 100644 index 0000000..e69de29 diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.history/a6/104fbf3706cf001b1a2ac2f9dbdf4288 b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.history/a6/104fbf3706cf001b1a2ac2f9dbdf4288 new file mode 100644 index 0000000..e69de29 diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.indexes/history.index b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.indexes/history.index new file mode 100644 index 0000000..663a2bc Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.indexes/history.index differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.markers.snap b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.markers.snap new file mode 100644 index 0000000..1253ec8 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.markers.snap differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.syncinfo.snap b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.syncinfo.snap new file mode 100644 index 0000000..1253ec8 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.syncinfo.snap differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000..f2f8423 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 0000000..6b2aaa7 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap new file mode 100644 index 0000000..3ab7083 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000..2c0b367 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.resources/0.snap b/build/classes/.metadata/.plugins/org.eclipse.core.resources/0.snap new file mode 100644 index 0000000..89e6c94 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.core.resources/0.snap differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.collabnet.subversion.merge.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.collabnet.subversion.merge.prefs new file mode 100644 index 0000000..7ae6d53 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.collabnet.subversion.merge.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +merge_provider_set=true diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.jaspersoft.studio.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.jaspersoft.studio.prefs new file mode 100644 index 0000000..412a948 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.jaspersoft.studio.prefs @@ -0,0 +1,12 @@ +com.jaspersoft.studio.myreports.created=true +com.jaspersoft.studio.parameterset.Http\ Data\ Adapters\ Built\ In\ Parameters=PFBhcmFtZXRlclNldD48bmFtZT5IdHRwIERhdGEgQWRhcHRlcnMgQnVpbHQgSW4gUGFyYW1ldGVy\nczwvbmFtZT48YnVpbHRJbj50cnVlPC9idWlsdEluPjxwYXJhbWV0ZXJzPjxuYW1lPkhUVFBfREFU\nQV9VUkw8L25hbWU+PGRlc2NyaXB0aW9uPlVSTCBUbyBnZXQgZmlsZSBmcm9tPC9kZXNjcmlwdGlv\nbj48Zm9yUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEu\nbGFuZy5TdHJpbmc8L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0\nPiJodHRwOi8vc29tZXVybC5jb20iPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3Bh\ncmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+SFRUUF9EQVRBX1VTRVJOQU1FPC9uYW1lPjxkZXNj\ncmlwdGlvbj5Vc2VyIG5hbWU8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclBy\nb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS5sYW5nLlN0cmluZzwvdmFsdWVDbGFzc05hbWU+\nPGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRleHQ+InVzZXIiPC90ZXh0PjwvZGVmYXVsdFZhbHVl\nRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+SFRUUF9EQVRBX1BBU1NX\nT1JEPC9uYW1lPjxkZXNjcmlwdGlvbj5QYXNzd29yZDwvZGVzY3JpcHRpb24+PGZvclByb21wdGlu\nZz5mYWxzZTwvZm9yUHJvbXB0aW5nPjx2YWx1ZUNsYXNzTmFtZT5qYXZhLmxhbmcuU3RyaW5nPC92\nYWx1ZUNsYXNzTmFtZT48ZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48dGV4dD4icGFzcyI8L3RleHQ+\nPC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48cGFyYW1ldGVycz48bmFtZT5I\nVFRQX0RBVEFfVVJMX1BBUkFNRVRFUl88L25hbWU+PGRlc2NyaXB0aW9uPlVSTCBQYXJhbWV0ZXIg\ncHJlZml4PC9kZXNjcmlwdGlvbj48Zm9yUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZh\nbHVlQ2xhc3NOYW1lPmphdmEubGFuZy5TdHJpbmc8L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFs\ndWVFeHByZXNzaW9uPjx0ZXh0PiJwcm0iPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48\nL3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+SFRUUF9EQVRBX1BPU1RfUEFSQU1FVEVSXzwv\nbmFtZT48ZGVzY3JpcHRpb24+UE9TVCByZXF1ZXN0IHBhcmFtZXRlciBwcmVmaXg8L2Rlc2NyaXB0\naW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2\nYS5sYW5nLlN0cmluZzwvdmFsdWVDbGFzc05hbWU+PGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRl\neHQ+InBybSI8L3RleHQ+PC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48cGFy\nYW1ldGVycz48bmFtZT5IVFRQX0RBVEFfSEVBREVSX1BBUkFNRVRFUl88L25hbWU+PGRlc2NyaXB0\naW9uPkh0dHAgSGVhZGVyIHBhcmFtZXRlciBwcmVmaXg8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRp\nbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS5sYW5nLlN0cmluZzwv\ndmFsdWVDbGFzc05hbWU+PGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRleHQ+InZhbHVlIjwvdGV4\ndD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9wYXJhbWV0ZXJzPjwvUGFyYW1ldGVyU2V0Pg\=\= +com.jaspersoft.studio.parameterset.Jaspersoft\ Server\ Built\ In\ Parameters=PFBhcmFtZXRlclNldD48bmFtZT5KYXNwZXJzb2Z0IFNlcnZlciBCdWlsdCBJbiBQYXJhbWV0ZXJz\nPC9uYW1lPjxidWlsdEluPnRydWU8L2J1aWx0SW4+PHBhcmFtZXRlcnM+PG5hbWU+TG9nZ2VkSW5V\nc2VyPC9uYW1lPjxkZXNjcmlwdGlvbj5Ob3QgdXNhYmxlIGluIHF1ZXJ5IGlucHV0IGNvbnRyb2ws\nIGJ1dCBpcyB1c2VkIGFzIHBhcmFtZXRlciB0byByZXBvcnQ8L2Rlc2NyaXB0aW9uPjxmb3JQcm9t\ncHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+Y29tLmphc3BlcnNvZnQu\namFzcGVyc2VydmVyLmFwaS5tZXRhZGF0YS51c2VyLmRvbWFpbi5jbGllbnQuVXNlckltcGw8L3Zh\nbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0Pm5ldyBjb20uamFzcGVy\nc29mdC5qYXNwZXJzZXJ2ZXIuYXBpLm1ldGFkYXRhLnVzZXIuZG9tYWluLmNsaWVudC5Vc2VySW1w\nbCgpPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRl\ncnM+PG5hbWU+TG9nZ2VkSW5Vc2VybmFtZTwvbmFtZT48ZGVzY3JpcHRpb24+T2YgbG9nZ2VkIGlu\nIHVzZXI8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFs\ndWVDbGFzc05hbWU+amF2YS5sYW5nLlN0cmluZzwvdmFsdWVDbGFzc05hbWU+PGRlZmF1bHRWYWx1\nZUV4cHJlc3Npb24+PHRleHQ+ImpvZXVzZXIiPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lv\nbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+TG9nZ2VkSW5Vc2VyRnVsbE5hbWU8L25h\nbWU+PGRlc2NyaXB0aW9uPk9mIGxvZ2dlZCBpbiB1c2VyPC9kZXNjcmlwdGlvbj48Zm9yUHJvbXB0\naW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEubGFuZy5TdHJpbmc8\nL3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0PiJKb2UgU21pdGgi\nPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+\nPG5hbWU+TG9nZ2VkSW5Vc2VyRW1haWxBZGRyZXNzPC9uYW1lPjxkZXNjcmlwdGlvbj5PZiBsb2dn\nZWQgaW4gdXNlcjwvZGVzY3JpcHRpb24+PGZvclByb21wdGluZz5mYWxzZTwvZm9yUHJvbXB0aW5n\nPjx2YWx1ZUNsYXNzTmFtZT5qYXZhLmxhbmcuU3RyaW5nPC92YWx1ZUNsYXNzTmFtZT48ZGVmYXVs\ndFZhbHVlRXhwcmVzc2lvbj48dGV4dD4iam9lQHNvbWUuZW1haWwiPC90ZXh0PjwvZGVmYXVsdFZh\nbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+TG9nZ2VkSW5Vc2Vy\nRW5hYmxlZDwvbmFtZT48ZGVzY3JpcHRpb24+SXMgbG9nZ2VkIGluIHVzZXIgZW5hYmxlZD88L2Rl\nc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05h\nbWU+amF2YS5sYW5nLkJvb2xlYW48L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNz\naW9uPjx0ZXh0PkJvb2xlYW4uVFJVRTwvdGV4dD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9w\nYXJhbWV0ZXJzPjxwYXJhbWV0ZXJzPjxuYW1lPkxvZ2dlZEluVXNlckV4dGVybmFsbHlEZWZpbmVk\nPC9uYW1lPjxkZXNjcmlwdGlvbj5JcyBsb2dnZWQgaW4gdXNlciBleHRlcm5hbGx5IGRlZmluZWQ/\nIGllLiBhdXRoZW50aWNhdGVkIGV4dGVybmFsbHk8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+\nZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS5sYW5nLkJvb2xlYW48L3Zh\nbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0PkJvb2xlYW4uRkFMU0U8\nL3RleHQ+PC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48cGFyYW1ldGVycz48\nbmFtZT5Mb2dnZWRJblVzZXJUZW5hbnRJZDwvbmFtZT48ZGVzY3JpcHRpb24+T2YgbG9nZ2VkIGlu\nIHVzZXIuIE9ubHkgcmVsZXZhbnQgaW4gUHJvL0VudGVycHJpc2UuPC9kZXNjcmlwdGlvbj48Zm9y\nUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEubGFuZy5T\ndHJpbmc8L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0PjwvdGV4\ndD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9wYXJhbWV0ZXJzPjxwYXJhbWV0ZXJzPjxuYW1l\nPkxvZ2dlZEluVXNlclJvbGVzPC9uYW1lPjxkZXNjcmlwdGlvbj5DdXJyZW50IHNldCBvZiByb2xl\ncyBvZiBsb2dnZWQgaW4gdXNlci4gVXNlZnVsIGZvciAkWCBwYXJhbWV0ZXI8L2Rlc2NyaXB0aW9u\nPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS51\ndGlsLkNvbGxlY3Rpb248L3ZhbHVlQ2xhc3NOYW1lPjxuZXN0ZWRUeXBlTmFtZT5qYXZhLmxhbmcu\nU3RyaW5nPC9uZXN0ZWRUeXBlTmFtZT48ZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48dGV4dD5uZXcg\nQXJyYXlMaXN0KCk8L3RleHQ+PC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48\ncGFyYW1ldGVycz48bmFtZT5Mb2dnZWRJblVzZXJBdHRyaWJ1dGVzPC9uYW1lPjxkZXNjcmlwdGlv\nbj5Ob3QgdXNhYmxlIGluIHF1ZXJ5IGlucHV0IGNvbnRyb2wsIGJ1dCBpcyB1c2VkIGFzIHBhcmFt\nZXRlciB0byByZXBvcnQuIEVtcHR5IG1hcCBpZiBubyBhdHRyaWJ1dGVzPC9kZXNjcmlwdGlvbj48\nZm9yUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEudXRp\nbC5NYXA8L3ZhbHVlQ2xhc3NOYW1lPjxuZXN0ZWRUeXBlTmFtZT5qYXZhLmxhbmcuU3RyaW5nPC9u\nZXN0ZWRUeXBlTmFtZT48ZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48dGV4dD5uZXcgSGFzaE1hcCgp\nPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+\nPG5hbWU+TG9nZ2VkSW5Vc2VyQXR0cmlidXRlTmFtZXM8L25hbWU+PGRlc2NyaXB0aW9uPlVzZXIg\ncHJvZmlsZSBhdHRyaWJ1dGUgbmFtZXMuIFVzZWZ1bCBmb3IgJFggcGFyYW1ldGVycy4gRW1wdHkg\nY29sbGVjdGlvbiBpZiBubyBhdHRyaWJ1dGVzPC9kZXNjcmlwdGlvbj48Zm9yUHJvbXB0aW5nPmZh\nbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEudXRpbC5Db2xsZWN0aW9uPC92\nYWx1ZUNsYXNzTmFtZT48bmVzdGVkVHlwZU5hbWU+amF2YS5sYW5nLlN0cmluZzwvbmVzdGVkVHlw\nZU5hbWU+PGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRleHQ+bmV3IEFycmF5TGlzdCgpPC90ZXh0\nPjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+\nTG9nZ2VkSW5Vc2VyQXR0cmlidXRlVmFsdWVzPC9uYW1lPjxkZXNjcmlwdGlvbj48L2Rlc2NyaXB0\naW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2\nYS51dGlsLkNvbGxlY3Rpb248L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9u\nPjx0ZXh0Pm5ldyBBcnJheUxpc3QoKTwvdGV4dD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9w\nYXJhbWV0ZXJzPjwvUGFyYW1ldGVyU2V0Pg\=\= +com.jaspersoft.studio.parametersets=SmFzcGVyc29mdCBTZXJ2ZXIgQnVpbHQgSW4gUGFyYW1ldGVycwpIdHRwIERhdGEgQWRhcHRlcnMg\nQnVpbHQgSW4gUGFyYW1ldGVycwo\= +com.jaspersoft.studio.theme.ui.dark=pageBackground\=0,0,0\ncontainerMarginColor\=0,255,0\ngridColor\=255,255,255\nelementDesignBorderColor\=255,255,0\npageMarginColor\=255,0,0\n +com.jaspersoft.studio.theme.ui.light=pageBackground\=255,255,255\ncontainerMarginColor\=170,168,255\ngridColor\=192,192,192\nelementDesignBorderColor\=0,0,0\npageMarginColor\=170,168,255\n +eclipse.preferences.version=1 +jssbranding_product_mainbundle=com.jaspersoft.studio.rcp +jssbranding_product_name=Jaspersoft Studio Community Edition +jssbranding_product_version=6.17.0.final +net.sf.jasperreports.JRPROPERTIES=com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path\=phantomjs\nnet.sf.jasperreports.web.resource.pattern.customvisualization.scripts\=com/jaspersoft/jasperreports/customvisualization/resources/require/.*\ncom.jaspersoft.jasperreports.components.customvisualization.require.js\=file\\\:/C\\\:/Program Files/TIBCO/Jaspersoft Studio-6.17.0/configuration/org.eclipse.osgi/28/0/.cp/resources/scripts/require-2.1.6.src.js\nnet.sf.jasperreports.compiler.temp.dir\=C\\\:\\\\Program Files\\\\TIBCO\\\\Jaspersoft Studio-6.17.0\nnet.sf.jasperreports.chrome.enabled\=true\nnet.sf.jasperreports.compiler.classpath\=C\\\:\\\\Program Files\\\\TIBCO\\\\Jaspersoft Studio-6.17.0\\\\\\\\plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar\n +net.sf.jasperreports.chrome.enabled=true diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..3f7a08c --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +description.disableLinking=false +eclipse.preferences.version=1 +version=1 diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gef.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gef.prefs new file mode 100644 index 0000000..6de1db9 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gef.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.gef.psize=125 +org.eclipse.gef.pstate=4 diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..5db3127 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..ffc66df --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_VM_XML=\r\n\r\n \r\n \r\n \r\n\r\n diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..579a6fb --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,9 @@ +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.internal.ui.navigator.librariesnode=true +org.eclipse.jdt.ui.formatterprofiles.version=21 +spelling_locale_initialized=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs new file mode 100644 index 0000000..d56c53f --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jsch.core.hasChangedDefaultWin32SshHome=true diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..eabb3a7 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +platformState=1623889939187 +quickStart=false +tipsAndTricks=false diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.navigator.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.navigator.prefs new file mode 100644 index 0000000..f7cb24a --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.navigator.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.ui.navigator.ProjectExplorer.filterActivation=\:org.eclipse.jdt.java.ui.filters.HideEmptyInnerPackages\:org.eclipse.jdt.java.ui.filters.HidePackageDeclaration\:org.eclipse.jdt.java.ui.filters.HideOutputFolder\:org.eclipse.jdt.java.ui.filters.HideInnerClassFiles\:org.eclipse.ui.navigator.resources.filters.startsWithDot\:org.eclipse.jdt.java.ui.filters.HideEmptyLibraryContainers\:org.eclipse.jdt.java.ui.filters.HideImportDeclaration\:org.eclipse.ui.navigator.resources.nested.HideTopLevelProjectIfNested\:org.eclipse.jdt.java.ui.filters.HideSyntheticMembers\:org.eclipse.ui.navigator.resources.nested.HideFolderWhenProjectIsShownAsNested\: diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs new file mode 100644 index 0000000..ea0f4f6 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs @@ -0,0 +1,3 @@ +PROMPT_WHEN_SAVEABLE_STILL_OPEN=false +eclipse.preferences.version=1 +showIntro=false diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..c9b2bc4 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,10 @@ +//org.eclipse.ui.commands/state/com.jaspersoft.studio.editor.context.type/org.eclipse.ui.commands.radioState=project +//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false +eclipse.preferences.version=1 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=255,255,255 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=255,255,255 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=16,16,16 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=255,255,255 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=255,255,255 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_END=240,240,240 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=242,242,242 diff --git a/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs new file mode 100644 index 0000000..1c00496 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +pref_merge_provider=CollabNet Desktop diff --git a/build/classes/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/build/classes/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..4420531 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,2063 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + + + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.search.searchActionSet + + + + noFocus + + View + categoryTag:Jaspersoft Studio + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + + + noFocus + + View + categoryTag:Jaspersoft Studio + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + View + categoryTag:General + + + + + + + + + + View + categoryTag:General + + + View + categoryTag:Help + + + View + categoryTag:Help + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Help + + + + + View + categoryTag:Help + + + + org.eclipse.e4.primaryDataStack + EditorStack + active + + + Editor + removeOnHide + com.jaspersoft.studio.editor.JrxmlEditor + + + + Editor + removeOnHide + com.jaspersoft.studio.editor.JrxmlEditor + active + activeOnClose + + + + + + + + View + categoryTag:Jaspersoft Studio + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + + View + categoryTag:Jaspersoft Studio + + ViewMenu + menuContribution:menu + + + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + Draggable + + + Draggable + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + TrimStack + Draggable + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + removeOnHide + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Help + + + + + View + categoryTag:Help + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:CVS + + + + + View + categoryTag:CVS + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + NoRestore + + + + + View + categoryTag:Git + + + + + View + categoryTag:Ant + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:SVN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.core/2142118396.index b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/2142118396.index new file mode 100644 index 0000000..70965d8 Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/2142118396.index differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..849e68c Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt new file mode 100644 index 0000000..91a1e1f --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -0,0 +1 @@ +INDEX VERSION 1.131+G:\Desktop\Dev\Netbeans\Librography\src\.metadata\.plugins\org.eclipse.jdt.core diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..c22d68a Binary files /dev/null and b/build/classes/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml b/build/classes/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml new file mode 100644 index 0000000..5e5c96b --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml b/build/classes/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml new file mode 100644 index 0000000..1a74285 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/build/classes/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/build/classes/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/build/classes/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..9e390f5 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/build/classes/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/build/classes/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..1c7eda2 --- /dev/null +++ b/build/classes/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/build/classes/MyReports/.classpath b/build/classes/MyReports/.classpath new file mode 100644 index 0000000..8ff54a6 --- /dev/null +++ b/build/classes/MyReports/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/build/classes/MyReports/.project b/build/classes/MyReports/.project new file mode 100644 index 0000000..01875dc --- /dev/null +++ b/build/classes/MyReports/.project @@ -0,0 +1,23 @@ + + + MyReports + + + + + + org.eclipse.jdt.core.javabuilder + + + + + net.sf.jasperreports.builder + + + + + + org.eclipse.jdt.core.javanature + net.sf.jasperreports.nature + + diff --git a/build/classes/MyReports/Blank_A4.jasper b/build/classes/MyReports/Blank_A4.jasper new file mode 100644 index 0000000..24ad8ee Binary files /dev/null and b/build/classes/MyReports/Blank_A4.jasper differ diff --git a/build/classes/MyReports/Blank_A4.jrxml b/build/classes/MyReports/Blank_A4.jrxml new file mode 100644 index 0000000..93d7687 --- /dev/null +++ b/build/classes/MyReports/Blank_A4.jrxml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + <band height="79" splitType="Stretch"/> + + + + + + + + + + + + + + + + + + + + diff --git a/build/classes/MyReports/Cherry.jasper b/build/classes/MyReports/Cherry.jasper new file mode 100644 index 0000000..fa45dc4 Binary files /dev/null and b/build/classes/MyReports/Cherry.jasper differ diff --git a/build/classes/MyReports/Cherry.jrxml b/build/classes/MyReports/Cherry.jrxml new file mode 100644 index 0000000..db323ba --- /dev/null +++ b/build/classes/MyReports/Cherry.jrxml @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="132" splitType="Stretch"> + <image> + <reportElement x="456" y="0" width="99" height="132" uuid="97705585-a0b5-4ec7-86f3-ae10c220e6af"/> + <imageExpression><![CDATA["cherry.jpg"]]></imageExpression> + </image> + <frame> + <reportElement mode="Opaque" x="0" y="0" width="451" height="95" backcolor="#000000" uuid="6c6ca4e1-17cd-4913-93d6-5e670ea9ae8a"/> + <staticText> + <reportElement style="Title" x="0" y="0" width="370" height="66" uuid="a2a2cac8-5a7d-4487-8c54-dab235ce4e21"/> + <textElement> + <font isBold="false"/> + </textElement> + <text><![CDATA[Cherry Title]]></text> + </staticText> + <staticText> + <reportElement style="SubTitle" x="157" y="66" width="249" height="29" uuid="8978eac3-c578-41c9-837e-48d2b0184642"/> + <textElement> + <font size="22" isBold="false"/> + </textElement> + <text><![CDATA[Cherry SubTitle]]></text> + </staticText> + </frame> + <frame> + <reportElement mode="Opaque" x="0" y="100" width="451" height="32" forecolor="#000000" backcolor="#CC0000" uuid="e3c14156-5b51-4201-918b-97fdc012e5d4"/> + <textField pattern="EEEEE dd MMMMM yyyy"> + <reportElement x="307" y="12" width="144" height="20" forecolor="#FFFFFF" uuid="5c3301e7-a737-4c59-8a2f-a6c79fd1adb8"/> + <textElement textAlignment="Right"> + <font size="12"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + </frame> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/classes/MyReports/cherry.jpg b/build/classes/MyReports/cherry.jpg new file mode 100644 index 0000000..9d1aa77 Binary files /dev/null and b/build/classes/MyReports/cherry.jpg differ diff --git a/build/classes/br/com/parg/viacep/CEP.class b/build/classes/br/com/parg/viacep/CEP.class new file mode 100644 index 0000000..c887084 Binary files /dev/null and b/build/classes/br/com/parg/viacep/CEP.class differ diff --git a/build/classes/br/com/parg/viacep/ViaCEP.class b/build/classes/br/com/parg/viacep/ViaCEP.class new file mode 100644 index 0000000..a5301f3 Binary files /dev/null and b/build/classes/br/com/parg/viacep/ViaCEP.class differ diff --git a/build/classes/br/com/parg/viacep/ViaCEPBase.class b/build/classes/br/com/parg/viacep/ViaCEPBase.class new file mode 100644 index 0000000..3293a64 Binary files /dev/null and b/build/classes/br/com/parg/viacep/ViaCEPBase.class differ diff --git a/build/classes/br/com/parg/viacep/ViaCEPEvents.class b/build/classes/br/com/parg/viacep/ViaCEPEvents.class new file mode 100644 index 0000000..3333bc4 Binary files /dev/null and b/build/classes/br/com/parg/viacep/ViaCEPEvents.class differ diff --git a/build/classes/br/com/parg/viacep/ViaCEPException.class b/build/classes/br/com/parg/viacep/ViaCEPException.class new file mode 100644 index 0000000..f3a5a5b Binary files /dev/null and b/build/classes/br/com/parg/viacep/ViaCEPException.class differ diff --git a/build/classes/br/com/projeto/dao/EmprestimoDao.class b/build/classes/br/com/projeto/dao/EmprestimoDao.class new file mode 100644 index 0000000..6b8d8f0 Binary files /dev/null and b/build/classes/br/com/projeto/dao/EmprestimoDao.class differ diff --git a/build/classes/br/com/projeto/dao/FornecedorDao.class b/build/classes/br/com/projeto/dao/FornecedorDao.class new file mode 100644 index 0000000..863225b Binary files /dev/null and b/build/classes/br/com/projeto/dao/FornecedorDao.class differ diff --git a/build/classes/br/com/projeto/dao/FuncionarioDao.class b/build/classes/br/com/projeto/dao/FuncionarioDao.class new file mode 100644 index 0000000..c51ad1f Binary files /dev/null and b/build/classes/br/com/projeto/dao/FuncionarioDao.class differ diff --git a/build/classes/br/com/projeto/dao/LivroDao.class b/build/classes/br/com/projeto/dao/LivroDao.class new file mode 100644 index 0000000..14eb6b6 Binary files /dev/null and b/build/classes/br/com/projeto/dao/LivroDao.class differ diff --git a/build/classes/br/com/projeto/dao/MultaDao.class b/build/classes/br/com/projeto/dao/MultaDao.class new file mode 100644 index 0000000..09cddde Binary files /dev/null and b/build/classes/br/com/projeto/dao/MultaDao.class differ diff --git a/build/classes/br/com/projeto/dao/OptionsDao.class b/build/classes/br/com/projeto/dao/OptionsDao.class new file mode 100644 index 0000000..d547fab Binary files /dev/null and b/build/classes/br/com/projeto/dao/OptionsDao.class differ diff --git a/build/classes/br/com/projeto/dao/ReciboDao.class b/build/classes/br/com/projeto/dao/ReciboDao.class new file mode 100644 index 0000000..6df8c9a Binary files /dev/null and b/build/classes/br/com/projeto/dao/ReciboDao.class differ diff --git a/build/classes/br/com/projeto/dao/UsuarioDao.class b/build/classes/br/com/projeto/dao/UsuarioDao.class new file mode 100644 index 0000000..cde572c Binary files /dev/null and b/build/classes/br/com/projeto/dao/UsuarioDao.class differ diff --git a/build/classes/br/com/projeto/jdbc/ConexaoBanco$1.class b/build/classes/br/com/projeto/jdbc/ConexaoBanco$1.class new file mode 100644 index 0000000..d235adb Binary files /dev/null and b/build/classes/br/com/projeto/jdbc/ConexaoBanco$1.class differ diff --git a/build/classes/br/com/projeto/jdbc/ConexaoBanco.class b/build/classes/br/com/projeto/jdbc/ConexaoBanco.class new file mode 100644 index 0000000..19f2c91 Binary files /dev/null and b/build/classes/br/com/projeto/jdbc/ConexaoBanco.class differ diff --git a/build/classes/br/com/projeto/jdbc/TestarConexao.class b/build/classes/br/com/projeto/jdbc/TestarConexao.class new file mode 100644 index 0000000..6bf8990 Binary files /dev/null and b/build/classes/br/com/projeto/jdbc/TestarConexao.class differ diff --git a/build/classes/br/com/projeto/model/Biblioteca.class b/build/classes/br/com/projeto/model/Biblioteca.class new file mode 100644 index 0000000..1b72d7f Binary files /dev/null and b/build/classes/br/com/projeto/model/Biblioteca.class differ diff --git a/build/classes/br/com/projeto/model/DateRenderer$DateFormatter.class b/build/classes/br/com/projeto/model/DateRenderer$DateFormatter.class new file mode 100644 index 0000000..b25f7d8 Binary files /dev/null and b/build/classes/br/com/projeto/model/DateRenderer$DateFormatter.class differ diff --git a/build/classes/br/com/projeto/model/DateRenderer.class b/build/classes/br/com/projeto/model/DateRenderer.class new file mode 100644 index 0000000..6ebc671 Binary files /dev/null and b/build/classes/br/com/projeto/model/DateRenderer.class differ diff --git a/build/classes/br/com/projeto/model/Emprestimo.class b/build/classes/br/com/projeto/model/Emprestimo.class new file mode 100644 index 0000000..8f39a17 Binary files /dev/null and b/build/classes/br/com/projeto/model/Emprestimo.class differ diff --git a/build/classes/br/com/projeto/model/Fornecedor.class b/build/classes/br/com/projeto/model/Fornecedor.class new file mode 100644 index 0000000..0284191 Binary files /dev/null and b/build/classes/br/com/projeto/model/Fornecedor.class differ diff --git a/build/classes/br/com/projeto/model/Funcionario.class b/build/classes/br/com/projeto/model/Funcionario.class new file mode 100644 index 0000000..cb7faf2 Binary files /dev/null and b/build/classes/br/com/projeto/model/Funcionario.class differ diff --git a/build/classes/br/com/projeto/model/GlobalUser.class b/build/classes/br/com/projeto/model/GlobalUser.class new file mode 100644 index 0000000..afd121c Binary files /dev/null and b/build/classes/br/com/projeto/model/GlobalUser.class differ diff --git a/build/classes/br/com/projeto/model/Insert.class b/build/classes/br/com/projeto/model/Insert.class new file mode 100644 index 0000000..4a4498c Binary files /dev/null and b/build/classes/br/com/projeto/model/Insert.class differ diff --git a/build/classes/br/com/projeto/model/Livro.class b/build/classes/br/com/projeto/model/Livro.class new file mode 100644 index 0000000..44a9cba Binary files /dev/null and b/build/classes/br/com/projeto/model/Livro.class differ diff --git a/build/classes/br/com/projeto/model/Multa.class b/build/classes/br/com/projeto/model/Multa.class new file mode 100644 index 0000000..5341c0a Binary files /dev/null and b/build/classes/br/com/projeto/model/Multa.class differ diff --git a/build/classes/br/com/projeto/model/Options.class b/build/classes/br/com/projeto/model/Options.class new file mode 100644 index 0000000..83ce949 Binary files /dev/null and b/build/classes/br/com/projeto/model/Options.class differ diff --git a/build/classes/br/com/projeto/model/QRCodeGenerator.class b/build/classes/br/com/projeto/model/QRCodeGenerator.class new file mode 100644 index 0000000..d042e2c Binary files /dev/null and b/build/classes/br/com/projeto/model/QRCodeGenerator.class differ diff --git a/build/classes/br/com/projeto/model/Recibo.class b/build/classes/br/com/projeto/model/Recibo.class new file mode 100644 index 0000000..adb7ebf Binary files /dev/null and b/build/classes/br/com/projeto/model/Recibo.class differ diff --git a/build/classes/br/com/projeto/model/Usuario.class b/build/classes/br/com/projeto/model/Usuario.class new file mode 100644 index 0000000..67ba06b Binary files /dev/null and b/build/classes/br/com/projeto/model/Usuario.class differ diff --git a/build/classes/br/com/projeto/model/Utilitarios$DateUtil.class b/build/classes/br/com/projeto/model/Utilitarios$DateUtil.class new file mode 100644 index 0000000..571d8fe Binary files /dev/null and b/build/classes/br/com/projeto/model/Utilitarios$DateUtil.class differ diff --git a/build/classes/br/com/projeto/model/Utilitarios$OS.class b/build/classes/br/com/projeto/model/Utilitarios$OS.class new file mode 100644 index 0000000..f160182 Binary files /dev/null and b/build/classes/br/com/projeto/model/Utilitarios$OS.class differ diff --git a/build/classes/br/com/projeto/model/Utilitarios.class b/build/classes/br/com/projeto/model/Utilitarios.class new file mode 100644 index 0000000..ebc3b22 Binary files /dev/null and b/build/classes/br/com/projeto/model/Utilitarios.class differ diff --git a/build/classes/br/com/projeto/model/XlsxProcess.class b/build/classes/br/com/projeto/model/XlsxProcess.class new file mode 100644 index 0000000..be57f1b Binary files /dev/null and b/build/classes/br/com/projeto/model/XlsxProcess.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao$1.class b/build/classes/br/com/projeto/view/FormCartao$1.class new file mode 100644 index 0000000..2d92a08 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao$1.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao$2.class b/build/classes/br/com/projeto/view/FormCartao$2.class new file mode 100644 index 0000000..331ba0a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao$2.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao$3.class b/build/classes/br/com/projeto/view/FormCartao$3.class new file mode 100644 index 0000000..432345e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao$3.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao$4.class b/build/classes/br/com/projeto/view/FormCartao$4.class new file mode 100644 index 0000000..2722a5c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao$4.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao$5.class b/build/classes/br/com/projeto/view/FormCartao$5.class new file mode 100644 index 0000000..ff3f1b3 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao$5.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao$PrintObject.class b/build/classes/br/com/projeto/view/FormCartao$PrintObject.class new file mode 100644 index 0000000..5291b3a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao$PrintObject.class differ diff --git a/build/classes/br/com/projeto/view/FormCartao.class b/build/classes/br/com/projeto/view/FormCartao.class new file mode 100644 index 0000000..b1f4913 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormCartao.class differ diff --git a/build/classes/br/com/projeto/view/FormDetalhesLivro$1.class b/build/classes/br/com/projeto/view/FormDetalhesLivro$1.class new file mode 100644 index 0000000..3119a66 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormDetalhesLivro$1.class differ diff --git a/build/classes/br/com/projeto/view/FormDetalhesLivro$2.class b/build/classes/br/com/projeto/view/FormDetalhesLivro$2.class new file mode 100644 index 0000000..828a3fd Binary files /dev/null and b/build/classes/br/com/projeto/view/FormDetalhesLivro$2.class differ diff --git a/build/classes/br/com/projeto/view/FormDetalhesLivro$3.class b/build/classes/br/com/projeto/view/FormDetalhesLivro$3.class new file mode 100644 index 0000000..b6fa676 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormDetalhesLivro$3.class differ diff --git a/build/classes/br/com/projeto/view/FormDetalhesLivro.class b/build/classes/br/com/projeto/view/FormDetalhesLivro.class new file mode 100644 index 0000000..b3eca7f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormDetalhesLivro.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$1.class b/build/classes/br/com/projeto/view/FormEmprestimos$1.class new file mode 100644 index 0000000..1b4b3e6 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$1.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$10.class b/build/classes/br/com/projeto/view/FormEmprestimos$10.class new file mode 100644 index 0000000..1db05b6 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$10.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$11.class b/build/classes/br/com/projeto/view/FormEmprestimos$11.class new file mode 100644 index 0000000..59045e3 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$11.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$12.class b/build/classes/br/com/projeto/view/FormEmprestimos$12.class new file mode 100644 index 0000000..79c4c7e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$12.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$13.class b/build/classes/br/com/projeto/view/FormEmprestimos$13.class new file mode 100644 index 0000000..3b46d3e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$13.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$14.class b/build/classes/br/com/projeto/view/FormEmprestimos$14.class new file mode 100644 index 0000000..824fe75 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$14.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$15.class b/build/classes/br/com/projeto/view/FormEmprestimos$15.class new file mode 100644 index 0000000..af947ab Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$15.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$16.class b/build/classes/br/com/projeto/view/FormEmprestimos$16.class new file mode 100644 index 0000000..e2e87b7 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$16.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$17.class b/build/classes/br/com/projeto/view/FormEmprestimos$17.class new file mode 100644 index 0000000..ee16afd Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$17.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$18.class b/build/classes/br/com/projeto/view/FormEmprestimos$18.class new file mode 100644 index 0000000..7d09515 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$18.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$19.class b/build/classes/br/com/projeto/view/FormEmprestimos$19.class new file mode 100644 index 0000000..ce0763d Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$19.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$2.class b/build/classes/br/com/projeto/view/FormEmprestimos$2.class new file mode 100644 index 0000000..5f3edf3 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$2.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$20.class b/build/classes/br/com/projeto/view/FormEmprestimos$20.class new file mode 100644 index 0000000..bcdb378 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$20.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$21.class b/build/classes/br/com/projeto/view/FormEmprestimos$21.class new file mode 100644 index 0000000..2460372 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$21.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$22.class b/build/classes/br/com/projeto/view/FormEmprestimos$22.class new file mode 100644 index 0000000..3639140 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$22.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$23.class b/build/classes/br/com/projeto/view/FormEmprestimos$23.class new file mode 100644 index 0000000..b4466f2 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$23.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$24.class b/build/classes/br/com/projeto/view/FormEmprestimos$24.class new file mode 100644 index 0000000..825be98 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$24.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$25.class b/build/classes/br/com/projeto/view/FormEmprestimos$25.class new file mode 100644 index 0000000..8843479 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$25.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$26.class b/build/classes/br/com/projeto/view/FormEmprestimos$26.class new file mode 100644 index 0000000..9fd1d79 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$26.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$27.class b/build/classes/br/com/projeto/view/FormEmprestimos$27.class new file mode 100644 index 0000000..8a2f111 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$27.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$28.class b/build/classes/br/com/projeto/view/FormEmprestimos$28.class new file mode 100644 index 0000000..e02696b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$28.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$29.class b/build/classes/br/com/projeto/view/FormEmprestimos$29.class new file mode 100644 index 0000000..97ee8db Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$29.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$3.class b/build/classes/br/com/projeto/view/FormEmprestimos$3.class new file mode 100644 index 0000000..a70ffee Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$3.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$30.class b/build/classes/br/com/projeto/view/FormEmprestimos$30.class new file mode 100644 index 0000000..1b93b8d Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$30.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$31.class b/build/classes/br/com/projeto/view/FormEmprestimos$31.class new file mode 100644 index 0000000..86e377d Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$31.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$32.class b/build/classes/br/com/projeto/view/FormEmprestimos$32.class new file mode 100644 index 0000000..0ca2a30 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$32.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$33.class b/build/classes/br/com/projeto/view/FormEmprestimos$33.class new file mode 100644 index 0000000..5628dca Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$33.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$34.class b/build/classes/br/com/projeto/view/FormEmprestimos$34.class new file mode 100644 index 0000000..39477fb Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$34.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$35.class b/build/classes/br/com/projeto/view/FormEmprestimos$35.class new file mode 100644 index 0000000..c53ac9d Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$35.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$36.class b/build/classes/br/com/projeto/view/FormEmprestimos$36.class new file mode 100644 index 0000000..7057801 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$36.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$37.class b/build/classes/br/com/projeto/view/FormEmprestimos$37.class new file mode 100644 index 0000000..0f48e7e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$37.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$38.class b/build/classes/br/com/projeto/view/FormEmprestimos$38.class new file mode 100644 index 0000000..33f5ca8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$38.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$39.class b/build/classes/br/com/projeto/view/FormEmprestimos$39.class new file mode 100644 index 0000000..879c781 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$39.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$4.class b/build/classes/br/com/projeto/view/FormEmprestimos$4.class new file mode 100644 index 0000000..0582209 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$4.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$40.class b/build/classes/br/com/projeto/view/FormEmprestimos$40.class new file mode 100644 index 0000000..21757f2 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$40.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$41.class b/build/classes/br/com/projeto/view/FormEmprestimos$41.class new file mode 100644 index 0000000..dfebeed Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$41.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$42.class b/build/classes/br/com/projeto/view/FormEmprestimos$42.class new file mode 100644 index 0000000..ade7f8e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$42.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$43.class b/build/classes/br/com/projeto/view/FormEmprestimos$43.class new file mode 100644 index 0000000..c3dbb2f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$43.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$44.class b/build/classes/br/com/projeto/view/FormEmprestimos$44.class new file mode 100644 index 0000000..88d4114 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$44.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$45.class b/build/classes/br/com/projeto/view/FormEmprestimos$45.class new file mode 100644 index 0000000..fafa202 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$45.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$5.class b/build/classes/br/com/projeto/view/FormEmprestimos$5.class new file mode 100644 index 0000000..3c234cb Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$5.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$6.class b/build/classes/br/com/projeto/view/FormEmprestimos$6.class new file mode 100644 index 0000000..b412196 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$6.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$7.class b/build/classes/br/com/projeto/view/FormEmprestimos$7.class new file mode 100644 index 0000000..85cfee8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$7.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$8.class b/build/classes/br/com/projeto/view/FormEmprestimos$8.class new file mode 100644 index 0000000..391611f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$8.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos$9.class b/build/classes/br/com/projeto/view/FormEmprestimos$9.class new file mode 100644 index 0000000..1267366 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos$9.class differ diff --git a/build/classes/br/com/projeto/view/FormEmprestimos.class b/build/classes/br/com/projeto/view/FormEmprestimos.class new file mode 100644 index 0000000..4813749 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormEmprestimos.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$1.class b/build/classes/br/com/projeto/view/FormFornecedores$1.class new file mode 100644 index 0000000..691b08d Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$1.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$10.class b/build/classes/br/com/projeto/view/FormFornecedores$10.class new file mode 100644 index 0000000..6ebd376 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$10.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$11.class b/build/classes/br/com/projeto/view/FormFornecedores$11.class new file mode 100644 index 0000000..3b3ab5a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$11.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$12.class b/build/classes/br/com/projeto/view/FormFornecedores$12.class new file mode 100644 index 0000000..e2c94f1 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$12.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$13.class b/build/classes/br/com/projeto/view/FormFornecedores$13.class new file mode 100644 index 0000000..c8ed070 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$13.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$14.class b/build/classes/br/com/projeto/view/FormFornecedores$14.class new file mode 100644 index 0000000..c86659a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$14.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$15.class b/build/classes/br/com/projeto/view/FormFornecedores$15.class new file mode 100644 index 0000000..b975f15 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$15.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$2.class b/build/classes/br/com/projeto/view/FormFornecedores$2.class new file mode 100644 index 0000000..b0d1de8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$2.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$3.class b/build/classes/br/com/projeto/view/FormFornecedores$3.class new file mode 100644 index 0000000..d67360b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$3.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$4.class b/build/classes/br/com/projeto/view/FormFornecedores$4.class new file mode 100644 index 0000000..f886fd0 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$4.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$5.class b/build/classes/br/com/projeto/view/FormFornecedores$5.class new file mode 100644 index 0000000..7a8ba2d Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$5.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$6.class b/build/classes/br/com/projeto/view/FormFornecedores$6.class new file mode 100644 index 0000000..02d2545 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$6.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$7.class b/build/classes/br/com/projeto/view/FormFornecedores$7.class new file mode 100644 index 0000000..10898aa Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$7.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$8.class b/build/classes/br/com/projeto/view/FormFornecedores$8.class new file mode 100644 index 0000000..96e0768 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$8.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores$9.class b/build/classes/br/com/projeto/view/FormFornecedores$9.class new file mode 100644 index 0000000..d3b90be Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores$9.class differ diff --git a/build/classes/br/com/projeto/view/FormFornecedores.class b/build/classes/br/com/projeto/view/FormFornecedores.class new file mode 100644 index 0000000..82baee4 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFornecedores.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$1.class b/build/classes/br/com/projeto/view/FormFuncionarios$1.class new file mode 100644 index 0000000..3448dad Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$1.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$10.class b/build/classes/br/com/projeto/view/FormFuncionarios$10.class new file mode 100644 index 0000000..64011ff Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$10.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$11.class b/build/classes/br/com/projeto/view/FormFuncionarios$11.class new file mode 100644 index 0000000..69170c1 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$11.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$12.class b/build/classes/br/com/projeto/view/FormFuncionarios$12.class new file mode 100644 index 0000000..7ac96fc Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$12.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$13.class b/build/classes/br/com/projeto/view/FormFuncionarios$13.class new file mode 100644 index 0000000..07e2eb7 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$13.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$14.class b/build/classes/br/com/projeto/view/FormFuncionarios$14.class new file mode 100644 index 0000000..34f71f1 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$14.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$15.class b/build/classes/br/com/projeto/view/FormFuncionarios$15.class new file mode 100644 index 0000000..79def53 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$15.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$16.class b/build/classes/br/com/projeto/view/FormFuncionarios$16.class new file mode 100644 index 0000000..71e4d45 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$16.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$2.class b/build/classes/br/com/projeto/view/FormFuncionarios$2.class new file mode 100644 index 0000000..927a719 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$2.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$3.class b/build/classes/br/com/projeto/view/FormFuncionarios$3.class new file mode 100644 index 0000000..535c47a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$3.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$4.class b/build/classes/br/com/projeto/view/FormFuncionarios$4.class new file mode 100644 index 0000000..13c4d4c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$4.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$5.class b/build/classes/br/com/projeto/view/FormFuncionarios$5.class new file mode 100644 index 0000000..f2c2648 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$5.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$6.class b/build/classes/br/com/projeto/view/FormFuncionarios$6.class new file mode 100644 index 0000000..48419ef Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$6.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$7.class b/build/classes/br/com/projeto/view/FormFuncionarios$7.class new file mode 100644 index 0000000..1764791 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$7.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$8.class b/build/classes/br/com/projeto/view/FormFuncionarios$8.class new file mode 100644 index 0000000..cf8ca79 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$8.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios$9.class b/build/classes/br/com/projeto/view/FormFuncionarios$9.class new file mode 100644 index 0000000..17cc634 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios$9.class differ diff --git a/build/classes/br/com/projeto/view/FormFuncionarios.class b/build/classes/br/com/projeto/view/FormFuncionarios.class new file mode 100644 index 0000000..2317afe Binary files /dev/null and b/build/classes/br/com/projeto/view/FormFuncionarios.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$1.class b/build/classes/br/com/projeto/view/FormLeitor$1.class new file mode 100644 index 0000000..8a12067 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$1.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$10.class b/build/classes/br/com/projeto/view/FormLeitor$10.class new file mode 100644 index 0000000..b481d63 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$10.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$11.class b/build/classes/br/com/projeto/view/FormLeitor$11.class new file mode 100644 index 0000000..3ddc3ef Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$11.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$12.class b/build/classes/br/com/projeto/view/FormLeitor$12.class new file mode 100644 index 0000000..1a5d0ae Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$12.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$13.class b/build/classes/br/com/projeto/view/FormLeitor$13.class new file mode 100644 index 0000000..4fcc781 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$13.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$14.class b/build/classes/br/com/projeto/view/FormLeitor$14.class new file mode 100644 index 0000000..0d7cf38 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$14.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$15.class b/build/classes/br/com/projeto/view/FormLeitor$15.class new file mode 100644 index 0000000..e09c470 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$15.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$16.class b/build/classes/br/com/projeto/view/FormLeitor$16.class new file mode 100644 index 0000000..7d28d71 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$16.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$17.class b/build/classes/br/com/projeto/view/FormLeitor$17.class new file mode 100644 index 0000000..60c0071 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$17.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$18.class b/build/classes/br/com/projeto/view/FormLeitor$18.class new file mode 100644 index 0000000..9af0dce Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$18.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$19.class b/build/classes/br/com/projeto/view/FormLeitor$19.class new file mode 100644 index 0000000..9f4eb1b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$19.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$2.class b/build/classes/br/com/projeto/view/FormLeitor$2.class new file mode 100644 index 0000000..11c46b7 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$2.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$20.class b/build/classes/br/com/projeto/view/FormLeitor$20.class new file mode 100644 index 0000000..cb76ed5 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$20.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$21.class b/build/classes/br/com/projeto/view/FormLeitor$21.class new file mode 100644 index 0000000..63cbe55 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$21.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$22.class b/build/classes/br/com/projeto/view/FormLeitor$22.class new file mode 100644 index 0000000..007bf27 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$22.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$23.class b/build/classes/br/com/projeto/view/FormLeitor$23.class new file mode 100644 index 0000000..0ffb848 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$23.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$3.class b/build/classes/br/com/projeto/view/FormLeitor$3.class new file mode 100644 index 0000000..02b4ead Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$3.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$4.class b/build/classes/br/com/projeto/view/FormLeitor$4.class new file mode 100644 index 0000000..4059e18 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$4.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$5.class b/build/classes/br/com/projeto/view/FormLeitor$5.class new file mode 100644 index 0000000..00cd96c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$5.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$6.class b/build/classes/br/com/projeto/view/FormLeitor$6.class new file mode 100644 index 0000000..f454ad9 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$6.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$7.class b/build/classes/br/com/projeto/view/FormLeitor$7.class new file mode 100644 index 0000000..6b0a201 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$7.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$8.class b/build/classes/br/com/projeto/view/FormLeitor$8.class new file mode 100644 index 0000000..a206316 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$8.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor$9.class b/build/classes/br/com/projeto/view/FormLeitor$9.class new file mode 100644 index 0000000..20dec59 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor$9.class differ diff --git a/build/classes/br/com/projeto/view/FormLeitor.class b/build/classes/br/com/projeto/view/FormLeitor.class new file mode 100644 index 0000000..b29172f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLeitor.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$1.class b/build/classes/br/com/projeto/view/FormLivros$1.class new file mode 100644 index 0000000..6e62551 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$1.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$10.class b/build/classes/br/com/projeto/view/FormLivros$10.class new file mode 100644 index 0000000..9e4b283 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$10.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$11.class b/build/classes/br/com/projeto/view/FormLivros$11.class new file mode 100644 index 0000000..e6de1bb Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$11.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$12.class b/build/classes/br/com/projeto/view/FormLivros$12.class new file mode 100644 index 0000000..81dd224 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$12.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$13.class b/build/classes/br/com/projeto/view/FormLivros$13.class new file mode 100644 index 0000000..23c5852 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$13.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$14.class b/build/classes/br/com/projeto/view/FormLivros$14.class new file mode 100644 index 0000000..4693025 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$14.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$15.class b/build/classes/br/com/projeto/view/FormLivros$15.class new file mode 100644 index 0000000..93a89ad Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$15.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$16.class b/build/classes/br/com/projeto/view/FormLivros$16.class new file mode 100644 index 0000000..11df144 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$16.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$17.class b/build/classes/br/com/projeto/view/FormLivros$17.class new file mode 100644 index 0000000..a423632 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$17.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$18.class b/build/classes/br/com/projeto/view/FormLivros$18.class new file mode 100644 index 0000000..2b0a5cf Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$18.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$19.class b/build/classes/br/com/projeto/view/FormLivros$19.class new file mode 100644 index 0000000..c998378 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$19.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$2.class b/build/classes/br/com/projeto/view/FormLivros$2.class new file mode 100644 index 0000000..ca9fc54 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$2.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$20.class b/build/classes/br/com/projeto/view/FormLivros$20.class new file mode 100644 index 0000000..73fb5b9 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$20.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$21.class b/build/classes/br/com/projeto/view/FormLivros$21.class new file mode 100644 index 0000000..08ea1e9 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$21.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$22.class b/build/classes/br/com/projeto/view/FormLivros$22.class new file mode 100644 index 0000000..df6e30e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$22.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$23.class b/build/classes/br/com/projeto/view/FormLivros$23.class new file mode 100644 index 0000000..53272dc Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$23.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$24.class b/build/classes/br/com/projeto/view/FormLivros$24.class new file mode 100644 index 0000000..d6173e5 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$24.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$25.class b/build/classes/br/com/projeto/view/FormLivros$25.class new file mode 100644 index 0000000..c8c431c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$25.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$26.class b/build/classes/br/com/projeto/view/FormLivros$26.class new file mode 100644 index 0000000..4e44a2b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$26.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$27.class b/build/classes/br/com/projeto/view/FormLivros$27.class new file mode 100644 index 0000000..a67aafc Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$27.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$3.class b/build/classes/br/com/projeto/view/FormLivros$3.class new file mode 100644 index 0000000..7af0484 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$3.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$4.class b/build/classes/br/com/projeto/view/FormLivros$4.class new file mode 100644 index 0000000..7a5502b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$4.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$5.class b/build/classes/br/com/projeto/view/FormLivros$5.class new file mode 100644 index 0000000..f50bba7 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$5.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$6.class b/build/classes/br/com/projeto/view/FormLivros$6.class new file mode 100644 index 0000000..6b4238c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$6.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$7.class b/build/classes/br/com/projeto/view/FormLivros$7.class new file mode 100644 index 0000000..7662d3c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$7.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$8.class b/build/classes/br/com/projeto/view/FormLivros$8.class new file mode 100644 index 0000000..a367c18 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$8.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros$9.class b/build/classes/br/com/projeto/view/FormLivros$9.class new file mode 100644 index 0000000..be57f49 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros$9.class differ diff --git a/build/classes/br/com/projeto/view/FormLivros.class b/build/classes/br/com/projeto/view/FormLivros.class new file mode 100644 index 0000000..f272cde Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLivros.class differ diff --git a/build/classes/br/com/projeto/view/FormLogin$1.class b/build/classes/br/com/projeto/view/FormLogin$1.class new file mode 100644 index 0000000..5e55692 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLogin$1.class differ diff --git a/build/classes/br/com/projeto/view/FormLogin$2.class b/build/classes/br/com/projeto/view/FormLogin$2.class new file mode 100644 index 0000000..feab359 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLogin$2.class differ diff --git a/build/classes/br/com/projeto/view/FormLogin$3.class b/build/classes/br/com/projeto/view/FormLogin$3.class new file mode 100644 index 0000000..d942c63 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLogin$3.class differ diff --git a/build/classes/br/com/projeto/view/FormLogin.class b/build/classes/br/com/projeto/view/FormLogin.class new file mode 100644 index 0000000..b01a28a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormLogin.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$1.class b/build/classes/br/com/projeto/view/FormMenu$1.class new file mode 100644 index 0000000..c996267 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$1.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$10.class b/build/classes/br/com/projeto/view/FormMenu$10.class new file mode 100644 index 0000000..da06d25 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$10.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$2.class b/build/classes/br/com/projeto/view/FormMenu$2.class new file mode 100644 index 0000000..b803be8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$2.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$3.class b/build/classes/br/com/projeto/view/FormMenu$3.class new file mode 100644 index 0000000..d08a53f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$3.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$4.class b/build/classes/br/com/projeto/view/FormMenu$4.class new file mode 100644 index 0000000..554bed9 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$4.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$5.class b/build/classes/br/com/projeto/view/FormMenu$5.class new file mode 100644 index 0000000..f57b9ba Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$5.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$6.class b/build/classes/br/com/projeto/view/FormMenu$6.class new file mode 100644 index 0000000..d508bd4 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$6.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$7.class b/build/classes/br/com/projeto/view/FormMenu$7.class new file mode 100644 index 0000000..7b13bd1 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$7.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$8.class b/build/classes/br/com/projeto/view/FormMenu$8.class new file mode 100644 index 0000000..a459de8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$8.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu$9.class b/build/classes/br/com/projeto/view/FormMenu$9.class new file mode 100644 index 0000000..0130169 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu$9.class differ diff --git a/build/classes/br/com/projeto/view/FormMenu.class b/build/classes/br/com/projeto/view/FormMenu.class new file mode 100644 index 0000000..cce8b11 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenu.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$1.class b/build/classes/br/com/projeto/view/FormMenuAtendente$1.class new file mode 100644 index 0000000..4bb06db Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$1.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$2.class b/build/classes/br/com/projeto/view/FormMenuAtendente$2.class new file mode 100644 index 0000000..1c52060 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$2.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$3.class b/build/classes/br/com/projeto/view/FormMenuAtendente$3.class new file mode 100644 index 0000000..ac55c31 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$3.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$4.class b/build/classes/br/com/projeto/view/FormMenuAtendente$4.class new file mode 100644 index 0000000..2ce8aa6 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$4.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$5.class b/build/classes/br/com/projeto/view/FormMenuAtendente$5.class new file mode 100644 index 0000000..e360ecd Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$5.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$6.class b/build/classes/br/com/projeto/view/FormMenuAtendente$6.class new file mode 100644 index 0000000..34ba667 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$6.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente$7.class b/build/classes/br/com/projeto/view/FormMenuAtendente$7.class new file mode 100644 index 0000000..63f175f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente$7.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuAtendente.class b/build/classes/br/com/projeto/view/FormMenuAtendente.class new file mode 100644 index 0000000..2a38aa8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuAtendente.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$1.class b/build/classes/br/com/projeto/view/FormMenuUsuario$1.class new file mode 100644 index 0000000..8681984 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$1.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$10.class b/build/classes/br/com/projeto/view/FormMenuUsuario$10.class new file mode 100644 index 0000000..42e6e40 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$10.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$2.class b/build/classes/br/com/projeto/view/FormMenuUsuario$2.class new file mode 100644 index 0000000..55eef04 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$2.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$3.class b/build/classes/br/com/projeto/view/FormMenuUsuario$3.class new file mode 100644 index 0000000..1e013eb Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$3.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$4.class b/build/classes/br/com/projeto/view/FormMenuUsuario$4.class new file mode 100644 index 0000000..4b3a957 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$4.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$5.class b/build/classes/br/com/projeto/view/FormMenuUsuario$5.class new file mode 100644 index 0000000..34564c2 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$5.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$6.class b/build/classes/br/com/projeto/view/FormMenuUsuario$6.class new file mode 100644 index 0000000..2d46455 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$6.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$7.class b/build/classes/br/com/projeto/view/FormMenuUsuario$7.class new file mode 100644 index 0000000..75116bb Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$7.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$8.class b/build/classes/br/com/projeto/view/FormMenuUsuario$8.class new file mode 100644 index 0000000..6c0d8a5 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$8.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario$9.class b/build/classes/br/com/projeto/view/FormMenuUsuario$9.class new file mode 100644 index 0000000..e518b1e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario$9.class differ diff --git a/build/classes/br/com/projeto/view/FormMenuUsuario.class b/build/classes/br/com/projeto/view/FormMenuUsuario.class new file mode 100644 index 0000000..cc56ef5 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMenuUsuario.class differ diff --git a/build/classes/br/com/projeto/view/FormMulta$1.class b/build/classes/br/com/projeto/view/FormMulta$1.class new file mode 100644 index 0000000..4348823 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMulta$1.class differ diff --git a/build/classes/br/com/projeto/view/FormMulta$2.class b/build/classes/br/com/projeto/view/FormMulta$2.class new file mode 100644 index 0000000..cbc21a8 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMulta$2.class differ diff --git a/build/classes/br/com/projeto/view/FormMulta$3.class b/build/classes/br/com/projeto/view/FormMulta$3.class new file mode 100644 index 0000000..cea1795 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMulta$3.class differ diff --git a/build/classes/br/com/projeto/view/FormMulta$4.class b/build/classes/br/com/projeto/view/FormMulta$4.class new file mode 100644 index 0000000..927b8b4 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMulta$4.class differ diff --git a/build/classes/br/com/projeto/view/FormMulta$5.class b/build/classes/br/com/projeto/view/FormMulta$5.class new file mode 100644 index 0000000..9c95ad9 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMulta$5.class differ diff --git a/build/classes/br/com/projeto/view/FormMulta.class b/build/classes/br/com/projeto/view/FormMulta.class new file mode 100644 index 0000000..27209a7 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormMulta.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$1.class b/build/classes/br/com/projeto/view/FormOptions$1.class new file mode 100644 index 0000000..395d82e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$1.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$10.class b/build/classes/br/com/projeto/view/FormOptions$10.class new file mode 100644 index 0000000..15d2e1f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$10.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$11.class b/build/classes/br/com/projeto/view/FormOptions$11.class new file mode 100644 index 0000000..5839917 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$11.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$12.class b/build/classes/br/com/projeto/view/FormOptions$12.class new file mode 100644 index 0000000..6ed9a82 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$12.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$13.class b/build/classes/br/com/projeto/view/FormOptions$13.class new file mode 100644 index 0000000..0d4fdee Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$13.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$14.class b/build/classes/br/com/projeto/view/FormOptions$14.class new file mode 100644 index 0000000..0294c79 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$14.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$15.class b/build/classes/br/com/projeto/view/FormOptions$15.class new file mode 100644 index 0000000..9fed39b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$15.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$16.class b/build/classes/br/com/projeto/view/FormOptions$16.class new file mode 100644 index 0000000..58efc74 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$16.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$17.class b/build/classes/br/com/projeto/view/FormOptions$17.class new file mode 100644 index 0000000..324d21c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$17.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$18.class b/build/classes/br/com/projeto/view/FormOptions$18.class new file mode 100644 index 0000000..b0a18f4 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$18.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$19.class b/build/classes/br/com/projeto/view/FormOptions$19.class new file mode 100644 index 0000000..85f8127 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$19.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$2.class b/build/classes/br/com/projeto/view/FormOptions$2.class new file mode 100644 index 0000000..a9c08f6 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$2.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$20.class b/build/classes/br/com/projeto/view/FormOptions$20.class new file mode 100644 index 0000000..67ce93b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$20.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$21.class b/build/classes/br/com/projeto/view/FormOptions$21.class new file mode 100644 index 0000000..5176254 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$21.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$22.class b/build/classes/br/com/projeto/view/FormOptions$22.class new file mode 100644 index 0000000..dfeb375 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$22.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$23.class b/build/classes/br/com/projeto/view/FormOptions$23.class new file mode 100644 index 0000000..e20a72a Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$23.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$24.class b/build/classes/br/com/projeto/view/FormOptions$24.class new file mode 100644 index 0000000..264ac5f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$24.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$25.class b/build/classes/br/com/projeto/view/FormOptions$25.class new file mode 100644 index 0000000..ff99498 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$25.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$26.class b/build/classes/br/com/projeto/view/FormOptions$26.class new file mode 100644 index 0000000..67069cd Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$26.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$27.class b/build/classes/br/com/projeto/view/FormOptions$27.class new file mode 100644 index 0000000..659e54f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$27.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$28.class b/build/classes/br/com/projeto/view/FormOptions$28.class new file mode 100644 index 0000000..c937f0c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$28.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$29.class b/build/classes/br/com/projeto/view/FormOptions$29.class new file mode 100644 index 0000000..e9b8715 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$29.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$3.class b/build/classes/br/com/projeto/view/FormOptions$3.class new file mode 100644 index 0000000..2e09128 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$3.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$30.class b/build/classes/br/com/projeto/view/FormOptions$30.class new file mode 100644 index 0000000..27122d5 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$30.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$31.class b/build/classes/br/com/projeto/view/FormOptions$31.class new file mode 100644 index 0000000..6e6a9d1 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$31.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$32.class b/build/classes/br/com/projeto/view/FormOptions$32.class new file mode 100644 index 0000000..0e1d583 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$32.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$33.class b/build/classes/br/com/projeto/view/FormOptions$33.class new file mode 100644 index 0000000..5f2f76b Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$33.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$34.class b/build/classes/br/com/projeto/view/FormOptions$34.class new file mode 100644 index 0000000..f5ad57f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$34.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$35.class b/build/classes/br/com/projeto/view/FormOptions$35.class new file mode 100644 index 0000000..b89307e Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$35.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$36.class b/build/classes/br/com/projeto/view/FormOptions$36.class new file mode 100644 index 0000000..bc3c242 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$36.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$37.class b/build/classes/br/com/projeto/view/FormOptions$37.class new file mode 100644 index 0000000..80c8a03 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$37.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$38.class b/build/classes/br/com/projeto/view/FormOptions$38.class new file mode 100644 index 0000000..b137faa Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$38.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$4.class b/build/classes/br/com/projeto/view/FormOptions$4.class new file mode 100644 index 0000000..26fb20c Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$4.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$5.class b/build/classes/br/com/projeto/view/FormOptions$5.class new file mode 100644 index 0000000..9d7a206 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$5.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$6.class b/build/classes/br/com/projeto/view/FormOptions$6.class new file mode 100644 index 0000000..638fa9f Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$6.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$7.class b/build/classes/br/com/projeto/view/FormOptions$7.class new file mode 100644 index 0000000..7fb70d3 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$7.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$8.class b/build/classes/br/com/projeto/view/FormOptions$8.class new file mode 100644 index 0000000..53b2c35 Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$8.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions$9.class b/build/classes/br/com/projeto/view/FormOptions$9.class new file mode 100644 index 0000000..3cff1bb Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions$9.class differ diff --git a/build/classes/br/com/projeto/view/FormOptions.class b/build/classes/br/com/projeto/view/FormOptions.class new file mode 100644 index 0000000..e7efecd Binary files /dev/null and b/build/classes/br/com/projeto/view/FormOptions.class differ diff --git a/build/classes/imagens/book_cover.png b/build/classes/imagens/book_cover.png new file mode 100644 index 0000000..8c2ce13 Binary files /dev/null and b/build/classes/imagens/book_cover.png differ diff --git a/build/classes/imagens/bookloc.png b/build/classes/imagens/bookloc.png new file mode 100644 index 0000000..0d7bb9d Binary files /dev/null and b/build/classes/imagens/bookloc.png differ diff --git a/build/classes/imagens/books_small.png b/build/classes/imagens/books_small.png new file mode 100644 index 0000000..031563a Binary files /dev/null and b/build/classes/imagens/books_small.png differ diff --git a/build/classes/imagens/boook.png b/build/classes/imagens/boook.png new file mode 100644 index 0000000..1be3b6a Binary files /dev/null and b/build/classes/imagens/boook.png differ diff --git a/build/classes/imagens/cancel_small.png b/build/classes/imagens/cancel_small.png new file mode 100644 index 0000000..9a0623f Binary files /dev/null and b/build/classes/imagens/cancel_small.png differ diff --git a/build/classes/imagens/cardBackground.jpg b/build/classes/imagens/cardBackground.jpg new file mode 100644 index 0000000..f222622 Binary files /dev/null and b/build/classes/imagens/cardBackground.jpg differ diff --git a/build/classes/imagens/config.png b/build/classes/imagens/config.png new file mode 100644 index 0000000..090a82c Binary files /dev/null and b/build/classes/imagens/config.png differ diff --git a/build/classes/imagens/delete_small.png b/build/classes/imagens/delete_small.png new file mode 100644 index 0000000..37d8835 Binary files /dev/null and b/build/classes/imagens/delete_small.png differ diff --git a/build/classes/imagens/edit_small.png b/build/classes/imagens/edit_small.png new file mode 100644 index 0000000..404d968 Binary files /dev/null and b/build/classes/imagens/edit_small.png differ diff --git a/build/classes/imagens/funcionario.png b/build/classes/imagens/funcionario.png new file mode 100644 index 0000000..5bac88f Binary files /dev/null and b/build/classes/imagens/funcionario.png differ diff --git a/build/classes/imagens/iconfinder_20_Graduation_2064495.png b/build/classes/imagens/iconfinder_20_Graduation_2064495.png new file mode 100644 index 0000000..a8f223d Binary files /dev/null and b/build/classes/imagens/iconfinder_20_Graduation_2064495.png differ diff --git a/build/classes/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png b/build/classes/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png new file mode 100644 index 0000000..66bd80d Binary files /dev/null and b/build/classes/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png differ diff --git a/build/classes/imagens/iconfinder_General_Office_01_3592874 (1).png b/build/classes/imagens/iconfinder_General_Office_01_3592874 (1).png new file mode 100644 index 0000000..8f60cff Binary files /dev/null and b/build/classes/imagens/iconfinder_General_Office_01_3592874 (1).png differ diff --git a/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (1).png b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (1).png new file mode 100644 index 0000000..7c36dca Binary files /dev/null and b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (1).png differ diff --git a/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (2).png b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (2).png new file mode 100644 index 0000000..11f22f6 Binary files /dev/null and b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (2).png differ diff --git a/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (3).png b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (3).png new file mode 100644 index 0000000..be4ac34 Binary files /dev/null and b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (3).png differ diff --git a/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082.png b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082.png new file mode 100644 index 0000000..5a82d65 Binary files /dev/null and b/build/classes/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082.png differ diff --git a/build/classes/imagens/iconfinder_Learner_pupil_reader_scholar_student_4763273.png b/build/classes/imagens/iconfinder_Learner_pupil_reader_scholar_student_4763273.png new file mode 100644 index 0000000..b8d3012 Binary files /dev/null and b/build/classes/imagens/iconfinder_Learner_pupil_reader_scholar_student_4763273.png differ diff --git a/build/classes/imagens/iconfinder_education-school-learn-study-04_2125342.png b/build/classes/imagens/iconfinder_education-school-learn-study-04_2125342.png new file mode 100644 index 0000000..5348b21 Binary files /dev/null and b/build/classes/imagens/iconfinder_education-school-learn-study-04_2125342.png differ diff --git a/build/classes/imagens/iconfinder_student_309036 (1).png b/build/classes/imagens/iconfinder_student_309036 (1).png new file mode 100644 index 0000000..b9660d1 Binary files /dev/null and b/build/classes/imagens/iconfinder_student_309036 (1).png differ diff --git a/build/classes/imagens/iconfinder_student_309036 (2).png b/build/classes/imagens/iconfinder_student_309036 (2).png new file mode 100644 index 0000000..25ae44b Binary files /dev/null and b/build/classes/imagens/iconfinder_student_309036 (2).png differ diff --git a/build/classes/imagens/iconfinder_student_309036.png b/build/classes/imagens/iconfinder_student_309036.png new file mode 100644 index 0000000..fc063be Binary files /dev/null and b/build/classes/imagens/iconfinder_student_309036.png differ diff --git a/build/classes/imagens/iconfinder_user_student_black_93426.png b/build/classes/imagens/iconfinder_user_student_black_93426.png new file mode 100644 index 0000000..74abafa Binary files /dev/null and b/build/classes/imagens/iconfinder_user_student_black_93426.png differ diff --git a/build/classes/imagens/leitor.png b/build/classes/imagens/leitor.png new file mode 100644 index 0000000..48b1f22 Binary files /dev/null and b/build/classes/imagens/leitor.png differ diff --git a/build/classes/imagens/new_file_small.png b/build/classes/imagens/new_file_small.png new file mode 100644 index 0000000..a7fea00 Binary files /dev/null and b/build/classes/imagens/new_file_small.png differ diff --git a/build/classes/imagens/pass-small.png b/build/classes/imagens/pass-small.png new file mode 100644 index 0000000..eb61d3b Binary files /dev/null and b/build/classes/imagens/pass-small.png differ diff --git a/build/classes/imagens/print_small.png b/build/classes/imagens/print_small.png new file mode 100644 index 0000000..3cfffe1 Binary files /dev/null and b/build/classes/imagens/print_small.png differ diff --git a/build/classes/imagens/provider.png b/build/classes/imagens/provider.png new file mode 100644 index 0000000..586ee28 Binary files /dev/null and b/build/classes/imagens/provider.png differ diff --git a/build/classes/imagens/right_small.png b/build/classes/imagens/right_small.png new file mode 100644 index 0000000..47adffa Binary files /dev/null and b/build/classes/imagens/right_small.png differ diff --git a/build/classes/imagens/save_small.png b/build/classes/imagens/save_small.png new file mode 100644 index 0000000..c498cec Binary files /dev/null and b/build/classes/imagens/save_small.png differ diff --git a/build/classes/imagens/settings_small.png b/build/classes/imagens/settings_small.png new file mode 100644 index 0000000..9871b2c Binary files /dev/null and b/build/classes/imagens/settings_small.png differ diff --git a/build/classes/imagens/update_small.png b/build/classes/imagens/update_small.png new file mode 100644 index 0000000..364e41b Binary files /dev/null and b/build/classes/imagens/update_small.png differ diff --git a/build/classes/imagens/userPass_small.png b/build/classes/imagens/userPass_small.png new file mode 100644 index 0000000..6cef08c Binary files /dev/null and b/build/classes/imagens/userPass_small.png differ diff --git a/build/classes/imagens/user_small.png b/build/classes/imagens/user_small.png new file mode 100644 index 0000000..8458f15 Binary files /dev/null and b/build/classes/imagens/user_small.png differ diff --git a/dist/Librography.jar b/dist/Librography.jar new file mode 100644 index 0000000..6d81d24 Binary files /dev/null and b/dist/Librography.jar differ diff --git a/dist/README.TXT b/dist/README.TXT new file mode 100644 index 0000000..bcaca3c --- /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 "Librography.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..ee023b6 Binary files /dev/null and b/dist/lib/AbsoluteLayout.jar differ diff --git a/dist/lib/caelum-stella-core-2.1.2.jar b/dist/lib/caelum-stella-core-2.1.2.jar new file mode 100644 index 0000000..1cba33f Binary files /dev/null and b/dist/lib/caelum-stella-core-2.1.2.jar differ diff --git a/dist/lib/commons-collections4-4.4.jar b/dist/lib/commons-collections4-4.4.jar new file mode 100644 index 0000000..da06c3e Binary files /dev/null and b/dist/lib/commons-collections4-4.4.jar differ diff --git a/dist/lib/commons-compress-1.19.jar b/dist/lib/commons-compress-1.19.jar new file mode 100644 index 0000000..5c9f52a Binary files /dev/null and b/dist/lib/commons-compress-1.19.jar differ diff --git a/dist/lib/commons-math3-3.6.1.jar b/dist/lib/commons-math3-3.6.1.jar new file mode 100644 index 0000000..0ff582c Binary files /dev/null and b/dist/lib/commons-math3-3.6.1.jar differ diff --git a/dist/lib/core-3.3.0.jar b/dist/lib/core-3.3.0.jar new file mode 100644 index 0000000..94f7406 Binary files /dev/null and b/dist/lib/core-3.3.0.jar differ diff --git a/dist/lib/darcula-1.0.0.jar b/dist/lib/darcula-1.0.0.jar new file mode 100644 index 0000000..b7ed095 Binary files /dev/null and b/dist/lib/darcula-1.0.0.jar differ diff --git a/dist/lib/dom4j-2.1.3.jar b/dist/lib/dom4j-2.1.3.jar new file mode 100644 index 0000000..9a4f5d2 Binary files /dev/null and b/dist/lib/dom4j-2.1.3.jar differ diff --git a/dist/lib/java-json.jar b/dist/lib/java-json.jar new file mode 100644 index 0000000..2f211e3 Binary files /dev/null and b/dist/lib/java-json.jar differ diff --git a/dist/lib/javase-3.3.0.jar b/dist/lib/javase-3.3.0.jar new file mode 100644 index 0000000..359ca5f Binary files /dev/null and b/dist/lib/javase-3.3.0.jar differ diff --git a/dist/lib/log4j-1.2-api-2.14.1.jar b/dist/lib/log4j-1.2-api-2.14.1.jar new file mode 100644 index 0000000..167b2f9 Binary files /dev/null and b/dist/lib/log4j-1.2-api-2.14.1.jar differ diff --git a/dist/lib/log4j-api-2.14.1.jar b/dist/lib/log4j-api-2.14.1.jar new file mode 100644 index 0000000..dd7a3c0 Binary files /dev/null and b/dist/lib/log4j-api-2.14.1.jar differ diff --git a/dist/lib/log4j-core-2.14.1.jar b/dist/lib/log4j-core-2.14.1.jar new file mode 100644 index 0000000..3964149 Binary files /dev/null and b/dist/lib/log4j-core-2.14.1.jar differ diff --git a/dist/lib/mysql-connector-java-5.1.23-bin.jar b/dist/lib/mysql-connector-java-5.1.23-bin.jar new file mode 100644 index 0000000..1f90414 Binary files /dev/null and b/dist/lib/mysql-connector-java-5.1.23-bin.jar differ diff --git a/dist/lib/poi-5.0.0.jar b/dist/lib/poi-5.0.0.jar new file mode 100644 index 0000000..d239022 Binary files /dev/null and b/dist/lib/poi-5.0.0.jar differ diff --git a/dist/lib/poi-ooxml-5.0.0.jar b/dist/lib/poi-ooxml-5.0.0.jar new file mode 100644 index 0000000..574e6c1 Binary files /dev/null and b/dist/lib/poi-ooxml-5.0.0.jar differ diff --git a/dist/lib/poi-ooxml-lite-5.0.0.jar b/dist/lib/poi-ooxml-lite-5.0.0.jar new file mode 100644 index 0000000..5d0e244 Binary files /dev/null and b/dist/lib/poi-ooxml-lite-5.0.0.jar differ diff --git a/dist/lib/postgresql-42.3.1.jar b/dist/lib/postgresql-42.3.1.jar new file mode 100644 index 0000000..17af3fc Binary files /dev/null and b/dist/lib/postgresql-42.3.1.jar differ diff --git a/dist/lib/xmlbeans-5.0.0.jar b/dist/lib/xmlbeans-5.0.0.jar new file mode 100644 index 0000000..5b8d7e2 Binary files /dev/null and b/dist/lib/xmlbeans-5.0.0.jar differ diff --git a/dist/lib/yaz4j-1.7.0-SNAPSHOT.jar b/dist/lib/yaz4j-1.7.0-SNAPSHOT.jar new file mode 100644 index 0000000..f25f587 Binary files /dev/null and b/dist/lib/yaz4j-1.7.0-SNAPSHOT.jar differ diff --git a/excel files/Livros.xlsx b/excel files/Livros.xlsx new file mode 100644 index 0000000..4846dc3 Binary files /dev/null and b/excel files/Livros.xlsx differ diff --git a/excel files/Usuarios.xlsx b/excel files/Usuarios.xlsx new file mode 100644 index 0000000..6b4cdf4 Binary files /dev/null and b/excel files/Usuarios.xlsx differ diff --git a/images/2.png b/images/2.png new file mode 100644 index 0000000..45249d1 Binary files /dev/null and b/images/2.png differ diff --git a/images/BarCodes/00000001 b/images/BarCodes/00000001 new file mode 100644 index 0000000..aa758c8 Binary files /dev/null and b/images/BarCodes/00000001 differ diff --git a/images/BarCodes/00000002 b/images/BarCodes/00000002 new file mode 100644 index 0000000..582e6b9 Binary files /dev/null and b/images/BarCodes/00000002 differ diff --git a/images/BarCodes/00000003 b/images/BarCodes/00000003 new file mode 100644 index 0000000..1bcc67e Binary files /dev/null and b/images/BarCodes/00000003 differ diff --git a/images/BarCodes/00000007 b/images/BarCodes/00000007 new file mode 100644 index 0000000..0190a5f Binary files /dev/null and b/images/BarCodes/00000007 differ diff --git a/images/Books/0987654321234 b/images/Books/0987654321234 new file mode 100644 index 0000000..add1b43 Binary files /dev/null and b/images/Books/0987654321234 differ diff --git a/images/Books/1231231231231 b/images/Books/1231231231231 new file mode 100644 index 0000000..2984ddc Binary files /dev/null and b/images/Books/1231231231231 differ diff --git a/images/Books/1234567890123 b/images/Books/1234567890123 new file mode 100644 index 0000000..2984ddc Binary files /dev/null and b/images/Books/1234567890123 differ diff --git a/images/Cards/1.png b/images/Cards/1.png new file mode 100644 index 0000000..7db8dcb Binary files /dev/null and b/images/Cards/1.png differ diff --git a/images/Cards/2.png b/images/Cards/2.png new file mode 100644 index 0000000..ca1d160 Binary files /dev/null and b/images/Cards/2.png differ diff --git a/images/Cards/XXXXXXX.png b/images/Cards/XXXXXXX.png new file mode 100644 index 0000000..0e0f20f Binary files /dev/null and b/images/Cards/XXXXXXX.png differ diff --git a/images/Devolucao/BarCode/00000003 b/images/Devolucao/BarCode/00000003 new file mode 100644 index 0000000..1bcc67e Binary files /dev/null and b/images/Devolucao/BarCode/00000003 differ diff --git a/images/Devolucao/BarCode/00000004 b/images/Devolucao/BarCode/00000004 new file mode 100644 index 0000000..313f196 Binary files /dev/null and b/images/Devolucao/BarCode/00000004 differ diff --git a/images/Devolucao/QrCode/00000003 b/images/Devolucao/QrCode/00000003 new file mode 100644 index 0000000..3c405b9 Binary files /dev/null and b/images/Devolucao/QrCode/00000003 differ diff --git a/images/Devolucao/QrCode/00000004 b/images/Devolucao/QrCode/00000004 new file mode 100644 index 0000000..e83d80a Binary files /dev/null and b/images/Devolucao/QrCode/00000004 differ diff --git a/images/Emprestimos/BarCode/00000004 b/images/Emprestimos/BarCode/00000004 new file mode 100644 index 0000000..313f196 Binary files /dev/null and b/images/Emprestimos/BarCode/00000004 differ diff --git a/images/Emprestimos/QrCode/00000004 b/images/Emprestimos/QrCode/00000004 new file mode 100644 index 0000000..e83d80a Binary files /dev/null and b/images/Emprestimos/QrCode/00000004 differ diff --git a/images/Multas/BarCode/00000002 b/images/Multas/BarCode/00000002 new file mode 100644 index 0000000..582e6b9 Binary files /dev/null and b/images/Multas/BarCode/00000002 differ diff --git a/images/Multas/QrCode/00000002 b/images/Multas/QrCode/00000002 new file mode 100644 index 0000000..115844e Binary files /dev/null and b/images/Multas/QrCode/00000002 differ diff --git a/images/QrCodes/00000001 b/images/QrCodes/00000001 new file mode 100644 index 0000000..dd77cb1 Binary files /dev/null and b/images/QrCodes/00000001 differ diff --git a/images/QrCodes/00000002 b/images/QrCodes/00000002 new file mode 100644 index 0000000..115844e Binary files /dev/null and b/images/QrCodes/00000002 differ diff --git a/images/QrCodes/00000003 b/images/QrCodes/00000003 new file mode 100644 index 0000000..3c405b9 Binary files /dev/null and b/images/QrCodes/00000003 differ diff --git a/images/QrCodes/00000007 b/images/QrCodes/00000007 new file mode 100644 index 0000000..638dce4 Binary files /dev/null and b/images/QrCodes/00000007 differ diff --git a/images/QrCodes/000002 (2).png b/images/QrCodes/000002 (2).png new file mode 100644 index 0000000..80f7262 Binary files /dev/null and b/images/QrCodes/000002 (2).png differ diff --git a/images/QrCodes/000002.png b/images/QrCodes/000002.png new file mode 100644 index 0000000..d64079e Binary files /dev/null and b/images/QrCodes/000002.png differ diff --git a/images/QrCodes/1.png b/images/QrCodes/1.png new file mode 100644 index 0000000..ae722a8 Binary files /dev/null and b/images/QrCodes/1.png differ diff --git a/images/Usuarios/1 b/images/Usuarios/1 new file mode 100644 index 0000000..5ceced5 Binary files /dev/null and b/images/Usuarios/1 differ diff --git a/images/Usuarios/1.jpg b/images/Usuarios/1.jpg new file mode 100644 index 0000000..2984ddc Binary files /dev/null and b/images/Usuarios/1.jpg differ diff --git a/images/Usuarios/2 b/images/Usuarios/2 new file mode 100644 index 0000000..5ceced5 Binary files /dev/null and b/images/Usuarios/2 differ diff --git a/images/Usuarios/222.222.222-22 b/images/Usuarios/222.222.222-22 new file mode 100644 index 0000000..2984ddc Binary files /dev/null and b/images/Usuarios/222.222.222-22 differ diff --git a/images/Usuarios/7 b/images/Usuarios/7 new file mode 100644 index 0000000..fc70f24 Binary files /dev/null and b/images/Usuarios/7 differ diff --git a/images/cardBackground.jpg b/images/cardBackground.jpg new file mode 100644 index 0000000..ebfbb45 Binary files /dev/null and b/images/cardBackground.jpg differ diff --git a/images/cartao.png b/images/cartao.png new file mode 100644 index 0000000..ccfc2cd Binary files /dev/null and b/images/cartao.png differ diff --git a/images/libraryLogo.png b/images/libraryLogo.png new file mode 100644 index 0000000..2e8534f Binary files /dev/null and b/images/libraryLogo.png differ diff --git a/lib/AbsoluteLayout.jar b/lib/AbsoluteLayout.jar new file mode 100644 index 0000000..ee023b6 Binary files /dev/null and b/lib/AbsoluteLayout.jar differ diff --git a/lib/caelum-stella-core-2.1.2.jar b/lib/caelum-stella-core-2.1.2.jar new file mode 100644 index 0000000..1cba33f Binary files /dev/null and b/lib/caelum-stella-core-2.1.2.jar differ diff --git a/lib/commons-collections4-4.4.jar b/lib/commons-collections4-4.4.jar new file mode 100644 index 0000000..da06c3e Binary files /dev/null and b/lib/commons-collections4-4.4.jar differ diff --git a/lib/commons-compress-1.19.jar b/lib/commons-compress-1.19.jar new file mode 100644 index 0000000..5c9f52a Binary files /dev/null and b/lib/commons-compress-1.19.jar differ diff --git a/lib/commons-math3-3.6.1.jar b/lib/commons-math3-3.6.1.jar new file mode 100644 index 0000000..0ff582c Binary files /dev/null and b/lib/commons-math3-3.6.1.jar differ diff --git a/lib/core-3.3.0.jar b/lib/core-3.3.0.jar new file mode 100644 index 0000000..94f7406 Binary files /dev/null and b/lib/core-3.3.0.jar differ diff --git a/lib/darcula-1.0.0.jar b/lib/darcula-1.0.0.jar new file mode 100644 index 0000000..b7ed095 Binary files /dev/null and b/lib/darcula-1.0.0.jar differ diff --git a/lib/dom4j-2.1.3.jar b/lib/dom4j-2.1.3.jar new file mode 100644 index 0000000..9a4f5d2 Binary files /dev/null and b/lib/dom4j-2.1.3.jar differ diff --git a/lib/java-json.jar b/lib/java-json.jar new file mode 100644 index 0000000..2f211e3 Binary files /dev/null and b/lib/java-json.jar differ diff --git a/lib/javase-3.3.0.jar b/lib/javase-3.3.0.jar new file mode 100644 index 0000000..359ca5f Binary files /dev/null and b/lib/javase-3.3.0.jar differ diff --git a/lib/log4j-1.2-api-2.14.1.jar b/lib/log4j-1.2-api-2.14.1.jar new file mode 100644 index 0000000..167b2f9 Binary files /dev/null and b/lib/log4j-1.2-api-2.14.1.jar differ diff --git a/lib/log4j-api-2.14.1.jar b/lib/log4j-api-2.14.1.jar new file mode 100644 index 0000000..dd7a3c0 Binary files /dev/null and b/lib/log4j-api-2.14.1.jar differ diff --git a/lib/log4j-core-2.14.1.jar b/lib/log4j-core-2.14.1.jar new file mode 100644 index 0000000..3964149 Binary files /dev/null and b/lib/log4j-core-2.14.1.jar differ diff --git a/lib/mysql-connector-java-5.1.23-bin.jar b/lib/mysql-connector-java-5.1.23-bin.jar new file mode 100644 index 0000000..1f90414 Binary files /dev/null and b/lib/mysql-connector-java-5.1.23-bin.jar differ diff --git a/lib/poi-5.0.0.jar b/lib/poi-5.0.0.jar new file mode 100644 index 0000000..d239022 Binary files /dev/null and b/lib/poi-5.0.0.jar differ diff --git a/lib/poi-ooxml-5.0.0.jar b/lib/poi-ooxml-5.0.0.jar new file mode 100644 index 0000000..574e6c1 Binary files /dev/null and b/lib/poi-ooxml-5.0.0.jar differ diff --git a/lib/poi-ooxml-lite-5.0.0.jar b/lib/poi-ooxml-lite-5.0.0.jar new file mode 100644 index 0000000..5d0e244 Binary files /dev/null and b/lib/poi-ooxml-lite-5.0.0.jar differ diff --git a/lib/postgresql-42.3.1.jar b/lib/postgresql-42.3.1.jar new file mode 100644 index 0000000..17af3fc Binary files /dev/null and b/lib/postgresql-42.3.1.jar differ diff --git a/lib/xmlbeans-5.0.0.jar b/lib/xmlbeans-5.0.0.jar new file mode 100644 index 0000000..5b8d7e2 Binary files /dev/null and b/lib/xmlbeans-5.0.0.jar differ diff --git a/lib/yaz4j-1.7.0-SNAPSHOT.jar b/lib/yaz4j-1.7.0-SNAPSHOT.jar new file mode 100644 index 0000000..f25f587 Binary files /dev/null and b/lib/yaz4j-1.7.0-SNAPSHOT.jar differ diff --git a/manifest.mf b/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/myql scripts/CreateDBModel_Win.mwb b/myql scripts/CreateDBModel_Win.mwb new file mode 100644 index 0000000..92c7e20 Binary files /dev/null and b/myql scripts/CreateDBModel_Win.mwb differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..a3eddf7 --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1420 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..d823a40 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f7bb6918 +build.xml.script.CRC32=a6a9e6dd +build.xml.stylesheet.CRC32=8064a381@1.80.1.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=f7bb6918 +nbproject/build-impl.xml.script.CRC32=6e9b9526 +nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48 diff --git a/nbproject/private/config.properties b/nbproject/private/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/nbproject/private/private.properties b/nbproject/private/private.properties new file mode 100644 index 0000000..e348c36 --- /dev/null +++ b/nbproject/private/private.properties @@ -0,0 +1,6 @@ +compile.on.save=true +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true +user.properties.file=/home/sandman/.netbeans/8.2/build.properties diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml new file mode 100644 index 0000000..895212e --- /dev/null +++ b/nbproject/private/private.xml @@ -0,0 +1,12 @@ + + + + + + file:/G:/Desktop/git/Librography/src/br/com/projeto/view/FormOptions.java + file:/G:/Desktop/git/Librography/src/br/com/projeto/jdbc/ConexaoBanco.java + file:/G:/Desktop/git/Librography/src/br/com/projeto/view/FormEmprestimos.java + file:/G:/Desktop/git/Librography/src/br/com/projeto/jdbc/TestarConexao.java + + + diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..fc36e10 --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,118 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.title=Librography +application.vendor=flash +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Os arquivos em build.classes.dir que devem ser exclu\u00eddos do jar de distribui\u00e7\u00e3o +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/Librography.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.AbsoluteLayout.jar=lib/AbsoluteLayout.jar +file.reference.caelum-stella-core-2.1.2.jar-1=lib/caelum-stella-core-2.1.2.jar +file.reference.commons-collections4-4.4.jar=lib/commons-collections4-4.4.jar +file.reference.commons-compress-1.19.jar-1=lib/commons-compress-1.19.jar +file.reference.commons-math3-3.6.1.jar-1=lib/commons-math3-3.6.1.jar +file.reference.core-3.3.0.jar-1=lib/core-3.3.0.jar +file.reference.darcula-1.0.0.jar-1=lib/darcula-1.0.0.jar +file.reference.dom4j-2.1.3.jar-1=lib/dom4j-2.1.3.jar +file.reference.java-json.jar=lib/java-json.jar +file.reference.javase-3.3.0.jar=lib/javase-3.3.0.jar +file.reference.log4j-1.2-api-2.14.1.jar=lib/log4j-1.2-api-2.14.1.jar +file.reference.log4j-api-2.14.1.jar=lib/log4j-api-2.14.1.jar +file.reference.log4j-core-2.14.1.jar=lib/log4j-core-2.14.1.jar +file.reference.mysql-connector-java-5.1.23-bin.jar=lib/mysql-connector-java-5.1.23-bin.jar +file.reference.poi-5.0.0.jar=lib/poi-5.0.0.jar +file.reference.poi-ooxml-5.0.0.jar=lib/poi-ooxml-5.0.0.jar +file.reference.poi-ooxml-lite-5.0.0.jar-1=lib/poi-ooxml-lite-5.0.0.jar +file.reference.postgresql-42.3.1.jar=lib/postgresql-42.3.1.jar +file.reference.xmlbeans-5.0.0.jar=lib/xmlbeans-5.0.0.jar +file.reference.yaz4j-1.7.0-SNAPSHOT.jar=lib/yaz4j-1.7.0-SNAPSHOT.jar +includes=** +jar.compress=true +javac.classpath=\ + ${libs.MySQLDriver.classpath}:\ + ${libs.absolutelayout.classpath}:\ + ${file.reference.AbsoluteLayout.jar}:\ + ${file.reference.caelum-stella-core-2.1.2.jar-1}:\ + ${file.reference.commons-collections4-4.4.jar}:\ + ${file.reference.commons-compress-1.19.jar-1}:\ + ${file.reference.commons-math3-3.6.1.jar-1}:\ + ${file.reference.core-3.3.0.jar-1}:\ + ${file.reference.darcula-1.0.0.jar-1}:\ + ${file.reference.dom4j-2.1.3.jar-1}:\ + ${file.reference.java-json.jar}:\ + ${file.reference.javase-3.3.0.jar}:\ + ${file.reference.log4j-1.2-api-2.14.1.jar}:\ + ${file.reference.log4j-api-2.14.1.jar}:\ + ${file.reference.log4j-core-2.14.1.jar}:\ + ${file.reference.mysql-connector-java-5.1.23-bin.jar}:\ + ${file.reference.poi-5.0.0.jar}:\ + ${file.reference.poi-ooxml-5.0.0.jar}:\ + ${file.reference.poi-ooxml-lite-5.0.0.jar-1}:\ + ${file.reference.xmlbeans-5.0.0.jar}:\ + ${file.reference.yaz4j-1.7.0-SNAPSHOT.jar}:\ + ${file.reference.postgresql-42.3.1.jar} +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.external.vm=true +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +main.class=br.com.projeto.view.FormLogin +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..a43dcdf --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + Librography + + + + + + + + + diff --git a/notas.txt b/notas.txt new file mode 100644 index 0000000..a83439c --- /dev/null +++ b/notas.txt @@ -0,0 +1,7 @@ +-- remover VISIBLE e linha com create table if no exist + carateres estranhios mysql + build for ant + + + convert sysntax: mysql to postgresql -> sqlite + \ No newline at end of file diff --git a/script.sql b/script.sql new file mode 100644 index 0000000..5b571c7 --- /dev/null +++ b/script.sql @@ -0,0 +1,319 @@ +-- MySQL Script generated by MySQL Workbench +-- 11/02/21 00:19:36 +-- Model: New Model Version: 1.0 +-- MySQL Workbench Forward Engineering + +SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; +SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; + +-- ----------------------------------------------------- +-- Schema applibrography +-- ----------------------------------------------------- + +-- ----------------------------------------------------- +-- Schema applibrography +-- ----------------------------------------------------- +CREATE SCHEMA IF NOT EXISTS `applibrography` DEFAULT CHARACTER SET utf8 ; +USE `applibrography` ; + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_leitores` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_leitores` ( + `id` INT(8) ZEROFILL NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NULL, + `rg` VARCHAR(30) NULL DEFAULT NULL, + `cpf` VARCHAR(20) NULL DEFAULT NULL, + `email` VARCHAR(200) NULL DEFAULT NULL, + `telefone` VARCHAR(30) NULL DEFAULT NULL, + `celular` VARCHAR(30) NULL DEFAULT NULL, + `cep` VARCHAR(100) NULL DEFAULT NULL, + `endereco` VARCHAR(255) NULL DEFAULT NULL, + `numero` VARCHAR(50) NULL DEFAULT NULL, + `complemento` VARCHAR(200) NULL DEFAULT NULL, + `bairro` VARCHAR(100) NULL DEFAULT NULL, + `cidade` VARCHAR(100) NULL DEFAULT NULL, + `estado` VARCHAR(2) NULL DEFAULT NULL, + `tipo` VARCHAR(15) NULL, + `is_locked` TINYINT NULL, + `curso` VARCHAR(45) NULL, + `curso_ano` VARCHAR(45) NULL, + `qtd_emprestimos` INT(3) NULL, + `emprestmax` INT NULL, + `observacoes` VARCHAR(225) NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +AUTO_INCREMENT = 00000100 +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_fornecedores` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_fornecedores` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NULL DEFAULT NULL, + `cnpj` VARCHAR(100) NULL DEFAULT NULL, + `email` VARCHAR(200) NULL DEFAULT NULL, + `telefone` VARCHAR(30) NULL DEFAULT NULL, + `celular` VARCHAR(30) NULL DEFAULT NULL, + `cep` VARCHAR(100) NULL DEFAULT NULL, + `endereco` VARCHAR(255) NULL DEFAULT NULL, + `numero` VARCHAR(50) NULL DEFAULT NULL, + `complemento` VARCHAR(200) NULL DEFAULT NULL, + `bairro` VARCHAR(100) NULL DEFAULT NULL, + `cidade` VARCHAR(100) NULL DEFAULT NULL, + `estado` VARCHAR(2) NULL DEFAULT NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_funcionarios` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_funcionarios` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `nome` VARCHAR(100) NOT NULL, + `rg` VARCHAR(30) NULL, + `cpf` VARCHAR(20) NULL, + `email` VARCHAR(200) NULL, + `senha` VARCHAR(10) NOT NULL, + `cargo` VARCHAR(100) NOT NULL, + `nivel_acesso` VARCHAR(50) NOT NULL, + `telefone` VARCHAR(30) NULL, + `celular` VARCHAR(30) NULL, + `cep` VARCHAR(100) NOT NULL, + `endereco` VARCHAR(255) NULL, + `numero` VARCHAR(50) NULL, + `complemento` VARCHAR(200) NULL, + `bairro` VARCHAR(100) NULL, + `cidade` VARCHAR(100) NOT NULL, + `estado` VARCHAR(2) NOT NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_livros` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_livros` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `titulo` VARCHAR(100) NOT NULL, + `autor` VARCHAR(45) NOT NULL, + `editora` VARCHAR(45) NOT NULL, + `isbn` VARCHAR(13) NOT NULL, + `ano` VARCHAR(4) NOT NULL, + `serie` VARCHAR(45) NULL, + `edicao` VARCHAR(45) NULL, + `idioma` VARCHAR(25) NOT NULL, + `tb_fornecedores_id` INT(8) NULL, + `piso` VARCHAR(45) NULL, + `corredor` VARCHAR(45) NULL, + `posicao` VARCHAR(45) NULL, + `secao` VARCHAR(45) NULL, + `disponibilidade` VARCHAR(15) NOT NULL, + `observacoes` VARCHAR(225) NULL, + `is_emprestado` TINYINT NULL, + PRIMARY KEY (`id`), + INDEX `fk_tb_livros_tb_fornecedores1_idx` (`tb_fornecedores_id` ASC), + CONSTRAINT `fk_tb_livros_tb_fornecedores1` + FOREIGN KEY (`tb_fornecedores_id`) + REFERENCES `applibrography`.`tb_fornecedores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_emprestimos` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_emprestimos` ( + `id` INT(8) ZEROFILL NOT NULL AUTO_INCREMENT, + `data_emprestimo` DATETIME NULL, + `data_devolucao` DATETIME NULL DEFAULT NULL, + `observacoes` TEXT NULL DEFAULT NULL, + `tb_funcionarios_id` INT(8) NULL, + `tb_livros_id` INT(8) NULL, + `tb_livros_tb_fornecedores_id` INT(8) NULL, + `tb_leitores_id` INT(8) ZEROFILL NULL, + `data_entrega_agendada` DATETIME NULL, + `tb_funcionarios_iddevol` INT(8) NULL, + `static_id_emprestimo` INT(8) NULL, + PRIMARY KEY (`id`), + INDEX `fk_tb_emprestimos_tb_funcionarios1_idx` (`tb_funcionarios_id` ASC), + INDEX `fk_tb_emprestimos_tb_livros1_idx` (`tb_livros_id` ASC, `tb_livros_tb_fornecedores_id` ASC), + INDEX `fk_tb_emprestimos_tb_leitores1_idx` (`tb_leitores_id` ASC), + INDEX `fk_tb_emprestimos_tb_funcionarios2_idx` (`tb_funcionarios_iddevol` ASC), + CONSTRAINT `fk_tb_emprestimos_tb_funcionarios1` + FOREIGN KEY (`tb_funcionarios_id`) + REFERENCES `applibrography`.`tb_funcionarios` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_livros1` + FOREIGN KEY (`tb_livros_id`) + REFERENCES `applibrography`.`tb_livros` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_leitores1` + FOREIGN KEY (`tb_leitores_id`) + REFERENCES `applibrography`.`tb_leitores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_emprestimos_tb_funcionarios2` + FOREIGN KEY (`tb_funcionarios_iddevol`) + REFERENCES `applibrography`.`tb_funcionarios` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB +AUTO_INCREMENT = 10000000 +DEFAULT CHARACTER SET = utf8; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_multa` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_multa` ( + `idmulta` INT(8) NOT NULL AUTO_INCREMENT, + `dias_atraso` INT(6) NOT NULL, + `valor_multa` DECIMAL(10,2) NULL, + `esta_pago` TINYINT NULL, + `tb_leitores_id` INT(8) ZEROFILL NOT NULL, + `tb_emprestimos_id` INT(8) ZEROFILL NOT NULL, + PRIMARY KEY (`idmulta`, `tb_emprestimos_id`), + INDEX `fk_multa_tb_leitores1_idx` (`tb_leitores_id` ASC), + INDEX `fk_tb_multa_tb_emprestimos1_idx` (`tb_emprestimos_id` ASC), + CONSTRAINT `fk_multa_tb_leitores1` + FOREIGN KEY (`tb_leitores_id`) + REFERENCES `applibrography`.`tb_leitores` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION, + CONSTRAINT `fk_tb_multa_tb_emprestimos1` + FOREIGN KEY (`tb_emprestimos_id`) + REFERENCES `applibrography`.`tb_emprestimos` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_opcoes` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_opcoes` ( + `id` INT NOT NULL AUTO_INCREMENT, + `data` VARCHAR(45) NOT NULL, + `parentid` INT NULL, + PRIMARY KEY (`id`), + INDEX `fk_Opcoes_Opcoes1_idx` (`parentid` ASC), + CONSTRAINT `fk_Opcoes_Opcoes1` + FOREIGN KEY (`parentid`) + REFERENCES `applibrography`.`tb_opcoes` (`id`) + ON DELETE NO ACTION + ON UPDATE NO ACTION) +ENGINE = InnoDB; + + +-- ----------------------------------------------------- +-- Table `applibrography`.`tb_recibos` +-- ----------------------------------------------------- +CREATE TABLE IF NOT EXISTS `applibrography`.`tb_recibos` ( + `id` INT(8) NOT NULL AUTO_INCREMENT, + `emprestimo_id` INT(8) NULL, + `data_emprestimo` VARCHAR(45) NULL, + `data_devolucao_agendada` VARCHAR(45) NULL, + `data_entrega` VARCHAR(45) NULL, + `livro` VARCHAR(45) NULL, + `usuario` VARCHAR(45) NULL, + `tipo` VARCHAR(45) NULL, + `multa` VARCHAR(45) NULL, + `status` VARCHAR(45) NULL, + `funcionario` VARCHAR(45) NULL, + PRIMARY KEY (`id`)) +ENGINE = InnoDB; + + +SET SQL_MODE=@OLD_SQL_MODE; +SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; +SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_leitores` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_leitores` (`id`, `nome`, `rg`, `cpf`, `email`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`, `tipo`, `is_locked`, `curso`, `curso_ano`, `qtd_emprestimos`, `emprestmax`, `observacoes`) VALUES (00000101, 'Leitor Teste', '5.432.234-1', '099.999.345-23', 'leitor@mail.com', '(42)98877-2299', '(42)98877-2299', '854670-000', 'Rua 1 de abril', '13', 'casa', 'Centro', 'Mallet', 'PR', 'Estudante', 0, 'Letras', '1', 0, 123, 'Ok'); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_fornecedores` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_fornecedores` (`id`, `nome`, `cnpj`, `email`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`) VALUES (1, 'Fornecedor Teste', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_funcionarios` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_funcionarios` (`id`, `nome`, `rg`, `cpf`, `email`, `senha`, `cargo`, `nivel_acesso`, `telefone`, `celular`, `cep`, `endereco`, `numero`, `complemento`, `bairro`, `cidade`, `estado`) VALUES (1, 'Administrador', NULL, NULL, 'admin@admin', 'admin', 'Administrador', 'Administrador', NULL, NULL, '84570-000', NULL, NULL, NULL, NULL, 'Mallet', 'PR'); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_livros` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_livros` (`id`, `titulo`, `autor`, `editora`, `isbn`, `ano`, `serie`, `edicao`, `idioma`, `tb_fornecedores_id`, `piso`, `corredor`, `posicao`, `secao`, `disponibilidade`, `observacoes`, `is_emprestado`) VALUES (1, 'Alice no Pis das maravilhas', 'Lewis Carrol', 'Nope', '1231231231231', '1894', '1', '1', 'Portugues', 1, NULL, NULL, NULL, 'Literatura Universal', '5', 'ok', 0); + +COMMIT; + + +-- ----------------------------------------------------- +-- Data for table `applibrography`.`tb_opcoes` +-- ----------------------------------------------------- +START TRANSACTION; +USE `applibrography`; +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (1, 'piso', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (2, 'corredor', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (3, 'secao', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (4, 'posicao', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (5, 'disponibilidade', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (6, 'printerurl', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (7, 'instituicaonome', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (8, 'instiuicaoendereco', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (17, 'piso 1', 1); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (20, 'corredor 1', 2); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (21, '1A', 3); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (22, 'Literatura Universal', 4); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (13, '0', 5); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (14, '3', 5); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (15, 'Biblioteca de Hogwarts', 7); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (16, 'Rua Epsilon, 888, Cidade Imaginaria, LA ', 8); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (9, 'tiposdeusuarios', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (18, 'Estudante', 9); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (19, 'Professor', 9); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (10, 'server url', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (11, 'libraryname', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (12, 'libraryAddress', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (23, '127.0.0.1', 12); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (24, 'Nome da Biblioteca', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (25, 'valor_multa', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (26, '300', 25); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (27, 'MsgReceipt', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (28, 'Obrigado!!', 27); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (29, 'theme', NULL); +INSERT INTO `applibrography`.`tb_opcoes` (`id`, `data`, `parentid`) VALUES (30, 'dark', 29); + +COMMIT; + diff --git a/setup/data b/setup/data new file mode 100644 index 0000000..0795f52 Binary files /dev/null and b/setup/data differ diff --git a/src/.metadata/.log b/src/.metadata/.log new file mode 100644 index 0000000..31609e9 --- /dev/null +++ b/src/.metadata/.log @@ -0,0 +1,76 @@ +!SESSION 2021-06-16 21:34:24.616 ----------------------------------------------- +eclipse.buildId=unknown +java.version=11.0.8 +java.vendor=AdoptOpenJDK +BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR +Command-line arguments: -os win32 -ws win32 -arch x86_64 -data @noDefault + +!ENTRY com.jaspersoft.studio 1 0 2021-06-16 21:34:32.703 +!MESSAGE Starting JaspersoftStudio bundle - Version: 6.17.0.final + +!ENTRY org.eclipse.egit.ui 2 0 2021-06-16 21:34:35.566 +!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git +user global configuration and to define the default location to store repositories: 'C:\Users\flash'. If this is +not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and +EGit might behave differently since they see different configuration options. +This warning can be switched off on the Team > Git > Confirmations and Warnings preference page. + +!ENTRY org.eclipse.jface 2 0 2021-06-16 21:48:06.852 +!MESSAGE Keybinding conflicts occurred. They may interfere with normal accelerator operation. +!SUBENTRY 1 org.eclipse.jface 2 0 2021-06-16 21:48:06.852 +!MESSAGE A conflict occurred for CTRL+SHIFT+K: +Binding(CTRL+SHIFT+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findPrevious,Find Previous, + Find previous item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1343b038, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+SHIFT+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findPrevious,Find Previous, + Find previous item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1343b038, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.xtext.ui.embeddedTextEditorScope,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2021-06-16 21:48:06.853 +!MESSAGE A conflict occurred for CTRL+K: +Binding(CTRL+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findNext,Find Next, + Find next item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6551611e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(CTRL+K, + ParameterizedCommand(Command(org.eclipse.ui.edit.findNext,Find Next, + Find next item, + Category(org.eclipse.ui.category.edit,Edit,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6551611e, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.xtext.ui.embeddedTextEditorScope,,,system) +!SUBENTRY 1 org.eclipse.jface 2 0 2021-06-16 21:48:06.853 +!MESSAGE A conflict occurred for F2: +Binding(F2, + ParameterizedCommand(Command(org.eclipse.ui.edit.rename,Rename, + Rename the selected item, + Category(org.eclipse.ui.category.file,File,null,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@295cab5d, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.ui.contexts.window,,,system) +Binding(F2, + ParameterizedCommand(Command(org.eclipse.ui.edit.text.showInformation,Show Tooltip Description, + Displays information for the current caret location in a focused hover, + Category(org.eclipse.ui.category.textEditor,Text Editing,Text Editing Commands,true), + org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7af59617, + ,,true),null), + org.eclipse.ui.defaultAcceleratorConfiguration, + org.eclipse.xtext.ui.embeddedTextEditorScope,,,system) + +!ENTRY org.eclipse.core.resources 2 10035 2021-06-16 22:46:17.042 +!MESSAGE The workspace will exit with unsaved changes in this session. diff --git a/src/.metadata/.plugins/com.jaspersoft.studio.data.sql.ui/dialog_settings.xml b/src/.metadata/.plugins/com.jaspersoft.studio.data.sql.ui/dialog_settings.xml new file mode 100644 index 0000000..5ca0b77 --- /dev/null +++ b/src/.metadata/.plugins/com.jaspersoft.studio.data.sql.ui/dialog_settings.xml @@ -0,0 +1,3 @@ + +
+
diff --git a/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_0 b/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_0 new file mode 100644 index 0000000..9d02367 --- /dev/null +++ b/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_0 @@ -0,0 +1 @@ +One Empty Record1 \ No newline at end of file diff --git a/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_1 b/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_1 new file mode 100644 index 0000000..ee432f3 --- /dev/null +++ b/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_1 @@ -0,0 +1 @@ +Sample DBorg.hsqldb.jdbcDriversatruejdbc:hsqldb:res:/defaults/hsqldb/test \ No newline at end of file diff --git a/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_2 b/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_2 new file mode 100644 index 0000000..a961fc7 --- /dev/null +++ b/src/.metadata/.plugins/com.jaspersoft.studio/dataAdapters/dataAdapter_2 @@ -0,0 +1 @@ +MySqlLocalHostcom.mysql.jdbc.Driverrootgoldenowltruejdbc:mysql://localhost/applibrographyC:\Program Files\NetBeans 8.2\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar \ No newline at end of file diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.history/19/c0e0efac05cf001b1a2ac2f9dbdf4288 b/src/.metadata/.plugins/org.eclipse.core.resources/.history/19/c0e0efac05cf001b1a2ac2f9dbdf4288 new file mode 100644 index 0000000..e69de29 diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.history/a6/104fbf3706cf001b1a2ac2f9dbdf4288 b/src/.metadata/.plugins/org.eclipse.core.resources/.history/a6/104fbf3706cf001b1a2ac2f9dbdf4288 new file mode 100644 index 0000000..e69de29 diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.indexes/history.index b/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.indexes/history.index new file mode 100644 index 0000000..663a2bc Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.indexes/history.index differ diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.markers.snap b/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.markers.snap new file mode 100644 index 0000000..1253ec8 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.markers.snap differ diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.syncinfo.snap b/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.syncinfo.snap new file mode 100644 index 0000000..1253ec8 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/.projects/MyReports/.syncinfo.snap differ diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version new file mode 100644 index 0000000..25cb955 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/history.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index new file mode 100644 index 0000000..f2f8423 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.index differ diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version new file mode 100644 index 0000000..6b2aaa7 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.indexes/properties.version @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap new file mode 100644 index 0000000..3ab7083 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/.root/.markers.snap differ diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources b/src/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources new file mode 100644 index 0000000..2c0b367 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/.safetable/org.eclipse.core.resources differ diff --git a/src/.metadata/.plugins/org.eclipse.core.resources/0.snap b/src/.metadata/.plugins/org.eclipse.core.resources/0.snap new file mode 100644 index 0000000..89e6c94 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.core.resources/0.snap differ diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.collabnet.subversion.merge.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.collabnet.subversion.merge.prefs new file mode 100644 index 0000000..7ae6d53 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.collabnet.subversion.merge.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +merge_provider_set=true diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.jaspersoft.studio.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.jaspersoft.studio.prefs new file mode 100644 index 0000000..412a948 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/com.jaspersoft.studio.prefs @@ -0,0 +1,12 @@ +com.jaspersoft.studio.myreports.created=true +com.jaspersoft.studio.parameterset.Http\ Data\ Adapters\ Built\ In\ Parameters=PFBhcmFtZXRlclNldD48bmFtZT5IdHRwIERhdGEgQWRhcHRlcnMgQnVpbHQgSW4gUGFyYW1ldGVy\nczwvbmFtZT48YnVpbHRJbj50cnVlPC9idWlsdEluPjxwYXJhbWV0ZXJzPjxuYW1lPkhUVFBfREFU\nQV9VUkw8L25hbWU+PGRlc2NyaXB0aW9uPlVSTCBUbyBnZXQgZmlsZSBmcm9tPC9kZXNjcmlwdGlv\nbj48Zm9yUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEu\nbGFuZy5TdHJpbmc8L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0\nPiJodHRwOi8vc29tZXVybC5jb20iPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3Bh\ncmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+SFRUUF9EQVRBX1VTRVJOQU1FPC9uYW1lPjxkZXNj\ncmlwdGlvbj5Vc2VyIG5hbWU8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclBy\nb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS5sYW5nLlN0cmluZzwvdmFsdWVDbGFzc05hbWU+\nPGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRleHQ+InVzZXIiPC90ZXh0PjwvZGVmYXVsdFZhbHVl\nRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+SFRUUF9EQVRBX1BBU1NX\nT1JEPC9uYW1lPjxkZXNjcmlwdGlvbj5QYXNzd29yZDwvZGVzY3JpcHRpb24+PGZvclByb21wdGlu\nZz5mYWxzZTwvZm9yUHJvbXB0aW5nPjx2YWx1ZUNsYXNzTmFtZT5qYXZhLmxhbmcuU3RyaW5nPC92\nYWx1ZUNsYXNzTmFtZT48ZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48dGV4dD4icGFzcyI8L3RleHQ+\nPC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48cGFyYW1ldGVycz48bmFtZT5I\nVFRQX0RBVEFfVVJMX1BBUkFNRVRFUl88L25hbWU+PGRlc2NyaXB0aW9uPlVSTCBQYXJhbWV0ZXIg\ncHJlZml4PC9kZXNjcmlwdGlvbj48Zm9yUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZh\nbHVlQ2xhc3NOYW1lPmphdmEubGFuZy5TdHJpbmc8L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFs\ndWVFeHByZXNzaW9uPjx0ZXh0PiJwcm0iPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48\nL3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+SFRUUF9EQVRBX1BPU1RfUEFSQU1FVEVSXzwv\nbmFtZT48ZGVzY3JpcHRpb24+UE9TVCByZXF1ZXN0IHBhcmFtZXRlciBwcmVmaXg8L2Rlc2NyaXB0\naW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2\nYS5sYW5nLlN0cmluZzwvdmFsdWVDbGFzc05hbWU+PGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRl\neHQ+InBybSI8L3RleHQ+PC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48cGFy\nYW1ldGVycz48bmFtZT5IVFRQX0RBVEFfSEVBREVSX1BBUkFNRVRFUl88L25hbWU+PGRlc2NyaXB0\naW9uPkh0dHAgSGVhZGVyIHBhcmFtZXRlciBwcmVmaXg8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRp\nbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS5sYW5nLlN0cmluZzwv\ndmFsdWVDbGFzc05hbWU+PGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRleHQ+InZhbHVlIjwvdGV4\ndD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9wYXJhbWV0ZXJzPjwvUGFyYW1ldGVyU2V0Pg\=\= +com.jaspersoft.studio.parameterset.Jaspersoft\ Server\ Built\ In\ Parameters=PFBhcmFtZXRlclNldD48bmFtZT5KYXNwZXJzb2Z0IFNlcnZlciBCdWlsdCBJbiBQYXJhbWV0ZXJz\nPC9uYW1lPjxidWlsdEluPnRydWU8L2J1aWx0SW4+PHBhcmFtZXRlcnM+PG5hbWU+TG9nZ2VkSW5V\nc2VyPC9uYW1lPjxkZXNjcmlwdGlvbj5Ob3QgdXNhYmxlIGluIHF1ZXJ5IGlucHV0IGNvbnRyb2ws\nIGJ1dCBpcyB1c2VkIGFzIHBhcmFtZXRlciB0byByZXBvcnQ8L2Rlc2NyaXB0aW9uPjxmb3JQcm9t\ncHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+Y29tLmphc3BlcnNvZnQu\namFzcGVyc2VydmVyLmFwaS5tZXRhZGF0YS51c2VyLmRvbWFpbi5jbGllbnQuVXNlckltcGw8L3Zh\nbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0Pm5ldyBjb20uamFzcGVy\nc29mdC5qYXNwZXJzZXJ2ZXIuYXBpLm1ldGFkYXRhLnVzZXIuZG9tYWluLmNsaWVudC5Vc2VySW1w\nbCgpPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRl\ncnM+PG5hbWU+TG9nZ2VkSW5Vc2VybmFtZTwvbmFtZT48ZGVzY3JpcHRpb24+T2YgbG9nZ2VkIGlu\nIHVzZXI8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFs\ndWVDbGFzc05hbWU+amF2YS5sYW5nLlN0cmluZzwvdmFsdWVDbGFzc05hbWU+PGRlZmF1bHRWYWx1\nZUV4cHJlc3Npb24+PHRleHQ+ImpvZXVzZXIiPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lv\nbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+TG9nZ2VkSW5Vc2VyRnVsbE5hbWU8L25h\nbWU+PGRlc2NyaXB0aW9uPk9mIGxvZ2dlZCBpbiB1c2VyPC9kZXNjcmlwdGlvbj48Zm9yUHJvbXB0\naW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEubGFuZy5TdHJpbmc8\nL3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0PiJKb2UgU21pdGgi\nPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+\nPG5hbWU+TG9nZ2VkSW5Vc2VyRW1haWxBZGRyZXNzPC9uYW1lPjxkZXNjcmlwdGlvbj5PZiBsb2dn\nZWQgaW4gdXNlcjwvZGVzY3JpcHRpb24+PGZvclByb21wdGluZz5mYWxzZTwvZm9yUHJvbXB0aW5n\nPjx2YWx1ZUNsYXNzTmFtZT5qYXZhLmxhbmcuU3RyaW5nPC92YWx1ZUNsYXNzTmFtZT48ZGVmYXVs\ndFZhbHVlRXhwcmVzc2lvbj48dGV4dD4iam9lQHNvbWUuZW1haWwiPC90ZXh0PjwvZGVmYXVsdFZh\nbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+TG9nZ2VkSW5Vc2Vy\nRW5hYmxlZDwvbmFtZT48ZGVzY3JpcHRpb24+SXMgbG9nZ2VkIGluIHVzZXIgZW5hYmxlZD88L2Rl\nc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05h\nbWU+amF2YS5sYW5nLkJvb2xlYW48L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNz\naW9uPjx0ZXh0PkJvb2xlYW4uVFJVRTwvdGV4dD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9w\nYXJhbWV0ZXJzPjxwYXJhbWV0ZXJzPjxuYW1lPkxvZ2dlZEluVXNlckV4dGVybmFsbHlEZWZpbmVk\nPC9uYW1lPjxkZXNjcmlwdGlvbj5JcyBsb2dnZWQgaW4gdXNlciBleHRlcm5hbGx5IGRlZmluZWQ/\nIGllLiBhdXRoZW50aWNhdGVkIGV4dGVybmFsbHk8L2Rlc2NyaXB0aW9uPjxmb3JQcm9tcHRpbmc+\nZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS5sYW5nLkJvb2xlYW48L3Zh\nbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0PkJvb2xlYW4uRkFMU0U8\nL3RleHQ+PC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48cGFyYW1ldGVycz48\nbmFtZT5Mb2dnZWRJblVzZXJUZW5hbnRJZDwvbmFtZT48ZGVzY3JpcHRpb24+T2YgbG9nZ2VkIGlu\nIHVzZXIuIE9ubHkgcmVsZXZhbnQgaW4gUHJvL0VudGVycHJpc2UuPC9kZXNjcmlwdGlvbj48Zm9y\nUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEubGFuZy5T\ndHJpbmc8L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9uPjx0ZXh0PjwvdGV4\ndD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9wYXJhbWV0ZXJzPjxwYXJhbWV0ZXJzPjxuYW1l\nPkxvZ2dlZEluVXNlclJvbGVzPC9uYW1lPjxkZXNjcmlwdGlvbj5DdXJyZW50IHNldCBvZiByb2xl\ncyBvZiBsb2dnZWQgaW4gdXNlci4gVXNlZnVsIGZvciAkWCBwYXJhbWV0ZXI8L2Rlc2NyaXB0aW9u\nPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2YS51\ndGlsLkNvbGxlY3Rpb248L3ZhbHVlQ2xhc3NOYW1lPjxuZXN0ZWRUeXBlTmFtZT5qYXZhLmxhbmcu\nU3RyaW5nPC9uZXN0ZWRUeXBlTmFtZT48ZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48dGV4dD5uZXcg\nQXJyYXlMaXN0KCk8L3RleHQ+PC9kZWZhdWx0VmFsdWVFeHByZXNzaW9uPjwvcGFyYW1ldGVycz48\ncGFyYW1ldGVycz48bmFtZT5Mb2dnZWRJblVzZXJBdHRyaWJ1dGVzPC9uYW1lPjxkZXNjcmlwdGlv\nbj5Ob3QgdXNhYmxlIGluIHF1ZXJ5IGlucHV0IGNvbnRyb2wsIGJ1dCBpcyB1c2VkIGFzIHBhcmFt\nZXRlciB0byByZXBvcnQuIEVtcHR5IG1hcCBpZiBubyBhdHRyaWJ1dGVzPC9kZXNjcmlwdGlvbj48\nZm9yUHJvbXB0aW5nPmZhbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEudXRp\nbC5NYXA8L3ZhbHVlQ2xhc3NOYW1lPjxuZXN0ZWRUeXBlTmFtZT5qYXZhLmxhbmcuU3RyaW5nPC9u\nZXN0ZWRUeXBlTmFtZT48ZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48dGV4dD5uZXcgSGFzaE1hcCgp\nPC90ZXh0PjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+\nPG5hbWU+TG9nZ2VkSW5Vc2VyQXR0cmlidXRlTmFtZXM8L25hbWU+PGRlc2NyaXB0aW9uPlVzZXIg\ncHJvZmlsZSBhdHRyaWJ1dGUgbmFtZXMuIFVzZWZ1bCBmb3IgJFggcGFyYW1ldGVycy4gRW1wdHkg\nY29sbGVjdGlvbiBpZiBubyBhdHRyaWJ1dGVzPC9kZXNjcmlwdGlvbj48Zm9yUHJvbXB0aW5nPmZh\nbHNlPC9mb3JQcm9tcHRpbmc+PHZhbHVlQ2xhc3NOYW1lPmphdmEudXRpbC5Db2xsZWN0aW9uPC92\nYWx1ZUNsYXNzTmFtZT48bmVzdGVkVHlwZU5hbWU+amF2YS5sYW5nLlN0cmluZzwvbmVzdGVkVHlw\nZU5hbWU+PGRlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PHRleHQ+bmV3IEFycmF5TGlzdCgpPC90ZXh0\nPjwvZGVmYXVsdFZhbHVlRXhwcmVzc2lvbj48L3BhcmFtZXRlcnM+PHBhcmFtZXRlcnM+PG5hbWU+\nTG9nZ2VkSW5Vc2VyQXR0cmlidXRlVmFsdWVzPC9uYW1lPjxkZXNjcmlwdGlvbj48L2Rlc2NyaXB0\naW9uPjxmb3JQcm9tcHRpbmc+ZmFsc2U8L2ZvclByb21wdGluZz48dmFsdWVDbGFzc05hbWU+amF2\nYS51dGlsLkNvbGxlY3Rpb248L3ZhbHVlQ2xhc3NOYW1lPjxkZWZhdWx0VmFsdWVFeHByZXNzaW9u\nPjx0ZXh0Pm5ldyBBcnJheUxpc3QoKTwvdGV4dD48L2RlZmF1bHRWYWx1ZUV4cHJlc3Npb24+PC9w\nYXJhbWV0ZXJzPjwvUGFyYW1ldGVyU2V0Pg\=\= +com.jaspersoft.studio.parametersets=SmFzcGVyc29mdCBTZXJ2ZXIgQnVpbHQgSW4gUGFyYW1ldGVycwpIdHRwIERhdGEgQWRhcHRlcnMg\nQnVpbHQgSW4gUGFyYW1ldGVycwo\= +com.jaspersoft.studio.theme.ui.dark=pageBackground\=0,0,0\ncontainerMarginColor\=0,255,0\ngridColor\=255,255,255\nelementDesignBorderColor\=255,255,0\npageMarginColor\=255,0,0\n +com.jaspersoft.studio.theme.ui.light=pageBackground\=255,255,255\ncontainerMarginColor\=170,168,255\ngridColor\=192,192,192\nelementDesignBorderColor\=0,0,0\npageMarginColor\=170,168,255\n +eclipse.preferences.version=1 +jssbranding_product_mainbundle=com.jaspersoft.studio.rcp +jssbranding_product_name=Jaspersoft Studio Community Edition +jssbranding_product_version=6.17.0.final +net.sf.jasperreports.JRPROPERTIES=com.jaspersoft.jasperreports.components.customvisualization.phantomjs.executable.path\=phantomjs\nnet.sf.jasperreports.web.resource.pattern.customvisualization.scripts\=com/jaspersoft/jasperreports/customvisualization/resources/require/.*\ncom.jaspersoft.jasperreports.components.customvisualization.require.js\=file\\\:/C\\\:/Program Files/TIBCO/Jaspersoft Studio-6.17.0/configuration/org.eclipse.osgi/28/0/.cp/resources/scripts/require-2.1.6.src.js\nnet.sf.jasperreports.compiler.temp.dir\=C\\\:\\\\Program Files\\\\TIBCO\\\\Jaspersoft Studio-6.17.0\nnet.sf.jasperreports.chrome.enabled\=true\nnet.sf.jasperreports.compiler.classpath\=C\\\:\\\\Program Files\\\\TIBCO\\\\Jaspersoft Studio-6.17.0\\\\\\\\plugins/org.eclipse.equinox.launcher_1.6.100.v20201223-0822.jar\n +net.sf.jasperreports.chrome.enabled=true diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..3f7a08c --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,3 @@ +description.disableLinking=false +eclipse.preferences.version=1 +version=1 diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gef.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gef.prefs new file mode 100644 index 0000000..6de1db9 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gef.prefs @@ -0,0 +1,3 @@ +eclipse.preferences.version=1 +org.eclipse.gef.psize=125 +org.eclipse.gef.pstate=4 diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..5db3127 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs new file mode 100644 index 0000000..ffc66df --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.launching.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.launching.PREF_VM_XML=\r\n\r\n \r\n \r\n \r\n\r\n diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..579a6fb --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,9 @@ +content_assist_proposals_background=255,255,255 +content_assist_proposals_foreground=0,0,0 +eclipse.preferences.version=1 +org.eclipse.jdt.internal.ui.navigator.layout=2 +org.eclipse.jdt.internal.ui.navigator.librariesnode=true +org.eclipse.jdt.ui.formatterprofiles.version=21 +spelling_locale_initialized=true +useAnnotationsPrefPage=true +useQuickDiffPrefPage=true diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs new file mode 100644 index 0000000..d56c53f --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jsch.core.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jsch.core.hasChangedDefaultWin32SshHome=true diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs new file mode 100644 index 0000000..eabb3a7 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.ide.prefs @@ -0,0 +1,4 @@ +eclipse.preferences.version=1 +platformState=1623889939187 +quickStart=false +tipsAndTricks=false diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.navigator.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.navigator.prefs new file mode 100644 index 0000000..f7cb24a --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.navigator.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.ui.navigator.ProjectExplorer.filterActivation=\:org.eclipse.jdt.java.ui.filters.HideEmptyInnerPackages\:org.eclipse.jdt.java.ui.filters.HidePackageDeclaration\:org.eclipse.jdt.java.ui.filters.HideOutputFolder\:org.eclipse.jdt.java.ui.filters.HideInnerClassFiles\:org.eclipse.ui.navigator.resources.filters.startsWithDot\:org.eclipse.jdt.java.ui.filters.HideEmptyLibraryContainers\:org.eclipse.jdt.java.ui.filters.HideImportDeclaration\:org.eclipse.ui.navigator.resources.nested.HideTopLevelProjectIfNested\:org.eclipse.jdt.java.ui.filters.HideSyntheticMembers\:org.eclipse.ui.navigator.resources.nested.HideFolderWhenProjectIsShownAsNested\: diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs new file mode 100644 index 0000000..ea0f4f6 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.prefs @@ -0,0 +1,3 @@ +PROMPT_WHEN_SAVEABLE_STILL_OPEN=false +eclipse.preferences.version=1 +showIntro=false diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs new file mode 100644 index 0000000..c9b2bc4 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs @@ -0,0 +1,10 @@ +//org.eclipse.ui.commands/state/com.jaspersoft.studio.editor.context.type/org.eclipse.ui.commands.radioState=project +//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false +eclipse.preferences.version=1 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=255,255,255 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=255,255,255 +org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=16,16,16 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=255,255,255 +org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=255,255,255 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_END=240,240,240 +org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=242,242,242 diff --git a/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs new file mode 100644 index 0000000..1c00496 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.tigris.subversion.subclipse.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +pref_merge_provider=CollabNet Desktop diff --git a/src/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi b/src/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi new file mode 100644 index 0000000..4420531 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi @@ -0,0 +1,2063 @@ + + + + activeSchemeId:org.eclipse.ui.defaultAcceleratorConfiguration + + + + + + + + topLevel + shellMaximized + + + + + persp.actionSet:org.eclipse.ui.actionSet.keyBindings + persp.actionSet:org.eclipse.ui.actionSet.openFiles + persp.actionSet:org.eclipse.ui.edit.text.actionSet.annotationNavigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.navigation + persp.actionSet:org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo + persp.actionSet:org.eclipse.ui.externaltools.ExternalToolsSet + persp.actionSet:org.eclipse.search.searchActionSet + + + + noFocus + + View + categoryTag:Jaspersoft Studio + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + + + + noFocus + + View + categoryTag:Jaspersoft Studio + + + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + View + categoryTag:General + + + + + + + + + + View + categoryTag:General + + + View + categoryTag:Help + + + View + categoryTag:Help + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:Help + + + + + View + categoryTag:Help + + + + org.eclipse.e4.primaryDataStack + EditorStack + active + + + Editor + removeOnHide + com.jaspersoft.studio.editor.JrxmlEditor + + + + Editor + removeOnHide + com.jaspersoft.studio.editor.JrxmlEditor + active + activeOnClose + + + + + + + + View + categoryTag:Jaspersoft Studio + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + + View + categoryTag:General + + ViewMenu + menuContribution:menu + + + + + + + View + categoryTag:General + + + + + + View + categoryTag:Jaspersoft Studio + + ViewMenu + menuContribution:menu + + + + + + toolbarSeparator + + + + Draggable + + + + toolbarSeparator + + + + Draggable + + + Draggable + + + toolbarSeparator + + + + Draggable + + + + Draggable + + + Draggable + + + toolbarSeparator + + + + toolbarSeparator + + + + Draggable + + + stretch + SHOW_RESTORE_MENU + + + Draggable + HIDEABLE + SHOW_RESTORE_MENU + + + + + stretch + + + Draggable + + + Draggable + + + + + TrimStack + Draggable + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + platform:win32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Editor + removeOnHide + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Help + + + + + View + categoryTag:Help + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:Version Control (Team) + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:SVN + + + + + View + categoryTag:CVS + + + + + View + categoryTag:CVS + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java Browsing + + + + + View + categoryTag:Java + + + + + View + categoryTag:General + + + + + View + categoryTag:Java + + + + + View + categoryTag:Java + + + + + View + categoryTag:Debug + + + + + View + categoryTag:Java + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + + + + + View + categoryTag:Git + NoRestore + + + + + View + categoryTag:Git + + + + + View + categoryTag:Ant + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Plug-in Development + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:Jaspersoft Studio + + + + + View + categoryTag:SVN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/.metadata/.plugins/org.eclipse.jdt.core/2142118396.index b/src/.metadata/.plugins/org.eclipse.jdt.core/2142118396.index new file mode 100644 index 0000000..70965d8 Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.jdt.core/2142118396.index differ diff --git a/src/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps b/src/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps new file mode 100644 index 0000000..849e68c Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.jdt.core/externalLibsTimeStamps differ diff --git a/src/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt b/src/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt new file mode 100644 index 0000000..8586397 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.jdt.core/javaLikeNames.txt @@ -0,0 +1 @@ +java \ No newline at end of file diff --git a/src/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt b/src/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt new file mode 100644 index 0000000..91a1e1f --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.jdt.core/savedIndexNames.txt @@ -0,0 +1 @@ +INDEX VERSION 1.131+G:\Desktop\Dev\Netbeans\Librography\src\.metadata\.plugins\org.eclipse.jdt.core diff --git a/src/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat b/src/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat new file mode 100644 index 0000000..c22d68a Binary files /dev/null and b/src/.metadata/.plugins/org.eclipse.jdt.core/variablesAndContainers.dat differ diff --git a/src/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml b/src/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml new file mode 100644 index 0000000..5e5c96b --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.jdt.launching/.install.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml b/src/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml new file mode 100644 index 0000000..1a74285 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.jdt.launching/libraryInfos.xml @@ -0,0 +1,4 @@ + + + + diff --git a/src/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml b/src/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml new file mode 100644 index 0000000..a4ee3cb --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.jdt.ui/OpenTypeHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/src/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml b/src/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml new file mode 100644 index 0000000..9e390f5 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.jdt.ui/QualifiedTypeNameHistory.xml @@ -0,0 +1,2 @@ + + diff --git a/src/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml b/src/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml new file mode 100644 index 0000000..1c7eda2 --- /dev/null +++ b/src/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/MyReports/.classpath b/src/MyReports/.classpath new file mode 100644 index 0000000..8ff54a6 --- /dev/null +++ b/src/MyReports/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/MyReports/.project b/src/MyReports/.project new file mode 100644 index 0000000..01875dc --- /dev/null +++ b/src/MyReports/.project @@ -0,0 +1,23 @@ + + + MyReports + + + + + + org.eclipse.jdt.core.javabuilder + + + + + net.sf.jasperreports.builder + + + + + + org.eclipse.jdt.core.javanature + net.sf.jasperreports.nature + + diff --git a/src/MyReports/Blank_A4.jasper b/src/MyReports/Blank_A4.jasper new file mode 100644 index 0000000..24ad8ee Binary files /dev/null and b/src/MyReports/Blank_A4.jasper differ diff --git a/src/MyReports/Blank_A4.jrxml b/src/MyReports/Blank_A4.jrxml new file mode 100644 index 0000000..93d7687 --- /dev/null +++ b/src/MyReports/Blank_A4.jrxml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + <band height="79" splitType="Stretch"/> + + + + + + + + + + + + + + + + + + + + diff --git a/src/MyReports/Cherry.jasper b/src/MyReports/Cherry.jasper new file mode 100644 index 0000000..fa45dc4 Binary files /dev/null and b/src/MyReports/Cherry.jasper differ diff --git a/src/MyReports/Cherry.jrxml b/src/MyReports/Cherry.jrxml new file mode 100644 index 0000000..db323ba --- /dev/null +++ b/src/MyReports/Cherry.jrxml @@ -0,0 +1,376 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="132" splitType="Stretch"> + <image> + <reportElement x="456" y="0" width="99" height="132" uuid="97705585-a0b5-4ec7-86f3-ae10c220e6af"/> + <imageExpression><![CDATA["cherry.jpg"]]></imageExpression> + </image> + <frame> + <reportElement mode="Opaque" x="0" y="0" width="451" height="95" backcolor="#000000" uuid="6c6ca4e1-17cd-4913-93d6-5e670ea9ae8a"/> + <staticText> + <reportElement style="Title" x="0" y="0" width="370" height="66" uuid="a2a2cac8-5a7d-4487-8c54-dab235ce4e21"/> + <textElement> + <font isBold="false"/> + </textElement> + <text><![CDATA[Cherry Title]]></text> + </staticText> + <staticText> + <reportElement style="SubTitle" x="157" y="66" width="249" height="29" uuid="8978eac3-c578-41c9-837e-48d2b0184642"/> + <textElement> + <font size="22" isBold="false"/> + </textElement> + <text><![CDATA[Cherry SubTitle]]></text> + </staticText> + </frame> + <frame> + <reportElement mode="Opaque" x="0" y="100" width="451" height="32" forecolor="#000000" backcolor="#CC0000" uuid="e3c14156-5b51-4201-918b-97fdc012e5d4"/> + <textField pattern="EEEEE dd MMMMM yyyy"> + <reportElement x="307" y="12" width="144" height="20" forecolor="#FFFFFF" uuid="5c3301e7-a737-4c59-8a2f-a6c79fd1adb8"/> + <textElement textAlignment="Right"> + <font size="12"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + </frame> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/MyReports/cherry.jpg b/src/MyReports/cherry.jpg new file mode 100644 index 0000000..9d1aa77 Binary files /dev/null and b/src/MyReports/cherry.jpg differ diff --git a/src/br/com/parg/viacep/CEP.java b/src/br/com/parg/viacep/CEP.java new file mode 100644 index 0000000..477d24d --- /dev/null +++ b/src/br/com/parg/viacep/CEP.java @@ -0,0 +1,70 @@ +/* + * PARG Desenvolvimento de Sistemas + * Pablo Alexander - pablo@parg.com.br + * + * Obtem um CEP no ViaCEP + */ +package br.com.parg.viacep; + +/** + * Define um CEP + * @author PABLO + */ +public class CEP { + // pripriedades do CEP + public String CEP; + public String Logradouro; + public String Complemento; + public String Bairro; + public String Localidade; + public String Uf; + public String Ibge; + public String Gia; + + /** + * Cria um novo CEP vazio + */ + public CEP() { + this.Logradouro = null; + this.Complemento = null; + this.Bairro = null; + this.Localidade = null; + this.Uf = null; + this.Ibge = null; + this.Gia = null; + } + + /** + * Cria um novo CEP completo + * @param CEP + * @param Logradouro + * @param Complemento + * @param Bairro + * @param Localidade + * @param Uf + * @param Ibge + * @param Gia + */ + public CEP(String CEP, String Logradouro, String Complemento, String Bairro, String Localidade, String Uf, String Ibge, String Gia) { + this.CEP = CEP; + this.Logradouro = Logradouro; + this.Complemento = Complemento; + this.Bairro = Bairro; + this.Localidade = Localidade; + this.Uf = Uf; + this.Ibge = Ibge; + this.Gia = Gia; + } + + /** + * Cria um novo CEP parcial + * @param Logradouro + * @param Localidade + * @param Uf + */ + public CEP(String Logradouro, String Localidade, String Uf) { + this.Logradouro = Logradouro; + this.Localidade = Localidade; + this.Uf = Uf; + } +} diff --git a/src/br/com/parg/viacep/ViaCEP.java b/src/br/com/parg/viacep/ViaCEP.java new file mode 100644 index 0000000..b933499 --- /dev/null +++ b/src/br/com/parg/viacep/ViaCEP.java @@ -0,0 +1,188 @@ +/* + * PARG Desenvolvimento de Sistemas + * Pablo Alexander - pablo@parg.com.br + * + * Obtem um CEP no ViaCEP + */ +package br.com.parg.viacep; + +import java.util.logging.Level; +import java.util.logging.Logger; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +/** + * Classe java para obter um CEP no ViaCEP + * + * @author Pablo Alexander da Rocha Gonçalves + */ +public class ViaCEP extends ViaCEPBase { + + // constantes + public static final double VIACEP_VERSAO = 0.33; + + /** + * Constrói uma nova classe + */ + public ViaCEP() { + super(); + } + + /** + * Constrói uma nova classe + * + * @param events eventos para a classe + */ + public ViaCEP(ViaCEPEvents events) { + super(); + this.Events = events; + } + + /** + * Constrói uma nova classe e busca um CEP no ViaCEP + * + * @param events eventos para a classe + * @param cep + * @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro + */ + public ViaCEP(String cep, ViaCEPEvents events) throws ViaCEPException { + super(); + this.Events = events; + this.buscar(cep); + } + + /** + * Constrói uma nova classe e busca um CEP no ViaCEP + * + * @param cep + * @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro + */ + public ViaCEP(String cep) throws ViaCEPException { + super(); + this.buscar(cep); + } + + /** + * Busca um CEP no ViaCEP + * + * @param cep + * @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro + */ + @Override + public final void buscar(String cep) throws ViaCEPException { + try { + // define o cep atual + currentCEP = cep; + + // define a url + String url = "http://viacep.com.br/ws/" + cep + "/json/"; + + // define os dados + JSONObject obj = new JSONObject(getHttpGET(url)); + + if (!obj.has("erro")) { + CEP novoCEP = new CEP(obj.getString("cep"), + obj.getString("logradouro"), + obj.getString("complemento"), + obj.getString("bairro"), + obj.getString("localidade"), + obj.getString("uf"), + obj.getString("ibge"), + obj.getString("gia")); + + // insere o novo CEP + CEPs.add(novoCEP); + + // atualiza o index + index = CEPs.size() - 1; + + // verifica os Eventos + if (Events instanceof ViaCEPEvents) { + Events.onCEPSuccess(this); + } + } else { + // verifica os Eventos + if (Events instanceof ViaCEPEvents) { + Events.onCEPError(currentCEP); + } + + throw new ViaCEPException("Não foi possível encontrar o CEP", cep, ViaCEPException.class.getName()); + } + } catch (JSONException ex) { + Logger.getLogger(ViaCEP.class.getName()).log(Level.SEVERE, null, ex); + } + } + + /** + * Busca um CEP usando um endereço + * + * @param cep classe CEP com uf, localidade, logradouro + * @throws ViaCEPException + */ + @Override + public void buscarCEP(CEP cep) throws ViaCEPException { + buscarCEP(cep.Uf, cep.Localidade, cep.Logradouro); + } + + /** + * Busca um CEP usando um endereço + * + * @param Uf Estado + * @param Localidade Municipio + * @param Logradouro Rua, Avenidade, Viela... + * @throws ViaCEPException + */ + @Override + public void buscarCEP(String Uf, String Localidade, String Logradouro) throws ViaCEPException { + try { + // define o cep atual + currentCEP = "?????-???"; + + // define a url + String url = "http://viacep.com.br/ws/" + Uf.toUpperCase() + "/" + Localidade + "/" + Logradouro + "/json/"; + + // obtem a lista de CEP's + JSONArray ceps = new JSONArray(getHttpGET(url)); + + if (ceps.length() > 0) { + for (int i = 0; i < ceps.length(); i++) { + JSONObject obj = ceps.getJSONObject(i); + + if (!obj.has("erro")) { + CEP novoCEP = new CEP(obj.getString("cep"), + obj.getString("logradouro"), + obj.getString("complemento"), + obj.getString("bairro"), + obj.getString("localidade"), + obj.getString("uf"), + obj.getString("ibge"), + obj.getString("gia")); + + // insere o novo CEP + CEPs.add(novoCEP); + + // atualiza o index + index = CEPs.size() - 1; + + // verifica os Eventos + if (Events instanceof ViaCEPEvents) { + Events.onCEPSuccess(this); + } + } else { + // verifica os Eventos + if (Events instanceof ViaCEPEvents) { + Events.onCEPError(currentCEP); + } + + throw new ViaCEPException("Não foi possível validar o CEP", currentCEP, ViaCEPException.class.getName()); + } + } + } else { + throw new ViaCEPException("Nenhum CEP encontrado", currentCEP, getClass().getName()); + } + } catch (JSONException ex) { + Logger.getLogger(ViaCEP.class.getName()).log(Level.SEVERE, null, ex); + } + } +} diff --git a/src/br/com/parg/viacep/ViaCEPBase.java b/src/br/com/parg/viacep/ViaCEPBase.java new file mode 100644 index 0000000..fa060e0 --- /dev/null +++ b/src/br/com/parg/viacep/ViaCEPBase.java @@ -0,0 +1,286 @@ +/* + * PARG Desenvolvimento de Sistemas + * Pablo Alexander - pablo@parg.com.br + * + * Obtem um CEP no ViaCEP + */ +package br.com.parg.viacep; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.ProtocolException; +import java.net.URL; +import java.net.URLEncoder; +import java.util.ArrayList; +import java.util.List; + +/** + * Serve como base para a classe ViaCEP + * @author PABLO + */ +public abstract class ViaCEPBase { + // pripriedades do CEP + protected List CEPs; + protected int index; + protected String currentCEP; + + // váriaveis internas + protected ViaCEPEvents Events; + + public ViaCEPBase () { + CEPs = new ArrayList<>(); + index = -1; + currentCEP = "00000-000"; + this.Events = null; + } + + // métodos abstratos + public abstract void buscar(String cep) throws ViaCEPException; + public abstract void buscarCEP(CEP cep) throws ViaCEPException; + + /** + * Busca um CEP usando um endereço + * @param Uf estado + * @param Localidade cidade + * @param Logradouro nome ou parte do nome da rua, av, viela... + * @throws br.com.parg.viacep.ViaCEPException + */ + public void buscarCEP(String Uf, String Localidade, String Logradouro) throws ViaCEPException { + buscarCEP(new CEP(Logradouro, Localidade, Uf)); + } + + /** + * Retona o index atual; + * @return + */ + public int getIndex() { + return index; + } + + /** + * Retorna o total de CEP's + * @return + */ + public int getSize() { + return CEPs.size(); + } + + /** + * Retonar o CEP + * + * @return + */ + public String getCep() { + return CEPs.get(index).CEP; + } + + /** + * Retorna o nome da rua, avenida, travessa, ... + * + * @return + */ + public String getLogradouro() { + return CEPs.get(index).Logradouro; + } + + /** + * Retorna se tem algum complemento Ex: lado impar + * + * @return + */ + public String getComplemento() { + return CEPs.get(index).Complemento; + } + + /** + * Retorna o Bairro + * + * @return + */ + public String getBairro() { + return CEPs.get(index).Bairro; + } + + /** + * Retorna a Cidade + * + * @return + */ + public String getLocalidade() { + return CEPs.get(index).Localidade; + } + + /** + * Retorna o UF + * + * @return + */ + public String getUf() { + return CEPs.get(index).Uf; + } + + /** + * Retorna o Ibge + * + * @return + */ + public String getIbge() { + return CEPs.get(index).Ibge; + } + + /** + * Retorna a Gia + * + * @return + */ + public String getGia() { + return CEPs.get(index).Gia; + } + + /** + * Procedimento para obtem dados via GET + * + * @param urlToRead endereço + * @return conteúdo remoto + * @throws br.com.parg.viacep.ViaCEPException caso ocorra algum erro + */ + public final String getHttpGET(String urlToRead) throws ViaCEPException { + StringBuilder result = new StringBuilder(); + + try { + URL url = new URL(urlToRead); + HttpURLConnection conn = (HttpURLConnection) url.openConnection(); + conn.setRequestMethod("GET"); + + BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); + String line; + while ((line = rd.readLine()) != null) { + result.append(line); + } + + } catch (MalformedURLException | ProtocolException ex) { + // verifica os Eventos + if (Events instanceof ViaCEPEvents) { + Events.onCEPError(currentCEP); + } + + throw new ViaCEPException(ex.getMessage(), ex.getClass().getName()); + } catch (IOException ex) { + // verifica os Eventos + if (Events instanceof ViaCEPEvents) { + Events.onCEPError(currentCEP); + } + + throw new ViaCEPException(ex.getMessage(), ex.getClass().getName()); + } + + return result.toString(); + } + + /** + * Move para um registro específico + * @param index + * @return + */ + public boolean move(int index) { + if (CEPs.size() > 0 && index >= 0 && index < CEPs.size()) { + this.index = index; + return true; + } + + this.index = -1; + return false; + } + + /** + * Move para o primeiro registro + * @return + */ + public boolean moveFirst() { + if (CEPs.size() > 0) { + index = 0; + return true; + } + + index = -1; + return false; + } + + /** + * Move para o próximo registro + * @return + */ + public boolean moveNext() { + if (CEPs.size() > 0 && (index + 1) < CEPs.size()) { + index += 1; + return true; + } + + index = -1; + return false; + } + + /** + * Move para o registro anterior + * @return + */ + public boolean movePrevious() { + if (CEPs.size() > 0 && (index - 1) >= 0) { + index -= 1; + return true; + } + + index = -1; + return false; + } + + /** + * Move para o último registro + * @return + */ + public boolean moveLast() { + if (CEPs.size() > 0) { + index = CEPs.size() - 1; + return true; + } + + index = -1; + return false; + } + + /** + * Retorna a lista de CEP's + * @return + */ + public List getList() { + return CEPs; + } + + /** + * Procedimento para formatar uma string para usar em urls + * @param string texto que vai ser formatado + * @return texto formatado + * @throws ViaCEPException em caso de erro + */ + protected String formatStringToUri(String string) throws ViaCEPException { + String out = null; + + // verifica está válido + if (string != null && !string.isEmpty()) { + try { + out = URLEncoder.encode(string, "utf-8"); + out = out.replace("+", "%20"); // força espaço como %20 + } catch (UnsupportedEncodingException e) { + throw new ViaCEPException("Não foi possível codificar o valor solicitado!", UnsupportedEncodingException.class.getName()); + } + } else { + throw new ViaCEPException("Valor nulo ou vazio informado!", String.class.getName()); + } + + return out; + } +} diff --git a/src/br/com/parg/viacep/ViaCEPEvents.java b/src/br/com/parg/viacep/ViaCEPEvents.java new file mode 100644 index 0000000..bf38905 --- /dev/null +++ b/src/br/com/parg/viacep/ViaCEPEvents.java @@ -0,0 +1,26 @@ +/* + * PARG Desenvolvimento de Sistemas + * Pablo Alexander - pablo@parg.com.br + * + * Obtem um CEP no ViaCEP + */ +package br.com.parg.viacep; + +/** + * Interface para os eventos + * + * @author Pablo Alexander da Rocha Gonçalves + */ +public interface ViaCEPEvents { + /** + * Quando o CEP for encontrado com sucesso + * @param cep retorna o objeto ViaCEP + */ + public void onCEPSuccess(ViaCEP cep); + + /** + * Quando ocorrer qualquer erro ao encontrar o CEP + * @param cep retorna o CEP que foi requisitado + */ + public void onCEPError(String cep); +} diff --git a/src/br/com/parg/viacep/ViaCEPException.java b/src/br/com/parg/viacep/ViaCEPException.java new file mode 100644 index 0000000..95eeecf --- /dev/null +++ b/src/br/com/parg/viacep/ViaCEPException.java @@ -0,0 +1,78 @@ +/* + * PARG Desenvolvimento de Sistemas + * Pablo Alexander - pablo@parg.com.br + * + * Obtem um CEP no ViaCEP + */ +package br.com.parg.viacep; + +/** + * Classe para registrar uma exceção de CEP + * @author Pablo Alexander da Rocha Gonçalves + */ +public class ViaCEPException extends Exception { + private String CEP; + private String Classe; + + /** + * Gera uma nova exceção + * + * @param message descrição do erro + * @param classe classe da excessão original + */ + public ViaCEPException(String message, String classe) { + super(message); + + this.CEP = ""; + this.Classe = classe; + } + + /** + * Gera uma nova exceção e define o CEP que foi solicitado + * + * @param message descrição do erro + * @param cep CEP que foi usado durante o processo + * @param classe classe da excessão original + */ + public ViaCEPException(String message, String cep, String classe) { + super(message); + + this.CEP = cep; + this.Classe = classe; + } + + /** + * Define o CEP da exceção + * + * @param cep + */ + public void setCEP(String cep) { + this.CEP = cep; + } + + /** + * Retorna o CEP da exceção + * + * @return String CEP + */ + public String getCEP() { + return this.CEP; + } + + /** + * Retorna se tem algum CEP + * + * @return boolean + */ + public boolean hasCEP() { + return !this.CEP.isEmpty(); + } + + /** + * Retorna a classe da excessão original + * @return + */ + public String getClasse() { + return Classe; + } +} diff --git a/src/br/com/projeto/dao/EmprestimoDao.java b/src/br/com/projeto/dao/EmprestimoDao.java new file mode 100644 index 0000000..a3bf76e --- /dev/null +++ b/src/br/com/projeto/dao/EmprestimoDao.java @@ -0,0 +1,462 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Emprestimo; +import br.com.projeto.model.Funcionario; +import br.com.projeto.model.Livro; +import br.com.projeto.model.Usuario; +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.PreparedStatement; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class EmprestimoDao { + + private Connection conexao; + + //conexao + public EmprestimoDao(Connection conexao) { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public EmprestimoDao() throws Exception { + this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates. + } + + public void cadastrarEmprestimo(Emprestimo obj) throws SQLException { + try { + String sql = "INSERT INTO tb_emprestimos (data_emprestimo, data_entrega_agendada, " + + "observacoes, tb_funcionarios_id, tb_livros_id, tb_leitores_id ) " + + "VALUES (?,?,?,?,?,?)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); + stmt.setTimestamp(1, obj.getData_emprestimo()); + stmt.setTimestamp(2, obj.getData_entrega_agendada()); //calculo de dada aqui + stmt.setString(3, obj.getObservacoes()); + System.out.println("obj.getTb_funcionarios_id().getId()" + obj.getTb_funcionarios_id().getId()); + System.out.println("obj.getTb_funcionarios_id()" + obj.getTb_funcionarios_id()); + stmt.setInt(4, obj.getTb_funcionarios_id().getId()); + stmt.setInt(5, obj.getTb_livros_id().getId()); + stmt.setInt(6, obj.getTb_leitores_id().getId());// aqui extende + + stmt.execute(); + ResultSet rs = stmt.getGeneratedKeys(); + int key = rs.next() ? rs.getInt(1) : 0; + if (key != 0) { + System.out.println("Generated key=" + key); + } + //stmt.execute(); + stmt.close(); + String sql2 = "update tb_emprestimos set static_id_emprestimo = ? where data_emprestimo = ? and tb_livros_id = ?"; + java.sql.PreparedStatement stmt2 = conexao.prepareStatement(sql2); + stmt2.setInt(1, key); + stmt2.setTimestamp(2, obj.getData_emprestimo()); + stmt2.setInt(3, obj.getTb_livros_id().getId()); + stmt2.execute(); + stmt2.close(); + + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro ao cadastrar emprestimo: " + e); + System.out.println(e); + } + JOptionPane.showMessageDialog(null, "Emprestimo realizado com sucesso"); + } + + //retorna o cvalor de quaquer campo passando a id de usuaraio) + public String getUserData(String table, int id) throws SQLException { + String value = null; + String sql = "select " + table + " from tb_leitores where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = rs.getString(table); + } + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + return value; + + } + + public void SomaEmprestimo(int value, int id) throws SQLException { + String sql = "update tb_leitores set qtd_emprestimos = ? where id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setInt(1, value + 1); + stmt.setInt(2, id); + stmt.execute(); + stmt.close(); + } + + public void DiminuiEmprestimo(int value, int id) throws SQLException { + String sql = "update tb_leitores set qtd_emprestimos = ? where id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setInt(1, value); + stmt.setInt(2, id); + + stmt.execute(); + stmt.close(); + } + + //lixeira : excluir + public void AddEmprestimoToUser(int data) throws SQLException { + String sql = "select emprestmax, qtd_emprestimos from tb_leitores where id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, data); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Usuario obj = new Usuario(); + obj.setEmprestmax(rs.getInt("emprestmax")); + obj.setQtd_emprestimos(rs.getInt("qtd_emprestimos")); + int limite = obj.getEmprestmax(); + int emprestados = obj.getQtd_emprestimos(); + int restantes = limite - emprestados; + if (restantes > 0) { + int newEmprestados = emprestados + 1; + String sql2 = "UPDATE tb_leitores set QTD_EMPRESTIMOS = ? where ID= ?"; + java.sql.PreparedStatement prepstmt = conexao.prepareStatement(sql2); + prepstmt.setInt(1, newEmprestados); + prepstmt.setInt(2, data); + System.out.println("newemprestados = " + newEmprestados); + prepstmt.executeUpdate(); + prepstmt.close(); + } else { + } + } + rs.close(); + stmt.close(); + } + + public List buscarDevolucoes() throws SQLException { + List lista = new ArrayList<>(); + String sql = "select e.id, u.nome, l.titulo, f.nome, e.data_emprestimo, e.data_entrega_agendada, l.disponibilidade, e.observacoes, e.data_devolucao " + + "from tb_emprestimos as e " + + "inner join tb_leitores as u on(e.tb_leitores_id = u.id) " + + "inner join tb_livros as l on(e.tb_livros_id = l.id) " + + "inner join tb_funcionarios as f on(e.tb_funcionarios_id = f.id)"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Emprestimo e = new Emprestimo(); + Usuario u = new Usuario(); + Livro l = new Livro(); + Funcionario f = new Funcionario(); + int idEmprest = rs.getInt("e.id"); + e.setId(idEmprest);//----------------------------------------------------------id + u.setNome(rs.getString("u.nome")); + e.setTb_leitores_id(u); //-----------------------------------------------------nome do leitor + l.setTitulo(rs.getString("l.titulo")); + e.setTb_livros_id(l);//--------------------------------------------------------titulo livro + f.setNome(rs.getString("f.nome")); + e.setTb_funcionarios_id(f);// -------------------------------------------------nome do funcionario + e.setData_emprestimo(rs.getTimestamp("e.data_emprestimo")); // ----------------data emrpestimo + e.setData_entrega_agendada(rs.getTimestamp("e.data_entrega_agendada"));// -----data entraga + e.setAtraso(this.calculaAtraso(idEmprest));//----------------------------------atraso + e.setObservacoes(rs.getString("e.observacoes"));//-----------------------------observacoes + e.setData_devolucao(rs.getTimestamp("e.data_devolucao"));//--------------------data devolucao + lista.add(e); + } + return lista; + } + + public int calculaAtraso(int id) throws SQLException { + int i = 0; + String sql = "select data_entrega_agendada, data_devolucao from tb_emprestimos where id = ?"; + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + stmt.setInt(1, id); + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { //add daata entrega para fazer 0 se for null (ja entregue) + Timestamp tmstEnt = rs.getTimestamp("data_devolucao"); + if (tmstEnt == null) { + Timestamp tmsp = rs.getTimestamp("data_entrega_agendada"); + Timestamp now = new Timestamp(System.currentTimeMillis());//tempo agora + long _timeGap = now.getTime() - tmsp.getTime(); + long tempo = _timeGap / 1000 / 60 / 60 / 24; + Long l = new Long(tempo); + i = l.intValue(); + } else { + i = 0; + } + } + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + return i; + } + + public Timestamp addDays(Timestamp date, int days) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + cal.add(Calendar.DATE, days); + return new Timestamp(cal.getTime().getTime()); + } + + public String displayData(Timestamp timestamp) { + String s = new SimpleDateFormat("dd/MM/yyyy HH:mm").format(timestamp); + return s; + } + + public double calculaMulta(int dias) { + double taxa = 0; + String sql = "select * from tb_opcoes where parentid = ?"; + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + stmt.setInt(1, 25); + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { + taxa = rs.getInt("data"); + } + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + System.out.println("taxa: " + taxa); + return (taxa / 100) * dias; + } + + public void reemsprestaLivro(String disponibilidade, int iddoemprestimo) throws SQLException { + String sql = "update tb_emprestimos set data_entrega_agendada = ? where id = " + iddoemprestimo; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + + //get livro idponibilidade + Timestamp now = new Timestamp(System.currentTimeMillis());//tempo agora + Timestamp newdata = this.addDays(now, Integer.parseInt(disponibilidade)); + stmt.setString(1, String.valueOf(newdata)); + stmt.execute(); + stmt.close(); + } + + public void devolveLivro(int emprestimoId) throws SQLException, IOException, Exception {// não passa como objeto pois saida dos campos teve pós-formatação dos dados + String sql = "update tb_emprestimos as e " + + " INNER JOIN tb_leitores AS u ON (e.tb_leitores_id = u.id) " + + " INNER JOIN tb_livros AS l ON(e.tb_livros_id = l.id) " + + " set e.data_devolucao = ?, e.tb_funcionarios_iddevol = ?, l.is_emprestado = ? " + + " where e.id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + Timestamp tmsp = new Timestamp(System.currentTimeMillis()); + String now = String.valueOf(tmsp); + String contentid; + contentid = new String(Files.readAllBytes(Paths.get("C:\\Librography\\LoggedIn"))); + Funcionario fnc = new Funcionario(); + fnc.setId(Integer.parseInt(contentid)); + stmt.setString(1, now); + stmt.setInt(2, fnc.getId()); + stmt.setInt(3, 0); + + int leitorId = this.getEmprestimoFKeyData("tb_leitores_id", emprestimoId);//pega o id do usor + int qtdEmprestimos = Integer.parseInt(this.getUserData("qtd_emprestimos", leitorId));//pega qtd emrpestimos + int valorsubtraido = qtdEmprestimos - 1; + this.DiminuiEmprestimo(valorsubtraido, leitorId);//coloca o valor subtraido valor no db + stmt.setInt(4, emprestimoId); + System.out.println("now =" + now + "/ valorsubtraido=" + valorsubtraido + "/ contentid=" + contentid); + stmt.execute(); + stmt.close(); + + Emprestimo emprestimo = new Emprestimo(); + Usuario user = new Usuario(); + user.setId(leitorId); + Livro livro = new Livro(); + livro.setId(this.getEmprestimoFKeyData("tb_livros_id", emprestimoId)); + emprestimo.setData_devolucao(tmsp); + emprestimo.setId(emprestimoId); + emprestimo.setTb_funcionarios_id(fnc); + emprestimo.setTb_leitores_id(user); + emprestimo.setData_emprestimo(this.getEmprestData(emprestimo.getId())); + emprestimo.setTb_livros_id(livro); + ReciboDao recibodao = new ReciboDao(); + recibodao.imprimirDevolucao58(emprestimo); + + + if (contentid != null) { + JOptionPane.showMessageDialog(null, "Devolução realizada com sucesso"); + } + //checkbox gravar options + } + + public String campoStatusColor(Timestamp data_devolucao, int atraso) throws Exception { + if (atraso < -15) { //errado + String d = "+ de 15 dias restantes ou ilimitado"; + return d; + } else if (data_devolucao == null && atraso == 0) { + String d = "Vence Hoje"; + return d; + } else if (data_devolucao != null && atraso == 0) { + String d = "Devolvido"; + return d; + } else if (atraso > 0 && atraso < 15) { + String d = String.valueOf(atraso) + " dias de atraso"; + return d; + } else if (atraso > 15) { + String d = "+ de 15 dias de atraso"; + return d; + } else { + int x = Math.abs(atraso); + String d = String.valueOf(x) + " dias restantes"; + return d; + } + } + + public String campoStatus(Timestamp data_devolucao, int atraso) { + if (atraso > 0) { + String d = String.valueOf(atraso) + " dias de atraso"; + return d; + } else if (data_devolucao == null && atraso == 0) { + String d = "Vence Hoje"; + return d; + } else if (data_devolucao != null && atraso == 0) { + String d = "Devolvido"; + return d; + } else { + int x = Math.abs(atraso); + String d = String.valueOf(x) + " dias restantes"; + return d; + } + } + + public Timestamp getEmprestData(int id_do_emprestimo) throws SQLException { + Timestamp timestamp = null; + String value = ""; + String sql = "select * from tb_emprestimos where id = " + id_do_emprestimo; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) { + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = rs.getString("data_devolucao"); + if (value == null) { + timestamp = null; + } else { + timestamp = Timestamp.valueOf(value); + } + } + } + return timestamp; + } + + public int getEmprestimoFKeyData(String tabelaInt, int id_do_emprestimo) throws SQLException { + int value = 0; + String sql = "select * from tb_emprestimos where id = " + id_do_emprestimo; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) { + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = Integer.parseInt(rs.getString(tabelaInt)); + } + } + return value; + } + + public int calculaemprestimosrestantes(int userid) throws SQLException { + int emprestimosrestantes = 0; + String sql = "select * from tb_leitores where id = " + userid; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) { + ResultSet rs = stmt.executeQuery(sql); + while (rs.next()) { + int limitedeemprestimos = Integer.parseInt(rs.getString("emprestmax")); + int livrosemprestados = Integer.parseInt(rs.getString("qtd_emprestimos")); + emprestimosrestantes = limitedeemprestimos - livrosemprestados; + } + } + return emprestimosrestantes; + } + + public Timestamp livroStatusEmprestimo(int idDoLivro) throws SQLException { //pode restoornar varios valores por ex: ja edevolvidos + Timestamp ts = null; + String value = null; + String sql = "select * from tb_emprestimos where tb_livros_id = " + idDoLivro + " and data_devolucao IS NULL"; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + System.out.println("iddolivro=" + idDoLivro); + try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) { + ResultSet rs = stmt.executeQuery(sql); + while (rs.next()) { + value = rs.getString("data_entrega_agendada"); + if (value == null) { + ts = null; + } else { + ts = Timestamp.valueOf(value); + } + } + } + System.out.println("saida de livroStatusEmprestimo:" + ts); + return ts; + } + + public String campoStatusLista(int livroid) throws Exception { + String d = ""; + LivroDao livro = new LivroDao(); + Timestamp dataentregaagendada = this.livroStatusEmprestimo(livroid); + String emprestimo = livro.getLivroData("disponibilidade", livroid); + String estaemprestado = livro.getLivroData("is_emprestado", livroid); + Timestamp now = new Timestamp(System.currentTimeMillis());//tempo agora + System.out.println("now= " + now.getTime() + "dataentregaagendada.getTime() = " + dataentregaagendada); + int i; + String emprestimoFormat = ""; + if (emprestimo.equals("1")) { + emprestimoFormat = "1 dia"; + } else { + emprestimoFormat = emprestimo + " dias"; + } + if (dataentregaagendada != null) { + long _timeGap = now.getTime() - dataentregaagendada.getTime(); + long tempo = _timeGap / 1000 / 60 / 60 / 24; + Long l = new Long(tempo); + i = l.intValue(); + System.out.println("i = diferenca de dias = " + i + "/estaemprestado = " + estaemprestado); + + if (estaemprestado.equals("1") && i <= 0) { + d = "emprestado até " + this.displayData(dataentregaagendada) + ". empréstimo é de " + emprestimoFormat; + } + if (estaemprestado.equals("1") && i > 0) { + d = "emprestimo atrasado " + i + " dias ! empréstimo é de até " + emprestimoFormat; + } + } else { + if (!emprestimo.equals("0")) { + d = "Disponível para empréstimo de até " + emprestimoFormat; + } + if (emprestimo.equals("0")) { + d = "Volume para leitura nas dependências apenas"; + } + } + { + return d; + } + } + + public int getEmprestimoId(Timestamp data_emprestimo, int idDoLivro) throws SQLException { + int value = 0; + String sql = "select * from tb_emprestimos where data_emprestimo = ? and tb_livros_id = ?"; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setTimestamp(1, data_emprestimo); + stmt.setInt(2, idDoLivro); + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { + value = rs.getInt("static_id_emprestimo"); + System.out.println("value dentro- " + value); + } + stmt.close(); + System.out.println("value " + value); + return value; + + // System.out.println("value fora- " + value); + +// stmt.setString(1, nome); +// ResultSet rs = stmt.executeQuery(); + } +} diff --git a/src/br/com/projeto/dao/FornecedorDao.java b/src/br/com/projeto/dao/FornecedorDao.java new file mode 100644 index 0000000..77c0560 --- /dev/null +++ b/src/br/com/projeto/dao/FornecedorDao.java @@ -0,0 +1,258 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Fornecedor; +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FornecedorDao { + private Connection conexao; + + //conexao + public FornecedorDao(Connection conexao) { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public FornecedorDao() { + this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates. + } + + + //metodo cadastrar Fornecedor + public void cadastrarFornecedor(Fornecedor obj){ + try { + //criar instrução SQL + String sql = "insert into tb_fornecedores (nome, cnpj, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado )" + + "values(?,?,?,?,?,?,?,?,?,?,?,?)"; + //prepare o sql + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getNome()); + stmt.setString(2, obj.getCnpj()); + stmt.setString(3, obj.getEmail()); + stmt.setString(4, obj.getTelefone()); + stmt.setString(5, obj.getCelular()); + stmt.setString(6, obj.getCep()); + stmt.setString(7, obj.getEndereco()); + stmt.setString(8, obj.getNumero()); + stmt.setString(9, obj.getComplemento()); + stmt.setString(10, obj.getBairro()); + stmt.setString(11, obj.getCidade()); + stmt.setString(12, obj.getUf()); + + //execute + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Funcionário cadastrado com sucesso"); + + + } catch (Exception erro) { + JOptionPane.showMessageDialog(null,"erro!" + erro); + } + } + + //método editar + public void alterarFornecedor(Fornecedor obj) { + try { + // 1 - instrucoes sql + String sql = "update tb_fornecedores set nome = ?, cnpj = ?, email = ?,telefone = ?, celular = ?, cep = ?, endereco = ?, numero = ?, complemento = ?, bairro = ?, cidade = ?, estado = ? where id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getNome()); + stmt.setString(2, obj.getCnpj()); + stmt.setString(3, obj.getEmail()); + stmt.setString(4, obj.getTelefone()); + stmt.setString(5, obj.getCelular()); + stmt.setString(6, obj.getCep()); + stmt.setString(7, obj.getEndereco()); + stmt.setString(8, obj.getNumero()); + stmt.setString(9, obj.getComplemento()); + stmt.setString(10, obj.getBairro()); + stmt.setString(11, obj.getCidade()); + stmt.setString(12, obj.getUf()); + stmt.setInt(13, obj.getId()); + + // 3 - executar + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Funcionário alterado com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro!" + e); + } + } + + //método excluir + // TODO: implementar caixa de confirmação + public void excluirFornecedor(Fornecedor obj) { + try { + String sql = "delete from tb_fornecedores where id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Funcionário excluido com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + // função para unir botoes salvar e atualizar no mesmo botao, já detectando + // TODO + public void checkIdFornecedorExist(Fornecedor obj) { + try { + String sql = "SELECT 1 FROM tb_fornecedores WHERE id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + + try (ResultSet rs = stmt.executeQuery()){ + if (rs.next()) { + // por funcao "editar" aqui + JOptionPane.showMessageDialog(null, "Id já existe" + rs); + } else { + // por funcao "novo" e "salvar" aqui + // implemetar um função para campos obrigatorios + JOptionPane.showMessageDialog(null, "Id não existe" + rs); + } + }catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + + //buscar Fornecedores com botao + public Fornecedor buscarFornecedor(String nome) { + try { + String sql = "select * from tb_fornecedores where nome = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + Fornecedor obj = new Fornecedor(); + + while(rs.next()){ + //obj.setId(rs.getInt("id")); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setCnpj(rs.getString("cnpj")); + obj.setEmail(rs.getString("email")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + } + return obj; + + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + + + } + + //filtrar usuarios + public ListpesquisarNomeFornecedores(String nome) { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_fornecedores where nome like ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + while(rs.next()){ + Fornecedor obj = new Fornecedor(); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setCnpj(rs.getString("cnpj")); + obj.setEmail(rs.getString("email")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + lista.add(obj); + } + return lista; + } catch (SQLException e) { + JOptionPane.showMessageDialog(null,"Erro! " + e); + } + return null; + } + + // tabela listando usuarios + public List listarFornecedores() { + try { + //criar uma lista para armazenar + List lista = new ArrayList<>(); + + //instrucao sql + String sql = "select * from tb_fornecedores"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + + // resultSet representa um conjunto de dados do BD + ResultSet rs = stmt.executeQuery(); + while(rs.next()) { + Fornecedor obj = new Fornecedor(); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setCnpj(rs.getString("cnpj")); + obj.setEmail(rs.getString("email")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + + + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + public int getFornecedorId(String nome) throws SQLException { + int id = 0; + String sql = "select * from tb_fornecedores where nome = ?"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { + id = rs.getInt("id"); + } + stmt.close(); + return id; + } + + + +} diff --git a/src/br/com/projeto/dao/FuncionarioDao.java b/src/br/com/projeto/dao/FuncionarioDao.java new file mode 100644 index 0000000..ce2c101 --- /dev/null +++ b/src/br/com/projeto/dao/FuncionarioDao.java @@ -0,0 +1,321 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Funcionario; +import br.com.projeto.view.FormMenu; +import br.com.projeto.view.FormLogin; +import br.com.projeto.view.FormMenuAtendente; +import br.com.projeto.view.FormMenuUsuario; +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.PreparedStatement; +import java.io.IOException; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FuncionarioDao { + private Connection conexao; + + //conexao + public FuncionarioDao(Connection conexao) { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public FuncionarioDao() { + this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates. + } + + + //metodo cadastrar Funcionario + public void cadastrarFuncionario(Funcionario obj){ + try { + String sql = "insert into tb_funcionarios (nome, rg, cpf, email, senha, cargo, nivel_acesso, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado )" + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getNome()); + stmt.setString(2, obj.getRg()); + stmt.setString(3, obj.getCpf()); + stmt.setString(4, obj.getEmail()); + stmt.setString(5, obj.getSenha()); + stmt.setString(6, obj.getCargo()); + stmt.setString(7, obj.getNivel_acesso()); + stmt.setString(8, obj.getTelefone()); + stmt.setString(9, obj.getCelular()); + stmt.setString(10, obj.getCep()); + stmt.setString(11, obj.getEndereco()); + stmt.setString(12, obj.getNumero()); + stmt.setString(13, obj.getComplemento()); + stmt.setString(14, obj.getBairro()); + stmt.setString(15, obj.getCidade()); + stmt.setString(16, obj.getUf()); + + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Funcionário cadastrado com sucesso"); + + + } catch (Exception erro) { + JOptionPane.showMessageDialog(null,"erro!" + erro); + } + } + //método editar + public void alterarFuncionario(Funcionario obj) { + try { + // 1 - instrucoes sql + String sql = "update tb_funcionarios set nome = ?, rg = ?, cpf = ?, email = ?, senha = ?, cargo = ?, nivel_acesso = ?,telefone = ?, celular = ?, cep = ?, endereco = ?, numero = ?, complemento = ?, bairro = ?, cidade = ?, estado = ? where id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getNome()); + stmt.setString(2, obj.getRg()); + stmt.setString(3, obj.getCpf()); + stmt.setString(4, obj.getEmail()); + stmt.setString(5, obj.getSenha()); + stmt.setString(6, obj.getCargo()); + stmt.setString(7, obj.getNivel_acesso()); + stmt.setString(8, obj.getTelefone()); + stmt.setString(9, obj.getCelular()); + stmt.setString(10, obj.getCep()); + stmt.setString(11, obj.getEndereco()); + stmt.setString(12, obj.getNumero()); + stmt.setString(13, obj.getComplemento()); + stmt.setString(14, obj.getBairro()); + stmt.setString(15, obj.getCidade()); + stmt.setString(16, obj.getUf()); + stmt.setInt(17, obj.getId()); + + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Funcionário alterado com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro!" + e); + } + } + + // TODO: implementar caixa de confirmação + public void excluirFuncionario(Funcionario obj) { + try { + String sql = "delete from tb_funcionarios where id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Funcionário excluido com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + // TODO: função para unir botoes salvar e atualizar no mesmo botao, já detectando + public void checkIdFuncionarioExist(Funcionario obj) { + try { + String sql = "SELECT 1 FROM tb_funcionarios WHERE id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + + try (ResultSet rs = stmt.executeQuery()){ + if (rs.next()) { + // por funcao "editar" aqui + JOptionPane.showMessageDialog(null, "Id já existe" + rs); + } else { + // por funcao "novo" e "salvar" aqui + // implemetar um função para campos obrigatorios + JOptionPane.showMessageDialog(null, "Id não existe" + rs); + } + }catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + //buscar Funcionarios com botao + public Funcionario buscarFuncionario(String nome) { + try { + String sql = "select * from tb_funcionarios where nome = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + Funcionario obj = new Funcionario(); + + while(rs.next()){ + //obj.setId(rs.getInt("id")); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setRg(rs.getString("rg")); + obj.setCpf(rs.getString("cpf")); + obj.setEmail(rs.getString("email")); + obj.setSenha(rs.getString("senha")); + obj.setCargo(rs.getString("cargo")); + obj.setNivel_acesso(rs.getString("nivel_acesso")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + } + return obj; + + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + + + } + //filtrar usuarios + public ListpesquisarNomeFuncionarios(String nome) { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_funcionarios where nome like ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + + while(rs.next()){ + Funcionario obj = new Funcionario(); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setRg(rs.getString("rg")); + obj.setCpf(rs.getString("cpf")); + obj.setEmail(rs.getString("email")); + obj.setSenha(rs.getString("senha")); + obj.setCargo(rs.getString("cargo")); + obj.setNivel_acesso(rs.getString("nivel_acesso")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + + lista.add(obj); + } + return lista; + } catch (SQLException e) { + JOptionPane.showMessageDialog(null,"Erro! " + e); + } + return null; + } + + // tabela listando usuarios + public List listarFuncionarios() { + try { + //criar uma lista para armazenar + List lista = new ArrayList<>(); + + //instrucao sql + String sql = "select * from tb_funcionarios"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + + // resultSet representa um conjunto de dados do BD + ResultSet rs = stmt.executeQuery(); + while(rs.next()) { + Funcionario obj = new Funcionario(); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setRg(rs.getString("rg")); + obj.setCpf(rs.getString("cpf")); + obj.setEmail(rs.getString("email")); + obj.setSenha(rs.getString("senha")); + obj.setCargo(rs.getString("cargo")); + obj.setNivel_acesso(rs.getString("nivel_acesso")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + public void efetuarLogin(String email, String senha) throws IOException { + try { + String sql = "select * from tb_funcionarios where email=? and senha=?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, email); + stmt.setString(2, senha); + ResultSet rs = stmt.executeQuery(); + + if(rs.next()) { + if(rs.getString("nivel_acesso").equals("Administrador")) { + + FormMenu menu = new FormMenu(); + menu.usuarioLogado = rs.getString("nome"); + menu.idLogado = rs.getInt("id"); + + menu.setVisible(true); + JOptionPane.showMessageDialog(null, "Seja Bem Vindo ao Sistema, " + menu.usuarioLogado + "!"); + } else if (rs.getString("nivel_acesso").equals("Atendente")) { + FormMenuAtendente menu = new FormMenuAtendente(); + menu.usuarioLogado = rs.getString("nome"); + menu.idLogado = rs.getInt("id"); + menu.setVisible(true); + JOptionPane.showMessageDialog(null, "Seja Bem Vindo ao Sistema, " + menu.usuarioLogado + "!"); + } else if(rs.getString("nivel_acesso").equals("Usuario")) { + FormMenuUsuario menu = new FormMenuUsuario(); + menu.usuarioLogado = rs.getString("nome"); + menu.idLogado = rs.getInt("id"); + menu.setVisible(true); + JOptionPane.showMessageDialog(null, "Seja Bem Vindo ao Sistema, " + menu.usuarioLogado + "!"); + } + + }else { + + FormLogin tlogin = new FormLogin(); + tlogin.pack(); + tlogin.setLocationRelativeTo(null); + JOptionPane.showMessageDialog(null, "Dados Inválidos! Tente Novamente!"); + tlogin.setVisible(true); + } + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + public String getFuncionarioData(String table, int id) throws SQLException { + String value = null; + + String sql = "select " + table + " from tb_funcionarios where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = rs.getString(table); + //System.out.println("value dentro- " + value); + } + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + // System.out.println("value fora- " + value); + return value; + } +} diff --git a/src/br/com/projeto/dao/LivroDao.java b/src/br/com/projeto/dao/LivroDao.java new file mode 100644 index 0000000..f68fe64 --- /dev/null +++ b/src/br/com/projeto/dao/LivroDao.java @@ -0,0 +1,395 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Fornecedor; +import br.com.projeto.model.Livro; +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.PreparedStatement; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class LivroDao { + + private Connection conexao; + + //conexao + public LivroDao(Connection conexao) { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public LivroDao() throws Exception { + this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates. + } + + //metodo cadastrar Livro + public void cadastrarLivro(Livro obj) { + try { + String sql = "insert into tb_livros (titulo, autor, editora, isbn, ano, serie, " + + "edicao, idioma, tb_fornecedores_id, piso, corredor,posicao, secao, disponibilidade, observacoes, is_emprestado)" + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + try ( //prepare o sql + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) { + stmt.setString(1, obj.getTitulo()); + stmt.setString(2, obj.getAutor()); + stmt.setString(3, obj.getEditora()); + stmt.setString(4, obj.getIsbn()); + stmt.setString(5, obj.getAno()); + stmt.setString(6, obj.getSerie()); + stmt.setString(7, obj.getEdicao()); + stmt.setString(8, obj.getIdioma()); + stmt.setInt(9, obj.getFornecedor().getId()); + System.out.println("obj.getFornecedor().getId()" + obj.getFornecedor().getId()); + stmt.setString(10, obj.getPiso()); + stmt.setString(11, obj.getCorredor()); + stmt.setString(12, obj.getPosicao()); + stmt.setString(13, obj.getSecao()); + stmt.setInt(14, obj.getDisponibilidade()); + stmt.setString(15, obj.getObservacoes()); + stmt.setInt(16, 0);//set emprestado to false + + stmt.execute(); //???????? + stmt.close(); + } + JOptionPane.showMessageDialog(null, "Livro cadastrado com sucesso"); + + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro em cadastrar livro!" + erro); + } + } + + //método editar + public void alterarLivro(Livro obj) throws FileNotFoundException, IOException { + try { + // 1 - instrucoes sql + String sql = "update tb_livros set titulo = ?, autor = ?, editora = ?, isbn = ?, ano = ?, serie = ?, edicao = ?, idioma = ?, tb_fornecedores_id =?, piso = ?, corredor = ?, posicao = ?, secao = ?, disponibilidade = ?, observacoes = ? where id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getTitulo()); + stmt.setString(2, obj.getAutor()); + stmt.setString(3, obj.getEditora()); + stmt.setString(4, obj.getIsbn()); + stmt.setString(5, obj.getAno()); + stmt.setString(6, obj.getSerie()); + stmt.setString(7, obj.getEdicao()); + stmt.setString(8, obj.getIdioma()); + try { + stmt.setInt(9, obj.getFornecedor().getId()); + + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Selecione um Fornecedor"); + return; + } + + stmt.setString(10, obj.getPiso()); + stmt.setString(11, obj.getCorredor()); + stmt.setString(12, obj.getPosicao()); + stmt.setString(13, obj.getSecao()); + stmt.setInt(14, obj.getDisponibilidade()); + stmt.setString(15, obj.getObservacoes()); + + stmt.setInt(16, obj.getId()); + + // 3 - executar + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Livro alterado com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro!" + e); + } + } + + //método excluir + // TODO: implementar caixa de confirmação + public void excluirLivro(Livro obj) { + try { + String sql = "delete from tb_livros where id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Livro excluido com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + // função para unir botoes salvar e atualizar no mesmo botao, já detectando + // TODO + public void checkIdLivroExist(Livro obj) { + try { + String sql = "SELECT 1 FROM tb_livros WHERE id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + + try (ResultSet rs = stmt.executeQuery()) { + if (rs.next()) { + // por funcao "editar" aqui + JOptionPane.showMessageDialog(null, "Id já existe" + rs); + } else { + // por funcao "novo" e "salvar" aqui + // implemetar um função para campos obrigatorios + JOptionPane.showMessageDialog(null, "Id não existe" + rs); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + //buscar Livros com botao + public Livro buscarLivro(String titulo) { + try { + String sql = "select * from tb_livros where titulo = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, titulo); + ResultSet rs = stmt.executeQuery(); + Livro obj = new Livro(); + + while (rs.next()) { + obj.setId(rs.getInt("id")); + obj.setTitulo(rs.getString("titulo")); + obj.setAutor(rs.getString("autor")); + obj.setEditora(rs.getString("editora")); + obj.setIsbn(rs.getString("isbn")); + obj.setAno(rs.getString("ano")); + obj.setSerie(rs.getString("serie")); + obj.setEdicao(rs.getString("edicao")); + obj.setIdioma(rs.getString("idioma")); + obj.setPiso(rs.getString("piso")); + obj.setCorredor(rs.getString("corredor")); + obj.setPosicao(rs.getString("posicao")); + obj.setSecao(rs.getString("secao")); + obj.setDisponibilidade(rs.getInt("disponibilidade")); + obj.setObservacoes(rs.getString("observacoes")); + + } + return obj; + + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + + } + + //filtrar usuarios + public List pesquisarNomeLivros(String titulo) { + try { + List lista = new ArrayList<>(); + String sql = "select p.id, p.titulo, p.autor, p.editora, p.isbn, p.ano, p.serie," + + " p.edicao, p.idioma, f.nome, p.piso, p.corredor," + + " p.posicao, p.secao, p.disponibilidade, p.observacoes from tb_livros as p inner join tb_fornecedores as " + + "f on(p.tb_fornecedores_id=f.id) where p.titulo like ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, titulo); + ResultSet rs = stmt.executeQuery(); + + while (rs.next()) { + Livro obj = new Livro(); + Fornecedor f = new Fornecedor(); + obj.setId(rs.getInt("p.id")); + obj.setTitulo(rs.getString("p.titulo")); + obj.setAutor(rs.getString("p.autor")); + obj.setEditora(rs.getString("p.editora")); + obj.setIsbn(rs.getString("p.isbn")); + obj.setAno(rs.getString("p.ano")); + obj.setSerie(rs.getString("p.serie")); + obj.setEdicao(rs.getString("p.edicao")); + obj.setIdioma(rs.getString("p.idioma")); + f.setNome(rs.getString("nome")); + obj.setFornecedor(f); + obj.setPiso(rs.getString("p.piso")); + obj.setCorredor(rs.getString("p.corredor")); + obj.setPosicao(rs.getString("p.posicao")); + obj.setSecao(rs.getString("p.secao")); + obj.setDisponibilidade(rs.getInt("disponibilidade")); + obj.setObservacoes(rs.getString("observacoes")); + + lista.add(obj); + } + return lista; + } catch (SQLException e) { + throw new RuntimeException(e); + //JOptionPane.showMessageDialog(null,"Erro! " + e); + } + //return null; + } + + public List buscarLivros() { + try { + List lista = new ArrayList<>(); + String sql = "select p.id, p.titulo, p.autor, p.editora, p.isbn, p.ano, p.serie," + + " p.edicao, p.idioma, f.nome, p.piso, p.corredor," + + " p.posicao, p.secao, p.disponibilidade, p.observacoes, p.is_emprestado from tb_livros as p inner join tb_fornecedores as " + + "f on(p.tb_fornecedores_id=f.id)"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Fornecedor f = new Fornecedor(); + Livro obj = new Livro(); + obj.setId(rs.getInt("p.id")); + obj.setTitulo(rs.getString("p.titulo")); + obj.setAutor(rs.getString("p.autor")); + obj.setEditora(rs.getString("p.editora")); + obj.setIsbn(rs.getString("p.isbn")); + obj.setAno(rs.getString("p.ano")); + obj.setSerie(rs.getString("p.serie")); + obj.setEdicao(rs.getString("p.edicao")); + obj.setIdioma(rs.getString("p.idioma")); + f.setNome(rs.getString("f.Nome")); + obj.setFornecedor(f); + obj.setPiso(rs.getString("p.piso")); + obj.setCorredor(rs.getString("p.corredor")); + obj.setPosicao(rs.getString("p.posicao")); + obj.setSecao(rs.getString("p.secao")); + obj.setDisponibilidade(rs.getInt("p.disponibilidade")); //adiconado p + obj.setObservacoes(rs.getString("p.observacoes"));//adicionado p + obj.setEmprestado(rs.getBoolean("p.is_emprestado")); + lista.add(obj); + } + return lista; + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + //função seta livro esta emprestado ou nao (boolean) + public void setIsEmprestado(int data) throws SQLException { + + String sql = "UPDATE tb_livros SET is_emprestado = 1 where id =" + data; + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.execute(); + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + public String getLivroData(String table, int id) throws SQLException { + String value = null; + + String sql = "select " + table + " from tb_livros where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = rs.getString(table); + //System.out.println("value dentro- " + value); + } + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + // System.out.println("value fora- " + value); + return value; + } + + public void addObservacoes(String data, int livroid) throws SQLException { + + String sql = "UPDATE tb_livros SET observacoes = '" + data + "' where id =" + livroid; + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.execute(); + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + public int getFornecedorIndex(String name) throws SQLException { + int value = 0; + String sql = "select * from tb_fornecedores where nome = '" + name + "'"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = Integer.parseInt(rs.getString("id")); + //System.out.println("value dentro- " + value); + } + stmt.close(); + return value; + } + + public int getLivroIndex(String name) throws SQLException { + int value = 0; + String sql = "select * from tb_Livros where titulo = '" + name + "'"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = Integer.parseInt(rs.getString("id")); + //System.out.println("value dentro- " + value); + } + stmt.close(); + return value; + } + + public void importaLivrosXlsx(String path) throws FileNotFoundException, IOException, SQLException, InvalidFormatException { + conexao.setAutoCommit(false); + FornecedorDao fornecedorDao = new FornecedorDao(); + java.sql.PreparedStatement stmt = null; + InputStream pkg = new FileInputStream(path); + XSSFWorkbook wb = new XSSFWorkbook(pkg); + XSSFSheet sheet = wb.getSheetAt(0); + Row row; + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + row = (Row) sheet.getRow(i); + String sql = "insert into tb_livros (titulo, autor, editora, isbn, ano, serie, " + + "edicao, idioma, tb_fornecedores_id, piso, corredor,posicao, secao," + + " disponibilidade, observacoes, is_emprestado)" + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + stmt = conexao.prepareStatement(sql); + String titulo = row.getCell(1).getStringCellValue(); + stmt.setString(1, titulo); + //System.out.println("nome = " + nome); + stmt.setString(2, row.getCell(2).getStringCellValue()); + stmt.setString(3, row.getCell(3).getStringCellValue()); + stmt.setString(4, row.getCell(4).getStringCellValue()); + stmt.setString(5, row.getCell(5).getStringCellValue()); + stmt.setString(6, row.getCell(6).getStringCellValue()); + stmt.setString(7, row.getCell(7).getStringCellValue()); + stmt.setString(8, row.getCell(8).getStringCellValue()); + String forcedorNome = row.getCell(9).getStringCellValue(); + //System.out.println("forcedorNome" + forcedorNome); + String fornec = String.valueOf(fornecedorDao.getFornecedorId(forcedorNome)); + // System.out.println("fornec= " + fornec);//erro aqui + stmt.setString(9, fornec); + stmt.setString(10, row.getCell(10).getStringCellValue()); + stmt.setString(11, row.getCell(11).getStringCellValue()); + stmt.setString(12, row.getCell(12).getStringCellValue()); + stmt.setString(13, row.getCell(13).getStringCellValue()); + stmt.setString(14, row.getCell(14).getStringCellValue()); + stmt.setString(15, row.getCell(15).getStringCellValue()); + stmt.setInt(16, 0);//qtd_emprestimos//0 + + stmt.execute(); + + } + conexao.commit(); + stmt.close(); + conexao.close(); + JOptionPane.showMessageDialog(null, " planilha de Livros importada com sucesso"); + } + +} diff --git a/src/br/com/projeto/dao/MultaDao.java b/src/br/com/projeto/dao/MultaDao.java new file mode 100644 index 0000000..bde636d --- /dev/null +++ b/src/br/com/projeto/dao/MultaDao.java @@ -0,0 +1,108 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Multa; +import br.com.projeto.model.Usuario; +import com.mysql.jdbc.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class MultaDao { + + private Connection conexao; + + //conexao + public MultaDao(Connection conexao) { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public MultaDao() throws Exception { + this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates. + } + + public void cadastrarMulta(Multa obj) throws SQLException { + String sql = "insert into tb_multa (dias_atraso, valor_multa, tb_leitores_id , tb_emprestimos_id, esta_pago) " + + " values(?,?,?,?,?)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setInt(1, obj.getDias_atraso()); + stmt.setDouble(2, obj.getValor_multa()); + stmt.setInt(3, obj.getTb_leitores_id()); + stmt.setInt(4, obj.getTb_emprestimos_id()); + stmt.setBoolean(5, false); + stmt.execute(); + } + + public List listaMulta(int idDoEmprestimo) throws SQLException { + + List lista = new ArrayList<>(); + String sql = "select * from tb_multa where tb_emprestimos_id = ?"; + com.mysql.jdbc.PreparedStatement stmt = (com.mysql.jdbc.PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, idDoEmprestimo); + ResultSet rs = stmt.executeQuery(); + + while (rs.next()) { + Multa obj = new Multa(); + obj.setId(rs.getInt("idmulta")); + obj.setDias_atraso(rs.getInt("dias_atraso")); + obj.setValor_multa(rs.getInt("valor_multa")); + obj.setEsta_pago(rs.getBoolean("esta_pago")); + obj.setTb_leitores_id(rs.getInt("tb_leitores_id")); + obj.setTb_emprestimos_id(rs.getInt("tb_emprestimos_id")); + + + lista.add(obj); + } + return lista; + } + + public boolean seJaExiste(int idDoEmprestimo) throws SQLException { + boolean Empduplicado = false; //veirifique se o id do emprestimo ja existe em multas + String sql = "select * from tb_multa where tb_emprestimos_id = " + idDoEmprestimo; + com.mysql.jdbc.PreparedStatement stmt = (com.mysql.jdbc.PreparedStatement) conexao.prepareStatement(sql); + String key = String.valueOf(idDoEmprestimo); + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + String result = rs.getString("tb_emprestimos_id");//comparar pra ver se ja exite em multa +// + if (result == key) {//!result.equals("")) { + System.out.println("result"+ result + " == key" + key); + Empduplicado = false; + } else { + System.out.println("result"+ result + " != key" + key); + Empduplicado = true; + } + }return Empduplicado; + } + + public void zeraMulta ( int multaId) throws SQLException { + String sql = "update tb_multa set valor_multa = ? where idmulta = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setInt(1, 0);// pode mudar funcao a partir daqui para setar valor a ser pago (parcelado) + stmt.setInt(2, multaId); + stmt.execute(); + stmt.close(); + } + + + + + + + +} diff --git a/src/br/com/projeto/dao/OptionsDao.java b/src/br/com/projeto/dao/OptionsDao.java new file mode 100644 index 0000000..2a2995d --- /dev/null +++ b/src/br/com/projeto/dao/OptionsDao.java @@ -0,0 +1,418 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Options; +import com.mysql.jdbc.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class OptionsDao { + + private Connection conexao; + + //conexao + public OptionsDao(Connection conexao) throws SQLException { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public OptionsDao() { + this.conexao = new ConexaoBanco().pegarConexao(); //To change body of generated methods, choose Tools | Templates. + } + + //Tabela está usando Adjacency List Model aqui em option + //função retorna qualquer campo unico na tabela de options de acordo com o id na tabela + public String retornaOption(int data) throws SQLException { + String value = null; + String sql = "select data from tb_opcoes where id = " + data; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = rs.getString("data"); + } + System.out.println("data = " + data + "e value = " + value); + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + return value; + } + + //metodo cadastrar + public void cadastrarPiso(Options obj) { + try { + String sql = "insert into tb_opcoes (data, parentid)" + + "values(?,1)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getPiso()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Piso cadastrado com sucesso"); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método Listar + public List listarPiso() { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_opcoes where parentid = 1"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Options obj = new Options(); + obj.setPiso(rs.getString("data")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + public void excluirPiso(Options obj) { //esta pegando a id da box nao do banco + try { + String sql = "delete from tb_opcoes where data = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, obj.getPiso()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Piso excluido com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + //############################################################################ + + //metodo cadastrar + public void cadastrarCorredor(Options obj) { + try { + String sql = "insert into tb_opcoes (data, parentid)" + + "values(?,2)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getCorredor()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Corredor cadastrado com sucesso"); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método Listar + public List listarCorredor() { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_opcoes where parentid = 2"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Options obj = new Options(); + obj.setCorredor(rs.getString("data")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + //metodo excluir + public void excluirCorredor(Options obj) { + try { + String sql = "delete from tb_opcoes where data = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, obj.getCorredor()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Corredor excluido com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + // ######################################################################### + + //metodo cadastrar + public void cadastrarPosicao(Options obj) { + try { + String sql = "insert into tb_opcoes (data, parentid)" + + "values(?,3)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getPosicao()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Posição cadastrado com sucesso"); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método Listar + public List listarPosicao() { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_opcoes where parentid = 3"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Options obj = new Options(); + obj.setPosicao(rs.getString("data")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + //metodo excluir + public void excluirPosicao(Options obj) { + try { + String sql = "delete from tb_opcoes where data = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, obj.getPosicao()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Posicao excluida com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + //############################################################################ + + //metodo cadastrar + public void cadastrarSecao(Options obj) { + try { + String sql = "insert into tb_opcoes (data, parentid)" + + "values(?,4)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getSecao()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Seção cadastrada com sucesso"); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método Listar + public List listarSecao() { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_opcoes where parentid = 4"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Options obj = new Options(); + obj.setSecao(rs.getString("data")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + //metodo excluir + public void excluirSecao(Options obj) { + try { + String sql = "delete from tb_opcoes where data = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, obj.getSecao()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Seçào excluida com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + //############################################################################ + + public void cadastrarDisponibilidade(Options obj) { + try { + String sql = "insert into tb_opcoes (data, parentid)" + + "values(?,5)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getDisponibilidade()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Disponibilidade de Livro cadastrada com sucesso"); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método Listar + public List listarDisponibilidade() { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_opcoes where parentid = 5"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Options obj = new Options(); + obj.setDisponibilidade(rs.getString("data")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + //metodo excluir + public void excluirDisponibilidade(Options obj) { + try { + String sql = "delete from tb_opcoes where data = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, obj.getDisponibilidade()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Disponibilidade excluida com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + //############################################################################### + + //Tipos_de_usuarios + public void cadastrarTipos_de_usuarios(Options obj) { + try { + String sql = "insert into tb_opcoes (data, parentid)" + + "values(?,9)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getTipos_de_usuarios()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Tipo de Usuário de Livro cadastrado com sucesso"); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método Listar + public List listarTipos_de_usuarios() { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_opcoes where parentid = 9"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Options obj = new Options(); + obj.setTipos_de_usuarios(rs.getString("data")); + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + //metodo excluir + public void excluirTipos_de_usuarios(Options obj) { + try { + String sql = "delete from tb_opcoes where data = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, obj.getTipos_de_usuarios()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Tipos de Usuário excluida com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + //################################################################ + public void setIp(Options obj) { + String sql = "update tb_opcoes set data = ? , parentid = 12 where id = 23"; + java.sql.PreparedStatement stmt; + try { + stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getServer_ip()); + stmt.execute(); + stmt.close(); + } catch (SQLException ex) { + JOptionPane.showMessageDialog(null, "erro!" + ex); + } + } + + public void setLibraryName(Options obj) { + String sql = "update tb_opcoes set data = ? , parentid = 11 where id = 15"; + java.sql.PreparedStatement stmt; + try { + stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getLibrary_name()); + stmt.execute(); + stmt.close(); + } catch (SQLException ex) { + JOptionPane.showMessageDialog(null, "erro!" + ex); + } + } + + public void setReceiptMsg(Options obj) { + String sql = "update tb_opcoes set data = ? where id = 28 and parentid = 27"; + java.sql.PreparedStatement stmt; + try { + stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getReceiptMsg()); + stmt.execute(); + stmt.close(); + } catch (SQLException ex) { + JOptionPane.showMessageDialog(null, "erro!" + ex); + } + } + + public void setLibraryAddress(Options obj) { + String sql = "update tb_opcoes set data = ? , parentid = 12 where id = 16"; + java.sql.PreparedStatement stmt; + try { + stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getLibrary_address()); + stmt.execute(); + stmt.close(); + } catch (SQLException ex) { + JOptionPane.showMessageDialog(null, "erro!" + ex); + } + } + + public void setTheme(int index) { + String sql = "update tb_opcoes set data = ? where parentid = 29 and id = 30"; + java.sql.PreparedStatement stmt; + //index = 0; + String tema = ""; + if (index == 0) { + tema = "Tema Claro"; + } else if (index == 1) { + tema = "Tema Escuro"; + } + try { + stmt = conexao.prepareStatement(sql); + stmt.setString(1, tema); + stmt.execute(); + stmt.close(); + } catch (SQLException ex) { + JOptionPane.showMessageDialog(null, "erro!" + ex); + } + } +} diff --git a/src/br/com/projeto/dao/ReciboDao.java b/src/br/com/projeto/dao/ReciboDao.java new file mode 100644 index 0000000..edecd39 --- /dev/null +++ b/src/br/com/projeto/dao/ReciboDao.java @@ -0,0 +1,192 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Emprestimo; +import br.com.projeto.model.Recibo; +import br.com.projeto.model.Utilitarios; +import com.mysql.jdbc.Connection; +import java.awt.Font; +import java.awt.print.PrinterException; +import java.io.File; +import java.io.IOException; +import java.io.PrintWriter; +import javax.print.PrintException; +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.PrintRequestAttributeSet; +import javax.print.attribute.standard.Copies; +import javax.print.attribute.standard.MediaPrintableArea; +import javax.print.attribute.standard.MediaSizeName; +import javax.print.attribute.standard.MediaTray; +import javax.swing.JEditorPane; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class ReciboDao { + + private File ticket; + + //contstrutor + public ReciboDao(File f) { + ticket = f; + } + + private Connection conexao; + + //conexao + public ReciboDao(Connection conexao) { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //construtor + public ReciboDao() { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //metodo cadastrar Funcionario + public void cadastrarReciboEmprestimo(Recibo obj) { + try { + String sql = "insert into tb_recibos (emprestimo_id, data_emprestimo, data_devolucao_agendada, livro, usuario, tipo, status, funcionario)" + + "values(?,?,?,?,?,?,?,?)"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setInt(1, obj.getEmprestimoid()); + stmt.setString(2, obj.getData_emprestimo()); + stmt.setString(3, obj.getData_devolução_agendada()); + stmt.setString(4, obj.getLivro()); + stmt.setString(5, obj.getUsuario()); + stmt.setString(6, obj.getTipo()); + stmt.setString(7, obj.getStatus()); + stmt.setString(8, obj.getFuncionario()); + stmt.execute(); + stmt.close(); + this.imprimeCupom58Emprestimo(obj); + String filepath = "C:\\Librography\\ticket.txt"; + PrintWriter pw = new PrintWriter(filepath); + pw.close(); + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + public void imprimeCupom58Emprestimo(Recibo obj) throws IOException, PrinterException, PrintException { + int msg = obj.getEmprestimoid(); + //String Code = String.format("%08d", msg); + Utilitarios util = new Utilitarios(); + util.gerarBarCode("emprestimo", msg); + util.gerarQrCode("emprestimo", msg); + String toCode = String.format("%08d", msg); + String QrImage = "file:C:\\\\Librography\\\\images\\\\Emprestimos\\\\QrCode\\\\" + toCode; + String BarCodeImage = "file:C:\\\\Librography\\\\images\\\\Emprestimos\\\\BarCode\\\\" + toCode; + String filepath = "C:\\Librography\\ticket"; + File arquivo = new File(filepath); + if (!arquivo.exists()) { + arquivo.createNewFile(); + } + String line = "Obrigado pela Preferencia"; /// options get message + JEditorPane p = new JEditorPane("file:" + filepath); + p.setContentType("text/html"); + p.setFont(new Font("Helvetica", 0, 9)); + StringBuilder htmlContent = new StringBuilder(); + htmlContent.append("

"); + htmlContent.append("

"); + htmlContent.append("BIBLIOTECA DE HOGWARTS

"); + htmlContent.append("

RECIBO DE EMPRÉSTIMO


"); + htmlContent.append("LIVRO:"); + htmlContent.append("

").append(String.format("%26s", obj.getLivro())).append("

"); + htmlContent.append(" Data Empréstimo:"); + htmlContent.append("

").append(String.format("%26s", obj.getData_emprestimo().toUpperCase())).append("

"); + htmlContent.append(" Data Devolução:"); + htmlContent.append("

").append(String.format("%26s", obj.getData_devolução_agendada().toUpperCase())).append("

"); + htmlContent.append(" Usuário: ").append(String.format("%26s", obj.getUsuario().toUpperCase())).append("
"); + htmlContent.append(" Atendente: ").append(String.format("%26s", obj.getFuncionario().toUpperCase())).append("
"); + htmlContent.append(""); + htmlContent.append("
"); + htmlContent.append("").append(line).append("


"); + htmlContent.append(""); + htmlContent.append(""); + p.setText(htmlContent.toString()); + this.imprimirTicket(p, 1); + arquivo.delete(); + } + + public void imprimirTicket(JEditorPane resultadoTicket, int numeroImpressoes) { + try { + for (int i = 0; i < numeroImpressoes; i++) { + PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet(); + attributes.add(new Copies(1)); + attributes.add(MediaTray.TOP); + attributes.add(MediaSizeName.INVOICE); + attributes.add(new MediaPrintableArea(0f, 0f, 58f, 210f, MediaPrintableArea.MM)); + PrintService service = PrintServiceLookup.lookupDefaultPrintService(); + System.out.println("impressora" + service.getName()); + if (!service.getName().equals("Dialogo")) { + resultadoTicket.print(null, null, true, null, attributes, true); + } else { + resultadoTicket.print(null, null, false, service, attributes, false); + } + } + } catch (PrinterException e) { + e.printStackTrace(); + } + } + + public void imprimirDevolucao58(Emprestimo obj) throws IOException, Exception { + int msg = obj.getId(); + Utilitarios util = new Utilitarios(); + util.gerarBarCode("devolucao", msg); + util.gerarQrCode("devolucao", msg); + String toCode = String.format("%08d", msg); + String QrImage = "file:C:\\\\Librography\\\\images\\\\Devolucao\\\\QrCode\\\\" + toCode; + String BarCodeImage = "file:C:\\\\Librography\\\\images\\\\Devolucao\\\\BarCode\\\\" + toCode; + String filepath = "C:\\Librography\\ticket"; + File arquivo = new File(filepath); + if (!arquivo.exists()) { + arquivo.createNewFile(); + } + String line = "Obrigado pela Preferencia"; /// options get message + JEditorPane p = new JEditorPane("file:" + filepath); + p.setContentType("text/html"); + p.setFont(new Font("Helvetica", 0, 9)); + UsuarioDao usuariodao = new UsuarioDao(); + LivroDao livrodao = new LivroDao(); + FuncionarioDao funcionarioDao = new FuncionarioDao(); + String usuarioNome = usuariodao.getUserData("nome", obj.getTb_leitores_id().getId()); + String funcionarioNome = funcionarioDao.getFuncionarioData("nome", obj.getTb_funcionarios_id().getId()); + String livroNome = livrodao.getLivroData("titulo", obj.getTb_livros_id().getId()); + StringBuilder htmlContent = new StringBuilder(); + htmlContent.append("

"); + htmlContent.append("

"); + OptionsDao optionsdao = new OptionsDao(); + String LivryName = optionsdao.retornaOption(15); + + htmlContent.append(LivryName).append("

"); + htmlContent.append("

RECIBO DE DEVOLUÇÃO


"); + htmlContent.append("LIVRO:"); + htmlContent.append("

").append(String.format("%26s", livroNome)).append("

"); + htmlContent.append(" Data Empréstimo:"); + htmlContent.append("

").append(String.format("%26s", util.formatData(obj.getData_emprestimo()))).append("

"); + htmlContent.append(" Data Devolução:"); + htmlContent.append("

").append(String.format("%26s", util.formatData(obj.getData_devolucao()))).append("

"); + htmlContent.append(" Usuário: ").append(String.format("%26s", usuarioNome.toUpperCase())).append("
"); + htmlContent.append(" Atendente: ").append(String.format("%26s", funcionarioNome.toUpperCase())).append("
"); + htmlContent.append(""); + htmlContent.append("
"); + htmlContent.append("").append(line).append("


"); + htmlContent.append(""); + htmlContent.append(""); + p.setText(htmlContent.toString()); + this.imprimirTicket(p, 1); + arquivo.delete(); + + } + +} diff --git a/src/br/com/projeto/dao/UsuarioDao.java b/src/br/com/projeto/dao/UsuarioDao.java new file mode 100644 index 0000000..0a0c649 --- /dev/null +++ b/src/br/com/projeto/dao/UsuarioDao.java @@ -0,0 +1,326 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.dao; + +import br.com.projeto.jdbc.ConexaoBanco; +import br.com.projeto.model.Usuario; +import com.mysql.jdbc.Connection; +import com.mysql.jdbc.PreparedStatement; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import javax.swing.JOptionPane; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class UsuarioDao { + + private Connection conexao; + + //construtor + public UsuarioDao() { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + //metodo cadastrar usuario + public void cadastrarUsuario(Usuario obj) { + try { + //criar instrução SQL + String sql = "insert into tb_leitores (nome, rg, cpf, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado, curso, curso_ano, qtd_emprestimos, emprestmax, observacoes, tipo, is_locked )" + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + try (java.sql.PreparedStatement stmt = conexao.prepareStatement(sql)) { + stmt.setString(1, obj.getNome()); + stmt.setString(2, obj.getRg()); + stmt.setString(3, obj.getCpf()); + stmt.setString(4, obj.getEmail()); + stmt.setString(5, obj.getTelefone()); + stmt.setString(6, obj.getCelular()); + stmt.setString(7, obj.getCep()); + stmt.setString(8, obj.getEndereco()); + stmt.setString(9, obj.getNumero()); + stmt.setString(10, obj.getComplemento()); + stmt.setString(11, obj.getBairro()); + stmt.setString(12, obj.getCidade()); + stmt.setString(13, obj.getUf()); + stmt.setString(14, obj.getCurso()); + stmt.setString(15, obj.getSerie()); + stmt.setInt(16, obj.getQtd_emprestimos());//qtd_emprestimos + stmt.setInt(17, obj.getEmprestmax()); + stmt.setString(18, obj.getObservacoes()); + stmt.setString(19, obj.getTipo()); + stmt.setBoolean(20, obj.isIs_locked()); + + //execute + stmt.execute(); + } + JOptionPane.showMessageDialog(null, "Usuário cadastrado com sucesso"); + // https://www.guj.com.br/t/exemplo-de-preparedstatement/33609/5 + + } catch (Exception erro) { + JOptionPane.showMessageDialog(null, "erro!" + erro); + } + } + + //método editar + public void alterarUsuario(Usuario obj) { + try { + // 1 - instrucoes sql + String sql = "update tb_leitores set nome = ?, rg = ?, cpf = ?, email = ?, telefone = ?, celular = ?, cep = ?, endereco = ?, numero = ?, complemento = ?, bairro = ?, cidade = ?, estado = ?, curso = ?, curso_ano = ?, emprestmax=?, observacoes=?, tipo = ? where id = ? "; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, obj.getNome()); + stmt.setString(2, obj.getRg()); + stmt.setString(3, obj.getCpf()); + stmt.setString(4, obj.getEmail()); + stmt.setString(5, obj.getTelefone()); + stmt.setString(6, obj.getCelular()); + stmt.setString(7, obj.getCep()); + stmt.setString(8, obj.getEndereco()); + stmt.setString(9, obj.getNumero()); + stmt.setString(10, obj.getComplemento()); + stmt.setString(11, obj.getBairro()); + stmt.setString(12, obj.getCidade()); + stmt.setString(13, obj.getUf()); + stmt.setString(14, obj.getCurso()); + stmt.setString(15, obj.getSerie()); + stmt.setInt(16, obj.getEmprestmax()); + stmt.setString(17, obj.getObservacoes()); + stmt.setString(18, obj.getTipo()); + + stmt.setInt(19, obj.getId()); + + // 3 - executar + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Cliente alterado com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro!" + e); + } + } + + //método excluir + // TODO: implementar caixa de confirmação + public void excluirUsuario(Usuario obj) { + try { + String sql = "delete from tb_leitores where id = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setInt(1, obj.getId()); + stmt.execute(); + stmt.close(); + JOptionPane.showMessageDialog(null, "Usuário excluido com sucesso! "); + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + } + + //buscar usuarios com botao + public Usuario buscarUsuario(String nome) { + try { + String sql = "select * from tb_leitores where nome = ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + Usuario obj = new Usuario(); + while (rs.next()) { + //obj.setId(rs.getInt("id")); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setRg(rs.getString("rg")); + obj.setCpf(rs.getString("cpf")); + obj.setEmail(rs.getString("email")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + obj.setCurso(rs.getString("curso")); + obj.setSerie(rs.getString("curso_ano")); + obj.setEmprestmax(rs.getInt("emprestmax")); + obj.setObservacoes(rs.getString("observacoes")); + obj.setTipo(rs.getString("tipo")); + } + return obj; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + //filtrar usuarios + public List pesquisarNome(String nome) { + try { + List lista = new ArrayList<>(); + String sql = "select * from tb_leitores where nome like ?"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + + while (rs.next()) { + Usuario obj = new Usuario(); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setRg(rs.getString("rg")); + obj.setCpf(rs.getString("cpf")); + obj.setEmail(rs.getString("email")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + obj.setCurso(rs.getString("curso")); + obj.setSerie(rs.getString("curso_ano")); + obj.setEmprestmax(rs.getInt("emprestmax")); + obj.setObservacoes(rs.getString("observacoes")); + obj.setTipo(rs.getString("tipo")); + lista.add(obj); + } + return lista; + } catch (SQLException e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + // tabela listando usuarios + public List listarUsuarios() { + try { + //criar uma lista para armazenar + List lista = new ArrayList<>(); + + //instrucao sql + String sql = "select * from tb_leitores"; + PreparedStatement stmt = (PreparedStatement) conexao.prepareStatement(sql); + + // resultSet representa um conjunto de dados do BD + ResultSet rs = stmt.executeQuery(); + while (rs.next()) { + Usuario obj = new Usuario(); + obj.setId(rs.getInt("id")); + obj.setNome(rs.getString("nome")); + obj.setRg(rs.getString("rg")); + obj.setCpf(rs.getString("cpf")); + obj.setEmail(rs.getString("email")); + obj.setTelefone(rs.getString("telefone")); + obj.setCelular(rs.getString("celular")); + obj.setCep(rs.getString("cep")); + obj.setEndereco(rs.getString("endereco")); + obj.setNumero(rs.getString("numero")); + obj.setComplemento(rs.getString("complemento")); + obj.setBairro(rs.getString("bairro")); + obj.setCidade(rs.getString("cidade")); + obj.setUf(rs.getString("estado")); + obj.setCurso(rs.getString("curso")); + obj.setSerie(rs.getString("curso_ano")); + obj.setEmprestmax(rs.getInt("emprestmax")); + obj.setObservacoes(rs.getString("observacoes")); + obj.setTipo(rs.getString("tipo")); + + lista.add(obj); + } + return lista; + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! " + e); + } + return null; + } + + public int pegaUserIdpeloNome(String nome) throws SQLException { + int id = 0; + String sql = "select * from tb_leitores where nome = ?"; + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql); + stmt.setString(1, nome); + ResultSet rs = stmt.executeQuery(); + if (rs.next()) { + id = rs.getInt("id"); + } + stmt.close(); + return id; + } + + public String getUserData(String table, int id) throws SQLException { + String value = null; + + String sql = "select " + table + " from tb_leitores where id = " + id; // substituir por ? e stmt.setInt(1,data dá erro, ver o pq + try { + java.sql.PreparedStatement stmt = conexao.prepareStatement(sql);//createStatment nao suporta placeholders + ResultSet rs = stmt.executeQuery(sql); + if (rs.next()) { + value = rs.getString(table); + } + stmt.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + return value; + } + + public void importaUsuariosXls(String path) throws FileNotFoundException, IOException, SQLException, InvalidFormatException { + conexao.setAutoCommit(false); + java.sql.PreparedStatement stmt = null; + InputStream pkg = new FileInputStream(path); + XSSFWorkbook wb = new XSSFWorkbook(pkg); + XSSFSheet sheet = wb.getSheetAt(0); + Row row; + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + row = (Row) sheet.getRow(i); + String sql = "insert into tb_leitores (nome, rg, cpf, email, telefone, celular, cep, " + + "endereco, numero, complemento, bairro, cidade, estado, curso, curso_ano, " + + "qtd_emprestimos, emprestmax, observacoes, tipo, is_locked )" + + "values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; + stmt = conexao.prepareStatement(sql); + String nome = row.getCell(1).getStringCellValue(); + stmt.setString(1, nome); + System.out.println("nome = " + nome); + stmt.setString(2, row.getCell(2).getStringCellValue()); + stmt.setString(3, row.getCell(3).getStringCellValue()); + stmt.setString(4, row.getCell(4).getStringCellValue()); + stmt.setString(5, row.getCell(5).getStringCellValue()); + stmt.setString(6, row.getCell(6).getStringCellValue()); + stmt.setString(7, row.getCell(7).getStringCellValue()); + stmt.setString(8, row.getCell(8).getStringCellValue()); + stmt.setString(9, row.getCell(9).getStringCellValue()); + stmt.setString(10, row.getCell(10).getStringCellValue()); + stmt.setString(11, row.getCell(11).getStringCellValue()); + stmt.setString(12, row.getCell(12).getStringCellValue()); + stmt.setString(13, row.getCell(13).getStringCellValue()); + stmt.setString(14, row.getCell(14).getStringCellValue()); + stmt.setString(15, row.getCell(15).getStringCellValue()); + stmt.setInt(16, 0);//qtd_emprestimos//0 + //String id = (String) row.getCell(16).getStringCellValue(); + String emprestmax = row.getCell(16).getStringCellValue(); + // System.out.println("emprestmax = " + emprestmax); + stmt.setString(17, emprestmax); + stmt.setString(18, row.getCell(17).getStringCellValue()); + stmt.setString(19, row.getCell(18).getStringCellValue()); + stmt.setBoolean(20, false);// false//0 + stmt.execute(); + + } + conexao.commit(); + stmt.close(); + conexao.close(); + JOptionPane.showMessageDialog(null, " planilha de usuarios importada com sucesso"); + } + +} diff --git a/src/br/com/projeto/jdbc/ConexaoBanco.java b/src/br/com/projeto/jdbc/ConexaoBanco.java new file mode 100644 index 0000000..56caea1 --- /dev/null +++ b/src/br/com/projeto/jdbc/ConexaoBanco.java @@ -0,0 +1,97 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.jdbc; + +import br.com.projeto.model.Utilitarios; +import br.com.projeto.view.FormOptions; +import com.mysql.jdbc.Connection; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.DriverManager; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class ConexaoBanco { + + Utilitarios util = new Utilitarios(); + + public Connection pegarConexao() { + try { + + String contentIP = null; + String ipserverPath = ""; + String dbuserpPath = ""; + String dbpassPath = ""; + String dbTypePath = ""; + + switch (util.getOS()) { + case WINDOWS: + ipserverPath = "C:\\Librography\\ipserver"; + dbuserpPath = "C:\\Librography\\DBUser"; + dbpassPath = "C:\\Librography\\DBPass"; + dbTypePath = "C:\\Librography\\DBType"; + break; + case MAC: + ipserverPath = "//Applications//Librography.app//config//ipserver"; + dbuserpPath = "//Applications//Librography.app//config//DBUser"; + dbpassPath = "//Applications//Librography.app//config//DBPass"; + dbTypePath = "//Applications//Librography.app//config//DBType"; + break; + case LINUX: + ipserverPath = "//opt//Librography//ipserver"; + dbuserpPath = "//opt//Librography//DBUser"; + dbpassPath = "//opt//Librography//DBPass"; + dbTypePath = "//opt//Librography//DBType"; + // some stuff + break; + } + try { + contentIP = new String(Files.readAllBytes(Paths.get(ipserverPath))); + } catch (IOException ex) { + Logger.getLogger(FormOptions.class.getName()).log(Level.SEVERE, null, ex); + } + + + String contentUser; + contentUser = new String(Files.readAllBytes(Paths.get(dbuserpPath))); + + String contentPass; + contentPass = new String(Files.readAllBytes(Paths.get(dbpassPath))); + + String contentDBType = new String(Files.readAllBytes(Paths.get(dbTypePath))); + + String contentDBPort = ""; + if(contentDBType.contains("mysql")) { + contentDBPort = "3306"; + } else if (contentDBType.contains("postgresql")) { + contentDBPort = "5432"; + } + + //String url = "jdbc:mysql://" + contentIP + ":3306/applibrography"; //Nome da base de dados + String url = "jdbc:" + contentDBType + "://" + contentIP + ":" + contentDBPort + "/applibrography"; //Nome da base de dados + String user = contentUser; //nome do usuário do MySQL + String password = contentPass; //senha do MySQL + //System.out.println(url + user + password); + + Connection conexao = null; + conexao = (Connection) DriverManager.getConnection(url, user, password); + + + return conexao; + + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "erro" + e); + } + return null; + } + +} diff --git a/src/br/com/projeto/jdbc/TestarConexao.java b/src/br/com/projeto/jdbc/TestarConexao.java new file mode 100644 index 0000000..9733349 --- /dev/null +++ b/src/br/com/projeto/jdbc/TestarConexao.java @@ -0,0 +1,25 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.jdbc; +//classe para testar conexao +import javax.swing.JOptionPane; +import sun.applet.Main; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class TestarConexao { + public static void main(String[] args) { + try { + new ConexaoBanco().pegarConexao(); + JOptionPane.showMessageDialog(null,"conectado"); + } catch (Exception e) { + JOptionPane.showMessageDialog(null,"erro" + e); + } + } + +} diff --git a/src/br/com/projeto/model/Biblioteca.java b/src/br/com/projeto/model/Biblioteca.java new file mode 100644 index 0000000..57308a1 --- /dev/null +++ b/src/br/com/projeto/model/Biblioteca.java @@ -0,0 +1,70 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Biblioteca { + private int id; + private String piso; + private String corredor; + private String posicao; + private String secao; + private String mapa; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getPiso() { + return piso; + } + + public void setPiso(String piso) { + this.piso = piso; + } + + public String getCorredor() { + return corredor; + } + + public void setCorredor(String corredor) { + this.corredor = corredor; + } + + public String getPosicao() { + return posicao; + } + + public void setPosicao(String posicao) { + this.posicao = posicao; + } + + public String getSecao() { + return secao; + } + + public void setSecao(String secao) { + this.secao = secao; + } + + public String getMapa() { + return mapa; + } + + public void setMapa(String mapa) { + this.mapa = mapa; + } + + + +} diff --git a/src/br/com/projeto/model/DateRenderer.java b/src/br/com/projeto/model/DateRenderer.java new file mode 100644 index 0000000..e5d8013 --- /dev/null +++ b/src/br/com/projeto/model/DateRenderer.java @@ -0,0 +1,26 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; +import java.text.SimpleDateFormat; +import javax.swing.table.DefaultTableCellRenderer; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ + public class DateRenderer extends DefaultTableCellRenderer { + + public DateRenderer() { // This is a contructor + DateFormatter formatter = new DateFormatter("yyyy-MM-dd"); + } + + public class DateFormatter extends SimpleDateFormat { //This another class within a class + + public DateFormatter(String pattern) { + super(pattern); + } + } +} \ No newline at end of file diff --git a/src/br/com/projeto/model/Emprestimo.java b/src/br/com/projeto/model/Emprestimo.java new file mode 100644 index 0000000..b8100e6 --- /dev/null +++ b/src/br/com/projeto/model/Emprestimo.java @@ -0,0 +1,109 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; +import java.sql.Timestamp; + +import java.sql.Date; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Emprestimo { + private int id; + private Timestamp data_emprestimo; + private Timestamp data_devolucao; + private String observacoes; + private Funcionario tb_funcionarios_id; + private Livro tb_livros_id; + private Usuario tb_leitores_id; + private Timestamp data_entrega_agendada; + private int atraso; + private long static_id_emprestimo; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Timestamp getData_emprestimo() { + return data_emprestimo; + } + + public void setData_emprestimo(Timestamp data_emprestimo) { + this.data_emprestimo = data_emprestimo; + } + + public Timestamp getData_devolucao() { + return data_devolucao; + } + + public void setData_devolucao(Timestamp data_devolucao) { + this.data_devolucao = data_devolucao; + } + + + + public String getObservacoes() { + return observacoes; + } + + public void setObservacoes(String observacoes) { + this.observacoes = observacoes; + } + + public Funcionario getTb_funcionarios_id() { + return tb_funcionarios_id; + } + + public void setTb_funcionarios_id(Funcionario tb_funcionarios_id) { + this.tb_funcionarios_id = tb_funcionarios_id; + } + + public Livro getTb_livros_id() { + return tb_livros_id; + } + + public void setTb_livros_id(Livro tb_livros_id) { + this.tb_livros_id = tb_livros_id; + } + + public Usuario getTb_leitores_id() { + return tb_leitores_id; + } + + public void setTb_leitores_id(Usuario tb_leitores_id) { + this.tb_leitores_id = tb_leitores_id; + } + + public Timestamp getData_entrega_agendada() { + return data_entrega_agendada; + } + + public void setData_entrega_agendada(Timestamp data_entrega_agendada) { + this.data_entrega_agendada = data_entrega_agendada; + } + + public int getAtraso() { + return atraso; + } + + public void setAtraso(int atraso) { + this.atraso = atraso; + } + + public long getStatic_id_emprestimo() { + return static_id_emprestimo; + } + + public void setStatic_id_emprestimo(long static_id_emprestimo) { + this.static_id_emprestimo = static_id_emprestimo; + } + +} diff --git a/src/br/com/projeto/model/Fornecedor.java b/src/br/com/projeto/model/Fornecedor.java new file mode 100644 index 0000000..0a12be7 --- /dev/null +++ b/src/br/com/projeto/model/Fornecedor.java @@ -0,0 +1,40 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Fornecedor extends GlobalUser{ + private String cnpj; + private String nome; + + @Override + public String getNome() { + return nome; + } + + @Override + public void setNome(String nome) { + this.nome = nome; + } + + + + public String getCnpj() { + return cnpj; + } + + public void setCnpj(String cnpj) { + this.cnpj = cnpj; + } + + @Override + public String toString () { + return this.getNome(); + } +} diff --git a/src/br/com/projeto/model/Funcionario.java b/src/br/com/projeto/model/Funcionario.java new file mode 100644 index 0000000..45d2189 --- /dev/null +++ b/src/br/com/projeto/model/Funcionario.java @@ -0,0 +1,60 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Funcionario extends GlobalUser{ + private String cpf; + private String rg; + private String cargo; + private String nivel_acesso; + private String senha; + + public String getCpf() { + return cpf; + } + + public void setCpf(String cpf) { + this.cpf = cpf; + } + + public String getRg() { + return rg; + } + + public void setRg(String rg) { + this.rg = rg; + } + + public String getCargo() { + return cargo; + } + + public void setCargo(String cargo) { + this.cargo = cargo; + } + + public String getNivel_acesso() { + return nivel_acesso; + } + + public void setNivel_acesso(String nivel_acesso) { + this.nivel_acesso = nivel_acesso; + } + + public String getSenha() { + return senha; + } + + public void setSenha(String senha) { + this.senha = senha; + } + + +} diff --git a/src/br/com/projeto/model/GlobalUser.java b/src/br/com/projeto/model/GlobalUser.java new file mode 100644 index 0000000..46db085 --- /dev/null +++ b/src/br/com/projeto/model/GlobalUser.java @@ -0,0 +1,124 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class GlobalUser { + private int id; + private String nome; + private String celular; + private String telefone; + private String email; + private String endereco; + private String numero; + private String complemento; + private String bairro; + private String cidade; + private String uf; + private String cep; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getNome() { + return nome; + } + + public void setNome(String nome) { + this.nome = nome; + } + + public String getCelular() { + return celular; + } + + public void setCelular(String celular) { + this.celular = celular; + } + + public String getTelefone() { + return telefone; + } + + public void setTelefone(String telefone) { + this.telefone = telefone; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getEndereco() { + return endereco; + } + + public void setEndereco(String endereco) { + this.endereco = endereco; + } + + public String getNumero() { + return numero; + } + + public void setNumero(String numero) { + this.numero = numero; + } + + public String getComplemento() { + return complemento; + } + + public void setComplemento(String complemento) { + this.complemento = complemento; + } + + public String getBairro() { + return bairro; + } + + public void setBairro(String bairro) { + this.bairro = bairro; + } + + public String getCidade() { + return cidade; + } + + public void setCidade(String cidade) { + this.cidade = cidade; + } + + public String getUf() { + return uf; + } + + public void setUf(String uf) { + this.uf = uf; + } + + public String getCep() { + return cep; + } + + public void setCep(String cep) { + this.cep = cep; + } + + + +} diff --git a/src/br/com/projeto/model/Insert.java b/src/br/com/projeto/model/Insert.java new file mode 100644 index 0000000..a237899 --- /dev/null +++ b/src/br/com/projeto/model/Insert.java @@ -0,0 +1,76 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +import java.io.*; +import java.sql.*; +import java.util.*; +import java.util.regex.*; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; + +public class Insert { + + public static void main(String[] args) { + String fileName = "C:\\File.xls"; + Vector dataHolder = read(fileName); + saveToDatabase(dataHolder); + } + + public static Vector read(String fileName) { + Vector cellVectorHolder = new Vector(); + try { + FileInputStream myInput = new FileInputStream(fileName); + POIFSFileSystem myFileSystem = new POIFSFileSystem(myInput); + HSSFWorkbook myWorkBook = new HSSFWorkbook(myFileSystem); + HSSFSheet mySheet = myWorkBook.getSheetAt(0); + Iterator rowIter = mySheet.rowIterator(); + while (rowIter.hasNext()) { + HSSFRow myRow = (HSSFRow) rowIter.next(); + Iterator cellIter = myRow.cellIterator(); + Vector cellStoreVector = new Vector(); + while (cellIter.hasNext()) { + HSSFCell myCell = (HSSFCell) cellIter.next(); + cellStoreVector.addElement(myCell); + } + cellVectorHolder.addElement(cellStoreVector); + } + } catch (Exception e) { + e.printStackTrace(); + } + return cellVectorHolder; + } + + private static void saveToDatabase(Vector dataHolder) { + String username = ""; + String password = ""; + for (int i = 0; i < dataHolder.size(); i++) { + Vector cellStoreVector = (Vector) dataHolder.elementAt(i); + for (int j = 0; j < cellStoreVector.size(); j++) { + HSSFCell myCell = (HSSFCell) cellStoreVector.elementAt(j); + String st = myCell.toString(); + username = st.substring(0, 1); + password = st.substring(0); + } + try { + Class.forName("com.mysql.jdbc.Driver").newInstance(); + Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "root"); + Statement stat = con.createStatement(); + int k = stat.executeUpdate("insert into login(username,password) value('" + username + "','" + password + "')"); + System.out.println("Data is inserted"); + stat.close(); + con.close(); + } catch (Exception e) { + } + } + } + + +} diff --git a/src/br/com/projeto/model/Livro.java b/src/br/com/projeto/model/Livro.java new file mode 100644 index 0000000..5c9d713 --- /dev/null +++ b/src/br/com/projeto/model/Livro.java @@ -0,0 +1,192 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +import java.sql.Blob; + + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Livro { + private int id; + private String titulo; + private String autor; + private String editora; + private String isbn; + private String ano; + private String serie; + private String edicao; + private String idioma; + private String piso; + private String corredor; + private String posicao; + private String secao; + private Fornecedor fornecedor; + private int disponibilidade; + private boolean emprestado; + private String observacoes; + + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitulo() { + return titulo; + } + + public void setTitulo(String titulo) { + this.titulo = titulo; + } + + public String getAutor() { + return autor; + } + + public void setAutor(String autor) { + this.autor = autor; + } + + public String getEditora() { + return editora; + } + + public void setEditora(String editora) { + this.editora = editora; + } + + public String getIsbn() { + return isbn; + } + + public void setIsbn(String isbn) { + this.isbn = isbn; + } + + public String getAno() { + return ano; + } + + public void setAno(String ano) { + this.ano = ano; + } + + public String getSerie() { + return serie; + } + + public void setSerie(String serie) { + this.serie = serie; + } + + public String getEdicao() { + return edicao; + } + + public void setEdicao(String edicao) { + this.edicao = edicao; + } + + public String getIdioma() { + return idioma; + } + + public void setIdioma(String idioma) { + this.idioma = idioma; + } + + + public String getPiso() { + return piso; + } + + public void setPiso(String piso) { + this.piso = piso; + } + + public String getCorredor() { + return corredor; + } + + public void setCorredor(String corredor) { + this.corredor = corredor; + } + + public String getPosicao() { + return posicao; + } + + public void setPosicao(String posicao) { + this.posicao = posicao; + } + + public String getSecao() { + return secao; + } + + public void setSecao(String secao) { + this.secao = secao; + } + + public Fornecedor getFornecedor() { + return fornecedor; + } + + public void setFornecedor(Fornecedor fornecedor) { + this.fornecedor = fornecedor; + } + + public int getDisponibilidade() { + return disponibilidade; + } + + public void setDisponibilidade(int disponibilidade) { + this.disponibilidade = disponibilidade; + } + + public boolean isEmprestado() { + return emprestado; + } + + public void setEmprestado(boolean emprestado) { + this.emprestado = emprestado; + } + + + +// public String getDisponibilidade() { +// if(!"0".equals(disponibilidade)){ +// return disponibilidade + " Dias máx."; +// } else { +// return "Não Disponível/Emprestado"; +// } +// //return disponibilidade; +// } +// +// public void setDisponibilidade(String disponibilidade) { +// this.disponibilidade = disponibilidade; +// } + + public String getObservacoes() { + return observacoes; + } + + public void setObservacoes(String observacoes) { + this.observacoes = observacoes; + } + + +// public void getDisponibilidade(Object selectedItem) { +// throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. +// } + +} diff --git a/src/br/com/projeto/model/Multa.java b/src/br/com/projeto/model/Multa.java new file mode 100644 index 0000000..0fa96a3 --- /dev/null +++ b/src/br/com/projeto/model/Multa.java @@ -0,0 +1,71 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Multa { + + private int id; + private int dias_atraso; + private boolean esta_pago; + private int tb_leitores_id; + private int tb_emprestimos_id; + private double valor_multa; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getDias_atraso() { + return dias_atraso; + } + + public void setDias_atraso(int dias_atraso) { + this.dias_atraso = dias_atraso; + } + + public boolean isEsta_pago() { + return esta_pago; + } + + public void setEsta_pago(boolean esta_pago) { + this.esta_pago = esta_pago; + } + + public int getTb_leitores_id() { + return tb_leitores_id; + } + + public void setTb_leitores_id(int tb_leitores_id) { + this.tb_leitores_id = tb_leitores_id; + } + + public int getTb_emprestimos_id() { + return tb_emprestimos_id; + } + + public void setTb_emprestimos_id(int tb_emprestimos_id) { + this.tb_emprestimos_id = tb_emprestimos_id; + } + + public double getValor_multa() { + return valor_multa; + } + + public void setValor_multa(double valor_multa) { + this.valor_multa = valor_multa; + } + + + +} diff --git a/src/br/com/projeto/model/Options.java b/src/br/com/projeto/model/Options.java new file mode 100644 index 0000000..41efb21 --- /dev/null +++ b/src/br/com/projeto/model/Options.java @@ -0,0 +1,140 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Options { + private int id; + private String piso; + private String corredor; + private String posicao; + private String secao; + private String parent_id; + private String Observacoes; + private String disponibilidade; + private String tipos_de_usuarios; + private String server_ip; + private String library_name; + private String library_address; + private String receiptMsg; + + public String getPiso() { + return piso; + } + + public void setPiso(String piso) { + this.piso = piso; + } + + public String getCorredor() { + return corredor; + } + + public void setCorredor(String corredor) { + this.corredor = corredor; + } + + public String getPosicao() { + return posicao; + } + + public void setPosicao(String posicao) { + this.posicao = posicao; + } + + public String getSecao() { + return secao; + } + + public void setSecao(String secao) { + this.secao = secao; + } + + public String getParent_id() { + return parent_id; + } + + public void setParent_id(String parent_id) { + this.parent_id = parent_id; + } + +// @Override +// public String toString() { +// return this.getPiso(); +// } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getObservacoes() { + return Observacoes; + } + + public void setObservacoes(String Observacoes) { + this.Observacoes = Observacoes; + } + + public String getDisponibilidade() { + return disponibilidade; + } + + public void setDisponibilidade(String disponibilidade) { + this.disponibilidade = disponibilidade; + } + + public String getTipos_de_usuarios() { + return tipos_de_usuarios; + } + + public void setTipos_de_usuarios(String tipos_de_usuarios) { + this.tipos_de_usuarios = tipos_de_usuarios; + } + + public String getServer_ip() { + return server_ip; + } + + public void setServer_ip(String server_ip) { + this.server_ip = server_ip; + } + + public String getLibrary_name() { + return library_name; + } + + public void setLibrary_name(String library_name) { + this.library_name = library_name; + } + + public String getLibrary_address() { + return library_address; + } + + public void setLibrary_address(String library_address) { + this.library_address = library_address; + } + + @Override public String toString( ){ return this.getPiso(); } + + public String getReceiptMsg() { + return receiptMsg; + } + + public void setReceiptMsg(String receiptMsg) { + this.receiptMsg = receiptMsg; + } + + + +} diff --git a/src/br/com/projeto/model/QRCodeGenerator.java b/src/br/com/projeto/model/QRCodeGenerator.java new file mode 100644 index 0000000..1684f23 --- /dev/null +++ b/src/br/com/projeto/model/QRCodeGenerator.java @@ -0,0 +1,43 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com +// */ +import com.google.zxing.BarcodeFormat; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.oned.EAN8Writer; +import com.google.zxing.qrcode.QRCodeWriter; + +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Path; + +public class QRCodeGenerator { + + public void generateQRCodeImage(String text, int width, int height, String filePath) + throws WriterException, IOException { + QRCodeWriter qrCodeWriter = new QRCodeWriter(); + BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height); + + Path path = FileSystems.getDefault().getPath(filePath); + MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path); + } + + public void generateBarCodeImage(String text, int width, int height, String filePath) + throws WriterException, IOException { + EAN8Writer barCodeWriter = new EAN8Writer(); + BitMatrix bitMatrix = barCodeWriter.encode(text, BarcodeFormat.EAN_8, width, height); + + Path path = FileSystems.getDefault().getPath(filePath); + MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path); + } + +} \ No newline at end of file diff --git a/src/br/com/projeto/model/Recibo.java b/src/br/com/projeto/model/Recibo.java new file mode 100644 index 0000000..79322fa --- /dev/null +++ b/src/br/com/projeto/model/Recibo.java @@ -0,0 +1,114 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Recibo { + + private int id; + private int emprestimoid; + private String data_emprestimo; + private String data_devolução_agendada; + private String data_entrega; + private String livro; + private String usuario; + private String tipo; + private String multa; + private String status; + private String funcionario; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getEmprestimoid() { + return emprestimoid; + } + + public void setEmprestimoid(int emprestimoid) { + this.emprestimoid = emprestimoid; + } + + public String getData_emprestimo() { + return data_emprestimo; + } + + public void setData_emprestimo(String data_emprestimo) { + this.data_emprestimo = data_emprestimo; + } + + public String getData_devolução_agendada() { + return data_devolução_agendada; + } + + public void setData_devolução_agendada(String data_devolução_agendada) { + this.data_devolução_agendada = data_devolução_agendada; + } + + public String getData_entrega() { + return data_entrega; + } + + public void setData_entrega(String data_entrega) { + this.data_entrega = data_entrega; + } + + public String getLivro() { + return livro; + } + + public void setLivro(String livro) { + this.livro = livro; + } + + public String getUsuario() { + return usuario; + } + + public void setUsuario(String usuario) { + this.usuario = usuario; + } + + public String getMulta() { + return multa; + } + + public void setMulta(String multa) { + this.multa = multa; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public String getFuncionario() { + return funcionario; + } + + public void setFuncionario(String funcionario) { + this.funcionario = funcionario; + } + + public String getTipo() { + return tipo; + } + + public void setTipo(String tipo) { + this.tipo = tipo; + } + +} diff --git a/src/br/com/projeto/model/Usuario.java b/src/br/com/projeto/model/Usuario.java new file mode 100644 index 0000000..38fed86 --- /dev/null +++ b/src/br/com/projeto/model/Usuario.java @@ -0,0 +1,102 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Usuario extends GlobalUser{ + private String cpf; + private String rg; + private String curso; + private String serie; + private int emprestmax; + private String observacoes; + private String tipo; + private int qtd_emprestimos; + private boolean is_locked; + + public String getCpf() { + return cpf; + } + + public void setCpf(String cpf) { + this.cpf = cpf; + } + + public String getRg() { + return rg; + } + + public void setRg(String rg) { + this.rg = rg; + } + + public String getCurso() { + return curso; + } + + public void setCurso(String curso) { + this.curso = curso; + } + + public String getSerie() { + return serie; + } + + public void setSerie(String serie) { + this.serie = serie; + } + + public int getEmprestmax() { + return emprestmax; + } + + public void setEmprestmax(int emprestmax) { + this.emprestmax = emprestmax; + } + + public String getObservacoes() { + return observacoes; + } + + public void setObservacoes(String observacoes) { + this.observacoes = observacoes; + } + + public String getTipo() { + return tipo; + } + + public void setTipo(String tipo) { + this.tipo = tipo; + } + + public int getQtd_emprestimos() { + return qtd_emprestimos; + } + + public void setQtd_emprestimos(int qtd_emprestimos) { + this.qtd_emprestimos = qtd_emprestimos; + } + + public boolean isIs_locked() { + return is_locked; + } + + public void setIs_locked(boolean is_locked) { + this.is_locked = is_locked; + } + + + + + + + + +} diff --git a/src/br/com/projeto/model/Utilitarios.java b/src/br/com/projeto/model/Utilitarios.java new file mode 100644 index 0000000..1259def --- /dev/null +++ b/src/br/com/projeto/model/Utilitarios.java @@ -0,0 +1,297 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +import br.com.caelum.stella.validation.CNPJValidator; +import br.com.caelum.stella.validation.CPFValidator; +import br.com.projeto.view.FormCartao; +import com.google.zxing.WriterException; +import java.awt.Component; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.TimeZone; +import java.util.logging.Level; +import java.util.logging.Logger; +import static javax.management.Query.lt; +import javax.swing.ImageIcon; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.table.TableModel; +import static org.apache.commons.math3.fitting.leastsquares.LeastSquaresFactory.model; +import org.apache.poi.hssf.usermodel.HSSFCell; +import org.apache.poi.ss.usermodel.Cell; +import org.apache.poi.xssf.usermodel.XSSFCell; +import org.apache.poi.xssf.usermodel.XSSFRow; +import org.apache.poi.xssf.usermodel.XSSFSheet; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class Utilitarios { + + // método limpar tela + public void limpaTela(JPanel container) { + Component components[] = container.getComponents(); + for (Component component : components) { + if (component instanceof JTextField || component instanceof JTextArea) { + ((JTextField) component).setText(null); + } + if (component instanceof JComboBox) { + ((JComboBox) component).setSelectedIndex(-1); + } + if (component instanceof JLabel) { + ((JLabel) component).setIcon(null); + } + } + } + + public static boolean isNegative(double d) { + return Double.doubleToRawLongBits(d) < 0; + } + + public interface DateUtil { + + String ISO_DATE_FORMAT_ZERO_OFFSET = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; + String UTC_TIMEZONE_NAME = "UTC"; + + static SimpleDateFormat provideDateFormat() { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat(ISO_DATE_FORMAT_ZERO_OFFSET); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone(UTC_TIMEZONE_NAME)); + return simpleDateFormat; + } + } + + public String campoMulta(double multa) { + NumberFormat formatter = NumberFormat.getCurrencyInstance(); + if (multa <= 0) { + String e = "Em dia"; + return e; + } else { + String e = formatter.format(multa); + return e; + } + } + + public static int okcancel(String theMessage) { + int result = JOptionPane.showConfirmDialog((Component) null, theMessage, + "Atenção!", JOptionPane.OK_CANCEL_OPTION); + return result; + } + + /** + * + * @param tipo + * @param id + */ + public void gerarBarCode(String tipo, int id) { + String toCode = String.format("%08d", id); + String BAR_CODE_IMAGE_PATH = "C:\\Librography\\images\\Emprestimos\\BarCode\\"; + switch (tipo) { + case "emprestimo": + BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Emprestimos\\\\BarCode\\\\"; + break; + case "devolucao": + BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Devolucao\\\\BarCode\\\\"; + break; + case "usuario": + BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Usuarios\\\\BarCode\\\\"; + break; + case "card": + BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Cards\\\\BarCode\\\\"; + break; + case "book": + BAR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\Books\\\\BarCode\\\\"; + break; + } + System.out.println(BAR_CODE_IMAGE_PATH); + String Finalbpath = BAR_CODE_IMAGE_PATH + toCode; + System.out.println(Finalbpath); + QRCodeGenerator genBarCode = new QRCodeGenerator(); + try { + genBarCode.generateBarCodeImage(toCode, 340, 150, Finalbpath); + } catch (WriterException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } + //String BarCodeImage = "C:\\Librography\\images\\Emprestimos\\QrCode\\" + toCode; + } + + public void gerarQrCode(String tipo, int id) { + String toCode = String.format("%08d", id); + String QR_CODE_IMAGE_PATH = "C:\\Librography\\images\\Emprestimos\\QrCode\\"; + switch (tipo) { + case "emprestimo": + QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Emprestimos\\\\QrCode\\\\"; + break; + case "devolucao": + QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Devolucao\\\\QrCode\\\\"; + break; + case "usuario": + QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Usuarios\\\\QrCode\\\\"; + break; + case "card": + QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Cards\\\\QrCode\\\\"; + break; + case "book": + QR_CODE_IMAGE_PATH = "C:\\\\Librography\\\\images\\\\Books\\\\QrCode\\\\"; + break; + } + String Finalbpath = QR_CODE_IMAGE_PATH + toCode; + QRCodeGenerator genCode = new QRCodeGenerator(); + + try { + genCode.generateQRCodeImage(toCode, 550, 550, Finalbpath); + } catch (WriterException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } + + } + + public String formatData(Timestamp timestamp) { + SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + String dataFormatada = dataBR.format(timestamp); + return dataFormatada; + } + + public boolean valida(String cpf) { + CPFValidator cpfValidator = new CPFValidator(); + try { + cpfValidator.assertValid(cpf); + return true; + } catch (Exception e) { + //JOptionPane.showMessageDialog(null, "CPF Inválido! Tente Novamente!"); +// e.printStackTrace(); + return false; + } + } + + public boolean validaCnpj(String cpf) { + CNPJValidator cnpjValidator = new CNPJValidator(); + try { + cnpjValidator.assertValid(cpf); + return true; + } catch (Exception e) { + //JOptionPane.showMessageDialog(null, "CNPJ Inválido! Tente Novamente!"); +// e.printStackTrace(); + return false; + } + } + + public void toExcel(JTable table, File file) throws FileNotFoundException, IOException { + FileOutputStream excelFos = null; + XSSFWorkbook excelJTableExport = null; + BufferedOutputStream excelBos = null; + try { + TableModel model = table.getModel(); + excelJTableExport = new XSSFWorkbook(); + XSSFSheet excelSheet = excelJTableExport.createSheet("Jtable Export"); + for (int i = 0; i < model.getRowCount(); i++) { + XSSFRow excelRow = excelSheet.createRow(i); + for (int j = 0; j < model.getColumnCount(); j++) { + XSSFCell excelCell = excelRow.createCell(j); + if (model.getValueAt(i, j) == null) { + excelCell.setCellValue(""); + } else { + String ccell = model.getValueAt(i, j).toString(); + excelCell.setCellValue(ccell); + } + } + } + excelFos = new FileOutputStream(file); + excelBos = new BufferedOutputStream(excelFos); + excelJTableExport.write(excelBos); + //JOptionPane.showMessageDialog(null, "Exported Successfully"); + } catch (FileNotFoundException ex) { + ex.printStackTrace(); + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + try { + if (excelBos != null) { + excelBos.close(); + } + if (excelFos != null) { + excelFos.close(); + } + if (excelJTableExport != null) { + excelJTableExport.close(); + } + } catch (IOException ex) { + ex.printStackTrace(); + } + } + } + + public enum OS { + WINDOWS, LINUX, MAC, SOLARIS + };// Operating systems. + + private static OS os = null; + + public static OS getOS() { + if (os == null) { + String operSys = System.getProperty("os.name").toLowerCase(); + if (operSys.contains("win")) { + os = OS.WINDOWS; + } else if (operSys.contains("nix") || operSys.contains("nux") + || operSys.contains("aix")) { + os = OS.LINUX; + } else if (operSys.contains("mac")) { + os = OS.MAC; + } else if (operSys.contains("sunos")) { + os = OS.SOLARIS; + } + } + return os; + } + +// try { +// TableModel model = table.getModel(); +// FileWriter excel = new FileWriter(file); +// +// for (int i = 0; i < model.getColumnCount(); i++) { +// excel.write(model.getColumnName(i) + "\t"); +// } +// +// excel.write("\n"); +// +// for (int i = 0; i < model.getRowCount(); i++) { +// for (int j = 0; j < model.getColumnCount(); j++) { +// excel.write(model.getValueAt(i, j).toString() + "\t"); +// } +// excel.write("\n"); +// } +// +// excel.close(); +// +// } +// catch (IOException e +// +// +// ) { +// System.out.println(e); +// } +//} +} diff --git a/src/br/com/projeto/model/XlsxProcess.java b/src/br/com/projeto/model/XlsxProcess.java new file mode 100644 index 0000000..b164c26 --- /dev/null +++ b/src/br/com/projeto/model/XlsxProcess.java @@ -0,0 +1,90 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.model; + +import br.com.projeto.jdbc.ConexaoBanco; +import com.mysql.jdbc.Connection; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import javax.swing.JFileChooser; +import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; + +/** + * + * @author orfeu + */ +public class XlsxProcess { + + private Connection conexao; + + //construtor + public XlsxProcess() { + this.conexao = new ConexaoBanco().pegarConexao(); + } + + public void importaUsuariosXls() throws FileNotFoundException, IOException, SQLException { + + // java.sql.PreparedStatement stmt = null; + final JFileChooser fc = new JFileChooser(); + File file = fc.getSelectedFile(); //if xls only + java.sql.PreparedStatement stmt = null; + FileInputStream input = new FileInputStream(file); + POIFSFileSystem fs = new POIFSFileSystem(input); + Workbook workbook; + workbook = WorkbookFactory.create(fs); + Sheet sheet = workbook.getSheetAt(0); + Row row; + for (int i = 1; i <= sheet.getLastRowNum(); i++) { + row = (Row) sheet.getRow(i); + String nome = row.getCell(0).getStringCellValue(); + String rg = row.getCell(1).getStringCellValue(); + String cpf = row.getCell(2).getStringCellValue(); + String email= row.getCell(3).getStringCellValue(); + String telefone= row.getCell(4).getStringCellValue(); + String celular= row.getCell(5).getStringCellValue(); + String cep= row.getCell(6).getStringCellValue(); + String endereco= row.getCell(7).getStringCellValue(); + String numero= row.getCell(8).getStringCellValue(); + String complemento = row.getCell(9).getStringCellValue(); + String bairro= row.getCell(10).getStringCellValue(); + String cidade= row.getCell(11).getStringCellValue(); + String estado= row.getCell(12).getStringCellValue(); + String curso= row.getCell(13).getStringCellValue(); + String curso_ano= row.getCell(14).getStringCellValue(); + String qtd_emprestimos= "0"; + String emprestmax= row.getCell(15).getStringCellValue(); + String observacoes= row.getCell(16).getStringCellValue(); + String tipo= row.getCell(17).getStringCellValue(); + String is_locked= "0"; + //String = row.getCell(20).getStringCellValue(); + + String sql = "insert into tb_leitores (nome, rg, cpf, email, telefone, celular, cep, endereco, numero, complemento, bairro, cidade, estado, curso, curso_ano, qtd_emprestimos, emprestmax, observacoes, tipo, is_locked )" + + "values("+nome +", "+ rg+", "+ cpf+","+email +","+ telefone+", " + + ""+ celular+", "+cep +", "+ endereco+", "+numero +", "+ complemento+", "+ bairro+"," + + " "+ cidade+", "+estado +", "+ curso+", "+ curso_ano+", "+ qtd_emprestimos+", "+ emprestmax+"," + + " "+observacoes +", "+ tipo+", "+ is_locked+")"; + + stmt = (PreparedStatement) conexao.prepareStatement(sql); + stmt.execute(); + System.out.println("Import rows " + i); + + } + conexao.commit(); + stmt.close(); + conexao.close(); + input.close(); + System.out.println("Success import excel to mysql table"); + } + +} diff --git a/src/br/com/projeto/view/FormCartao.form b/src/br/com/projeto/view/FormCartao.form new file mode 100644 index 0000000..e38a889 --- /dev/null +++ b/src/br/com/projeto/view/FormCartao.form @@ -0,0 +1,370 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/br/com/projeto/view/FormCartao.java b/src/br/com/projeto/view/FormCartao.java new file mode 100644 index 0000000..ba2874b --- /dev/null +++ b/src/br/com/projeto/view/FormCartao.java @@ -0,0 +1,533 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import br.com.projeto.dao.OptionsDao; +import br.com.projeto.model.QRCodeGenerator; +import com.bulenkov.darcula.DarculaLaf; +import java.awt.Image; +import java.sql.SQLException; +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import com.google.zxing.WriterException; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Toolkit; +import java.awt.image.BufferedImage; +import java.awt.print.PageFormat; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; +import java.io.File; +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.imageio.ImageIO; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.plaf.basic.BasicLookAndFeel; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormCartao extends javax.swing.JFrame { + + // Image src; + + /** + * Creates new form FormCartao + */ + public FormCartao() { + //Toolkit.getDefaultToolkit().createImage("C:\\Librography\\images\\cardBackground.jpg"); + initComponents(); + } + + + + public FormCartao(String msg, String msgNome, String msgCurso, String msgAcesso) throws SQLException { + initComponents(); +// int in = Integer.parseInt(msg); +// String id = String.format("%08d", in); + lblId.setText(msg); + lblNome.setText(msgNome); + lblCurso.setText(msgCurso); + + OptionsDao opt = new OptionsDao(); + String biblioteca = opt.retornaOption(15); + lblInstituicao.setText(biblioteca.toUpperCase()); // global! nao precisa importar do outro frame + + lblAcesso.setText(msgAcesso); // nivel de acesso a implementar + + String path = "C:\\Librography\\images\\usuarios\\" + msg; + lblFoto.setIcon(ResizeIdImage(path)); + + String pathLogo = "C:\\Librography\\images\\libraryLogo.png"; + lblLogo.setIcon(ResizeLogoImage(pathLogo)); + + int i = Integer.parseInt(msg); + //parse to int e add zero + String toCode = String.format("%08d", i); + + //qrcode + String QrCodeName = toCode; + String QR_CODE_IMAGE_PATH = "C:\\Librography\\images\\QrCodes\\"; + String Finalpath = QR_CODE_IMAGE_PATH + QrCodeName; + QRCodeGenerator genCode = new QRCodeGenerator(); + try { + genCode.generateQRCodeImage(toCode, 550, 550, Finalpath); + } catch (WriterException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } + String QrImage = "C:\\Librography\\images\\QrCodes\\" + toCode; + lblQrcode.setIcon(ResizeQrCodeImage(QrImage)); + + //lblCodBarras.setIcon(toCode); + String toBCode = String.format("%08d", i); + String BarCodeName = toBCode; + String BAR_CODE_IMAGE_PATH = "C:\\Librography\\images\\BarCodes\\"; + String Finalbpath = BAR_CODE_IMAGE_PATH + BarCodeName; + QRCodeGenerator genBarCode = new QRCodeGenerator(); + try { + genBarCode.generateBarCodeImage(toCode, 340, 150, Finalbpath); + } catch (WriterException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } + String BarCodeImage = "C:\\Librography\\images\\BarCodes\\" + toCode; + lblCodBarras.setIcon(ResizeBarCodeImage(BarCodeImage)); + + } + + //criar classe em arquivo separado aqui + class PrintObject implements Printable +{ + public int print(Graphics g, PageFormat f, int pageIndex) { + Graphics2D g2 = (Graphics2D) g; // Allow use of Java 2 graphics on +// the print pages : + + String msg =lblId.getText(); + if (pageIndex == 0) { + + // tamabnho de margens e papel +// Paper p = new Paper(); + //p.setSize(5.48, 8.6); + //f.setPaper(p); +// double margin = 20.; +//p.setImageableArea(margin, +// p.getImageableY(), +// p.getWidth() - 2* margin, p.getImageableHeight()); +// +// f.setPaper(p); + + try { + g2.drawImage(ImageIO.read(new File("C:\\Librography\\images\\cards\\" + msg + ".png" )), null, pageIndex, pageIndex); + } catch (IOException ex) { + Logger.getLogger(PrintObject.class.getName()).log(Level.SEVERE, null, ex); + } + return PAGE_EXISTS; + } else { + return NO_SUCH_PAGE; + } + } + } + + //funcao tira screenshot + public static BufferedImage getScreenshotCartao(Component component) { + BufferedImage image = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_RGB); + component.paint(image.getGraphics()); + return image; + } + + public static void salvaImagemCartao(Component component, String filename) throws Exception { + BufferedImage img = getScreenshotCartao(component); + ImageIO.write(img, "png", new File(filename)); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + jLayeredPane1 = new javax.swing.JLayeredPane(); + jPanel1 = new javax.swing.JPanel(); + lblLogo = new javax.swing.JLabel(); + lblInstituicao = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + lblId = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + lblFoto = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + lblNome = new javax.swing.JLabel(); + lblAcesso = new javax.swing.JLabel(); + lblQrcode = new javax.swing.JLabel(); + lblCodBarras = new javax.swing.JLabel(); + lblCurso = new javax.swing.JLabel(); + btnPrint = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + btnSave = new javax.swing.JButton(); + + javax.swing.GroupLayout jLayeredPane1Layout = new javax.swing.GroupLayout(jLayeredPane1); + jLayeredPane1.setLayout(jLayeredPane1Layout); + jLayeredPane1Layout.setHorizontalGroup( + jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 100, Short.MAX_VALUE) + ); + jLayeredPane1Layout.setVerticalGroup( + jLayeredPane1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGap(0, 100, Short.MAX_VALUE) + ); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Cartao"); + setLocation(new java.awt.Point(0, 0)); + setUndecorated(true); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(255, 255, 255)); + jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 204, 204))); + jPanel1.setForeground(new java.awt.Color(204, 204, 204)); + + lblLogo.setBackground(new java.awt.Color(255, 255, 255)); + + lblInstituicao.setBackground(new java.awt.Color(0, 51, 153)); + lblInstituicao.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N + lblInstituicao.setForeground(new java.awt.Color(0, 51, 153)); + lblInstituicao.setText("Nome da Instituição"); + + jLabel7.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N + jLabel7.setText("ID:"); + + lblId.setBackground(new java.awt.Color(235, 235, 235)); + lblId.setForeground(new java.awt.Color(0, 0, 0)); + lblId.setText("XXXXXXX"); + lblId.setOpaque(true); + + jLabel9.setFont(new java.awt.Font("Dialog", 0, 12)); // NOI18N + jLabel9.setText("Curso:"); + + setContentPane(new JLabel(new ImageIcon("C:/Librography/images/cardBackground.jpg"))); + lblFoto.setBackground(new java.awt.Color(255, 255, 255)); + lblFoto.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/leitor.png"))); // NOI18N + lblFoto.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.lightGray, java.awt.Color.darkGray)); + lblFoto.setFocusable(false); + lblFoto.setInheritsPopupMenu(false); + lblFoto.setRequestFocusEnabled(false); + lblFoto.setVerifyInputWhenFocusTarget(false); + + jLabel6.setForeground(new java.awt.Color(0, 102, 204)); + jLabel6.setText("Nome:"); + + lblNome.setBackground(new java.awt.Color(235, 235, 235)); + lblNome.setFont(new java.awt.Font("Dialog", 1, 13)); // NOI18N + lblNome.setForeground(new java.awt.Color(0, 0, 0)); + lblNome.setText("XXXXXX XX XXXXXXX XXXXXXXXXXXX"); + lblNome.setOpaque(true); + + lblAcesso.setBackground(new java.awt.Color(51, 153, 255)); + lblAcesso.setFont(new java.awt.Font("Segoe UI", 1, 15)); // NOI18N + lblAcesso.setForeground(new java.awt.Color(0, 102, 204)); + lblAcesso.setText("ESTUDANTE"); + + lblQrcode.setBackground(new java.awt.Color(255, 255, 255)); + lblQrcode.setText("QRCODE"); + lblQrcode.setOpaque(true); + + lblCodBarras.setBackground(new java.awt.Color(255, 255, 255)); + lblCodBarras.setText("Cod Barras"); + lblCodBarras.setOpaque(true); + + lblCurso.setBackground(new java.awt.Color(235, 235, 235)); + lblCurso.setForeground(new java.awt.Color(0, 0, 0)); + lblCurso.setText("XXXXXXXXXXXXXXXXXXXX"); + lblCurso.setOpaque(true); + + 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(7, 7, 7) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblInstituicao, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel7) + .addGap(6, 6, 6) + .addComponent(lblId)) + .addComponent(jLabel9) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(4, 4, 4) + .addComponent(lblCurso, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGap(4, 4, 4) + .addComponent(lblLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(13, 13, 13) + .addComponent(jLabel6) + .addGap(6, 6, 6) + .addComponent(lblNome, javax.swing.GroupLayout.PREFERRED_SIZE, 220, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(7, 7, 7) + .addComponent(lblAcesso) + .addGap(26, 26, 26) + .addComponent(lblCodBarras, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(12, 12, 12) + .addComponent(lblQrcode, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(lblInstituicao, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(2, 2, 2) + .addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblId, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(10, 10, 10) + .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(6, 6, 6) + .addComponent(lblCurso)))) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(5, 5, 5) + .addComponent(lblLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(2, 2, 2) + .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblNome)) + .addGap(6, 6, 6) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(3, 3, 3) + .addComponent(lblAcesso, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(1, 1, 1) + .addComponent(lblCodBarras, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(lblQrcode, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))) + ); + + btnPrint.setText("Imprimir"); + btnPrint.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPrintActionPerformed(evt); + } + }); + + jButton3.setText("Fechar"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + btnSave.setText("Salvar"); + btnSave.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSaveActionPerformed(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(10, 10, 10) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(26, 26, 26) + .addComponent(btnSave) + .addGap(18, 18, 18) + .addComponent(btnPrint, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(18, 18, 18)) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSave) + .addComponent(btnPrint) + .addComponent(jButton3)) + .addContainerGap(16, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void btnPrintActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPrintActionPerformed + PrinterJob job = PrinterJob.getPrinterJob(); + + // It is first called to tell it what object will print each page. + job.setPrintable(new PrintObject()); + + // Then it is called to display the standard print options dialog. + if (job.printDialog()) + { + // If the user has pressed OK (printDialog returns true), then go + // ahead with the printing. This is started by the simple call to + // the job print() method. When it runs, it calls the page print + // object for page index 0. Then page index 1, 2, and so on + // until NO_SUCH_PAGE is returned. + try { job.print(); } + catch (PrinterException e) { System.out.println(e); } + } + + }//GEN-LAST:event_btnPrintActionPerformed + + private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed + try { + String msg = lblId.getText(); + salvaImagemCartao(jPanel1, "C:\\Librography\\images\\cards\\" + msg + ".png"); + } catch (Exception ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_btnSaveActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + super.dispose(); + }//GEN-LAST:event_jButton3ActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + // TODO add your handling code here: + }//GEN-LAST:event_formWindowActivated + + /** + * @param args the command line arguments + */ + public static void main(String args[]) throws UnsupportedLookAndFeelException { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormCartao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // +// BasicLookAndFeel darcula = new DarculaLaf(); +// UIManager.setLookAndFeel(darcula); + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormCartao().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnPrint; + private javax.swing.JButton btnSave; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel6; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel9; + private javax.swing.JLayeredPane jLayeredPane1; + private javax.swing.JPanel jPanel1; + private javax.swing.JLabel lblAcesso; + private javax.swing.JLabel lblCodBarras; + private javax.swing.JLabel lblCurso; + private javax.swing.JLabel lblFoto; + private javax.swing.JLabel lblId; + private javax.swing.JLabel lblInstituicao; + private javax.swing.JLabel lblLogo; + private javax.swing.JLabel lblNome; + private javax.swing.JLabel lblQrcode; + // End of variables declaration//GEN-END:variables +//jPanel1.setLayout(new OverlayLayout(panel)); + private ImageIcon ResizeIdImage(String imgPath) { //192x261 + int imageX = 65; + int imageY = 73; + lblFoto.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblFoto.getWidth(), lblFoto.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + + private ImageIcon ResizeLogoImage(String imgPath) { //192x261 + int imageX = 84; + int imageY = 83; + lblLogo.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblLogo.getWidth(), lblLogo.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + + private ImageIcon ResizeQrCodeImage(String imgPath) { //192x261 + int imageX = 50; + int imageY = 50; + lblQrcode.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblQrcode.getWidth(), lblQrcode.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + + private ImageIcon ResizeBarCodeImage(String imgPath) { //192x261 + int imageX = 113; + int imageY = 50; + lblCodBarras.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblCodBarras.getWidth(), lblCodBarras.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + + } + +} diff --git a/src/br/com/projeto/view/FormDetalhesLivro.form b/src/br/com/projeto/view/FormDetalhesLivro.form new file mode 100644 index 0000000..94e42ee --- /dev/null +++ b/src/br/com/projeto/view/FormDetalhesLivro.form @@ -0,0 +1,458 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/br/com/projeto/view/FormDetalhesLivro.java b/src/br/com/projeto/view/FormDetalhesLivro.java new file mode 100644 index 0000000..aaba838 --- /dev/null +++ b/src/br/com/projeto/view/FormDetalhesLivro.java @@ -0,0 +1,432 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import java.awt.Image; +import javax.swing.ImageIcon; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormDetalhesLivro extends javax.swing.JFrame { + + /** + * Creates new form FormDetalhesLivro + */ + public FormDetalhesLivro() { + initComponents(); + } + + + public FormDetalhesLivro(String msgTit, String msgAut, String msgEdt, String msgIsb, String msgAno, String msgSer, String msgEdc, String msgIdi, String msgFor, String msgPis, String msgCor, String msgPos, String msgSec, String msgObs) { + initComponents(); + lblTitulo.setText(msgTit); + lblAutor.setText(msgAut); + lblEditora.setText(msgEdt); + lblIsbn.setText(msgIsb); + lblAno.setText(msgAno); + lblSerie.setText(msgSer); + lblEdicao.setText(msgEdc); + lblIdioma.setText(msgIdi); + lblFornecedor.setText(msgFor); + lblPiso.setText(msgPis); + lblCorredor.setText(msgCor); + lblPosicao.setText(msgPos); + lblSecao.setText(msgSec); + txtObservacoes.setText(msgObs); +// String img = Integer.toString(msgImg); +// System.out.println("img:" + img); +// System.out.println("msgImg:" + msgImg); + String path = "C:\\Librography\\images\\books\\" + msgIsb; + lblFoto.setIcon(ResizeBookImage(path)); + } + + /** + * This method is called from within the constructor to initialize the form. + * WARNING: Do NOT modify this code. The content of this method is always + * regenerated by the Form Editor. + */ + @SuppressWarnings("unchecked") + // //GEN-BEGIN:initComponents + private void initComponents() { + + lblTitulo = new javax.swing.JLabel(); + lblFoto = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + lblSerie = 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(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + jScrollPane1 = new javax.swing.JScrollPane(); + txtObservacoes = new javax.swing.JTextArea(); + jLabel15 = new javax.swing.JLabel(); + lblAutor = new javax.swing.JLabel(); + lblEditora = new javax.swing.JLabel(); + lblIsbn = new javax.swing.JLabel(); + lblSecao = new javax.swing.JLabel(); + lblAno = new javax.swing.JLabel(); + lblEdicao = new javax.swing.JLabel(); + lblFornecedor = new javax.swing.JLabel(); + lblIdioma = new javax.swing.JLabel(); + lblPiso = new javax.swing.JLabel(); + lblCorredor = new javax.swing.JLabel(); + lblPosicao = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("DETALHES DO LIVRO"); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + lblTitulo.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N + lblTitulo.setText("Título do Livro"); + + lblFoto.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.lightGray, java.awt.Color.darkGray)); + + jLabel2.setText("Título:"); + + lblSerie.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblSerie.setText("XXXX"); + + jLabel3.setText("Autor:"); + + jLabel4.setText("Fornecedor:"); + + jLabel5.setText("Série:"); + + jLabel6.setText("ISBN/ISSN:"); + + jLabel7.setText("Edição:"); + + jLabel8.setText("Editora:"); + + jLabel9.setText("Idioma:"); + + jLabel10.setText("Ano:"); + + jLabel11.setText("Corredor:"); + + jLabel12.setText("Piso:"); + + jLabel13.setText("Posição:"); + + jLabel14.setText("Seção:"); + + txtObservacoes.setEditable(false); + txtObservacoes.setColumns(20); + txtObservacoes.setForeground(new java.awt.Color(102, 102, 102)); + txtObservacoes.setRows(5); + jScrollPane1.setViewportView(txtObservacoes); + + jLabel15.setText("Observações:"); + + lblAutor.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblAutor.setText("Autor"); + + lblEditora.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblEditora.setText("EDITORA"); + + lblIsbn.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblIsbn.setText("XXXXXXXXXXXXX"); + + lblSecao.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblSecao.setText("SEÇÃO"); + + lblAno.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblAno.setText("XXXX"); + + lblEdicao.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblEdicao.setText("XXXX"); + + lblFornecedor.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblFornecedor.setText("Fornecedor"); + + lblIdioma.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblIdioma.setText("IDIOMA"); + + lblPiso.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblPiso.setText("PISO"); + + lblCorredor.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblCorredor.setText("CORREDOR"); + + lblPosicao.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + lblPosicao.setText("POSIÇÃO"); + + jButton1.setText("Fechar"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel14) + .addGap(18, 18, 18) + .addComponent(lblSecao, javax.swing.GroupLayout.PREFERRED_SIZE, 289, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel12) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblPiso, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel13) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel11) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(363, 363, 363) + .addComponent(jButton1)) + .addGroup(layout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel15) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 424, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addContainerGap()) + .addGroup(layout.createSequentialGroup() + .addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel3) + .addGap(18, 18, 18) + .addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 414, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(23, 23, 23)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(lblAno, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(lblEditora, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGap(200, 200, 200)) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel9) + .addComponent(jLabel10)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(lblIdioma, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel4) + .addGap(18, 18, 18) + .addComponent(lblFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 231, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(65, 65, 65) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblSerie, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addGap(86, 86, 86) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE))))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(15, 15, 15) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(layout.createSequentialGroup() + .addComponent(lblFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel12) + .addComponent(lblPiso, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel11) + .addComponent(lblCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel13))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(lblTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblAutor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(lblEditora, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(jLabel10)) + .addGroup(layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblSerie, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5) + .addComponent(lblAno, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(lblEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(lblIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblIdioma) + .addComponent(jLabel9) + .addComponent(jLabel4) + .addComponent(lblFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel15) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblSecao, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel14) + .addComponent(jButton1)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// //GEN-END:initComponents + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + + }//GEN-LAST:event_formWindowActivated + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + super.dispose(); + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) { + /* Set the Nimbus look and feel */ + // + /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. + * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html + */ + try { + for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { + if ("Nimbus".equals(info.getName())) { + javax.swing.UIManager.setLookAndFeel(info.getClassName()); + break; + } + } + } catch (ClassNotFoundException ex) { + java.util.logging.Logger.getLogger(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormDetalhesLivro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + // + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormDetalhesLivro().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton jButton1; + 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 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.JScrollPane jScrollPane1; + private javax.swing.JLabel lblAno; + private javax.swing.JLabel lblAutor; + private javax.swing.JLabel lblCorredor; + private javax.swing.JLabel lblEdicao; + private javax.swing.JLabel lblEditora; + private javax.swing.JLabel lblFornecedor; + private javax.swing.JLabel lblFoto; + private javax.swing.JLabel lblIdioma; + private javax.swing.JLabel lblIsbn; + private javax.swing.JLabel lblPiso; + private javax.swing.JLabel lblPosicao; + private javax.swing.JLabel lblSecao; + private javax.swing.JLabel lblSerie; + private javax.swing.JLabel lblTitulo; + private javax.swing.JTextArea txtObservacoes; + // End of variables declaration//GEN-END:variables + private ImageIcon ResizeBookImage(String imgPath) { //192x261 + int imageX = 132; + int imageY = 208; + lblFoto.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblFoto.getWidth(), lblFoto.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } +} diff --git a/src/br/com/projeto/view/FormEmprestimos.form b/src/br/com/projeto/view/FormEmprestimos.form new file mode 100644 index 0000000..d0a9f88 --- /dev/null +++ b/src/br/com/projeto/view/FormEmprestimos.form @@ -0,0 +1,1440 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + +
+ + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + <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> + <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="tabelaLivrosFiltroMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(0)).setPreferredWidth(34); tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(1)).setPreferredWidth(170); tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(2)).setPreferredWidth(150); tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(3)).setPreferredWidth(140);"/> + <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JTable() /* { @Override public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){ Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex); Object value = getModel().getValueAt(rowIndex,columnIndex); System.out.println("value ===" +value); if(columnIndex == 6){ if(value.equals("true")) { componenet.setBackground(Color.RED); componenet.setForeground(Color.GREEN); } if(value.equals("false")){ componenet.setBackground(Color.GREEN); componenet.setForeground(Color.RED); } }else { componenet.setBackground(Color.WHITE); componenet.setForeground(Color.BLACK); } return componenet; } } */ "/> + </AuxValues> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JTextField" name="txtBuscaLivro"> + <Events> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtBuscaLivroKeyReleased"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtAgora"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtAgoraActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtPrazoEntrega"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPrazoEntregaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Data para Devolução:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="Data Atual:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="text" type="java.lang.String" value="Livro ID:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTituloSelect"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtTituloSelectActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="brnAddLivro"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/right_small.png"/> + </Property> + <Property name="text" type="java.lang.String" value="<html>Adicionar à Lista"/> + <Property name="toolTipText" type="java.lang.String" value=""/> + <Property name="actionCommand" type="java.lang.String" value="<html>Adicionar à Lista"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="brnAddLivroActionPerformed"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_InitCodePost" type="java.lang.String" value="brnAddLivro.setVerticalTextPosition(SwingConstants.BOTTOM); brnAddLivro.setHorizontalTextPosition(SwingConstants.CENTER);"/> + </AuxValues> + </Component> + <Component class="javax.swing.JTextField" name="txtBookId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </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="txtObservacoes"> + <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="jLabel8"> + <Properties> + <Property name="text" type="java.lang.String" value="Observações:"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnRemoveBook"> + <Properties> + <Property name="text" type="java.lang.String" value="Remover Livro da Lista"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRemoveBookActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/save_small.png"/> + </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="btnSalvarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="ID de Usuário:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JCheckBox" name="cbOcultarEmprestados"> + <Properties> + <Property name="text" type="java.lang.String" value="Ocultar Emprestados"/> + </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="cbOcultarEmprestadosItemStateChanged"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton5"> + <Properties> + <Property name="text" type="java.lang.String" value="Mapa"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnNovo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/new_file_small.png"/> + </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="btnNovoActionPerformed"/> + </Events> + </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/book_cover.png"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> + <EtchetBorder bevelType="0"> + <Color PropertyName="highlight" blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/> + <Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/> + </EtchetBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtISBN"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtISBNActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="text" type="java.lang.String" value="<html>ISBN/<br>ISSN: "/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtStatus"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="text" type="java.lang.String" value="Status:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="text" type="java.lang.String" value="Empréstimos Restantes:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEmprestimosRestantes"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblimagemUser"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor" postCode="lblimagemUser.setVerticalTextPosition(SwingConstants.BOTTOM); lblimagemUser.setHorizontalTextPosition(SwingConstants.CENTER);"> + <Image iconType="3" name="/imagens/iconfinder_student_309036 (2).png"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> + <EtchetBorder bevelType="0"> + <Color PropertyName="highlight" blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/> + <Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/> + </EtchetBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnCartao"> + <Properties> + <Property name="text" type="java.lang.String" value="Imprimir/ Ver Cartão"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCartaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <Property name="text" type="java.lang.String" value="Cadastro"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton13"> + <Properties> + <Property name="text" type="java.lang.String" value="Cadastro"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton13ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnDetalhes"> + <Properties> + <Property name="text" type="java.lang.String" value="Detalhes"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDetalhesActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnBuscarLivrosAdvanced"> + <Properties> + <Property name="text" type="java.lang.String" value="Busca Avançada"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBuscarLivrosAdvancedActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtDisponibilidade"> + <Properties> + <Property name="enabled" type="boolean" value="false"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel23"> + <Properties> + <Property name="text" type="java.lang.String" value="Título:"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Devoluções"> + <Property name="tabTitle" type="java.lang.String" value="Devoluções"/> + </JTabbedPaneConstraints> + </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"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + <Component id="jLabel12" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jLabel15" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtIdEmprest" min="-2" pref="66" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel13" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtLeitorresponsavel" min="-2" pref="348" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Component id="txtLivroEmprestado" min="-2" pref="544" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <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="13" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel20" min="-2" max="-2" attributes="0"/> + <Component id="jLabel19" min="-2" max="-2" attributes="0"/> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtMulta" min="-2" pref="175" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtDataParaDevolucao" min="-2" pref="175" max="-2" attributes="0"/> + <Component id="StatusEmprestimo" min="-2" pref="175" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Component id="jLabel17" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtDataEmprestimo" min="-2" pref="172" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtFuncionarioQueEmprestou" alignment="1" min="-2" pref="275" max="-2" attributes="0"/> + <Component id="jScrollPane7" alignment="1" min="-2" pref="354" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="radbtnAddObs" alignment="1" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnDevolver" min="-2" pref="161" max="-2" attributes="0"/> + <Component id="btnReemprestar" min="-2" pref="161" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnImprimeMulta" min="-2" pref="148" max="-2" attributes="0"/> + <Component id="btnDesbloqueiaUsuario" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Component id="jLabel16" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="jLabel22" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="231" max="-2" attributes="0"/> + <Component id="jButton9" min="-2" 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="833" max="-2" attributes="0"/> + <Component id="radioLista" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane6" min="-2" pref="993" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Component id="radioLista" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane6" min="-2" pref="200" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtIdEmprest" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtLeitorresponsavel" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="13" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtLivroEmprestado" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" pref="18" max="32767" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="radbtnAddObs" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="3" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnImprimeMulta" alignment="3" min="-2" pref="50" max="-2" attributes="0"/> + <Component id="btnDevolver" alignment="3" min="-2" pref="50" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnDesbloqueiaUsuario" alignment="3" min="-2" pref="50" max="-2" attributes="0"/> + <Component id="btnReemprestar" alignment="3" min="-2" pref="50" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="52" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtDataEmprestimo" linkSize="1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtFuncionarioQueEmprestou" 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="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtDataParaDevolucao" linkSize="1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel22" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="StatusEmprestimo" linkSize="1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtMulta" linkSize="1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="jScrollPane7" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="35" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" attributes="0"> + <Component id="jButton9" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JScrollPane" name="jScrollPane6"> + <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="tabelaDevolucoes"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="9" rowCount="0"> + <Column editable="false" title="Atraso" type="java.lang.Object"/> + <Column editable="false" title="Id do Empréstimo" type="java.lang.Object"/> + <Column editable="false" title="Usuário" type="java.lang.Object"/> + <Column editable="false" title="Titulo" type="java.lang.Object"/> + <Column editable="false" title="Funcionário" type="java.lang.Object"/> + <Column editable="false" title="Data do Empréstimo" type="java.lang.Object"/> + <Column editable="false" title="Data Agendada de Entrega" type="java.lang.Object"/> + <Column editable="true" title="Observações" type="java.lang.Object"/> + <Column editable="false" title="Data da Devolução" type="java.lang.Object"/> + </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> + <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="tabelaDevolucoesMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JTable() { @Override public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){ Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex); Object value = getModel().getValueAt(rowIndex,columnIndex); if(columnIndex == 0){ if(value.equals("1 dias restantes") || value.equals("2 dias restantes") || value.equals("3 dias restantes") || value.equals("4 dias restantes") || value.equals("5 dias restantes") || value.equals("6 dias restantes") || value.equals("7 dias restantes") || value.equals("8 dias restantes") || value.equals("9 dias restantes") || value.equals("10 dias restantes") || value.equals("11 dias restantes") || value.equals("12 dias restantes") || value.equals("13 dias restantes") || value.equals("14 dias restantes")) { componenet.setBackground(Color.GREEN); componenet.setForeground(Color.BLACK); } if(value.equals("Vence Hoje")){ // if date equal current date componenet.setBackground(Color.YELLOW); componenet.setForeground(Color.BLACK); } if(value.equals("1 dias de atraso") || value.equals("2 dias de atraso") || value.equals("3 dias de atraso") || value.equals("4 dias de atraso") || value.equals("5 dias de atraso") || value.equals("6 dias de atraso") || value.equals("7 dias de atraso") || value.equals("8 dias de atraso") || value.equals("9 dias de atraso") ){ componenet.setBackground(Color.PINK); componenet.setForeground(Color.BLACK); } if(value.equals("+ de 15 dias de atraso")){ // if date equal current date componenet.setBackground(Color.RED); componenet.setForeground(Color.WHITE); } if(value.equals("Devolvido")){ // if date equal current date componenet.setBackground(Color.WHITE); componenet.setForeground(Color.GRAY); } } else { // componenet.setBackground(Color.RED); // componenet.setForeground(Color.WHITE); } return componenet; } } "/> + <AuxValue name="JavaCodeGenerator_InitCodePre" type="java.lang.String" value="tabelaDevolucoes.setDefaultRenderer(Date.class, new DateRenderer());"/> + </AuxValues> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnDevolver"> + <Properties> + <Property name="text" type="java.lang.String" value="Devolver"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDevolverActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnReemprestar"> + <Properties> + <Property name="text" type="java.lang.String" value="reeemprestar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnReemprestarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton9"> + <Properties> + <Property name="text" type="java.lang.String" value="Localização"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnImprimeMulta"> + <Properties> + <Property name="text" type="java.lang.String" value="Imprime Multa"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImprimeMultaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnDesbloqueiaUsuario"> + <Properties> + <Property name="text" type="java.lang.String" value="Desbloqueia Usuário"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtIdEmprest"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdEmprestActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtLeitorresponsavel"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtLivroEmprestado"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtFuncionarioQueEmprestou"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="horizontalAlignment" type="int" value="11"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDataEmprestimo"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDataParaDevolucao"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtMulta"> + </Component> + <Component class="javax.swing.JTextField" name="StatusEmprestimo"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane7"> + <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="txtObservacoesDevolucao"> + <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="jLabel12"> + <Properties> + <Property name="text" type="java.lang.String" value="Id do Empréstimo"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="text" type="java.lang.String" value="Leitor Responsável:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel15"> + <Properties> + <Property name="text" type="java.lang.String" value="Título:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="text" type="java.lang.String" value="Funcionário:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel17"> + <Properties> + <Property name="text" type="java.lang.String" value="Data de Empréstimo:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="Data para Devolução:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel20"> + <Properties> + <Property name="text" type="java.lang.String" value="Status:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel21"> + <Properties> + <Property name="text" type="java.lang.String" value="Multa:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel22"> + <Properties> + <Property name="text" type="java.lang.String" value="Observações:"/> + </Properties> + </Component> + <Component class="javax.swing.JRadioButton" name="radbtnAddObs"> + <Properties> + <Property name="text" type="java.lang.String" value="Add Observações como permanente para o Livro"/> + </Properties> + </Component> + <Component class="javax.swing.JRadioButton" name="radioLista"> + <Properties> + <Property name="text" type="java.lang.String" value="Mostrar Devolvidos"/> + </Properties> + <Events> + <EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="radioListaItemStateChanged"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormEmprestimos.java b/src/br/com/projeto/view/FormEmprestimos.java new file mode 100644 index 0000000..36856b9 --- /dev/null +++ b/src/br/com/projeto/view/FormEmprestimos.java @@ -0,0 +1,2155 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +//mude para vizualizacao por projeto para adicionar action +package br.com.projeto.view; + +import br.com.projeto.dao.EmprestimoDao; +import br.com.projeto.dao.FuncionarioDao; +import javax.swing.SwingConstants; +import br.com.projeto.dao.LivroDao; +import br.com.projeto.dao.MultaDao; +import br.com.projeto.dao.ReciboDao; +import br.com.projeto.dao.UsuarioDao; +import br.com.projeto.model.DateRenderer; +import br.com.projeto.model.Emprestimo; +import br.com.projeto.model.Funcionario; +import br.com.projeto.model.Livro; +import br.com.projeto.model.Multa; +import br.com.projeto.model.QRCodeGenerator; +import br.com.projeto.model.Recibo; +import br.com.projeto.model.Usuario; +import br.com.projeto.model.Utilitarios; +import com.bulenkov.darcula.DarculaLaf; +import com.google.zxing.WriterException; +import java.awt.Color; +import java.awt.Component; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.awt.print.PrinterException; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.SQLException; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.table.DefaultTableModel; +import javax.swing.table.TableCellRenderer; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormEmprestimos extends javax.swing.JFrame { + //public String usuarioLogado; + + // fazer certo isso + Usuario obj = new Usuario(); + Integer Id; + String Usuario, Titulo, Prazo, Observacao; + DefaultTableModel caixa; + + //metodo listar usuarios + public void listarUsers() { + UsuarioDao dao = new UsuarioDao(); + List<Usuario> lista = dao.listarUsuarios(); + DefaultTableModel dados = (DefaultTableModel) tabelaUsuario.getModel(); + dados.setNumRows(0); + for (Usuario c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getRg(), + c.getCpf(), + c.getEmail(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(), + c.getCurso(), + c.getSerie(), + c.getObservacoes(), + c.getTipo(),}); + } + } + + public void listarLivros() throws Exception { + LivroDao dao = new LivroDao(); + List<Livro> lista = dao.buscarLivros(); + DefaultTableModel dados = (DefaultTableModel) tabelaLivros.getModel(); + dados.setNumRows(0); + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getTitulo(), + c.getAutor(), + c.getEditora(), + c.getIsbn(), + c.getAno(), + c.getSerie(), + c.getEdicao(), + c.getIdioma(), + c.getFornecedor().getNome(), + c.getPiso(), + c.getCorredor(), + c.getPosicao(), + c.getSecao(), + c.getDisponibilidade(), + c.getObservacoes() + }); + } + } + + public void listarDevolucoes() throws Exception { + EmprestimoDao dao = new EmprestimoDao(); + List<Emprestimo> lista = dao.buscarDevolucoes(); + DefaultTableModel dados = (DefaultTableModel) tabelaDevolucoes.getModel(); + dados.setNumRows(0); + SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + for (Emprestimo c : lista) { + dados.addRow(new Object[]{ + dao.campoStatusColor(c.getData_devolucao(), c.getAtraso()), + c.getId(), + c.getTb_leitores_id().getNome(), //muda o setTetTb_leitores_id do Emprestimo.java para o tipo Usuario + c.getTb_livros_id().getTitulo(),// + c.getTb_funcionarios_id().getNome(),// + formatter.format(c.getData_emprestimo()), + formatter.format(c.getData_entrega_agendada()), + c.getObservacoes(), + c.getData_devolucao(),}); + } + } + + public void listarDevolucoesCompact() throws Exception { + EmprestimoDao dao = new EmprestimoDao(); + List<Emprestimo> lista = dao.buscarDevolucoes(); + DefaultTableModel dados1 = (DefaultTableModel) tabelaDevolucoes.getModel(); + dados1.setNumRows(0); + SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + for (Emprestimo c : lista) { + String atraso = dao.campoStatusColor(c.getData_devolucao(), c.getAtraso()); + if (!atraso.equals("Devolvido")) { + dados1.addRow(new Object[]{ + dao.campoStatusColor(c.getData_devolucao(), c.getAtraso()), + c.getId(), + c.getTb_leitores_id().getNome(), //muda o setTetTb_leitores_id do Emprestimo.java para o tipo Usuario + c.getTb_livros_id().getTitulo(),// + c.getTb_funcionarios_id().getNome(),// + formatter.format(c.getData_emprestimo()), + formatter.format(c.getData_entrega_agendada()), + c.getObservacoes(), + c.getData_devolucao(),}); + } else { + continue; + } + } + } + + // ################################################################# + //add disponibilidade leitor localizacao e observações + public void listarLivrosFiltro() throws Exception { + LivroDao dao = new LivroDao(); + List<Livro> lista = dao.buscarLivros(); + DefaultTableModel dados = (DefaultTableModel) tabelaLivrosFiltro.getModel(); + dados.setNumRows(0); + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getDisponibilidade(), + c.getTitulo(), + //trocar para ususario que emprestou + c.getObservacoes(), + c.getSecao(), + c.getId(), + c.getIsbn(), + c.isEmprestado(),}); + } + + } + + public void listarLivrosFiltroCompact() throws Exception { + LivroDao dao = new LivroDao(); + List<Livro> lista = dao.buscarLivros(); + DefaultTableModel dados = (DefaultTableModel) tabelaLivrosFiltro.getModel(); + dados.setNumRows(0); + for (Livro c : lista) { + if (c.isEmprestado() == false) { + dados.addRow(new Object[]{ + c.getDisponibilidade(), + c.getTitulo(), + c.getObservacoes(), + c.getSecao(), + c.getId(), + c.getIsbn(), + c.isEmprestado(),}); + } + } + } + + /** + * Creates new form formLeitor + */ + public FormEmprestimos() { + 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(); + wdwEmprestimos = new javax.swing.JTabbedPane(); + tabConsultaUsuarios = new javax.swing.JPanel(); + jLabel14 = new javax.swing.JLabel(); + txtPesquisaUsuario = new javax.swing.JTextField(); + btnPesquisar = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + tabelaUsuario = new javax.swing.JTable(); + jPanel2 = new javax.swing.JPanel(); + btnPesquisar1 = new javax.swing.JButton(); + txtPesquisaLivros = new javax.swing.JTextField(); + jScrollPane2 = new javax.swing.JScrollPane(); + tabelaLivros = new javax.swing.JTable(); + tabCadastro = new javax.swing.JPanel(); + jLabel3 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + txtNome = new javax.swing.JTextField(); + jLabel18 = new javax.swing.JLabel(); + jScrollPane4 = new javax.swing.JScrollPane(); + tabelaEmprestimos = new javax.swing.JTable(); + btnBuscaUser = new javax.swing.JButton(); + jScrollPane5 = new javax.swing.JScrollPane(); + tabelaLivrosFiltro = new javax.swing.JTable() + /* + { + @Override + public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){ + Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex); + Object value = getModel().getValueAt(rowIndex,columnIndex); + + System.out.println("value ===" +value); + if(columnIndex == 6){ + if(value.equals("true")) + { + componenet.setBackground(Color.RED); + componenet.setForeground(Color.GREEN); + } + if(value.equals("false")){ + componenet.setBackground(Color.GREEN); + componenet.setForeground(Color.RED); + } + }else { + componenet.setBackground(Color.WHITE); + componenet.setForeground(Color.BLACK); + } + return componenet; + } + + } + */ + ; + txtBuscaLivro = new javax.swing.JTextField(); + txtAgora = new javax.swing.JTextField(); + txtPrazoEntrega = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + txtTituloSelect = new javax.swing.JTextField(); + brnAddLivro = new javax.swing.JButton(); + txtBookId = new javax.swing.JTextField(); + jScrollPane3 = new javax.swing.JScrollPane(); + txtObservacoes = new javax.swing.JTextArea(); + jLabel8 = new javax.swing.JLabel(); + btnRemoveBook = new javax.swing.JButton(); + btnSalvar = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); + txtId = new javax.swing.JTextField(); + cbOcultarEmprestados = new javax.swing.JCheckBox(); + jButton5 = new javax.swing.JButton(); + btnNovo = new javax.swing.JButton(); + lblImagem = new javax.swing.JLabel(); + txtISBN = new javax.swing.JTextField(); + jLabel10 = new javax.swing.JLabel(); + txtStatus = new javax.swing.JTextField(); + jLabel11 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + txtEmprestimosRestantes = new javax.swing.JTextField(); + lblimagemUser = new javax.swing.JLabel(); + btnCartao = new javax.swing.JButton(); + jButton1 = new javax.swing.JButton(); + jButton13 = new javax.swing.JButton(); + btnDetalhes = new javax.swing.JButton(); + btnBuscarLivrosAdvanced = new javax.swing.JButton(); + txtDisponibilidade = new javax.swing.JTextField(); + jLabel23 = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + jScrollPane6 = new javax.swing.JScrollPane(); + tabelaDevolucoes = new javax.swing.JTable() + + { + + @Override + + public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){ + Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex); + + Object value = getModel().getValueAt(rowIndex,columnIndex); + + if(columnIndex == 0){ + + if(value.equals("1 dias restantes") || value.equals("2 dias restantes") || value.equals("3 dias restantes") || value.equals("4 dias restantes") || value.equals("5 dias restantes") || value.equals("6 dias restantes") || value.equals("7 dias restantes") || value.equals("8 dias restantes") || value.equals("9 dias restantes") || value.equals("10 dias restantes") || value.equals("11 dias restantes") || value.equals("12 dias restantes") || value.equals("13 dias restantes") || value.equals("14 dias restantes")) + { + componenet.setBackground(Color.GREEN); + componenet.setForeground(Color.BLACK); + } + + if(value.equals("Vence Hoje")){ + // if date equal current date + componenet.setBackground(Color.YELLOW); + componenet.setForeground(Color.BLACK); + } + if(value.equals("1 dias de atraso") || value.equals("2 dias de atraso") || value.equals("3 dias de atraso") || value.equals("4 dias de atraso") || value.equals("5 dias de atraso") || value.equals("6 dias de atraso") || value.equals("7 dias de atraso") || value.equals("8 dias de atraso") || value.equals("9 dias de atraso") ){ + componenet.setBackground(Color.PINK); + componenet.setForeground(Color.BLACK); + } + if(value.equals("+ de 15 dias de atraso")){ + // if date equal current date + componenet.setBackground(Color.RED); + componenet.setForeground(Color.WHITE); + } + if(value.equals("Devolvido")){ + // if date equal current date + componenet.setBackground(Color.WHITE); + componenet.setForeground(Color.GRAY); + } + } + else { + // componenet.setBackground(Color.RED); + // componenet.setForeground(Color.WHITE); + } + return componenet; + } + } + + ; + btnDevolver = new javax.swing.JButton(); + btnReemprestar = new javax.swing.JButton(); + jButton9 = new javax.swing.JButton(); + btnImprimeMulta = new javax.swing.JButton(); + btnDesbloqueiaUsuario = new javax.swing.JButton(); + txtIdEmprest = new javax.swing.JTextField(); + txtLeitorresponsavel = new javax.swing.JTextField(); + txtLivroEmprestado = new javax.swing.JTextField(); + txtFuncionarioQueEmprestou = new javax.swing.JTextField(); + txtDataEmprestimo = new javax.swing.JTextField(); + txtDataParaDevolucao = new javax.swing.JTextField(); + txtMulta = new javax.swing.JTextField(); + StatusEmprestimo = new javax.swing.JTextField(); + jScrollPane7 = new javax.swing.JScrollPane(); + txtObservacoesDevolucao = new javax.swing.JTextArea(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel15 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + jLabel17 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + jLabel20 = new javax.swing.JLabel(); + jLabel21 = new javax.swing.JLabel(); + jLabel22 = new javax.swing.JLabel(); + radbtnAddObs = new javax.swing.JRadioButton(); + radioLista = new javax.swing.JRadioButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Controle de Empréstimo"); + + 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(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 1058, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) + ); + + wdwEmprestimos.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + wdwEmprestimosMouseClicked(evt); + } + }); + wdwEmprestimos.addComponentListener(new java.awt.event.ComponentAdapter() { + public void componentShown(java.awt.event.ComponentEvent evt) { + wdwEmprestimosComponentShown(evt); + } + }); + + jLabel14.setText("Nome:"); + + txtPesquisaUsuario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPesquisaUsuarioActionPerformed(evt); + } + }); + txtPesquisaUsuario.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtPesquisaUsuarioKeyReleased(evt); + } + }); + + btnPesquisar.setText("Pesquisar"); + btnPesquisar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarActionPerformed(evt); + } + }); + btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + btnPesquisarKeyReleased(evt); + } + }); + + tabelaUsuario.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "cod", "nome", "rg", "cpf", "email", "telefone", "celular", "cep", "endereco", "numero", "complemento", "bairro", "cidade", "estado", "curso", "ano", "Observações", "Tipo de Acesso" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaUsuario.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + tabelaUsuario.setAutoscrolls(false); + tabelaUsuario.getTableHeader().setReorderingAllowed(false); + tabelaUsuario.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaUsuarioMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tabelaUsuario); + tabelaUsuario.getColumn(tabelaUsuario.getColumnName(0)).setPreferredWidth(40); + tabelaUsuario.getColumn(tabelaUsuario.getColumnName(1)).setPreferredWidth(200); + + javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios); + tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout); + tabConsultaUsuariosLayout.setHorizontalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jScrollPane1) + .addContainerGap()) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtPesquisaUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE) + .addGap(18, 18, 18) + .addComponent(btnPesquisar) + .addGap(618, 618, 618)))) + ); + tabConsultaUsuariosLayout.setVerticalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(txtPesquisaUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 100, Short.MAX_VALUE) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 378, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + wdwEmprestimos.addTab("Consulta de Usuário", tabConsultaUsuarios); + + btnPesquisar1.setText("Pesquisar"); + btnPesquisar1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisar1ActionPerformed(evt); + } + }); + btnPesquisar1.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + btnPesquisar1KeyReleased(evt); + } + }); + + txtPesquisaLivros.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPesquisaLivrosActionPerformed(evt); + } + }); + txtPesquisaLivros.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtPesquisaLivrosKeyReleased(evt); + } + }); + + tabelaLivros.setAutoCreateRowSorter(true); + tabelaLivros.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "cod", "Título", "Autor", "Editora", "ISBN", "Ano", "Serie", "Edição", "Idioma", "Fornecedor", "Piso", "Corredor", "Posição", "Seção", "Disponibilidade", "Observações" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaLivros.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + tabelaLivros.getTableHeader().setReorderingAllowed(false); + tabelaLivros.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaLivrosMouseClicked(evt); + } + }); + jScrollPane2.setViewportView(tabelaLivros); + tabelaLivros.getColumn(tabelaLivros.getColumnName(0)).setPreferredWidth(40); + tabelaLivros.getColumn(tabelaLivros.getColumnName(1)).setPreferredWidth(200); + + 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(42, 42, 42) + .addComponent(txtPesquisaLivros, javax.swing.GroupLayout.PREFERRED_SIZE, 550, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnPesquisar1) + .addContainerGap(337, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane2) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(11, 11, 11) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtPesquisaLivros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar1)) + .addGap(18, 18, 18) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 440, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + wdwEmprestimos.addTab("Consulta de Livro", jPanel2); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel3.setText("Nome de Usuário:"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel5.setText("Filtrar Livro:"); + + txtNome.setEditable(false); + txtNome.setForeground(new java.awt.Color(102, 102, 102)); + txtNome.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtNomeActionPerformed(evt); + } + }); + + tabelaEmprestimos.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Titulo", "Data Empréstimo", "Data para Devolução", "Observações", "Id" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaEmprestimos.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + jScrollPane4.setViewportView(tabelaEmprestimos); + tabelaEmprestimos.getColumn(tabelaEmprestimos.getColumnName(4)).setPreferredWidth(38); + tabelaEmprestimos.getColumn(tabelaEmprestimos.getColumnName(0)).setPreferredWidth(130); + tabelaEmprestimos.getColumn(tabelaEmprestimos.getColumnName(1)).setPreferredWidth(120); + tabelaEmprestimos.getColumn(tabelaEmprestimos.getColumnName(2)).setPreferredWidth(120); + tabelaEmprestimos.getColumn(tabelaEmprestimos.getColumnName(3)).setPreferredWidth(150); + + btnBuscaUser.setText("Buscar Usuário"); + btnBuscaUser.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscaUserActionPerformed(evt); + } + }); + + tabelaLivrosFiltro.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Disponibilidade", "Título", "Observações", "Localização", "Cod", "ISBN", "Emprestado" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, true, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaLivrosFiltro.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + tabelaLivrosFiltro.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaLivrosFiltroMouseClicked(evt); + } + }); + jScrollPane5.setViewportView(tabelaLivrosFiltro); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(0)).setPreferredWidth(34); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(1)).setPreferredWidth(170); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(2)).setPreferredWidth(150); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(3)).setPreferredWidth(140); + + txtBuscaLivro.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtBuscaLivroKeyReleased(evt); + } + }); + + txtAgora.setEditable(false); + txtAgora.setForeground(new java.awt.Color(102, 102, 102)); + txtAgora.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtAgoraActionPerformed(evt); + } + }); + + txtPrazoEntrega.setEditable(false); + txtPrazoEntrega.setForeground(new java.awt.Color(102, 102, 102)); + txtPrazoEntrega.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPrazoEntregaActionPerformed(evt); + } + }); + + jLabel4.setText("Data para Devolução:"); + + jLabel6.setText("Data Atual:"); + + jLabel7.setText("Livro ID:"); + + txtTituloSelect.setEditable(false); + txtTituloSelect.setForeground(new java.awt.Color(102, 102, 102)); + txtTituloSelect.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtTituloSelectActionPerformed(evt); + } + }); + + brnAddLivro.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/right_small.png"))); // NOI18N + brnAddLivro.setText("<html>Adicionar à Lista"); + brnAddLivro.setToolTipText(""); + brnAddLivro.setActionCommand("<html>Adicionar à Lista"); + brnAddLivro.setVerticalTextPosition(SwingConstants.BOTTOM); + brnAddLivro.setHorizontalTextPosition(SwingConstants.CENTER); + brnAddLivro.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + brnAddLivroActionPerformed(evt); + } + }); + + txtBookId.setEditable(false); + txtBookId.setForeground(new java.awt.Color(102, 102, 102)); + + txtObservacoes.setColumns(20); + txtObservacoes.setRows(5); + jScrollPane3.setViewportView(txtObservacoes); + + jLabel8.setText("Observações:"); + + btnRemoveBook.setText("Remover Livro da Lista"); + btnRemoveBook.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnRemoveBookActionPerformed(evt); + } + }); + + btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N + btnSalvar.setText("SALVAR"); + btnSalvar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarActionPerformed(evt); + } + }); + + jLabel2.setText("ID de Usuário:"); + + txtId.setEditable(false); + txtId.setForeground(new java.awt.Color(102, 102, 102)); + txtId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdActionPerformed(evt); + } + }); + + cbOcultarEmprestados.setText("Ocultar Emprestados"); + cbOcultarEmprestados.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + cbOcultarEmprestadosItemStateChanged(evt); + } + }); + + jButton5.setText("Mapa"); + + btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N + btnNovo.setText("NOVO"); + btnNovo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoActionPerformed(evt); + } + }); + + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/book_cover.png"))); // NOI18N + lblImagem.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.white, java.awt.Color.darkGray)); + + txtISBN.setEditable(false); + txtISBN.setForeground(new java.awt.Color(102, 102, 102)); + txtISBN.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtISBNActionPerformed(evt); + } + }); + + jLabel10.setText("<html>ISBN/<br>ISSN:\n"); + + txtStatus.setEditable(false); + txtStatus.setForeground(new java.awt.Color(102, 102, 102)); + + jLabel11.setText("Status:"); + + jLabel9.setText("Empréstimos Restantes:"); + + txtEmprestimosRestantes.setEditable(false); + txtEmprestimosRestantes.setForeground(new java.awt.Color(102, 102, 102)); + + lblimagemUser.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + lblimagemUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_student_309036 (2).png"))); // NOI18N + lblimagemUser.setVerticalTextPosition(SwingConstants.BOTTOM); + lblimagemUser.setHorizontalTextPosition(SwingConstants.CENTER); + lblimagemUser.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.white, java.awt.Color.darkGray)); + + btnCartao.setText("Imprimir/ Ver Cartão"); + btnCartao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCartaoActionPerformed(evt); + } + }); + + jButton1.setText("Cadastro"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + jButton13.setText("Cadastro"); + jButton13.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton13ActionPerformed(evt); + } + }); + + btnDetalhes.setText("Detalhes"); + btnDetalhes.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnDetalhesActionPerformed(evt); + } + }); + + btnBuscarLivrosAdvanced.setText("Busca Avançada"); + btnBuscarLivrosAdvanced.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnBuscarLivrosAdvancedActionPerformed(evt); + } + }); + + txtDisponibilidade.setEnabled(false); + txtDisponibilidade.setOpaque(false); + + jLabel23.setText("Título:"); + + javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro); + tabCadastro.setLayout(tabCadastroLayout); + tabCadastroLayout.setHorizontalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtBuscaLivro, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(cbOcultarEmprestados)) + .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel11) + .addGap(332, 332, 332)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 349, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18))) + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(33, 33, 33)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel7) + .addGap(29, 29, 29) + .addComponent(txtBookId, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(12, 12, 12) + .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(13, 13, 13) + .addComponent(jLabel8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel6)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel4))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtPrazoEntrega) + .addComponent(txtAgora, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE)))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(btnDetalhes) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnBuscarLivrosAdvanced) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton13))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(24, 24, 24) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(8, 8, 8) + .addComponent(txtDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jLabel23)) + .addGap(15, 15, 15) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtStatus, javax.swing.GroupLayout.DEFAULT_SIZE, 297, Short.MAX_VALUE) + .addComponent(txtTituloSelect)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(brnAddLivro, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(lblimagemUser, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(btnBuscaUser, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnCartao, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtId) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel9) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmprestimosRestantes, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(7, 7, 7))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(btnNovo) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnRemoveBook))) + .addGap(28, 28, 28) + .addComponent(jLabel18) + .addGap(22, 22, 22)) + ); + tabCadastroLayout.setVerticalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel18) + .addGap(415, 415, 415)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel9) + .addComponent(txtEmprestimosRestantes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnBuscaUser) + .addComponent(btnCartao) + .addComponent(jButton1))) + .addComponent(lblimagemUser, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnNovo) + .addComponent(btnSalvar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnRemoveBook, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(393, 393, 393)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(txtBuscaLivro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(cbOcultarEmprestados)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnDetalhes) + .addComponent(btnBuscarLivrosAdvanced) + .addComponent(jButton5) + .addComponent(jButton13)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtTituloSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel23))) + .addComponent(brnAddLivro)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel11) + .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtBookId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7)) + .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel8) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(txtAgora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtPrazoEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4)))))) + .addGap(226, 226, 226) + .addComponent(txtDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))) + ); + + wdwEmprestimos.addTab("Cadastro de Empréstimo", tabCadastro); + + tabelaDevolucoes.setDefaultRenderer(Date.class, new DateRenderer()); + tabelaDevolucoes.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Atraso", "Id do Empréstimo", "Usuário", "Titulo", "Funcionário", "Data do Empréstimo", "Data Agendada de Entrega", "Observações", "Data da Devolução" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, true, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaDevolucoes.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaDevolucoesMouseClicked(evt); + } + }); + jScrollPane6.setViewportView(tabelaDevolucoes); + + btnDevolver.setText("Devolver"); + btnDevolver.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnDevolverActionPerformed(evt); + } + }); + + btnReemprestar.setText("reeemprestar"); + btnReemprestar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnReemprestarActionPerformed(evt); + } + }); + + jButton9.setText("Localização"); + + btnImprimeMulta.setText("Imprime Multa"); + btnImprimeMulta.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnImprimeMultaActionPerformed(evt); + } + }); + + btnDesbloqueiaUsuario.setText("Desbloqueia Usuário"); + + txtIdEmprest.setEditable(false); + txtIdEmprest.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdEmprestActionPerformed(evt); + } + }); + + txtLeitorresponsavel.setEditable(false); + + txtLivroEmprestado.setEditable(false); + + txtFuncionarioQueEmprestou.setEditable(false); + txtFuncionarioQueEmprestou.setHorizontalAlignment(javax.swing.JTextField.TRAILING); + + txtDataEmprestimo.setEditable(false); + + txtDataParaDevolucao.setEditable(false); + + StatusEmprestimo.setEditable(false); + + txtObservacoesDevolucao.setColumns(20); + txtObservacoesDevolucao.setRows(5); + jScrollPane7.setViewportView(txtObservacoesDevolucao); + + jLabel12.setText("Id do Empréstimo"); + + jLabel13.setText("Leitor Responsável:"); + + jLabel15.setText("Título:"); + + jLabel16.setText("Funcionário:"); + + jLabel17.setText("Data de Empréstimo:"); + + jLabel19.setText("Data para Devolução:"); + + jLabel20.setText("Status:"); + + jLabel21.setText("Multa:"); + + jLabel22.setText("Observações:"); + + radbtnAddObs.setText("Add Observações como permanente para o Livro"); + + radioLista.setText("Mostrar Devolvidos"); + radioLista.addItemListener(new java.awt.event.ItemListener() { + public void itemStateChanged(java.awt.event.ItemEvent evt) { + radioListaItemStateChanged(evt); + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(37, 37, 37) + .addComponent(jLabel12)) + .addComponent(jLabel15, javax.swing.GroupLayout.Alignment.TRAILING)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtIdEmprest, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel13) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtLeitorresponsavel, javax.swing.GroupLayout.PREFERRED_SIZE, 348, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(txtLivroEmprestado, javax.swing.GroupLayout.PREFERRED_SIZE, 544, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(13, 13, 13) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel20) + .addComponent(jLabel19) + .addComponent(jLabel21)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtDataParaDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(StatusEmprestimo, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(jLabel17) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtDataEmprestimo, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtFuncionarioQueEmprestou, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jScrollPane7, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 354, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(radbtnAddObs, javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnDevolver, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnReemprestar, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnImprimeMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnDesbloqueiaUsuario))))) + .addComponent(jLabel16, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel22, javax.swing.GroupLayout.Alignment.LEADING)))) + .addGap(231, 231, 231) + .addComponent(jButton9)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(833, 833, 833) + .addComponent(radioLista)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 993, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(radioLista) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtIdEmprest, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtLeitorresponsavel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel12) + .addComponent(jLabel13)) + .addGap(2, 2, 2) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(13, 13, 13) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel15) + .addComponent(txtLivroEmprestado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 18, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(radbtnAddObs) + .addGap(3, 3, 3) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnImprimeMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnDevolver, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnDesbloqueiaUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnReemprestar, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(52, Short.MAX_VALUE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel16) + .addComponent(jLabel17) + .addComponent(txtDataEmprestimo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtFuncionarioQueEmprestou, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(txtDataParaDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel22)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel20) + .addComponent(StatusEmprestimo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(23, 23, 23) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel21) + .addComponent(txtMulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(35, 35, 35)))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jButton9) + .addGap(0, 0, Short.MAX_VALUE)))) + ); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {StatusEmprestimo, txtDataEmprestimo, txtDataParaDevolucao, txtMulta}); + + wdwEmprestimos.addTab("Devoluções", jPanel3); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(wdwEmprestimos, javax.swing.GroupLayout.PREFERRED_SIZE, 1037, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(wdwEmprestimos, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed + Utilitarios util = new Utilitarios(); +//______________________pega id de usuario . verifica se esta selecionado___________________________________ + try { + int useridint;// + try { + useridint = Integer.parseInt(txtId.getText());//id int + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro! Selecione um Usuário"); + wdwEmprestimos.setSelectedIndex(0); + return; + } +//______________________caso user nao tenha emprestimos restantes__________________________________ + EmprestimoDao emprestimoDao = new EmprestimoDao(); + if ((emprestimoDao.calculaemprestimosrestantes(useridint)) == 0) { + JOptionPane.showMessageDialog(null, "Limite de empréstimos excedido, precisa devolver Livros antes de emprestar outros!"); + util.limpaTela(tabCadastro); + while (caixa.getRowCount() > 0) { + caixa.removeRow(0); + } + return; + } +//______________________ seleciona primeira linha - pega id do livro na 5a coluna ___________________________________ + while (tabelaEmprestimos.getRowCount() > 0) { + try { + if (tabelaEmprestimos != null && tabelaEmprestimos.getRowCount() > 0) { + tabelaEmprestimos.getSelectionModel().setSelectionInterval(0, 0); + } + DefaultTableModel modelo = (DefaultTableModel) tabelaEmprestimos.getModel(); + int row = tabelaEmprestimos.getSelectedRow(); + Livro livro = new Livro(); + livro.setId(Integer.parseInt((String) modelo.getValueAt(row, 4))); + int livroidint = livro.getId(); +//________________________ livro está emprestado? se estiver cancela operacao_____________________________________ + LivroDao livrodao = new LivroDao(); + String seLivroEmprestado = livrodao.getLivroData("is_emprestado", livroidint); + if (!seLivroEmprestado.equals("0")) { + JOptionPane.showMessageDialog(null, "Livro já foi Emprestado, verifique!"); + caixa.removeRow(0); + break; + } +//_____________________________________pega disponibilidade para caulcular prazos_ constroi objeto___________________________________ + Emprestimo emprestimo = new Emprestimo(); + Recibo recibo = new Recibo(); + Timestamp tmsp = new Timestamp(System.currentTimeMillis());//tempo agora + Timestamp prazoEntrega = emprestimoDao.addDays(tmsp, Integer.parseInt(livrodao.getLivroData("disponibilidade", livro.getId()))); + emprestimo.setData_emprestimo(tmsp);//1 //trocar e implemtar horario de fechamento da biblioteca + + emprestimo.setData_entrega_agendada(prazoEntrega);//2 + emprestimo.setObservacoes(modelo.getValueAt(row, 3).toString());//3 + //System.out.println("emprestimo.setObservacoes1" + emprestimo.getObservacoes()); + emprestimo.setTb_livros_id(livro);//4 + + Funcionario funcionario = new Funcionario(); + String contentid = new String(Files.readAllBytes(Paths.get("C:\\Librography\\LoggedIn"))); + funcionario.setId(Integer.parseInt(contentid)); + emprestimo.setTb_funcionarios_id(funcionario);//5 //set funcionario id + + Usuario usuario = new Usuario();//parse com variaveis tipo usuario + usuario.setId(useridint); + emprestimo.setTb_leitores_id(usuario);//6 //pega direto + EmprestimoDao obj = new EmprestimoDao(); + obj.cadastrarEmprestimo(emprestimo);// passar variavel default +// __________________ constroi objeto recibo _______________________________________________________________ + SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + String dataEmprestimoFormatada = dataBR.format(emprestimo.getData_emprestimo()); + String dataDevolucaoAgendadaFormatada = dataBR.format(emprestimo.getData_entrega_agendada()); + recibo.setData_emprestimo(dataEmprestimoFormatada); + recibo.setData_devolução_agendada(dataDevolucaoAgendadaFormatada); + recibo.setLivro(livrodao.getLivroData("titulo", livroidint));//livro id + UsuarioDao usuariodao = new UsuarioDao(); + recibo.setUsuario(usuariodao.getUserData("nome", useridint)); + recibo.setStatus("Emprestimo"); + FuncionarioDao funcionariodao = new FuncionarioDao(); + recibo.setFuncionario(funcionariodao.getFuncionarioData("nome", Integer.parseInt(contentid)));//contentid + ReciboDao recibodao = new ReciboDao(); + recibo.setEmprestimoid(obj.getEmprestimoId(emprestimo.getData_emprestimo(), livroidint)); + recibodao.cadastrarReciboEmprestimo(recibo); +//_____________________________cadastra objeto __________________________ + livrodao.setIsEmprestado(livroidint);//7 +//________________________ update campo emprestimos restantes e add ao contador do usuario no db ___________________________ + int livrosemprestados = Integer.parseInt(emprestimoDao.getUserData("qtd_emprestimos", useridint));//8 + emprestimoDao.SomaEmprestimo(livrosemprestados, useridint); +//___________________________ remove linha ____________________________________ + caixa.removeRow(0); + } catch (IOException ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + } + txtEmprestimosRestantes.setText(String.valueOf(emprestimoDao.calculaemprestimosrestantes(useridint))); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_btnSalvarActionPerformed + + private void txtPesquisaUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaUsuarioActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPesquisaUsuarioActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + // listar suario pt4 + listarUsers(); + try { + listarLivros(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + try { + listarLivrosFiltro(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + Date agora = new Date(); + SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + String dataFormatada = dataBR.format(agora); + txtAgora.setText(String.valueOf(dataFormatada)); + try { + listarDevolucoesCompact(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + + + }//GEN-LAST:event_formWindowActivated + + private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + while (caixa.getRowCount() > 0) { + caixa.removeRow(0); + } + Date agora = new Date(); + SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + String dataFormatada = dataBR.format(agora); + txtAgora.setText(String.valueOf(dataFormatada)); + }//GEN-LAST:event_btnNovoActionPerformed + + private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased + // TODO add your handling code here: + + }//GEN-LAST:event_btnPesquisarKeyReleased + + private void txtPesquisaUsuarioKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaUsuarioKeyReleased + + String nome = "%" + txtPesquisaUsuario.getText() + "%"; + UsuarioDao dao = new UsuarioDao(); + List<Usuario> lista = dao.pesquisarNome(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaUsuario.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Usuario c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getRg(), + c.getCpf(), + c.getEmail(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(), + c.getCurso(), + c.getSerie() + }); + } + }//GEN-LAST:event_txtPesquisaUsuarioKeyReleased + + private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed + + }//GEN-LAST:event_btnPesquisarActionPerformed + + //tabela da aba 1 + private void tabelaUsuarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaUsuarioMouseClicked + try { + DefaultTableModel model = (DefaultTableModel) tabelaUsuario.getModel(); + int selectedRowIndex = tabelaUsuario.getSelectedRow(); + txtId.setText(model.getValueAt(selectedRowIndex, 0).toString()); + txtNome.setText(model.getValueAt(selectedRowIndex, 1).toString()); + wdwEmprestimos.setSelectedIndex(2); + String path = "C:\\Librography\\images\\usuarios\\" + txtId.getText(); + lblimagemUser.setIcon(ResizeUserImage(path)); + EmprestimoDao user = new EmprestimoDao();//emprestimos restantes + String preleitor = txtId.getText(); + int leitor = Integer.parseInt(preleitor); + String emprestadosTxt = user.getUserData("qtd_emprestimos", leitor); + String emprestmaxtxt = user.getUserData("emprestmax", leitor); + int emprestmaxInt = Integer.parseInt(emprestmaxtxt); + int emprestadosInt = Integer.parseInt(emprestadosTxt); + int limite = emprestmaxInt - emprestadosInt; + String s = String.valueOf(limite/**/); + txtEmprestimosRestantes.setText(s); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_tabelaUsuarioMouseClicked + + // tabela da aba 2 + private void tabelaLivrosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaLivrosMouseClicked + DefaultTableModel model = (DefaultTableModel) tabelaLivros.getModel(); + int selectedRowIndex = tabelaLivros.getSelectedRow(); + txtBookId.setText(model.getValueAt(selectedRowIndex, 0).toString()); + txtTituloSelect.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtISBN.setText(model.getValueAt(selectedRowIndex, 4).toString()); + txtObservacoes.setText(model.getValueAt(selectedRowIndex, 15).toString()); + txtDisponibilidade.setText(model.getValueAt(selectedRowIndex, 14).toString()); + String path = "C:\\Librography\\images\\books\\" + txtISBN.getText(); + lblImagem.setIcon(ResizeBookImage(path)); + Date dataTeste = new Date(); + Calendar cal = Calendar.getInstance(); //prazo de entrega + cal.setTime(dataTeste); + cal.add(Calendar.DATE, (int) model.getValueAt(selectedRowIndex, 14)); //////////disponibilidade + dataTeste = cal.getTime(); + SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm"); +//trocar e implemtar horario de fechamento da biblioteca + String dataFormatada = dataBR.format(dataTeste); + txtPrazoEntrega.setText(String.valueOf(dataFormatada)); + wdwEmprestimos.setSelectedIndex(2); + }//GEN-LAST:event_tabelaLivrosMouseClicked + + private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdActionPerformed + + private void txtNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtNomeActionPerformed + + private void txtAgoraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtAgoraActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtAgoraActionPerformed + + private void wdwEmprestimosComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_wdwEmprestimosComponentShown + //listarUsers(); + }//GEN-LAST:event_wdwEmprestimosComponentShown + + private void btnPesquisar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisar1ActionPerformed + }//GEN-LAST:event_btnPesquisar1ActionPerformed + + private void btnPesquisar1KeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisar1KeyReleased + + }//GEN-LAST:event_btnPesquisar1KeyReleased + + private void txtPesquisaLivrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaLivrosActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPesquisaLivrosActionPerformed + + private void txtPesquisaLivrosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaLivrosKeyReleased + String nome = "%" + txtPesquisaLivros.getText() + "%"; + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + List<Livro> lista = dao.pesquisarNomeLivros(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaLivros.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getTitulo(), + c.getAutor(), + c.getEditora(), + c.getIsbn(), + c.getAno(), + c.getSerie(), + c.getEdicao(), + c.getIdioma(), + c.getFornecedor().getNome(), + c.getPiso(), + c.getCorredor(), + c.getPosicao(), + c.getSecao(), + c.getDisponibilidade(), + c.getObservacoes(),}); + } + }//GEN-LAST:event_txtPesquisaLivrosKeyReleased + + private void wdwEmprestimosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_wdwEmprestimosMouseClicked + // TODO add your handling code here: + //listarUsers(); + }//GEN-LAST:event_wdwEmprestimosMouseClicked + + private void tabelaLivrosFiltroMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaLivrosFiltroMouseClicked + try { + DefaultTableModel model = (DefaultTableModel) tabelaLivros.getModel(); + int selectedRowIndex = tabelaLivrosFiltro.getSelectedRow(); + txtBookId.setText(model.getValueAt(selectedRowIndex, 0).toString()); + txtTituloSelect.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtISBN.setText(model.getValueAt(selectedRowIndex, 4).toString()); + txtObservacoes.setText(model.getValueAt(selectedRowIndex, 15).toString()); + txtDisponibilidade.setText(model.getValueAt(selectedRowIndex, 14).toString()); + String path = "C:\\Librography\\images\\books\\" + txtISBN.getText(); + lblImagem.setIcon(ResizeBookImage(path)); + EmprestimoDao emprestimodao = new EmprestimoDao(); + txtStatus.setText(emprestimodao.campoStatusLista(Integer.parseInt(txtBookId.getText()))); + Date dataTeste = new Date(); + Calendar cal = Calendar.getInstance(); + cal.setTime(dataTeste); + cal.add(Calendar.DATE, (int) model.getValueAt(selectedRowIndex, 14)); //////////disponibilidade + dataTeste = cal.getTime(); + SimpleDateFormat dataBR = new SimpleDateFormat("dd/MM/yyyy HH:mm"); + //trocar e implemtar horario de fechamento da biblioteca + String dataFormatada = dataBR.format(dataTeste); + txtPrazoEntrega.setText(String.valueOf(dataFormatada)); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_tabelaLivrosFiltroMouseClicked + + // filtrar busca na aba cadastro de emprestimos + private void txtBuscaLivroKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscaLivroKeyReleased + String nome = "%" + txtBuscaLivro.getText() + "%"; + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + List<Livro> lista = dao.pesquisarNomeLivros(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaLivrosFiltro.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getTitulo(),}); + } + }//GEN-LAST:event_txtBuscaLivroKeyReleased + + //botao add to emprtestimo + // pega emprestimo restantes e qtdade de linhas da jtable para inserrir apenas limite de emprestimos junto com numero de licros na mao do usuario (ou se numero de emprestimos restantes == 0 + private void brnAddLivroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_brnAddLivroActionPerformed + String nome = txtTituloSelect.getText(); + Livro obj = new Livro(); + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + //verifica se tem livro selecionado + if ("".equals(txtISBN.getText()) | txtISBN.getText() == null) { + JOptionPane.showMessageDialog(null, "Selecione um Livro"); + return; + } + + obj = (Livro) dao.buscarLivro(nome); + if (obj.getAutor() != null) { + if (obj.getAutor() != null) { + caixa = (DefaultTableModel) tabelaEmprestimos.getModel(); + caixa.addRow(new Object[]{ + txtTituloSelect.getText(), + txtAgora.getText(), + txtPrazoEntrega.getText(), + txtObservacoes.getText(), + txtBookId.getText(),}); + } + // limpa campos + txtBookId.setText(""); + txtISBN.setText(""); + txtTituloSelect.setText(""); + txtStatus.setText(""); + txtObservacoes.selectAll(); + txtObservacoes.replaceSelection(""); + lblImagem.setIcon(null); + txtPrazoEntrega.setText(""); + } + }//GEN-LAST:event_brnAddLivroActionPerformed + + //detalhes + private void btnDetalhesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDetalhesActionPerformed + String msg = txtBookId.getText(); + int number = Integer.parseInt(msg); + int row = number - 1; + //encapsular abaixo? + String msgPis = null; + String msgCor = null; + String msgPos = null; + String msgSec = null; + String msgObs = null; + String msgTit = null; + String msgAut = null; + String msgEdt = null; + String msgIsb = null; + String msgAno = null; + String msgSer = null; + String msgEdc = null; + String msgIdi = null; + String msgFor = null; + + DefaultTableModel model = (DefaultTableModel) tabelaLivros.getModel(); + if ( model.getValueAt(row, 1) != null) { msgTit = model.getValueAt(row, 1).toString(); } + if ( model.getValueAt(row, 2) != null) { msgAut = model.getValueAt(row, 2).toString(); } + if ( model.getValueAt(row, 3) != null) { msgEdt = model.getValueAt(row, 3).toString(); } + if ( model.getValueAt(row, 4) != null) { msgIsb = model.getValueAt(row, 4).toString(); } + if ( model.getValueAt(row, 5) != null) { msgAno = model.getValueAt(row, 5).toString(); } + if ( model.getValueAt(row, 6) != null) { msgSer = model.getValueAt(row, 6).toString(); } + if ( model.getValueAt(row, 7) != null) { msgEdc = model.getValueAt(row, 7).toString(); } + if ( model.getValueAt(row, 8) != null) { msgIdi = model.getValueAt(row, 8).toString(); } + if ( model.getValueAt(row, 9) != null) { msgFor = model.getValueAt(row, 9).toString(); } + if ( model.getValueAt(row, 10) != null) { msgPis = model.getValueAt(row, 10).toString(); } + if ( model.getValueAt(row, 11) != null) { msgCor = model.getValueAt(row, 11).toString(); } + if ( model.getValueAt(row, 12) != null) { msgPos = model.getValueAt(row, 12).toString(); } + if ( model.getValueAt(row, 13) != null) { msgSec = model.getValueAt(row, 13).toString(); } + if ( model.getValueAt(row, 15) != null) { msgObs = model.getValueAt(row, 15).toString(); } + + FormDetalhesLivro detalhesLivro = new FormDetalhesLivro(msgTit, msgAut, msgEdt, msgIsb, msgAno, msgSer, msgEdc, msgIdi, msgFor, msgPis, msgCor, msgPos, msgSec, msgObs); + detalhesLivro.pack(); + detalhesLivro.setLocationRelativeTo(null); + detalhesLivro.setVisible(true); + }//GEN-LAST:event_btnDetalhesActionPerformed + + private void btnBuscaUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscaUserActionPerformed + wdwEmprestimos.setSelectedIndex(0); + }//GEN-LAST:event_btnBuscaUserActionPerformed + + private void btnRemoveBookActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveBookActionPerformed + //Delete Selected Row + int getSelectedRowForDeletion = tabelaEmprestimos.getSelectedRow(); + + caixa.removeRow(getSelectedRowForDeletion); + //JOptionPane.showMessageDialog(null, "Livro removido com sucesso!"); + }//GEN-LAST:event_btnRemoveBookActionPerformed + + private void btnBuscarLivrosAdvancedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBuscarLivrosAdvancedActionPerformed + wdwEmprestimos.setSelectedIndex(1); + }//GEN-LAST:event_btnBuscarLivrosAdvancedActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + FormLeitor leitorForn = new FormLeitor(); + //centralizar + leitorForn.pack(); + leitorForn.setLocationRelativeTo(null); + leitorForn.setVisible(true); + }//GEN-LAST:event_jButton1ActionPerformed + + private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed + FormLivros BookForn = new FormLivros(); + //centralizar + BookForn.pack(); + BookForn.setLocationRelativeTo(null); + BookForn.setVisible(true); + }//GEN-LAST:event_jButton13ActionPerformed + + //funcao tira screenshot + public static BufferedImage getScreenshotCartao(Component component) { + BufferedImage image = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_RGB); + component.paint(image.getGraphics()); + return image; + } + + public static void salvaImagemCartao(Component component, String filename) throws Exception { + BufferedImage img = getScreenshotCartao(component); + ImageIO.write(img, "png", new File(filename)); + } + + private void btnCartaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCartaoActionPerformed + //cartao + String msg = txtId.getText(); + int number = Integer.parseInt(msg); + int row = number - 101; + DefaultTableModel model = (DefaultTableModel) tabelaUsuario.getModel(); + + String msgNomePre = model.getValueAt(row, 1).toString(); + String msgNome = msgNomePre.toUpperCase(); + + String msgCursoPre = model.getValueAt(row, 14).toString(); + String msgCurso = msgCursoPre.toUpperCase(); + + String msgAcessoPre = model.getValueAt(row, 17).toString(); + String msgAcesso = msgAcessoPre.toUpperCase(); // maiusculas + + FormCartao detalhesUser = null; + try { + detalhesUser = new FormCartao(msg, msgNome, msgCurso, msgAcesso); + } catch (SQLException ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + detalhesUser.pack(); + detalhesUser.setLocationRelativeTo(null); + detalhesUser.setVisible(true); + }//GEN-LAST:event_btnCartaoActionPerformed + + private void btnDevolverActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDevolverActionPerformed + + String se_devolvido = StatusEmprestimo.getText(); + if (se_devolvido.equals("Devolvido")) { + JOptionPane.showMessageDialog(null, " Livro já foi devolvido"); + } else { + try { + EmprestimoDao devEmpres = new EmprestimoDao(); + if (txtIdEmprest.getText().isEmpty()) { + JOptionPane.showMessageDialog(null, "Selecione um Emprestimo antes de prosseguir"); + } else { + int EmpresId = Integer.parseInt(txtIdEmprest.getText()); + devEmpres.devolveLivro(EmpresId); + if (radbtnAddObs.isSelected()) { + int livroid = devEmpres.getEmprestimoFKeyData("tb_livros_id", Integer.parseInt(txtIdEmprest.getText())); + LivroDao livro = new LivroDao(); + livro.addObservacoes(txtObservacoesDevolucao.getText(), livroid); + } + txtIdEmprest.setText(""); + txtLeitorresponsavel.setText(""); + txtLivroEmprestado.setText(""); + txtDataEmprestimo.setText(""); + txtDataParaDevolucao.setText(""); + StatusEmprestimo.setText(""); + txtFuncionarioQueEmprestou.setText(""); + txtObservacoesDevolucao.selectAll(); + txtMulta.setText(""); + txtObservacoesDevolucao.replaceSelection(""); + //pegar id do user e atualizar emprestimos restantes ou limpar campo user + } + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_btnDevolverActionPerformed + + private void tabelaDevolucoesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaDevolucoesMouseClicked + try { + EmprestimoDao emprestDao = new EmprestimoDao(); + Utilitarios util = new Utilitarios(); + DefaultTableModel model = (DefaultTableModel) tabelaDevolucoes.getModel(); + int selectedRowIndex = tabelaDevolucoes.getSelectedRow(); + txtIdEmprest.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtLeitorresponsavel.setText(model.getValueAt(selectedRowIndex, 2).toString()); + txtLivroEmprestado.setText(model.getValueAt(selectedRowIndex, 3).toString()); + txtFuncionarioQueEmprestou.setText(model.getValueAt(selectedRowIndex, 4).toString()); + int idmprest = Integer.parseInt(txtIdEmprest.getText()); + Timestamp data_devolucao = emprestDao.getEmprestData(idmprest); + txtDataEmprestimo.setText(model.getValueAt(selectedRowIndex, 5).toString()); + txtDataParaDevolucao.setText(model.getValueAt(selectedRowIndex, 6).toString()); + String idempres = txtIdEmprest.getText(); + int atraso = emprestDao.calculaAtraso(Integer.parseInt(idempres)); + StatusEmprestimo.setText(emprestDao.campoStatus(data_devolucao, atraso)); + double multa = emprestDao.calculaMulta(atraso); + txtMulta.setText(util.campoMulta(multa)); + txtObservacoesDevolucao.setText(model.getValueAt(selectedRowIndex, 7).toString()); + + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class + .getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_tabelaDevolucoesMouseClicked + + private void txtIdEmprestActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdEmprestActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdEmprestActionPerformed + + private void radioListaItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_radioListaItemStateChanged + if (radioLista.isSelected()) { + try { + listarDevolucoes(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + } else { + try { + listarDevolucoesCompact(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_radioListaItemStateChanged + + private void btnImprimeMultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimeMultaActionPerformed + try { + + EmprestimoDao empDao = new EmprestimoDao(); + Multa multa = new Multa(); + UsuarioDao user = new UsuarioDao(); + multa.setTb_emprestimos_id(Integer.parseInt(txtIdEmprest.getText())); + multa.setDias_atraso(empDao.calculaAtraso(multa.getTb_emprestimos_id())); +//--------------------------------------------------------------------- +int i = Integer.parseInt(txtIdEmprest.getText()); + String toCode = String.format("%08d", i); + String QrCodeName = toCode; + String QR_CODE_IMAGE_PATH = "C:\\Librography\\images\\Multas\\QrCode\\"; + String Finalpath = QR_CODE_IMAGE_PATH + QrCodeName; + QRCodeGenerator genCode = new QRCodeGenerator(); + try { + genCode.generateQRCodeImage(toCode, 550, 550, Finalpath); + } catch (WriterException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } +//--------------------------------------------------------------------- +int e = Integer.parseInt(txtIdEmprest.getText()); + String toBCode = String.format("%08d", e); + String BarCodeName = toBCode; + String BAR_CODE_IMAGE_PATH = "C:\\Librography\\images\\Multas\\BarCode\\"; + String Finalbpath = BAR_CODE_IMAGE_PATH + BarCodeName; + QRCodeGenerator genBarCode = new QRCodeGenerator(); + try { + genBarCode.generateBarCodeImage(toCode, 340, 150, Finalbpath); + } catch (WriterException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormCartao.class.getName()).log(Level.SEVERE, null, ex); + } +//------------------------------------------------------------------------------ + multa.setValor_multa(empDao.calculaMulta(multa.getDias_atraso())); + multa.setTb_leitores_id(user.pegaUserIdpeloNome(txtLeitorresponsavel.getText())); + + MultaDao multaDao = new MultaDao(); + System.out.println("iddo emprestimo para comparar" + Integer.parseInt(txtIdEmprest.getText())); + if (multaDao.seJaExiste((Integer.parseInt(txtIdEmprest.getText()))) == false) { + multaDao.cadastrarMulta(multa); + } + int msgEmpId = multa.getTb_emprestimos_id(); + FormMulta formulta = new FormMulta(msgEmpId); + formulta.pack(); + formulta.setLocationRelativeTo(null); + formulta.setVisible(true); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_btnImprimeMultaActionPerformed + + private void txtTituloSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTituloSelectActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtTituloSelectActionPerformed + + private void txtISBNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtISBNActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtISBNActionPerformed + + private void txtPrazoEntregaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPrazoEntregaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPrazoEntregaActionPerformed + + private void cbOcultarEmprestadosItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbOcultarEmprestadosItemStateChanged + if (!cbOcultarEmprestados.isSelected()) { + try { + listarLivrosFiltro(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + } else { + try { + listarLivrosFiltroCompact(); //compact + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_cbOcultarEmprestadosItemStateChanged + + private void btnReemprestarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReemprestarActionPerformed + try { + String se_devolvido = StatusEmprestimo.getText(); + if (se_devolvido.equals("Devolvido")) { + JOptionPane.showMessageDialog(null, " Livro já foi devolvido"); + } else { + EmprestimoDao devEmpres = new EmprestimoDao(); + if (txtIdEmprest.getText().isEmpty()) { + JOptionPane.showMessageDialog(null, "Selecione um Emprestimo antes de prosseguir"); + } else { + //dialogo paca confirmar se o livro foi inspecionado + //nao esta marcando is emprestado em livro + Emprestimo obj = new Emprestimo(); + LivroDao livrodao = new LivroDao(); + EmprestimoDao emprestimodao = new EmprestimoDao(); + Timestamp now = new Timestamp(System.currentTimeMillis()); + int iddoemprestimo = Integer.parseInt(txtIdEmprest.getText()); + int disponibilidade = Integer.parseInt(livrodao.getLivroData("disponibilidade", emprestimodao.getEmprestimoFKeyData("tb_livros_id", iddoemprestimo))); + Timestamp newdata = emprestimodao.addDays(now, disponibilidade); + obj.setData_emprestimo(now); + obj.setData_entrega_agendada(newdata); + obj.setObservacoes(txtObservacoesDevolucao.getText()); + Funcionario funcionario = new Funcionario(); + String contentid = new String(Files.readAllBytes(Paths.get("C:\\Librography\\LoggedIn"))); + funcionario.setId(Integer.parseInt(contentid)); + obj.setTb_funcionarios_id(funcionario); + Usuario usuario = new Usuario(); + usuario.setId(emprestimodao.getEmprestimoFKeyData("tb_leitores_id", iddoemprestimo)); + obj.setTb_leitores_id(usuario); + Livro livro = new Livro(); + int livroid = emprestimodao.getEmprestimoFKeyData("tb_livros_id", iddoemprestimo); + livro.setId(livroid); + obj.setTb_livros_id(livro); + devEmpres.devolveLivro(iddoemprestimo); + + livrodao.setIsEmprestado(livroid); + int livrosemprestados = Integer.parseInt(emprestimodao.getUserData("qtd_emprestimos", usuario.getId()));//8 + emprestimodao.SomaEmprestimo(livrosemprestados, usuario.getId()); + emprestimodao.cadastrarEmprestimo(obj); + } + } + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_btnReemprestarActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { + /* 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());//info.getClassName() //new DarculaLaf + break; + + } + } + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormEmprestimos.class + .getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> +// BasicLookAndFeel darcula = new DarculaLaf(); +// UIManager.setLookAndFeel(darcula); + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormEmprestimos().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JTextField StatusEmprestimo; + private javax.swing.JButton brnAddLivro; + private javax.swing.JButton btnBuscaUser; + private javax.swing.JButton btnBuscarLivrosAdvanced; + private javax.swing.JButton btnCartao; + private javax.swing.JButton btnDesbloqueiaUsuario; + private javax.swing.JButton btnDetalhes; + private javax.swing.JButton btnDevolver; + private javax.swing.JButton btnImprimeMulta; + private javax.swing.JButton btnNovo; + private javax.swing.JButton btnPesquisar; + private javax.swing.JButton btnPesquisar1; + private javax.swing.JButton btnReemprestar; + private javax.swing.JButton btnRemoveBook; + private javax.swing.JButton btnSalvar; + private javax.swing.JCheckBox cbOcultarEmprestados; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton13; + private javax.swing.JButton jButton5; + private javax.swing.JButton jButton9; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel21; + private javax.swing.JLabel jLabel22; + private javax.swing.JLabel jLabel23; + private javax.swing.JLabel 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 jPanel3; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JScrollPane jScrollPane4; + private javax.swing.JScrollPane jScrollPane5; + private javax.swing.JScrollPane jScrollPane6; + private javax.swing.JScrollPane jScrollPane7; + private javax.swing.JLabel lblImagem; + private javax.swing.JLabel lblimagemUser; + private javax.swing.JRadioButton radbtnAddObs; + private javax.swing.JRadioButton radioLista; + private javax.swing.JPanel tabCadastro; + private javax.swing.JPanel tabConsultaUsuarios; + private javax.swing.JTable tabelaDevolucoes; + private javax.swing.JTable tabelaEmprestimos; + private javax.swing.JTable tabelaLivros; + private javax.swing.JTable tabelaLivrosFiltro; + private javax.swing.JTable tabelaUsuario; + private javax.swing.JTextField txtAgora; + private javax.swing.JTextField txtBookId; + private javax.swing.JTextField txtBuscaLivro; + private javax.swing.JTextField txtDataEmprestimo; + private javax.swing.JTextField txtDataParaDevolucao; + private javax.swing.JTextField txtDisponibilidade; + private javax.swing.JTextField txtEmprestimosRestantes; + private javax.swing.JTextField txtFuncionarioQueEmprestou; + private javax.swing.JTextField txtISBN; + private javax.swing.JTextField txtId; + private javax.swing.JTextField txtIdEmprest; + private javax.swing.JTextField txtLeitorresponsavel; + private javax.swing.JTextField txtLivroEmprestado; + private javax.swing.JTextField txtMulta; + private javax.swing.JTextField txtNome; + private javax.swing.JTextArea txtObservacoes; + private javax.swing.JTextArea txtObservacoesDevolucao; + private javax.swing.JTextField txtPesquisaLivros; + private javax.swing.JTextField txtPesquisaUsuario; + private javax.swing.JTextField txtPrazoEntrega; + private javax.swing.JTextField txtStatus; + private javax.swing.JTextField txtTituloSelect; + private javax.swing.JTabbedPane wdwEmprestimos; + // End of variables declaration//GEN-END:variables + + private ImageIcon ResizeBookImage(String imgPath) { //192x261 + int imageX = 126; + int imageY = 194; + lblImagem.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblImagem.getWidth(), lblImagem.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + + private ImageIcon ResizeUserImage(String imgPath) { //192x261 + int imageX = 91; + int imageY = 119; + lblImagem.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblImagem.getWidth(), lblImagem.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + +} +//na tabela de emprestimosa se a datya de devolucao for null nnao mostrar na lista +//em gravar nocvo se campos estiverem em branco dar aviso + // em gravar existente se ja existir dar aviso diff --git a/src/br/com/projeto/view/FormFornecedores.form b/src/br/com/projeto/view/FormFornecedores.form new file mode 100644 index 0000000..5dea4af --- /dev/null +++ b/src/br/com/projeto/view/FormFornecedores.form @@ -0,0 +1,707 @@ +<?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> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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" max="32767" attributes="0"/> + <Component id="tabbedFrameF" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnImprimir" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="29" 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="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="tabbedFrameF" max="32767" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnImprimir" max="32767" attributes="0"/> + <EmptySpace 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="33" green="33" red="33" 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"/> + <Component id="jLabel1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" alignment="1" pref="72" max="32767" attributes="0"/> + </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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Cadastro de Fornecedores"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JTabbedPane" name="tabbedFrameF"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="tabConsultaUsuarios"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Consulta de Fornecedores"> + <Property name="tabTitle" type="java.lang.String" value="Consulta de Fornecedores"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Component id="jLabel14" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtPesquisaFornecedor" min="-2" pref="282" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="428" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" 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="0" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPesquisaFornecedor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="208" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPesquisaFornecedor"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaFornecedorActionPerformed"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaFornecedorKeyReleased"/> + </Events> + </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"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/> + </Events> + </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.JTable" name="tabelaFornecedor"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="13" rowCount="0"> + <Column editable="false" title="cod" type="java.lang.Object"/> + <Column editable="false" title="nome" type="java.lang.Object"/> + <Column editable="false" title="cnpj" type="java.lang.Object"/> + <Column editable="false" title="email" type="java.lang.Object"/> + <Column editable="false" title="telefone" type="java.lang.Object"/> + <Column editable="false" title="celular" type="java.lang.Object"/> + <Column editable="false" title="cep" type="java.lang.Object"/> + <Column editable="false" title="endereco" type="java.lang.Object"/> + <Column editable="false" title="numero" type="java.lang.Object"/> + <Column editable="false" title="complemento" type="java.lang.Object"/> + <Column editable="false" title="bairro" type="java.lang.Object"/> + <Column editable="false" title="cidade" type="java.lang.Object"/> + <Column editable="false" title="estado" type="java.lang.Object"/> + </Table> + </Property> + <Property name="autoResizeMode" type="int" value="4"/> + <Property name="autoscrolls" type="boolean" value="false"/> + <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> + <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> + <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="false" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaFornecedorMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="tabCadastro"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Cadastro de Fornecedores"> + <Property name="tabTitle" type="java.lang.String" value="Cadastro de Fornecedores"/> + </JTabbedPaneConstraints> + </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" attributes="0"> + <EmptySpace min="-2" pref="312" max="-2" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel10" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="txtCnpj" min="-2" pref="165" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel12" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCelular" min="-2" pref="109" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtTelefone" min="-2" pref="125" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtNome" min="-2" pref="247" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtEmail" min="-2" pref="280" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel19" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCep" min="-2" pref="111" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="46" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEndereco" min="-2" pref="258" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNum" min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel13" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtComplemento" min="-2" pref="204" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtBairro" min="-2" pref="189" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel16" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCidade" min="-2" pref="171" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="boxUf" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="53" max="-2" attributes="0"/> + <Component id="btnNovo" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSalvar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnExcluir" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + </Group> + <EmptySpace pref="64" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNome" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCelular" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTelefone" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCnpj" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace pref="47" max="32767" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="159" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEndereco" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNum" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCep" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" 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="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtComplemento" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtBairro" 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="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxUf" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" max="-2" attributes="0"> + <Component id="btnNovo" alignment="3" max="32767" attributes="0"/> + <Component id="btnSalvar" alignment="3" max="32767" attributes="0"/> + <Component id="btnExcluir" alignment="3" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="ID:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Nome:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Email:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Logradouro:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="UF:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="N:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Bairro:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Telefone:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*CNPJ:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel12"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Celular:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Complemento:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Cidade:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNome"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNomeActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtEmail"> + </Component> + <Component class="javax.swing.JTextField" name="txtEndereco"> + </Component> + <Component class="javax.swing.JTextField" name="txtNum"> + </Component> + <Component class="javax.swing.JTextField" name="txtComplemento"> + </Component> + <Component class="javax.swing.JTextField" name="txtBairro"> + </Component> + <Component class="javax.swing.JTextField" name="txtCidade"> + </Component> + <Component class="javax.swing.JTextField" name="txtId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel18"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="CEP:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxUf"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="27"> + <StringItem index="0" value="AC"/> + <StringItem index="1" value="AL"/> + <StringItem index="2" value="AP"/> + <StringItem index="3" value="AM"/> + <StringItem index="4" value="BA"/> + <StringItem index="5" value="CE"/> + <StringItem index="6" value="DF"/> + <StringItem index="7" value="ES"/> + <StringItem index="8" value="GO"/> + <StringItem index="9" value="MA"/> + <StringItem index="10" value="MT"/> + <StringItem index="11" value="MS"/> + <StringItem index="12" value="MG"/> + <StringItem index="13" value="PA"/> + <StringItem index="14" value="PB"/> + <StringItem index="15" value="PR"/> + <StringItem index="16" value="PE"/> + <StringItem index="17" value="PI"/> + <StringItem index="18" value="RJ"/> + <StringItem index="19" value="RN"/> + <StringItem index="20" value="RS"/> + <StringItem index="21" value="RO"/> + <StringItem index="22" value="RR"/> + <StringItem index="23" value="SC"/> + <StringItem index="24" value="SP"/> + <StringItem index="25" value="SE"/> + <StringItem index="26" value="TO"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtCep"> + <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.JFormattedTextField" name="txtCelular"> + <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.JFormattedTextField" name="txtTelefone"> + <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.JFormattedTextField" name="txtCnpj"> + <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.JButton" name="btnNovo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/new_file_small.png"/> + </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="btnNovoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/save_small.png"/> + </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="btnSalvarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnExcluir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/delete_small.png"/> + </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="btnExcluirActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel21"> + <Properties> + <Property name="text" type="java.lang.String" value="Campos marcados com * são de preenchimento obrigátório!"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <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="jButton1ActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnImprimir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/> + </Property> + <Property name="text" type="java.lang.String" value="FECHAR"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImprimirActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormFornecedores.java b/src/br/com/projeto/view/FormFornecedores.java new file mode 100644 index 0000000..c587a1d --- /dev/null +++ b/src/br/com/projeto/view/FormFornecedores.java @@ -0,0 +1,781 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +//mude para vizualizacao por projeto para adicionar action +package br.com.projeto.view; + +import br.com.parg.viacep.ViaCEP; +import br.com.parg.viacep.ViaCEPException; +import br.com.projeto.dao.FornecedorDao; +import br.com.projeto.model.Fornecedor; +import br.com.projeto.model.Utilitarios; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JOptionPane; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormFornecedores extends javax.swing.JFrame { + + //metodo listar usuarios pt3 + public void listarFunc() { + FornecedorDao dao = new FornecedorDao(); + List<Fornecedor> lista = dao.listarFornecedores(); + DefaultTableModel dados = (DefaultTableModel) tabelaFornecedor.getModel(); + dados.setNumRows(0); + for (Fornecedor c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getCnpj(), + c.getEmail(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(),}); + } + + } + + /** + * Creates new form formLeitor + */ + public FormFornecedores() { + 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(); + tabbedFrameF = new javax.swing.JTabbedPane(); + tabConsultaUsuarios = new javax.swing.JPanel(); + jLabel14 = new javax.swing.JLabel(); + txtPesquisaFornecedor = new javax.swing.JTextField(); + btnPesquisar = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + tabelaFornecedor = new javax.swing.JTable(); + tabCadastro = new javax.swing.JPanel(); + 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(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + txtNome = new javax.swing.JTextField(); + txtEmail = new javax.swing.JTextField(); + txtEndereco = new javax.swing.JTextField(); + txtNum = new javax.swing.JTextField(); + txtComplemento = new javax.swing.JTextField(); + txtBairro = new javax.swing.JTextField(); + txtCidade = new javax.swing.JTextField(); + txtId = new javax.swing.JTextField(); + jLabel18 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + boxUf = new javax.swing.JComboBox<>(); + txtCep = new javax.swing.JFormattedTextField(); + txtCelular = new javax.swing.JFormattedTextField(); + txtTelefone = new javax.swing.JFormattedTextField(); + txtCnpj = new javax.swing.JFormattedTextField(); + btnNovo = new javax.swing.JButton(); + btnSalvar = new javax.swing.JButton(); + btnExcluir = new javax.swing.JButton(); + jLabel21 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + btnImprimir = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Cadastro de Fornecedores"); + + 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(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE) + ); + + jLabel14.setText("Nome:"); + + txtPesquisaFornecedor.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPesquisaFornecedorActionPerformed(evt); + } + }); + txtPesquisaFornecedor.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtPesquisaFornecedorKeyReleased(evt); + } + }); + + btnPesquisar.setText("Pesquisar"); + btnPesquisar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarActionPerformed(evt); + } + }); + btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + btnPesquisarKeyReleased(evt); + } + }); + + tabelaFornecedor.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "cod", "nome", "cnpj", "email", "telefone", "celular", "cep", "endereco", "numero", "complemento", "bairro", "cidade", "estado" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaFornecedor.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS); + tabelaFornecedor.setAutoscrolls(false); + tabelaFornecedor.getTableHeader().setReorderingAllowed(false); + tabelaFornecedor.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaFornecedorMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tabelaFornecedor); + + javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios); + tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout); + tabConsultaUsuariosLayout.setHorizontalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtPesquisaFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, 282, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnPesquisar) + .addContainerGap(428, Short.MAX_VALUE)) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addContainerGap() + .addComponent(jScrollPane1) + .addContainerGap()) + ); + tabConsultaUsuariosLayout.setVerticalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(txtPesquisaFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + tabbedFrameF.addTab("Consulta de Fornecedores", tabConsultaUsuarios); + + jLabel2.setText("ID:"); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel3.setText("*Nome:"); + + jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel4.setText("Email:"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel5.setText("Logradouro:"); + + jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel6.setText("UF:"); + + jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel7.setText("N:"); + + jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel8.setText("Bairro:"); + + jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel9.setText("*Telefone:"); + + jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel10.setText("*CNPJ:"); + + jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel12.setText("Celular:"); + + jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel13.setText("Complemento:"); + + jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel16.setText("*Cidade:"); + + txtNome.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtNomeActionPerformed(evt); + } + }); + + txtId.setEditable(false); + txtId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdActionPerformed(evt); + } + }); + + jLabel19.setText("CEP:"); + + boxUf.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" })); + + try { + txtCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)#####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtCnpj.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##.###.###/####-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N + btnNovo.setText("NOVO"); + btnNovo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoActionPerformed(evt); + } + }); + + btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N + btnSalvar.setText("SALVAR"); + btnSalvar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarActionPerformed(evt); + } + }); + + btnExcluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete_small.png"))); // NOI18N + btnExcluir.setText("EXCLUIR"); + btnExcluir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirActionPerformed(evt); + } + }); + + jLabel21.setText("Campos marcados com * são de preenchimento obrigátório!"); + + jButton1.setText("Buscar"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro); + tabCadastro.setLayout(tabCadastroLayout); + tabCadastroLayout.setHorizontalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(312, 312, 312) + .addComponent(jLabel18)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(33, 33, 33) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2) + .addComponent(jLabel10)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel12) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel9) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(11, 11, 11) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel19) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jButton1) + .addGap(46, 46, 46) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel13) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, 204, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel16) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel21) + .addGap(53, 53, 53) + .addComponent(btnNovo) + .addGap(18, 18, 18) + .addComponent(btnSalvar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnExcluir))))))) + .addContainerGap(64, Short.MAX_VALUE)) + ); + tabCadastroLayout.setVerticalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4) + .addComponent(txtEmail, 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(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel12) + .addComponent(jLabel9) + .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel10) + .addComponent(txtCnpj, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 47, Short.MAX_VALUE) + .addComponent(jLabel18) + .addGap(159, 159, 159)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(jLabel5) + .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton1)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel13) + .addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8) + .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel16) + .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6) + .addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel21) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false) + .addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnSalvar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnExcluir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))) + ); + + tabbedFrameF.addTab("Cadastro de Fornecedores", tabCadastro); + + btnImprimir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnImprimir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N + btnImprimir.setText("FECHAR"); + btnImprimir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnImprimirActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(tabbedFrameF) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnImprimir) + .addGap(29, 29, 29)) + ); + layout.setVerticalGroup( + 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(tabbedFrameF) + .addGap(18, 18, 18) + .addComponent(btnImprimir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed + // salvar usuario + Fornecedor obj = new Fornecedor(); + obj.setNome(txtNome.getText()); + obj.setCnpj(txtCnpj.getText()); + obj.setEmail(txtEmail.getText()); + obj.setTelefone(txtTelefone.getText()); + obj.setCelular(txtCelular.getText()); + obj.setCep(txtCep.getText()); + obj.setEndereco(txtEndereco.getText()); + obj.setNumero(txtNum.getText()); + obj.setComplemento(txtComplemento.getText()); + obj.setBairro(txtBairro.getText()); + obj.setCidade(txtCidade.getText()); + obj.setUf(boxUf.getSelectedItem().toString()); + + FornecedorDao dao = new FornecedorDao(); + if (txtNome.getText().isEmpty() || txtCelular.getText().isEmpty() || txtCnpj.getText().isEmpty() || txtTelefone.getText().isEmpty() || txtCidade.getText().isEmpty()) { + JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!"); + } else { + Utilitarios util = new Utilitarios(); + boolean valido = util.validaCnpj(txtCnpj.getText()); + if (!txtCnpj.getText().equals("00.000.000/0000-00") && !valido == true && !txtCnpj.getText().equals(" . . / - ")) { + JOptionPane.showMessageDialog(null, "CNPJ Inválido! Tente Novamente!"); + return; + } + if (!(txtId.getText()).equals("")) { + obj.setId(Integer.valueOf(txtId.getText())); + dao.alterarFornecedor(obj); + } else { + dao.cadastrarFornecedor(obj); + } + } + }//GEN-LAST:event_btnSalvarActionPerformed + + private void btnImprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirActionPerformed + this.dispose(); + }//GEN-LAST:event_btnImprimirActionPerformed + + private void txtPesquisaFornecedorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaFornecedorActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPesquisaFornecedorActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + // listar suario pt4 + listarFunc(); + }//GEN-LAST:event_formWindowActivated + + private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed + // excluir + Fornecedor obj = new Fornecedor(); + try { + obj.setId(Integer.valueOf(txtId.getText())); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Aviso! Selecione um Fornecedor!"); + } + + FornecedorDao dao = new FornecedorDao(); + dao.excluirFornecedor(obj); + + }//GEN-LAST:event_btnExcluirActionPerformed + //TODO parei aqui + private void tabelaFornecedorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaFornecedorMouseClicked + // tabela quando clicado + DefaultTableModel model = (DefaultTableModel) tabelaFornecedor.getModel(); + int selectedRowIndex = tabelaFornecedor.getSelectedRow(); + + if ( model.getValueAt(selectedRowIndex, 0) != null) { + txtId.setText(model.getValueAt(selectedRowIndex, 0).toString());} + if ( model.getValueAt(selectedRowIndex, 1) != null) { + txtNome.setText(model.getValueAt(selectedRowIndex, 1).toString());} + if ( model.getValueAt(selectedRowIndex, 2)!= null) { + txtCnpj.setText(model.getValueAt(selectedRowIndex, 2).toString());} + if ( model.getValueAt(selectedRowIndex, 3) != null) { + txtEmail.setText(model.getValueAt(selectedRowIndex, 3).toString());} + if ( model.getValueAt(selectedRowIndex, 4) != null) { + txtTelefone.setText(model.getValueAt(selectedRowIndex, 4).toString());} + if ( model.getValueAt(selectedRowIndex, 5) != null ) { + txtCelular.setText(model.getValueAt(selectedRowIndex, 5).toString());} + if ( model.getValueAt(selectedRowIndex, 6) != null) { + txtCep.setText(model.getValueAt(selectedRowIndex, 6).toString());} + if ( model.getValueAt(selectedRowIndex, 7) != null) { + txtEndereco.setText(model.getValueAt(selectedRowIndex, 7).toString());} + if ( model.getValueAt(selectedRowIndex, 8) != null) { + txtNum.setText(model.getValueAt(selectedRowIndex, 8).toString());} + if ( model.getValueAt(selectedRowIndex, 9) != null) { + txtComplemento.setText(model.getValueAt(selectedRowIndex, 9).toString());} + if ( model.getValueAt(selectedRowIndex, 10) != null) { + txtBairro.setText(model.getValueAt(selectedRowIndex, 10).toString());} + if ( model.getValueAt(selectedRowIndex, 11) != null) { + txtCidade.setText(model.getValueAt(selectedRowIndex, 11).toString());} + if ( model.getValueAt(selectedRowIndex, 12) != null) { + boxUf.setSelectedItem(model.getValueAt(selectedRowIndex, 12).toString());} + + //mouse click go to tab + tabbedFrameF.setSelectedIndex(1); + + + }//GEN-LAST:event_tabelaFornecedorMouseClicked + + private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed + // TODO add your handling code here: + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + }//GEN-LAST:event_btnNovoActionPerformed + + private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdActionPerformed + + private void txtNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtNomeActionPerformed + + private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased + // TODO add your handling code here: + + }//GEN-LAST:event_btnPesquisarKeyReleased + + private void txtPesquisaFornecedorKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaFornecedorKeyReleased + // TODO add your handling code here: + String nome = "%" + txtPesquisaFornecedor.getText() + "%"; + FornecedorDao dao = new FornecedorDao(); + List<Fornecedor> lista = dao.pesquisarNomeFornecedores(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaFornecedor.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Fornecedor c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getCnpj(), + c.getEmail(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(),}); + } + + }//GEN-LAST:event_txtPesquisaFornecedorKeyReleased + + private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed + // TODO add your handling code here: + String nome = txtNome.getText(); + Fornecedor obj = new Fornecedor(); + FornecedorDao dao = new FornecedorDao(); + obj = dao.buscarFornecedor(nome); + if (obj.getNome() != null) { + txtId.setText(String.valueOf(obj.getId())); + txtNome.setText(obj.getNome()); + txtCnpj.setText(obj.getCnpj()); + txtEmail.setText(obj.getEmail()); + txtTelefone.setText(obj.getTelefone()); + txtCelular.setText(obj.getCelular()); + txtCep.setText(obj.getCep()); + txtEndereco.setText(obj.getEndereco()); + txtNum.setText(obj.getNumero()); + txtComplemento.setText(obj.getComplemento()); + txtBairro.setText(obj.getBairro()); + txtCidade.setText(obj.getCidade()); + boxUf.setSelectedItem(obj.getUf()); + + } else { + JOptionPane.showMessageDialog(null, "Fornecedor não encontrado"); + } + + }//GEN-LAST:event_btnPesquisarActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + ViaCEP viacep = new ViaCEP(); + try { + viacep.buscar(txtCep.getText()); + txtBairro.setText(viacep.getBairro()); + txtCidade.setText(viacep.getLocalidade()); + txtEndereco.setText(viacep.getLogradouro()); + boxUf.setSelectedItem(viacep.getUf()); + + } catch (ViaCEPException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + { + } + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @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(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormFornecedores.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormFornecedores().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox<String> boxUf; + private javax.swing.JButton btnExcluir; + private javax.swing.JButton btnImprimir; + private javax.swing.JButton btnNovo; + private javax.swing.JButton btnPesquisar; + private javax.swing.JButton btnSalvar; + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel21; + 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.JScrollPane jScrollPane1; + private javax.swing.JPanel tabCadastro; + private javax.swing.JPanel tabConsultaUsuarios; + private javax.swing.JTabbedPane tabbedFrameF; + private javax.swing.JTable tabelaFornecedor; + private javax.swing.JTextField txtBairro; + private javax.swing.JFormattedTextField txtCelular; + private javax.swing.JFormattedTextField txtCep; + private javax.swing.JTextField txtCidade; + private javax.swing.JFormattedTextField txtCnpj; + private javax.swing.JTextField txtComplemento; + private javax.swing.JTextField txtEmail; + private javax.swing.JTextField txtEndereco; + private javax.swing.JTextField txtId; + private javax.swing.JTextField txtNome; + private javax.swing.JTextField txtNum; + private javax.swing.JTextField txtPesquisaFornecedor; + private javax.swing.JFormattedTextField txtTelefone; + // End of variables declaration//GEN-END:variables +} diff --git a/src/br/com/projeto/view/FormFuncionarios.form b/src/br/com/projeto/view/FormFuncionarios.form new file mode 100644 index 0000000..dd413ea --- /dev/null +++ b/src/br/com/projeto/view/FormFuncionarios.form @@ -0,0 +1,840 @@ +<?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> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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" max="32767" attributes="0"/> + <Component id="tabbedFrameF" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnFechar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="19" 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="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="tabbedFrameF" min="-2" pref="266" max="-2" attributes="0"/> + <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/> + <Component id="btnFechar" 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="33" green="33" red="33" 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"/> + <Component id="jLabel1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" alignment="1" pref="72" max="32767" attributes="0"/> + </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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Cadastro de Funcionários"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JTabbedPane" name="tabbedFrameF"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="tabConsultaUsuarios"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Consulta de Funcionários"> + <Property name="tabTitle" type="java.lang.String" value="Consulta de Funcionários"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jScrollPane1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel14" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtPesquisaFuncionario" pref="307" max="32767" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="618" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPesquisaFuncionario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="176" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPesquisaFuncionario"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaFuncionarioActionPerformed"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaFuncionarioKeyReleased"/> + </Events> + </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"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/> + </Events> + </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.JTable" name="tabelaFuncionario"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="17" rowCount="0"> + <Column editable="false" title="cod" type="java.lang.Object"/> + <Column editable="false" title="nome" type="java.lang.Object"/> + <Column editable="false" title="rg" type="java.lang.Object"/> + <Column editable="false" title="cpf" type="java.lang.Object"/> + <Column editable="false" title="email" type="java.lang.Object"/> + <Column editable="false" title="senha" type="java.lang.Object"/> + <Column editable="false" title="cargo" type="java.lang.Object"/> + <Column editable="false" title="nivel_acesso" type="java.lang.Object"/> + <Column editable="false" title="telefone" type="java.lang.Object"/> + <Column editable="false" title="celular" type="java.lang.Object"/> + <Column editable="false" title="cep" type="java.lang.Object"/> + <Column editable="false" title="endereco" type="java.lang.Object"/> + <Column editable="false" title="numero" type="java.lang.Object"/> + <Column editable="false" title="complemento" type="java.lang.Object"/> + <Column editable="false" title="bairro" type="java.lang.Object"/> + <Column editable="false" title="cidade" type="java.lang.Object"/> + <Column editable="false" title="estado" type="java.lang.Object"/> + </Table> + </Property> + <Property name="autoResizeMode" type="int" value="4"/> + <Property name="autoscrolls" type="boolean" value="false"/> + <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> + <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> + <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> + <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="false" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaFuncionarioMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="tabCadastro"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Cadastro deFuncionários"> + <Property name="tabTitle" type="java.lang.String" value="Cadastro deFuncionários"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel19" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="txtCep" min="-2" pref="111" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="26" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEndereco" min="-2" pref="258" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNum" min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="txtBairro" min="-2" pref="189" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel16" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCidade" min="-2" pref="171" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="boxUf" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel13" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtComplemento" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="307" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="btnNovo" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSalvar" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnExcluir" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="312" max="-2" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="33" 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="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmail" min="-2" pref="280" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCpf" min="-2" pref="165" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtRg" min="-2" pref="156" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel17" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="txtCargo" max="32767" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel12" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtCelular" min="-2" pref="109" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtTelefone" min="-2" pref="125" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="348" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jTextField17" alignment="0" min="-2" pref="86" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtNome" min="-2" pref="247" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel15" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtSenha" min="-2" pref="206" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel20" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="boxNivelAcesso" min="-2" pref="241" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNome" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxNivelAcesso" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSenha" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCelular" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTelefone" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCargo" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCpf" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtRg" 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="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEndereco" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNum" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtComplemento" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCep" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtBairro" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxUf" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="31" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" max="-2" attributes="0"> + <Component id="btnNovo" alignment="3" max="32767" attributes="0"/> + <Component id="btnSalvar" alignment="3" max="32767" attributes="0"/> + <Component id="btnExcluir" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="63" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="159" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="181" max="-2" attributes="0"/> + <Component id="jTextField17" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="ID:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Nome:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Email:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Endereço:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="UF:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="N:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Bairro:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Telefone:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="CPF:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*RG:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel12"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Celular:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Complemento:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Cidade:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNome"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNomeActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtEmail"> + </Component> + <Component class="javax.swing.JTextField" name="txtEndereco"> + </Component> + <Component class="javax.swing.JTextField" name="txtNum"> + </Component> + <Component class="javax.swing.JTextField" name="txtComplemento"> + </Component> + <Component class="javax.swing.JTextField" name="txtBairro"> + </Component> + <Component class="javax.swing.JTextField" name="txtCidade"> + </Component> + <Component class="javax.swing.JTextField" name="txtId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel15"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Senha"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCargo"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel17"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Cargo"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="jTextField17"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jTextField17ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel18"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="CEP:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxUf"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="27"> + <StringItem index="0" value="AC"/> + <StringItem index="1" value="AL"/> + <StringItem index="2" value="AP"/> + <StringItem index="3" value="AM"/> + <StringItem index="4" value="BA"/> + <StringItem index="5" value="CE"/> + <StringItem index="6" value="DF"/> + <StringItem index="7" value="ES"/> + <StringItem index="8" value="GO"/> + <StringItem index="9" value="MA"/> + <StringItem index="10" value="MT"/> + <StringItem index="11" value="MS"/> + <StringItem index="12" value="MG"/> + <StringItem index="13" value="PA"/> + <StringItem index="14" value="PB"/> + <StringItem index="15" value="PR"/> + <StringItem index="16" value="PE"/> + <StringItem index="17" value="PI"/> + <StringItem index="18" value="RJ"/> + <StringItem index="19" value="RN"/> + <StringItem index="20" value="RS"/> + <StringItem index="21" value="RO"/> + <StringItem index="22" value="RR"/> + <StringItem index="23" value="SC"/> + <StringItem index="24" value="SP"/> + <StringItem index="25" value="SE"/> + <StringItem index="26" value="TO"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtCep"> + <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.JFormattedTextField" name="txtCelular"> + <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.JFormattedTextField" name="txtTelefone"> + <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.JFormattedTextField" name="txtCpf"> + <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.JFormattedTextField" name="txtRg"> + <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="jLabel20"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Nível de Acesso"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxNivelAcesso"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="3"> + <StringItem index="0" value="Administrador"/> + <StringItem index="1" value="Atendente"/> + <StringItem index="2" value="Usuario"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JPasswordField" name="txtSenha"> + </Component> + <Component class="javax.swing.JButton" name="btnNovo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/new_file_small.png"/> + </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="btnNovoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/save_small.png"/> + </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="btnSalvarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnExcluir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/delete_small.png"/> + </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="btnExcluirActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel21"> + <Properties> + <Property name="text" type="java.lang.String" value="Campos marcados com * são de preenchimento obrigátório!"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <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="jButton1ActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnFechar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/> + </Property> + <Property name="text" type="java.lang.String" value="FECHAR"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFecharActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormFuncionarios.java b/src/br/com/projeto/view/FormFuncionarios.java new file mode 100644 index 0000000..5adaaf1 --- /dev/null +++ b/src/br/com/projeto/view/FormFuncionarios.java @@ -0,0 +1,887 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +//mude para vizualizacao por projeto para adicionar action +package br.com.projeto.view; + +import br.com.parg.viacep.ViaCEP; +import br.com.parg.viacep.ViaCEPException; +import br.com.projeto.dao.FuncionarioDao; +import br.com.projeto.model.Funcionario; +import br.com.projeto.model.Utilitarios; +import java.awt.Component; +import java.awt.Window; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JOptionPane; +import javax.swing.JTabbedPane; +import javax.swing.JTextField; +import javax.swing.SwingUtilities; +import javax.swing.table.DefaultTableModel; +import javax.swing.text.JTextComponent; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormFuncionarios extends javax.swing.JFrame { + + //metodo listar usuarios pt3 + public void listarFunc() { + FuncionarioDao dao = new FuncionarioDao(); + List<Funcionario> lista = dao.listarFuncionarios(); + DefaultTableModel dados = (DefaultTableModel) tabelaFuncionario.getModel(); + dados.setNumRows(0); + for (Funcionario c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getRg(), + c.getCpf(), + c.getEmail(), + c.getSenha(), + c.getCargo(), + c.getNivel_acesso(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(),}); + } + } + + /** + * Creates new form formLeitor + */ + public FormFuncionarios() { + 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(); + tabbedFrameF = new javax.swing.JTabbedPane(); + tabConsultaUsuarios = new javax.swing.JPanel(); + jLabel14 = new javax.swing.JLabel(); + txtPesquisaFuncionario = new javax.swing.JTextField(); + btnPesquisar = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + tabelaFuncionario = new javax.swing.JTable(); + tabCadastro = new javax.swing.JPanel(); + 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(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + txtNome = new javax.swing.JTextField(); + txtEmail = new javax.swing.JTextField(); + txtEndereco = new javax.swing.JTextField(); + txtNum = new javax.swing.JTextField(); + txtComplemento = new javax.swing.JTextField(); + txtBairro = new javax.swing.JTextField(); + txtCidade = new javax.swing.JTextField(); + txtId = new javax.swing.JTextField(); + jLabel15 = new javax.swing.JLabel(); + txtCargo = new javax.swing.JTextField(); + jLabel17 = new javax.swing.JLabel(); + jTextField17 = new javax.swing.JTextField(); + jLabel18 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + boxUf = new javax.swing.JComboBox<>(); + txtCep = new javax.swing.JFormattedTextField(); + txtCelular = new javax.swing.JFormattedTextField(); + txtTelefone = new javax.swing.JFormattedTextField(); + txtCpf = new javax.swing.JFormattedTextField(); + txtRg = new javax.swing.JFormattedTextField(); + jLabel20 = new javax.swing.JLabel(); + boxNivelAcesso = new javax.swing.JComboBox<>(); + txtSenha = new javax.swing.JPasswordField(); + btnNovo = new javax.swing.JButton(); + btnSalvar = new javax.swing.JButton(); + btnExcluir = new javax.swing.JButton(); + jLabel21 = new javax.swing.JLabel(); + jButton1 = new javax.swing.JButton(); + btnFechar = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Cadastro de Funcionários"); + + 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(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE) + ); + + jLabel14.setText("Nome:"); + + txtPesquisaFuncionario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPesquisaFuncionarioActionPerformed(evt); + } + }); + txtPesquisaFuncionario.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtPesquisaFuncionarioKeyReleased(evt); + } + }); + + btnPesquisar.setText("Pesquisar"); + btnPesquisar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarActionPerformed(evt); + } + }); + btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + btnPesquisarKeyReleased(evt); + } + }); + + tabelaFuncionario.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "cod", "nome", "rg", "cpf", "email", "senha", "cargo", "nivel_acesso", "telefone", "celular", "cep", "endereco", "numero", "complemento", "bairro", "cidade", "estado" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaFuncionario.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS); + tabelaFuncionario.setAutoscrolls(false); + tabelaFuncionario.getTableHeader().setReorderingAllowed(false); + tabelaFuncionario.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaFuncionarioMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tabelaFuncionario); + if (tabelaFuncionario.getColumnModel().getColumnCount() > 0) { + tabelaFuncionario.getColumnModel().getColumn(15).setResizable(false); + } + + javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios); + tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout); + tabConsultaUsuariosLayout.setHorizontalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jScrollPane1) + .addContainerGap()) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtPesquisaFuncionario, javax.swing.GroupLayout.DEFAULT_SIZE, 307, Short.MAX_VALUE) + .addGap(18, 18, 18) + .addComponent(btnPesquisar) + .addGap(618, 618, 618)))) + ); + tabConsultaUsuariosLayout.setVerticalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(txtPesquisaFuncionario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar)) + .addGap(38, 38, 38) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + tabbedFrameF.addTab("Consulta de Funcionários", tabConsultaUsuarios); + + jLabel2.setText("ID:"); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel3.setText("*Nome:"); + + jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel4.setText("*Email:"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel5.setText("Endereço:"); + + jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel6.setText("UF:"); + + jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel7.setText("N:"); + + jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel8.setText("Bairro:"); + + jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel9.setText("Telefone:"); + + jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel10.setText("CPF:"); + + jLabel11.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel11.setText("*RG:"); + + jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel12.setText("*Celular:"); + + jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel13.setText("Complemento:"); + + jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel16.setText("Cidade:"); + + txtNome.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtNomeActionPerformed(evt); + } + }); + + txtId.setEditable(false); + txtId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdActionPerformed(evt); + } + }); + + jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel15.setText("*Senha"); + + jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel17.setText("*Cargo"); + + jTextField17.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jTextField17ActionPerformed(evt); + } + }); + + jLabel19.setText("CEP:"); + + boxUf.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" })); + + try { + txtCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)#####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtRg.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#.###.###-#"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + jLabel20.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel20.setText("*Nível de Acesso"); + + boxNivelAcesso.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Administrador", "Atendente", "Usuario" })); + + btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N + btnNovo.setText("NOVO"); + btnNovo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoActionPerformed(evt); + } + }); + + btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N + btnSalvar.setText("SALVAR"); + btnSalvar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarActionPerformed(evt); + } + }); + + btnExcluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete_small.png"))); // NOI18N + btnExcluir.setText("EXCLUIR"); + btnExcluir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirActionPerformed(evt); + } + }); + + jLabel21.setText("Campos marcados com * são de preenchimento obrigátório!"); + + jButton1.setText("Buscar"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro); + tabCadastro.setLayout(tabCadastroLayout); + tabCadastroLayout.setHorizontalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addContainerGap() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel19) + .addComponent(jLabel8)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jButton1) + .addGap(26, 26, 26) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 258, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel16) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jLabel21))) + .addGap(25, 25, 25) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel13) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtComplemento) + .addGap(307, 307, 307)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(btnNovo) + .addGap(18, 18, 18) + .addComponent(btnSalvar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnExcluir) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(312, 312, 312) + .addComponent(jLabel18) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(33, 33, 33) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel10) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCpf, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel11) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtRg, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2) + .addComponent(jLabel17)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(txtCargo) + .addGap(18, 18, 18) + .addComponent(jLabel12) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel9) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(348, 348, 348)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, 247, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel15) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtSenha, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel20) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(boxNivelAcesso, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))))) + ); + tabCadastroLayout.setVerticalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel15) + .addComponent(jLabel20) + .addComponent(boxNivelAcesso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtSenha, 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(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel12) + .addComponent(jLabel9) + .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel17) + .addComponent(txtCargo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(11, 11, 11) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4) + .addComponent(jLabel10) + .addComponent(jLabel11) + .addComponent(txtCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(jLabel5) + .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel13) + .addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jButton1)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel16) + .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6) + .addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel21)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(31, 31, 31) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false) + .addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnSalvar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnExcluir)))) + .addGap(63, 63, 63) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel18) + .addGap(159, 159, 159)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addGap(181, 181, 181) + .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18)))) + ); + + tabbedFrameF.addTab("Cadastro deFuncionários", tabCadastro); + + btnFechar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnFechar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N + btnFechar.setText("FECHAR"); + btnFechar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFecharActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(tabbedFrameF) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnFechar) + .addGap(19, 19, 19)) + ); + layout.setVerticalGroup( + 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(tabbedFrameF, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnFechar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed + // salvar usuario + Funcionario obj = new Funcionario(); + obj.setNome(txtNome.getText()); + obj.setRg(txtRg.getText()); + obj.setCpf(txtCpf.getText()); + obj.setEmail(txtEmail.getText()); + obj.setTelefone(txtTelefone.getText()); + obj.setCelular(txtCelular.getText()); + obj.setSenha(txtSenha.getText()); + obj.setCargo(txtCargo.getText()); + obj.setNivel_acesso(boxNivelAcesso.getSelectedItem().toString()); + obj.setCep(txtCep.getText()); + obj.setEndereco(txtEndereco.getText()); + obj.setNumero(txtNum.getText()); + obj.setComplemento(txtComplemento.getText()); + obj.setBairro(txtBairro.getText()); + obj.setCidade(txtCidade.getText()); + obj.setUf(boxUf.getSelectedItem().toString()); + + FuncionarioDao dao = new FuncionarioDao(); + if (txtNome.getText().isEmpty() || txtCelular.getText().isEmpty() || txtRg.getText().isEmpty() || txtSenha.getText().isEmpty() || txtEmail.getText().isEmpty() || boxNivelAcesso.getSelectedIndex() == -1 || txtCargo.getText().isEmpty()) { + JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!"); + } else { + Utilitarios util = new Utilitarios(); + boolean valido = util.valida(txtCpf.getText()); + if (!txtCpf.getText().equals(" . . - ") && !valido == true && !txtCpf.getText().equals("000.000.000-00")) { + JOptionPane.showMessageDialog(null, "CPF Inválido! Tente Novamente!"); + return; + } + if (!(txtId.getText()).equals("")) { + obj.setId(Integer.valueOf(txtId.getText())); + dao.alterarFuncionario(obj); + } else { + dao.cadastrarFuncionario(obj); + } + } + + }//GEN-LAST:event_btnSalvarActionPerformed + + private void btnFecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFecharActionPerformed + this.dispose(); + }//GEN-LAST:event_btnFecharActionPerformed + + private void txtPesquisaFuncionarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaFuncionarioActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPesquisaFuncionarioActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + // listar suario pt4 + listarFunc(); + }//GEN-LAST:event_formWindowActivated + + private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed + // excluir + Funcionario obj = new Funcionario(); + try { + obj.setId(Integer.valueOf(txtId.getText())); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Aviso! Selecione um usuário!"); + return; + } + + FuncionarioDao dao = new FuncionarioDao(); + dao.excluirFuncionario(obj); + + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + + }//GEN-LAST:event_btnExcluirActionPerformed + //TODO parei aqui + private void tabelaFuncionarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaFuncionarioMouseClicked + // tabela quando clicado + DefaultTableModel model = (DefaultTableModel) tabelaFuncionario.getModel(); + int selectedRowIndex = tabelaFuncionario.getSelectedRow(); + + txtId.setText(model.getValueAt(selectedRowIndex, 0).toString()); + txtNome.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtRg.setText(model.getValueAt(selectedRowIndex, 2).toString()); + txtCpf.setText(model.getValueAt(selectedRowIndex, 3).toString()); + txtEmail.setText(model.getValueAt(selectedRowIndex, 4).toString()); + txtSenha.setText(model.getValueAt(selectedRowIndex, 5).toString()); + txtCargo.setText(model.getValueAt(selectedRowIndex, 6).toString()); + boxNivelAcesso.setSelectedItem(model.getValueAt(selectedRowIndex, 7).toString()); + txtTelefone.setText(model.getValueAt(selectedRowIndex, 8).toString()); + txtCelular.setText(model.getValueAt(selectedRowIndex, 9).toString()); + txtCep.setText(model.getValueAt(selectedRowIndex, 10).toString()); + txtEndereco.setText(model.getValueAt(selectedRowIndex, 11).toString()); + txtNum.setText(model.getValueAt(selectedRowIndex, 12).toString()); + txtComplemento.setText(model.getValueAt(selectedRowIndex, 13).toString()); + txtBairro.setText(model.getValueAt(selectedRowIndex, 14).toString()); + txtCidade.setText(model.getValueAt(selectedRowIndex, 15).toString()); + boxUf.setSelectedItem(model.getValueAt(selectedRowIndex, 16).toString()); + + //mouse click go to tab + tabbedFrameF.setSelectedIndex(1); + + + }//GEN-LAST:event_tabelaFuncionarioMouseClicked + + private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed + // TODO add your handling code here: + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + }//GEN-LAST:event_btnNovoActionPerformed + + private void jTextField17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField17ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jTextField17ActionPerformed + + private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdActionPerformed + + private void txtNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtNomeActionPerformed + + private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased + // TODO add your handling code here: + + }//GEN-LAST:event_btnPesquisarKeyReleased + + private void txtPesquisaFuncionarioKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaFuncionarioKeyReleased + // TODO add your handling code here: + String nome = "%" + txtPesquisaFuncionario.getText() + "%"; + FuncionarioDao dao = new FuncionarioDao(); + List<Funcionario> lista = dao.pesquisarNomeFuncionarios(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaFuncionario.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Funcionario c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getRg(), + c.getCpf(), + c.getEmail(), + c.getSenha(), + c.getCargo(), + c.getNivel_acesso(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(),}); + } + + }//GEN-LAST:event_txtPesquisaFuncionarioKeyReleased + + private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed + // TODO add your handling code here: + String nome = txtNome.getText(); + Funcionario obj = new Funcionario(); + FuncionarioDao dao = new FuncionarioDao(); + obj = dao.buscarFuncionario(nome); + if (obj.getNome() != null) { + txtId.setText(String.valueOf(obj.getId())); + txtNome.setText(obj.getNome()); + txtRg.setText(obj.getRg()); + txtCpf.setText(obj.getCpf()); + txtEmail.setText(obj.getEmail()); + txtSenha.setText(obj.getSenha()); + txtCargo.setText(obj.getCargo()); + boxNivelAcesso.setSelectedItem(obj.getNivel_acesso()); + txtTelefone.setText(obj.getTelefone()); + txtCelular.setText(obj.getCelular()); + txtCep.setText(obj.getCep()); + txtEndereco.setText(obj.getEndereco()); + txtNum.setText(obj.getNumero()); + txtComplemento.setText(obj.getComplemento()); + txtBairro.setText(obj.getBairro()); + txtCidade.setText(obj.getCidade()); + boxUf.setSelectedItem(obj.getUf()); + + } else { + JOptionPane.showMessageDialog(null, "Funcionario não encontrado"); + } + + }//GEN-LAST:event_btnPesquisarActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + ViaCEP viacep = new ViaCEP(); + try { + viacep.buscar(txtCep.getText()); + txtBairro.setText(viacep.getBairro()); + txtCidade.setText(viacep.getLocalidade()); + txtEndereco.setText(viacep.getLogradouro()); + boxUf.setSelectedItem(viacep.getUf()); + + } catch (ViaCEPException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + { + } + }//GEN-LAST:event_jButton1ActionPerformed + + /** + * @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(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormFuncionarios.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormFuncionarios().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox<String> boxNivelAcesso; + private javax.swing.JComboBox<String> boxUf; + private javax.swing.JButton btnExcluir; + private javax.swing.JButton btnFechar; + private javax.swing.JButton btnNovo; + private javax.swing.JButton btnPesquisar; + private javax.swing.JButton btnSalvar; + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel21; + private javax.swing.JLabel 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.JScrollPane jScrollPane1; + private javax.swing.JTextField jTextField17; + private javax.swing.JPanel tabCadastro; + private javax.swing.JPanel tabConsultaUsuarios; + private javax.swing.JTabbedPane tabbedFrameF; + private javax.swing.JTable tabelaFuncionario; + private javax.swing.JTextField txtBairro; + private javax.swing.JTextField txtCargo; + private javax.swing.JFormattedTextField txtCelular; + private javax.swing.JFormattedTextField txtCep; + private javax.swing.JTextField txtCidade; + private javax.swing.JTextField txtComplemento; + private javax.swing.JFormattedTextField txtCpf; + private javax.swing.JTextField txtEmail; + private javax.swing.JTextField txtEndereco; + private javax.swing.JTextField txtId; + private javax.swing.JTextField txtNome; + private javax.swing.JTextField txtNum; + private javax.swing.JTextField txtPesquisaFuncionario; + private javax.swing.JFormattedTextField txtRg; + private javax.swing.JPasswordField txtSenha; + private javax.swing.JFormattedTextField txtTelefone; + // End of variables declaration//GEN-END:variables +} diff --git a/src/br/com/projeto/view/FormLeitor.form b/src/br/com/projeto/view/FormLeitor.form new file mode 100644 index 0000000..6ed8ec9 --- /dev/null +++ b/src/br/com/projeto/view/FormLeitor.form @@ -0,0 +1,1022 @@ +<?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="Controle de Usuários"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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" max="32767" attributes="0"/> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnNovo1" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="tabbedFrame" min="-2" pref="826" max="-2" attributes="0"/> + <EmptySpace min="0" pref="24" 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="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="tabbedFrame" min="-2" pref="417" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnNovo1" pref="43" max="32767" attributes="0"/> + <EmptySpace min="-2" pref="10" 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="33" green="33" red="33" 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"/> + <Component id="jLabel1" 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="0" attributes="0"> + <Component id="jLabel1" min="-2" pref="48" max="-2" attributes="0"/> + <EmptySpace min="0" pref="6" max="32767" 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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Cadastro de Usuário"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JTabbedPane" name="tabbedFrame"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="tabConsultaUsuarios"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Consulta de Usuários"> + <Property name="tabTitle" type="java.lang.String" value="Consulta de Usuários"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnXlsExport" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnXlsImport" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jScrollPane1" min="-2" pref="791" max="-2" attributes="0"/> + <EmptySpace pref="8" max="32767" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel14" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtPesquisaUsuario" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="220" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPesquisaUsuario" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="274" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnXlsExport" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnXlsImport" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="19" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPesquisaUsuario"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaUsuarioActionPerformed"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaUsuarioKeyReleased"/> + </Events> + </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"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/> + </Events> + </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.JTable" name="tabelaUsuario"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="19" rowCount="0"> + <Column editable="false" title="cod" type="java.lang.Object"/> + <Column editable="false" title="nome" type="java.lang.Object"/> + <Column editable="false" title="rg" type="java.lang.Object"/> + <Column editable="false" title="cpf" type="java.lang.Object"/> + <Column editable="false" title="email" type="java.lang.Object"/> + <Column editable="false" title="telefone" type="java.lang.Object"/> + <Column editable="false" title="celular" type="java.lang.Object"/> + <Column editable="false" title="cep" type="java.lang.Object"/> + <Column editable="false" title="endereco" type="java.lang.Object"/> + <Column editable="false" title="numero" type="java.lang.Object"/> + <Column editable="false" title="complemento" type="java.lang.Object"/> + <Column editable="false" title="bairro" type="java.lang.Object"/> + <Column editable="false" title="cidade" type="java.lang.Object"/> + <Column editable="false" title="estado" type="java.lang.Object"/> + <Column editable="false" title="curso" type="java.lang.Object"/> + <Column editable="false" title="ano" type="java.lang.Object"/> + <Column editable="false" title="Máximo de Emprestimos" type="java.lang.Object"/> + <Column editable="false" title="Observações" type="java.lang.Object"/> + <Column editable="false" title="Tipo" type="java.lang.Object"/> + </Table> + </Property> + <Property name="autoResizeMode" type="int" value="0"/> + <Property name="autoscrolls" type="boolean" value="false"/> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor" postCode="tabelaUsuario.getColumn(tabelaUsuario.getColumnName(0)).setPreferredWidth(30); tabelaUsuario.getColumn(tabelaUsuario.getColumnName(1)).setPreferredWidth(200);"> + <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> + <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> + <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> + <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="false" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaUsuarioMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnXlsExport"> + <Properties> + <Property name="text" type="java.lang.String" value="Exportar para XLSX"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnXlsExportActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnXlsImport"> + <Properties> + <Property name="text" type="java.lang.String" value="Importar dados de arquivo XLSX"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnXlsImportActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="tabCadastro"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Cadastro de Usuário"> + <Property name="tabTitle" type="java.lang.String" value="Cadastro de Usuário"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jLabel22" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtMaxEmprestimos" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNome" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtEmail" min="-2" pref="279" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="6" pref="6" max="-2" attributes="0"/> + <Component id="jLabel20" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="boxTipo" min="-2" pref="215" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnFoto" min="-2" max="-2" attributes="0"/> + <Component id="lblImagem" min="-2" pref="115" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel12" alignment="0" min="-2" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="6" max="-2" attributes="0"/> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtTelefone" min="-2" pref="142" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCpf" max="32767" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="1" attributes="0"> + <Component id="txtRg" alignment="1" min="-2" pref="159" max="-2" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="56" max="-2" attributes="0"/> + <Component id="txtCelular" min="-2" pref="145" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Component id="btnImprimir" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnNovo" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnSalvar" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnExcluir" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="49" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <Component id="jLabel16" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="txtCidade" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="boxUf" min="-2" max="-2" attributes="0"/> + </Group> + <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="txtEndereco" min="-2" pref="266" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNum" min="-2" pref="45" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="txtBairro" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel13" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtComplemento" min="-2" pref="106" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="11" 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"> + <Component id="jLabel19" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="37" max="-2" attributes="0"/> + <Component id="txtCep" min="-2" pref="111" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton1" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="196" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="375" 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"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane2" alignment="0" min="-2" pref="407" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel15" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtCurso" min="-2" pref="212" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel17" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtSerie" min="-2" pref="31" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="14" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel22" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCep" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtMaxEmprestimos" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEndereco" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNum" 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="jLabel8" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtBairro" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtComplemento" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="171" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxUf" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="txtCidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" pref="103" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCurso" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSerie" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" pref="30" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" max="-2" attributes="0"> + <Component id="btnNovo" alignment="3" max="32767" attributes="0"/> + <Component id="btnSalvar" alignment="3" max="32767" attributes="0"/> + <Component id="btnExcluir" alignment="3" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNome" 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="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmail" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="lblImagem" min="-2" pref="158" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnFoto" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtTelefone" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" 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="txtCelular" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel12" 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="txtRg" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel11" 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="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCpf" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnImprimir" min="-2" pref="32" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="boxTipo" alignment="3" max="-2" attributes="0"/> + <Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="ID:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="* Nome:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Email:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="* Logradouro"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*UF:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="N:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Bairro:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Telefone:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="CPF:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="* RG:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel12"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="* Celular:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Complemento:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Cidade:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNome"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtNomeActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtEmail"> + </Component> + <Component class="javax.swing.JTextField" name="txtEndereco"> + </Component> + <Component class="javax.swing.JTextField" name="txtComplemento"> + </Component> + <Component class="javax.swing.JTextField" name="txtBairro"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtBairroActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtCidade"> + </Component> + <Component class="javax.swing.JTextField" name="txtId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel15"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Curso:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtCurso"> + </Component> + <Component class="javax.swing.JTextField" name="txtSerie"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel17"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Série:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel18"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="* CEP:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxUf"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="27"> + <StringItem index="0" value="AC"/> + <StringItem index="1" value="AL"/> + <StringItem index="2" value="AP"/> + <StringItem index="3" value="AM"/> + <StringItem index="4" value="BA"/> + <StringItem index="5" value="CE"/> + <StringItem index="6" value="DF"/> + <StringItem index="7" value="ES"/> + <StringItem index="8" value="GO"/> + <StringItem index="9" value="MA"/> + <StringItem index="10" value="MT"/> + <StringItem index="11" value="MS"/> + <StringItem index="12" value="MG"/> + <StringItem index="13" value="PA"/> + <StringItem index="14" value="PB"/> + <StringItem index="15" value="PR"/> + <StringItem index="16" value="PE"/> + <StringItem index="17" value="PI"/> + <StringItem index="18" value="RJ"/> + <StringItem index="19" value="RN"/> + <StringItem index="20" value="RS"/> + <StringItem index="21" value="RO"/> + <StringItem index="22" value="RR"/> + <StringItem index="23" value="SC"/> + <StringItem index="24" value="SP"/> + <StringItem index="25" value="SE"/> + <StringItem index="26" value="TO"/> + </StringArray> + </Property> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtCep"> + <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> + <AuxValues> + <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JFormattedTextField()"/> + </AuxValues> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtCelular"> + <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.JFormattedTextField" name="txtTelefone"> + <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.JFormattedTextField" name="txtCpf"> + <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.JFormattedTextField" name="txtRg"> + <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> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtRgActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="lblImagem"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_student_309036 (1).png"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + </Properties> + </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="txtObservacoes"> + <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="jLabel21"> + <Properties> + <Property name="text" type="java.lang.String" value="Observações:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel22"> + <Properties> + <Property name="text" type="java.lang.String" value="* No de Empréstimos Máximo:"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnFoto"> + <Properties> + <Property name="text" type="java.lang.String" value=" Escolher Foto"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnFotoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnImprimir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/print_small.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Imprimir/Ver Cartão"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImprimirActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JComboBox" name="boxTipo"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="selectedItem" type="java.lang.Object" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> + <Connection component="boxTipo" type="bean"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.MatteColorBorderInfo"> + <MatteColorBorder/> + </Border> + </Property> + <Property name="debugGraphicsOptions" type="int" value="-1"/> + <Property name="doubleBuffered" type="boolean" value="true"/> + <Property name="lightWeightPopupEnabled" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxTipoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel20"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de Usuário:"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnNovo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/new_file_small.png"/> + </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="btnNovoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnSalvar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/save_small.png"/> + </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="btnSalvarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnExcluir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/delete_small.png"/> + </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="btnExcluirActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton1"> + <Properties> + <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="jButton1ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtMaxEmprestimos"> + <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.JTextField" name="txtNum"> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnNovo1"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/> + </Property> + <Property name="text" type="java.lang.String" value="FECHAR"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnNovo1ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormLeitor.java b/src/br/com/projeto/view/FormLeitor.java new file mode 100644 index 0000000..5f074e1 --- /dev/null +++ b/src/br/com/projeto/view/FormLeitor.java @@ -0,0 +1,1198 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +//mude para vizualizacao por projeto para adicionar action +package br.com.projeto.view; + +import br.com.parg.viacep.ViaCEP; +import br.com.parg.viacep.ViaCEPException; +import br.com.projeto.dao.OptionsDao; +import br.com.projeto.dao.UsuarioDao; +import br.com.projeto.model.Options; +import br.com.projeto.model.Usuario; +import br.com.projeto.model.Utilitarios; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.SQLException; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.filechooser.FileNameExtensionFilter; +import javax.swing.table.DefaultTableModel; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormLeitor extends javax.swing.JFrame { + + //metodo listar usuarios pt3 + public void listar() { + UsuarioDao dao = new UsuarioDao(); + List<Usuario> lista = dao.listarUsuarios(); + DefaultTableModel dados = (DefaultTableModel) tabelaUsuario.getModel(); + dados.setNumRows(0); + lista.forEach((c) -> { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getRg(), + c.getCpf(), + c.getEmail(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(), + c.getCurso(), + c.getSerie(), + c.getEmprestmax(), + c.getObservacoes(), + c.getTipo(),}); + }); + + } + + /** + * Creates new form formLeitor + */ + public FormLeitor() { + 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(); + tabbedFrame = new javax.swing.JTabbedPane(); + tabConsultaUsuarios = new javax.swing.JPanel(); + jLabel14 = new javax.swing.JLabel(); + txtPesquisaUsuario = new javax.swing.JTextField(); + btnPesquisar = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + tabelaUsuario = new javax.swing.JTable(); + btnXlsExport = new javax.swing.JButton(); + btnXlsImport = new javax.swing.JButton(); + tabCadastro = new javax.swing.JPanel(); + 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(); + jLabel8 = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + jLabel10 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + jLabel16 = new javax.swing.JLabel(); + txtNome = new javax.swing.JTextField(); + txtEmail = new javax.swing.JTextField(); + txtEndereco = new javax.swing.JTextField(); + txtComplemento = new javax.swing.JTextField(); + txtBairro = new javax.swing.JTextField(); + txtCidade = new javax.swing.JTextField(); + txtId = new javax.swing.JTextField(); + jLabel15 = new javax.swing.JLabel(); + txtCurso = new javax.swing.JTextField(); + txtSerie = new javax.swing.JTextField(); + jLabel17 = new javax.swing.JLabel(); + jLabel18 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + boxUf = new javax.swing.JComboBox<>(); + txtCep = new javax.swing.JFormattedTextField(); + txtCelular = new javax.swing.JFormattedTextField(); + txtTelefone = new javax.swing.JFormattedTextField(); + txtCpf = new javax.swing.JFormattedTextField(); + txtRg = new javax.swing.JFormattedTextField(); + lblImagem = new javax.swing.JLabel(); + jScrollPane2 = new javax.swing.JScrollPane(); + txtObservacoes = new javax.swing.JTextArea(); + jLabel21 = new javax.swing.JLabel(); + jLabel22 = new javax.swing.JLabel(); + btnFoto = new javax.swing.JButton(); + btnImprimir = new javax.swing.JButton(); + boxTipo = new javax.swing.JComboBox<>(); + jLabel20 = new javax.swing.JLabel(); + btnNovo = new javax.swing.JButton(); + btnSalvar = new javax.swing.JButton(); + btnExcluir = new javax.swing.JButton(); + jButton1 = new javax.swing.JButton(); + txtMaxEmprestimos = new javax.swing.JFormattedTextField(); + txtNum = new javax.swing.JTextField(); + btnNovo1 = new javax.swing.JButton(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setTitle("Controle de Usuários"); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Cadastro de Usuário"); + + 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(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 6, Short.MAX_VALUE)) + ); + + jLabel14.setText("Nome:"); + + txtPesquisaUsuario.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPesquisaUsuarioActionPerformed(evt); + } + }); + txtPesquisaUsuario.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtPesquisaUsuarioKeyReleased(evt); + } + }); + + btnPesquisar.setText("Pesquisar"); + btnPesquisar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarActionPerformed(evt); + } + }); + btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + btnPesquisarKeyReleased(evt); + } + }); + + tabelaUsuario.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "cod", "nome", "rg", "cpf", "email", "telefone", "celular", "cep", "endereco", "numero", "complemento", "bairro", "cidade", "estado", "curso", "ano", "Máximo de Emprestimos", "Observações", "Tipo" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaUsuario.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + tabelaUsuario.setAutoscrolls(false); + tabelaUsuario.getTableHeader().setReorderingAllowed(false); + tabelaUsuario.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaUsuarioMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tabelaUsuario); + if (tabelaUsuario.getColumnModel().getColumnCount() > 0) { + tabelaUsuario.getColumnModel().getColumn(15).setResizable(false); + } + tabelaUsuario.getColumn(tabelaUsuario.getColumnName(0)).setPreferredWidth(30); + tabelaUsuario.getColumn(tabelaUsuario.getColumnName(1)).setPreferredWidth(200); + + btnXlsExport.setText("Exportar para XLSX"); + btnXlsExport.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnXlsExportActionPerformed(evt); + } + }); + + btnXlsImport.setText("Importar dados de arquivo XLSX"); + btnXlsImport.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnXlsImportActionPerformed(evt); + } + }); + + javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios); + tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout); + tabConsultaUsuariosLayout.setHorizontalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnXlsExport) + .addGap(18, 18, 18) + .addComponent(btnXlsImport) + .addContainerGap()) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 791, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(8, Short.MAX_VALUE)) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtPesquisaUsuario) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnPesquisar) + .addGap(220, 220, 220)))) + ); + tabConsultaUsuariosLayout.setVerticalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(txtPesquisaUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 274, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnXlsExport) + .addComponent(btnXlsImport)) + .addContainerGap(19, Short.MAX_VALUE)) + ); + + tabbedFrame.addTab("Consulta de Usuários", tabConsultaUsuarios); + + jLabel2.setText("ID:"); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel3.setText("* Nome:"); + + jLabel4.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel4.setText("Email:"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel5.setText("* Logradouro"); + + jLabel6.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel6.setText("*UF:"); + + jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel7.setText("N:"); + + jLabel8.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel8.setText("Bairro:"); + + jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel9.setText("Telefone:"); + + jLabel10.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel10.setText("CPF:"); + + jLabel11.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel11.setText("* RG:"); + + jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel12.setText("* Celular:"); + + jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel13.setText("Complemento:"); + + jLabel16.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel16.setText("Cidade:"); + + txtNome.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtNomeActionPerformed(evt); + } + }); + + txtBairro.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtBairroActionPerformed(evt); + } + }); + + txtId.setEditable(false); + txtId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdActionPerformed(evt); + } + }); + + jLabel15.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel15.setText("Curso:"); + + jLabel17.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel17.setText("Série:"); + + jLabel19.setText("* CEP:"); + + boxUf.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "AC", "AL", "AP", "AM", "BA", "CE", "DF", "ES", "GO", "MA", "MT", "MS", "MG", "PA", "PB", "PR", "PE", "PI", "RJ", "RN", "RS", "RO", "RR", "SC", "SP", "SE", "TO" })); + + try { + txtCep.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#####-###"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtCelular.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)#####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtTelefone.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("(##)####-####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtCpf.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###-##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + try { + txtRg.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#.###.###-#"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + txtRg.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtRgActionPerformed(evt); + } + }); + + lblImagem.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_student_309036 (1).png"))); // NOI18N + lblImagem.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + + txtObservacoes.setColumns(20); + txtObservacoes.setRows(5); + jScrollPane2.setViewportView(txtObservacoes); + + jLabel21.setText("Observações:"); + + jLabel22.setText("* No de Empréstimos Máximo:"); + + btnFoto.setText(" Escolher Foto"); + btnFoto.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnFotoActionPerformed(evt); + } + }); + + btnImprimir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnImprimir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/print_small.png"))); // NOI18N + btnImprimir.setText("Imprimir/Ver Cartão"); + btnImprimir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnImprimirActionPerformed(evt); + } + }); + + boxTipo.setSelectedItem(boxTipo); + boxTipo.setBorder(new javax.swing.border.MatteBorder(null)); + boxTipo.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION); + boxTipo.setDoubleBuffered(true); + boxTipo.setLightWeightPopupEnabled(false); + boxTipo.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxTipoMouseClicked(evt); + } + }); + + jLabel20.setText("Tipo de Usuário:"); + + btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N + btnNovo.setText("NOVO"); + btnNovo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoActionPerformed(evt); + } + }); + + btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N + btnSalvar.setText("SALVAR"); + btnSalvar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarActionPerformed(evt); + } + }); + + btnExcluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete_small.png"))); // NOI18N + btnExcluir.setText("EXCLUIR"); + btnExcluir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirActionPerformed(evt); + } + }); + + jButton1.setText("Buscar "); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + try { + txtMaxEmprestimos.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro); + tabCadastro.setLayout(tabCadastroLayout); + tabCadastroLayout.setHorizontalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(22, 22, 22) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel2) + .addGap(12, 12, 12) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(jLabel22) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtMaxEmprestimos)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel3) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNome)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jLabel18)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jLabel20) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(boxTipo, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnFoto) + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(11, 11, 11) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel12) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addComponent(jLabel11)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel9) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel10) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCpf)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(txtRg, javax.swing.GroupLayout.PREFERRED_SIZE, 159, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createSequentialGroup() + .addGap(56, 56, 56) + .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addComponent(btnImprimir)))) + .addGap(2, 2, 2) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(btnNovo) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnSalvar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnExcluir) + .addGap(49, 49, 49)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel8) + .addComponent(jLabel16)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtCidade) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtBairro) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel13) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(8, 8, 8))) + .addGap(11, 11, 11)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel19) + .addGap(37, 37, 37) + .addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1)) + .addComponent(jLabel5)) + .addContainerGap(196, Short.MAX_VALUE))))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(375, 375, 375) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(6, 6, 6) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel21) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 407, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel15) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtCurso, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel17) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtSerie, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(0, 14, Short.MAX_VALUE)))) + ); + tabCadastroLayout.setVerticalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel22) + .addComponent(txtCep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel19) + .addComponent(jButton1) + .addComponent(txtMaxEmprestimos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(txtEndereco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5) + .addComponent(txtNum, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel8) + .addComponent(txtBairro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtComplemento, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel13)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jLabel18) + .addGap(171, 171, 171)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(boxUf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtCidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel16))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jLabel21) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel15) + .addComponent(txtCurso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel17) + .addComponent(txtSerie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 30, Short.MAX_VALUE) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE, false) + .addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnSalvar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnExcluir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(txtNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 158, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnFoto)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtTelefone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel9)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtCelular, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel12)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtRg, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel11)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel10) + .addComponent(txtCpf, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addComponent(btnImprimir, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxTipo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel20)) + .addGap(0, 0, Short.MAX_VALUE)))) + ); + + tabbedFrame.addTab("Cadastro de Usuário", tabCadastro); + + btnNovo1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNovo1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N + btnNovo1.setText("FECHAR"); + btnNovo1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovo1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnNovo1) + .addGap(14, 14, 14)) + .addGroup(layout.createSequentialGroup() + .addComponent(tabbedFrame, javax.swing.GroupLayout.PREFERRED_SIZE, 826, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 24, Short.MAX_VALUE)) + ); + layout.setVerticalGroup( + 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(tabbedFrame, javax.swing.GroupLayout.PREFERRED_SIZE, 417, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnNovo1, javax.swing.GroupLayout.PREFERRED_SIZE, 43, Short.MAX_VALUE) + .addGap(10, 10, 10)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed + // salvar usuario + Usuario obj = new Usuario(); + obj.setNome(txtNome.getText()); + obj.setRg(txtRg.getText()); + obj.setCpf(txtCpf.getText()); + obj.setEmail(txtEmail.getText()); + obj.setTelefone(txtTelefone.getText()); + obj.setCelular(txtCelular.getText()); + obj.setCep(txtCep.getText()); + obj.setEndereco(txtEndereco.getText()); + obj.setNumero(txtNum.getText()); + obj.setComplemento(txtComplemento.getText()); + obj.setBairro(txtBairro.getText()); + obj.setCidade(txtCidade.getText()); + try { + obj.setUf(boxUf.getSelectedItem().toString()); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!"); + return; + } + obj.setUf(boxUf.getSelectedItem().toString()); + obj.setCurso(txtCurso.getText()); + obj.setSerie(txtSerie.getText()); + obj.setQtd_emprestimos(0); //inicializa emprestimos com zero + try { + obj.setEmprestmax(Integer.parseInt(txtMaxEmprestimos.getText().trim())); + } catch (Exception e) { + txtMaxEmprestimos.setText(""); + } + + obj.setObservacoes(txtObservacoes.getText()); + obj.setTipo((String) boxTipo.getSelectedItem()); + obj.setIs_locked(false); //inicializa is locked como falso (somente em novo usuario) + + if (txtNome.getText().isEmpty() || txtCelular.getText().isEmpty() || txtRg.getText().isEmpty() || txtCep.getText().isEmpty() || txtEndereco.getText().isEmpty() || txtMaxEmprestimos.getText().isEmpty() || boxUf.getSelectedIndex() == -1 || boxTipo.getSelectedIndex() == -1) { + JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!"); + } else { + UsuarioDao dao = new UsuarioDao(); + Utilitarios util = new Utilitarios(); + boolean valido = util.valida(txtCpf.getText()); + if (!txtCpf.getText().equals(" . . - ") && !valido == true && !txtCpf.getText().equals("000.000.000-00")) { + JOptionPane.showMessageDialog(null, "CPF Inválido! Tente Novamente!"); + return; + } + if (!(txtId.getText()).equals("")) { + obj.setId(Integer.valueOf(txtId.getText())); + dao.alterarUsuario(obj); + } else { + dao.cadastrarUsuario(obj); + } + } + }//GEN-LAST:event_btnSalvarActionPerformed + + private void btnImprimirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImprimirActionPerformed + String msg = txtId.getText(); + String msgNome = txtNome.getText().toUpperCase(); + String msgCurso = txtCurso.getText().toUpperCase(); + String msgAcesso = (String.valueOf(boxTipo.getSelectedItem()).toUpperCase()); + FormCartao detalhesUser = null; + try { + detalhesUser = new FormCartao(msg, msgNome, msgCurso, msgAcesso); + } catch (SQLException ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + detalhesUser.pack(); + detalhesUser.setLocationRelativeTo(null); + detalhesUser.setVisible(true); + }//GEN-LAST:event_btnImprimirActionPerformed + + private void txtPesquisaUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaUsuarioActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPesquisaUsuarioActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + // listar suario pt4 + listar(); + boxUf.setSelectedIndex(-1); + }//GEN-LAST:event_formWindowActivated + + private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed + Usuario obj = new Usuario(); + UsuarioDao dao = new UsuarioDao(); + try { + obj.setId(Integer.valueOf(txtId.getText())); + dao.excluirUsuario(obj); + } catch (NumberFormatException e) { + JOptionPane.showMessageDialog(null, "Selecione um usuário!"); + } + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + }//GEN-LAST:event_btnExcluirActionPerformed + + private void tabelaUsuarioMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaUsuarioMouseClicked + // tabela quando clicado + DefaultTableModel model = (DefaultTableModel) tabelaUsuario.getModel(); + int selectedRowIndex = tabelaUsuario.getSelectedRow(); + tabbedFrame.setSelectedIndex(1); + txtId.setText(model.getValueAt(selectedRowIndex, 0).toString()); + txtNome.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtRg.setText(model.getValueAt(selectedRowIndex, 2).toString()); + txtCpf.setText(model.getValueAt(selectedRowIndex, 3).toString()); + txtEmail.setText(model.getValueAt(selectedRowIndex, 4).toString()); + txtTelefone.setText(model.getValueAt(selectedRowIndex, 5).toString()); + txtCelular.setText(model.getValueAt(selectedRowIndex, 6).toString()); + txtCep.setText(model.getValueAt(selectedRowIndex, 7).toString()); + txtEndereco.setText(model.getValueAt(selectedRowIndex, 8).toString()); + txtNum.setText(model.getValueAt(selectedRowIndex, 9).toString()); + txtComplemento.setText(model.getValueAt(selectedRowIndex, 10).toString()); + txtBairro.setText(model.getValueAt(selectedRowIndex, 11).toString()); + txtCidade.setText(model.getValueAt(selectedRowIndex, 12).toString()); + boxUf.setSelectedItem(model.getValueAt(selectedRowIndex, 13).toString()); + txtCurso.setText(model.getValueAt(selectedRowIndex, 14).toString()); + txtSerie.setText(model.getValueAt(selectedRowIndex, 15).toString()); + txtMaxEmprestimos.setText(model.getValueAt(selectedRowIndex, 16).toString()); + txtObservacoes.setText(model.getValueAt(selectedRowIndex, 17).toString()); + + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarTipos_de_usuarios(); + boxTipo.removeAllItems(); + for (Options f : ListaOptions) { + boxTipo.addItem(f.getTipos_de_usuarios()); + } + boxTipo.setSelectedItem(model.getValueAt(selectedRowIndex, 18)); + + //boxTipo.addItem((String) model.getValueAt(selectedRowIndex, 18)); + String path = "C:\\Librography\\images\\usuarios\\" + txtId.getText(); + lblImagem.setIcon(ResizeBookImage(path)); + }//GEN-LAST:event_tabelaUsuarioMouseClicked + + private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + txtObservacoes.setText(null); + lblImagem.setIcon(null); + boxUf.setSelectedIndex(-1); + }//GEN-LAST:event_btnNovoActionPerformed + + private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdActionPerformed + + private void txtNomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNomeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtNomeActionPerformed + + private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased + // TODO add your handling code here: + + }//GEN-LAST:event_btnPesquisarKeyReleased + + private void txtPesquisaUsuarioKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaUsuarioKeyReleased + String nome = "%" + txtPesquisaUsuario.getText() + "%"; + UsuarioDao dao = new UsuarioDao(); + List<Usuario> lista = dao.pesquisarNome(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaUsuario.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Usuario c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getNome(), + c.getRg(), + c.getCpf(), + c.getEmail(), + c.getTelefone(), + c.getCelular(), + c.getCep(), + c.getEndereco(), + c.getNumero(), + c.getComplemento(), + c.getBairro(), + c.getCidade(), + c.getUf(), + c.getCurso(), + c.getSerie(), + c.getEmprestmax(), + c.getObservacoes(), + c.getTipo(),}); + } + + }//GEN-LAST:event_txtPesquisaUsuarioKeyReleased + + private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed + String nome = txtNome.getText(); + Usuario obj = new Usuario(); + UsuarioDao dao = new UsuarioDao(); + obj = dao.buscarUsuario(nome); + if (obj.getNome() != null) { + txtId.setText(String.valueOf(obj.getId())); + txtNome.setText(obj.getNome()); + txtRg.setText(obj.getRg()); + txtCpf.setText(obj.getCpf()); + txtEmail.setText(obj.getEmail()); + txtTelefone.setText(obj.getTelefone()); + txtCelular.setText(obj.getCelular()); + txtCep.setText(obj.getCep()); + txtEndereco.setText(obj.getEndereco()); + txtNum.setText(obj.getNumero()); + txtComplemento.setText(obj.getComplemento()); + txtBairro.setText(obj.getBairro()); + txtCidade.setText(obj.getCidade()); + boxUf.setSelectedItem(obj.getUf()); + txtCurso.setText(obj.getCurso()); + txtSerie.setText(obj.getSerie()); + txtMaxEmprestimos.setText(String.valueOf(obj.getEmprestmax())); + txtObservacoes.setText(obj.getObservacoes()); + boxTipo.setSelectedItem(obj.getTipo()); + } else { + JOptionPane.showMessageDialog(null, "Usuario não encontrado"); + } + }//GEN-LAST:event_btnPesquisarActionPerformed + + private void txtRgActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtRgActionPerformed + }//GEN-LAST:event_txtRgActionPerformed + + private void btnFotoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnFotoActionPerformed + JFileChooser jfile = new JFileChooser(); + int result = jfile.showSaveDialog(this); + File selectedFile = jfile.getSelectedFile(); + String filename = selectedFile.getName(); + if (filename.endsWith(".jpg") || filename.endsWith(".JPG") || filename.endsWith(".png") || filename.endsWith(".PNG") || filename.endsWith(".jpeg")) { + FileNameExtensionFilter filter = new FileNameExtensionFilter("*.image", "jpg", "png"); + jfile.addChoosableFileFilter(filter); + if (result == JFileChooser.APPROVE_OPTION) { + File selectedImage = jfile.getSelectedFile(); + String path = selectedImage.getAbsolutePath(); + BufferedImage image; + try { + image = ImageIO.read(selectedImage); + ImageIO.write(image, "jpg", new File("C:\\Librography\\images\\usuarios\\" + txtId.getText())); + } catch (IOException ex) { + Logger.getLogger(Image.class.getName()).log(Level.SEVERE, null, ex); + } + try { + lblImagem.setIcon(ResizeBookImage(path)); + // imagePathStr = path; + + } catch (Exception e) { + JOptionPane.showMessageDialog(this, "Image Error" + e.getMessage()); + } + } + } else { + JOptionPane.showMessageDialog(rootPane, "Por Favor Seleciona um arquivo do tipo Imagem", "Tente Novamente!", 1); + } + }//GEN-LAST:event_btnFotoActionPerformed + + private void boxTipoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxTipoMouseClicked + String boxTipoString = (String) boxTipo.getSelectedItem(); + boxTipo.removeAllItems(); + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarTipos_de_usuarios(); + for (Options f : ListaOptions) { + boxTipo.insertItemAt(f.getTipos_de_usuarios(), boxTipo.getItemCount()); + } + boxTipo.setSelectedItem(boxTipoString); + }//GEN-LAST:event_boxTipoMouseClicked + + private void btnNovo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovo1ActionPerformed + this.dispose(); + }//GEN-LAST:event_btnNovo1ActionPerformed + + private void txtBairroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtBairroActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtBairroActionPerformed + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + ViaCEP viacep = new ViaCEP(); + try { + viacep.buscar(txtCep.getText()); + txtBairro.setText(viacep.getBairro()); + txtCidade.setText(viacep.getLocalidade()); + txtEndereco.setText(viacep.getLogradouro()); + boxUf.setSelectedItem(viacep.getUf()); + + } catch (ViaCEPException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + { + } + }//GEN-LAST:event_jButton1ActionPerformed + + private void btnXlsExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXlsExportActionPerformed + Utilitarios util = new Utilitarios(); + JFileChooser fc = new JFileChooser(); + fc.setSelectedFile(new File("Usuarios")); + int option = fc.showSaveDialog(FormLeitor.this); + if (option == JFileChooser.APPROVE_OPTION) { + try { + String filename = fc.getSelectedFile().getName(); + String path = fc.getSelectedFile().getParentFile().getPath(); + int len = filename.length(); + String ext = ""; + String file = ""; + if (len > 4) { + ext = filename.substring(len - 4, len); + } + if (ext.equals(".xlsx")) { + switch (util.getOS()) { + case WINDOWS: + file = path + "\\" + filename; + break; + case MAC: + file = path + "/" + filename;//estava \\ no windows /(ver) + break; + } + } else { + switch (util.getOS()) { + case WINDOWS: + file = path + "\\" + filename + ".xlsx"; + break; + case MAC: + file = path + "/" + filename + ".xlsx";//estava \\ no windows /(ver) + break; + } + file = path + "/" + filename + ".xlsx";//aqui tambem + } + util.toExcel(tabelaUsuario, new File(file)); + JOptionPane.showMessageDialog(null, "Arquivo Salvo com sucesso em " + file + "!"); + } catch (IOException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_btnXlsExportActionPerformed + private void btnXlsImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXlsImportActionPerformed + UsuarioDao userDao = new UsuarioDao(); + JFileChooser fileChooser = new JFileChooser(); + int returnValue = fileChooser.showOpenDialog(null); + File selectedFile = fileChooser.getSelectedFile(); + String filename = selectedFile.getName(); + if (filename.endsWith(".xlsx") || filename.endsWith(".XLSX")) { + FileNameExtensionFilter filter = new FileNameExtensionFilter("*.table", "xlsx"); + fileChooser.addChoosableFileFilter(filter); + if (returnValue == JFileChooser.APPROVE_OPTION) { + String path = selectedFile.getAbsolutePath(); + try { + try { + userDao.importaUsuariosXls(path); + } catch (FileNotFoundException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } catch (InvalidFormatException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + System.out.println("path= " + path); + } catch (IOException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } catch (SQLException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + } + } else { + JOptionPane.showMessageDialog(null, "Selecione o Arquivo de nome: 'Usuarios.xlsx'"); + } + }//GEN-LAST:event_btnXlsImportActionPerformed + + /** + * @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(FormLeitor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormLeitor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormLeitor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormLeitor.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormLeitor().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox<String> boxTipo; + private javax.swing.JComboBox<String> boxUf; + private javax.swing.JButton btnExcluir; + private javax.swing.JButton btnFoto; + private javax.swing.JButton btnImprimir; + private javax.swing.JButton btnNovo; + private javax.swing.JButton btnNovo1; + private javax.swing.JButton btnPesquisar; + private javax.swing.JButton btnSalvar; + private javax.swing.JButton btnXlsExport; + private javax.swing.JButton btnXlsImport; + private javax.swing.JButton jButton1; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; + private javax.swing.JLabel jLabel16; + private javax.swing.JLabel jLabel17; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel21; + private javax.swing.JLabel jLabel22; + private javax.swing.JLabel 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.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JLabel lblImagem; + private javax.swing.JPanel tabCadastro; + private javax.swing.JPanel tabConsultaUsuarios; + private javax.swing.JTabbedPane tabbedFrame; + private javax.swing.JTable tabelaUsuario; + private javax.swing.JTextField txtBairro; + private javax.swing.JFormattedTextField txtCelular; + private javax.swing.JFormattedTextField txtCep; + private javax.swing.JTextField txtCidade; + private javax.swing.JTextField txtComplemento; + private javax.swing.JFormattedTextField txtCpf; + private javax.swing.JTextField txtCurso; + private javax.swing.JTextField txtEmail; + private javax.swing.JTextField txtEndereco; + private javax.swing.JTextField txtId; + private javax.swing.JFormattedTextField txtMaxEmprestimos; + private javax.swing.JTextField txtNome; + private javax.swing.JTextField txtNum; + private javax.swing.JTextArea txtObservacoes; + private javax.swing.JTextField txtPesquisaUsuario; + private javax.swing.JFormattedTextField txtRg; + private javax.swing.JTextField txtSerie; + private javax.swing.JFormattedTextField txtTelefone; + // End of variables declaration//GEN-END:variables + + private ImageIcon ResizeBookImage(String imgPath) { //192x261 + int imageX = 115; + int imageY = 158; + lblImagem.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblImagem.getWidth(), lblImagem.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + +} diff --git a/src/br/com/projeto/view/FormLivros.form b/src/br/com/projeto/view/FormLivros.form new file mode 100644 index 0000000..daab638 --- /dev/null +++ b/src/br/com/projeto/view/FormLivros.form @@ -0,0 +1,971 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <NonVisualComponents> + <Container class="javax.swing.JMenu" name="jMenu1"> + <Properties> + <Property name="text" type="java.lang.String" value="jMenu1"/> + </Properties> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="true"/> + </Layout> + </Container> + </NonVisualComponents> + <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> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Component id="tabbedFrameF" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="jButton1" 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"> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="tabbedFrameF" min="-2" pref="444" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton1" max="32767" attributes="0"/> + <EmptySpace 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="33" green="33" red="33" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" alignment="1" pref="72" max="32767" attributes="0"/> + </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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Cadastro de Livros"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JTabbedPane" name="tabbedFrameF"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="tabConsultaUsuarios"> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabConsultaUsuariosMouseClicked"/> + </Events> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Consulta de Livros"> + <Property name="tabTitle" type="java.lang.String" value="Consulta de Livros"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="25" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jScrollPane1" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel14" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtPesquisaLivros" pref="362" max="32767" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnPesquisar" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="426" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnXlsxExport" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jButton3" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtPesquisaLivros" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnPesquisar" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane1" min="-2" pref="278" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jButton3" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="btnXlsxExport" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="42" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPesquisaLivros"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPesquisaLivrosActionPerformed"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtPesquisaLivrosKeyReleased"/> + </Events> + </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"/> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="btnPesquisarKeyReleased"/> + </Events> + </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.JTable" name="tabelaLivros"> + <Properties> + <Property name="autoCreateRowSorter" type="boolean" value="true"/> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="16" rowCount="0"> + <Column editable="false" title="cod" type="java.lang.Object"/> + <Column editable="false" title="Título" type="java.lang.Object"/> + <Column editable="false" title="Autor" type="java.lang.Object"/> + <Column editable="false" title="Editora" type="java.lang.Object"/> + <Column editable="false" title="ISBN" type="java.lang.Object"/> + <Column editable="false" title="Ano" type="java.lang.Object"/> + <Column editable="false" title="Serie" type="java.lang.Object"/> + <Column editable="false" title="Edição" type="java.lang.Object"/> + <Column editable="false" title="Idioma" type="java.lang.Object"/> + <Column editable="false" title="Fornecedor" type="java.lang.Object"/> + <Column editable="false" title="Piso" type="java.lang.Object"/> + <Column editable="false" title="Corredor" type="java.lang.Object"/> + <Column editable="false" title="Posição" type="java.lang.Object"/> + <Column editable="false" title="Seção" type="java.lang.Object"/> + <Column editable="false" title="Disponibilidade" type="java.lang.Object"/> + <Column editable="false" title="Observações" type="java.lang.Object"/> + </Table> + </Property> + <Property name="autoResizeMode" type="int" value="0"/> + <Property name="columnModel" type="javax.swing.table.TableColumnModel" editor="org.netbeans.modules.form.editors2.TableColumnModelEditor" preCode="tabelaLivros.getColumn(tabelaLivros.getColumnName(0)).setPreferredWidth(30); tabelaLivros.getColumn(tabelaLivros.getColumnName(1)).setPreferredWidth(200);"> + <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> + <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> + <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="false" resizingAllowed="true"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="tabelaLivrosMouseClicked"/> + </Events> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JButton" name="btnXlsxExport"> + <Properties> + <Property name="text" type="java.lang.String" value="Exportar para XLSX"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnXlsxExportActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton3"> + <Properties> + <Property name="text" type="java.lang.String" value="Importar de arquivo XLSX"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="tabCadastro"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Cadastro de livros"> + <Property name="tabTitle" type="java.lang.String" value="Cadastro de livros"/> + </JTabbedPaneConstraints> + </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" attributes="0"> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel2" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="lblNome" min="-2" max="-2" attributes="0"/> + <Component id="lblAutor" min="-2" max="-2" attributes="0"/> + <Component id="lblEditora" min="-2" max="-2" attributes="0"/> + <Component id="lblIsbn" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="jLabel19" min="-2" max="-2" attributes="0"/> + <Component id="jLabel20" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtId" min="-2" pref="59" max="-2" attributes="0"/> + <Component id="txtIdioma" alignment="0" min="-2" pref="133" max="-2" attributes="0"/> + <Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0"> + <Component id="txtEditora" alignment="0" max="32767" attributes="0"/> + <Component id="txtAutor" alignment="0" max="32767" attributes="0"/> + <Component id="txtTitulo" alignment="0" max="32767" attributes="0"/> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" attributes="0"> + <Component id="txtIsbn" min="-2" pref="146" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblAno" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="txtSerie" max="32767" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblEdicao" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtEdicao" min="-2" pref="45" max="-2" attributes="0"/> + <Component id="txtAno" min="-2" pref="43" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="17" max="32767" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Component id="jSeparator2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="boxFornecedor" max="32767" attributes="0"/> + <Component id="boxDisponibilidade" min="-2" pref="208" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <Component id="jLabel12" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + <Component id="jLabel13" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="boxCorredor" alignment="1" max="32767" attributes="0"/> + <Component id="boxSecao" alignment="1" max="32767" attributes="0"/> + <Component id="boxPiso" pref="0" max="32767" attributes="0"/> + <Component id="boxPosicao" alignment="1" max="32767" attributes="0"/> + </Group> + </Group> + <Component id="jScrollPane2" alignment="0" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + <Component id="jSeparator1" min="-2" pref="203" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="73" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="160" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="0" pref="67" max="32767" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="btnMapa" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnNovo" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnSalvar" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnExcluir" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Component id="btNavegar" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnbaixarCapa" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="27" max="-2" attributes="0"/> + <Component id="lblImagem" min="-2" pref="162" max="-2" attributes="0"/> + </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"> + <EmptySpace 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" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jSeparator2" min="-2" pref="232" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="173" max="-2" 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="3" attributes="0"> + <Component id="boxFornecedor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel8" 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="boxDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jSeparator1" min="-2" pref="5" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel13" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxPiso" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="boxCorredor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="boxSecao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="boxPosicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane2" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblImagem" min="-2" pref="240" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btNavegar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnbaixarCapa" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/> + <Component id="btnMapa" min="-2" pref="40" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="48" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtId" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtTitulo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblNome" 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="txtAutor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblAutor" 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="txtEditora" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblEditora" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="18" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblIsbn" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtIsbn" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblAno" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtAno" 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="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblEdicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSerie" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEdicao" 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="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtIdioma" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnExcluir" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSalvar" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnNovo" alignment="3" max="32767" attributes="0"/> + </Group> + <Component id="jLabel18" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="32" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="ID:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Título:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblAutor"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Autor:"/> + </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="Tahoma" size="12" style="1"/> + </Property> + <Property name="text" type="java.lang.String" value="LOCALIZAÇÃO"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblAno"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Ano:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Posição:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEditora"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Editora:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*Seção:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblIsbn"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="*ISBN:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel12"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Corredor:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Piso:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEdicao"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Ediçã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="txtEditora"> + </Component> + <Component class="javax.swing.JTextField" name="txtId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel18"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="Série:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxSecao"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="null"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxSecaoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtIsbn"> + <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.JSeparator" name="jSeparator2"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo"> + <BevelBorder/> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxCorredor"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="null"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxCorredorMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="boxPiso"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="null"/> + </Property> + <Property name="lightWeightPopupEnabled" type="boolean" value="false"/> + <Property name="name" type="java.lang.String" value="" noResource="true"/> + <Property name="requestFocusEnabled" type="boolean" value="false"/> + <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPisoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="boxPosicao"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="null"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPosicaoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JButton" name="btnMapa"> + <Properties> + <Property name="text" type="java.lang.String" value="mapa"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnMapaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JSeparator" name="jSeparator1"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo"> + <BevelBorder/> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btNavegar"> + <Properties> + <Property name="text" type="java.lang.String" value="Navegar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btNavegarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnbaixarCapa"> + <Properties> + <Property name="text" type="java.lang.String" value="baixar capa"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel20"> + <Properties> + <Property name="text" type="java.lang.String" value="*Idioma:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtSerie"> + </Component> + <Component class="javax.swing.JTextField" name="txtIdioma"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdiomaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtEdicao"> + </Component> + <Component class="javax.swing.JComboBox" name="boxFornecedor"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="null"/> + </Property> + <Property name="lightWeightPopupEnabled" type="boolean" value="false"/> + <Property name="opaque" type="boolean" value="false"/> + <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxFornecedorMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_SerializeTo" type="java.lang.String" value="FormLivros_boxFornecedor"/> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + </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="txtAreaObservacoes"> + <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="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Observações:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxDisponibilidade"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="0"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="null"/> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxDisponibilidadeMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="*Disponibilidade:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblImagem"> + <Properties> + <Property name="horizontalAlignment" type="int" value="0"/> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/book_cover.png"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> + <LineBorder/> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="text" type="java.lang.String" value="Alterar Fornecedor:"/> + </Properties> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtAno"> + <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.JButton" name="btnSalvar"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/save_small.png"/> + </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="btnSalvarActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnNovo"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/new_file_small.png"/> + </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="btnNovoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnExcluir"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/delete_small.png"/> + </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="btnExcluirActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + </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="Dialog" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/> + </Property> + <Property name="text" type="java.lang.String" value="FECHAR"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/> + </Events> + </Component> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormLivros.java b/src/br/com/projeto/view/FormLivros.java new file mode 100644 index 0000000..05baea6 --- /dev/null +++ b/src/br/com/projeto/view/FormLivros.java @@ -0,0 +1,1261 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +//mude para vizualizacao por projeto para adicionar action +package br.com.projeto.view; + +import br.com.projeto.dao.FornecedorDao; +import br.com.projeto.dao.FuncionarioDao; +import br.com.projeto.dao.LivroDao; +import br.com.projeto.dao.OptionsDao; +import br.com.projeto.dao.UsuarioDao; +import br.com.projeto.model.Fornecedor; +import br.com.projeto.model.Livro; +import br.com.projeto.model.Options; +import br.com.projeto.model.Utilitarios; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.SQLException; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.imageio.ImageIO; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.JOptionPane; +import javax.swing.filechooser.FileNameExtensionFilter; +import javax.swing.table.DefaultTableModel; +import org.apache.poi.openxml4j.exceptions.InvalidFormatException; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormLivros extends javax.swing.JFrame { + + public void LimpaCampos() { + boxCorredor.removeAllItems(); + boxDisponibilidade.removeAllItems(); + boxFornecedor.removeAllItems(); + boxPiso.removeAllItems(); + boxSecao.removeAllItems(); + boxPosicao.removeAllItems(); + } + + //metodo listar usuarios pt3 + public void listarLivros() throws Exception { + LivroDao dao = new LivroDao(); + List<Livro> lista = dao.buscarLivros(); + DefaultTableModel dados = (DefaultTableModel) tabelaLivros.getModel(); + dados.setNumRows(0); + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getTitulo(), + c.getAutor(), + c.getEditora(), + c.getIsbn(), + c.getAno(), + c.getSerie(), + c.getEdicao(), + c.getIdioma(), + c.getFornecedor().getNome(), + c.getPiso(), + c.getCorredor(), + c.getPosicao(), + c.getSecao(), + c.getDisponibilidade(), + c.getObservacoes(),}); + } + + } + + /** + * Creates new form formLeitor + */ + public FormLivros() { + 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() { + + jMenu1 = new javax.swing.JMenu(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + tabbedFrameF = new javax.swing.JTabbedPane(); + tabConsultaUsuarios = new javax.swing.JPanel(); + jLabel14 = new javax.swing.JLabel(); + txtPesquisaLivros = new javax.swing.JTextField(); + btnPesquisar = new javax.swing.JButton(); + jScrollPane1 = new javax.swing.JScrollPane(); + tabelaLivros = new javax.swing.JTable(); + btnXlsxExport = new javax.swing.JButton(); + jButton3 = new javax.swing.JButton(); + tabCadastro = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + lblNome = new javax.swing.JLabel(); + lblAutor = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + lblAno = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + lblEditora = new javax.swing.JLabel(); + jLabel9 = new javax.swing.JLabel(); + lblIsbn = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + jLabel13 = new javax.swing.JLabel(); + lblEdicao = new javax.swing.JLabel(); + txtTitulo = new javax.swing.JTextField(); + txtAutor = new javax.swing.JTextField(); + txtEditora = new javax.swing.JTextField(); + txtId = new javax.swing.JTextField(); + jLabel18 = new javax.swing.JLabel(); + jLabel19 = new javax.swing.JLabel(); + boxSecao = new javax.swing.JComboBox<>(); + txtIsbn = new javax.swing.JFormattedTextField(); + jSeparator2 = new javax.swing.JSeparator(); + boxCorredor = new javax.swing.JComboBox<>(); + boxPiso = new javax.swing.JComboBox<>(); + boxPosicao = new javax.swing.JComboBox<>(); + btnMapa = new javax.swing.JButton(); + jSeparator1 = new javax.swing.JSeparator(); + btNavegar = new javax.swing.JButton(); + btnbaixarCapa = new javax.swing.JButton(); + jLabel20 = new javax.swing.JLabel(); + txtSerie = new javax.swing.JTextField(); + txtIdioma = new javax.swing.JTextField(); + txtEdicao = new javax.swing.JTextField(); + boxFornecedor = new javax.swing.JComboBox(); + jScrollPane2 = new javax.swing.JScrollPane(); + txtAreaObservacoes = new javax.swing.JTextArea(); + jLabel4 = new javax.swing.JLabel(); + boxDisponibilidade = new javax.swing.JComboBox(); + jLabel6 = new javax.swing.JLabel(); + lblImagem = new javax.swing.JLabel(); + jLabel8 = new javax.swing.JLabel(); + txtAno = new javax.swing.JFormattedTextField(); + btnSalvar = new javax.swing.JButton(); + btnNovo = new javax.swing.JButton(); + btnExcluir = new javax.swing.JButton(); + jButton1 = new javax.swing.JButton(); + + jMenu1.setText("jMenu1"); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(51, 51, 51)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Cadastro de Livros"); + + 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() + .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE) + ); + + tabConsultaUsuarios.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabConsultaUsuariosMouseClicked(evt); + } + }); + + jLabel14.setText("Nome:"); + + txtPesquisaLivros.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPesquisaLivrosActionPerformed(evt); + } + }); + txtPesquisaLivros.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtPesquisaLivrosKeyReleased(evt); + } + }); + + btnPesquisar.setText("Pesquisar"); + btnPesquisar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnPesquisarActionPerformed(evt); + } + }); + btnPesquisar.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + btnPesquisarKeyReleased(evt); + } + }); + + tabelaLivros.setAutoCreateRowSorter(true); + tabelaLivros.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "cod", "Título", "Autor", "Editora", "ISBN", "Ano", "Serie", "Edição", "Idioma", "Fornecedor", "Piso", "Corredor", "Posição", "Seção", "Disponibilidade", "Observações" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaLivros.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + tabelaLivros.getTableHeader().setReorderingAllowed(false); + tabelaLivros.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaLivrosMouseClicked(evt); + } + }); + jScrollPane1.setViewportView(tabelaLivros); + tabelaLivros.getColumn(tabelaLivros.getColumnName(0)).setPreferredWidth(30); + tabelaLivros.getColumn(tabelaLivros.getColumnName(1)).setPreferredWidth(200); + + btnXlsxExport.setText("Exportar para XLSX"); + btnXlsxExport.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnXlsxExportActionPerformed(evt); + } + }); + + jButton3.setText("Importar de arquivo XLSX"); + jButton3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton3ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout tabConsultaUsuariosLayout = new javax.swing.GroupLayout(tabConsultaUsuarios); + tabConsultaUsuarios.setLayout(tabConsultaUsuariosLayout); + tabConsultaUsuariosLayout.setHorizontalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(25, 25, 25) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jScrollPane1) + .addContainerGap()) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtPesquisaLivros, javax.swing.GroupLayout.DEFAULT_SIZE, 362, Short.MAX_VALUE) + .addGap(18, 18, 18) + .addComponent(btnPesquisar) + .addGap(426, 426, 426)))) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnXlsxExport) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jButton3) + .addContainerGap()) + ); + tabConsultaUsuariosLayout.setVerticalGroup( + tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabConsultaUsuariosLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel14) + .addComponent(txtPesquisaLivros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnPesquisar)) + .addGap(18, 18, 18) + .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabConsultaUsuariosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jButton3) + .addComponent(btnXlsxExport)) + .addContainerGap(42, Short.MAX_VALUE)) + ); + + tabbedFrameF.addTab("Consulta de Livros", tabConsultaUsuarios); + + jLabel2.setText("ID:"); + + lblNome.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblNome.setText("*Título:"); + + lblAutor.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblAutor.setText("*Autor:"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N + jLabel5.setText("LOCALIZAÇÃO"); + + lblAno.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblAno.setText("*Ano:"); + + jLabel7.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel7.setText("Posição:"); + + lblEditora.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblEditora.setText("*Editora:"); + + jLabel9.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel9.setText("*Seção:"); + + lblIsbn.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblIsbn.setText("*ISBN:"); + + jLabel12.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel12.setText("Corredor:"); + + jLabel13.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel13.setText("Piso:"); + + lblEdicao.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblEdicao.setText("Edição:"); + + txtTitulo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtTituloActionPerformed(evt); + } + }); + + txtId.setEditable(false); + txtId.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdActionPerformed(evt); + } + }); + + jLabel19.setText("Série:"); + + boxSecao.setBorder(null); + boxSecao.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxSecaoMouseClicked(evt); + } + }); + + try { + txtIsbn.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("#############"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + jSeparator2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED)); + + boxCorredor.setBorder(null); + boxCorredor.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxCorredorMouseClicked(evt); + } + }); + + boxPiso.setBorder(null); + boxPiso.setLightWeightPopupEnabled(false); + boxPiso.setName(""); // NOI18N + boxPiso.setRequestFocusEnabled(false); + boxPiso.setVerifyInputWhenFocusTarget(false); + boxPiso.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxPisoMouseClicked(evt); + } + }); + + boxPosicao.setBorder(null); + boxPosicao.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxPosicaoMouseClicked(evt); + } + }); + + btnMapa.setText("mapa"); + btnMapa.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnMapaActionPerformed(evt); + } + }); + + jSeparator1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED)); + + btNavegar.setText("Navegar"); + btNavegar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btNavegarActionPerformed(evt); + } + }); + + btnbaixarCapa.setText("baixar capa"); + + jLabel20.setText("*Idioma:"); + + txtIdioma.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdiomaActionPerformed(evt); + } + }); + + boxFornecedor.setBorder(null); + boxFornecedor.setLightWeightPopupEnabled(false); + boxFornecedor.setOpaque(false); + boxFornecedor.setVerifyInputWhenFocusTarget(false); + boxFornecedor.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxFornecedorMouseClicked(evt); + } + }); + + txtAreaObservacoes.setColumns(20); + txtAreaObservacoes.setRows(5); + jScrollPane2.setViewportView(txtAreaObservacoes); + + jLabel4.setText("Observações:"); + + boxDisponibilidade.setBorder(null); + boxDisponibilidade.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxDisponibilidadeMouseClicked(evt); + } + }); + + jLabel6.setText("*Disponibilidade:"); + + lblImagem.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/book_cover.png"))); // NOI18N + lblImagem.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); + + jLabel8.setText("Alterar Fornecedor:"); + + try { + txtAno.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + btnSalvar.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnSalvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/save_small.png"))); // NOI18N + btnSalvar.setText("SALVAR"); + btnSalvar.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSalvarActionPerformed(evt); + } + }); + + btnNovo.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnNovo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/new_file_small.png"))); // NOI18N + btnNovo.setText("NOVO"); + btnNovo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnNovoActionPerformed(evt); + } + }); + + btnExcluir.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnExcluir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/delete_small.png"))); // NOI18N + btnExcluir.setText("EXCLUIR"); + btnExcluir.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirActionPerformed(evt); + } + }); + + javax.swing.GroupLayout tabCadastroLayout = new javax.swing.GroupLayout(tabCadastro); + tabCadastro.setLayout(tabCadastroLayout); + tabCadastroLayout.setHorizontalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(23, 23, 23) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel2) + .addComponent(lblNome) + .addComponent(lblAutor) + .addComponent(lblEditora) + .addComponent(lblIsbn) + .addComponent(jLabel19) + .addComponent(jLabel20)) + .addGap(15, 15, 15) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(txtEditora, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtAutor, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtTitulo, javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(txtIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblAno)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addComponent(txtSerie) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblEdicao))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 17, Short.MAX_VALUE)))) + .addGap(12, 12, 12) + .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel6) + .addComponent(jLabel8)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(boxFornecedor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(boxDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(14, 14, 14) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel9) + .addComponent(jLabel12) + .addComponent(jLabel7) + .addComponent(jLabel13)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(boxCorredor, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(boxSecao, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(boxPiso, 0, 1, Short.MAX_VALUE) + .addComponent(boxPosicao, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addComponent(jScrollPane2) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 203, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(73, 73, 73) + .addComponent(jLabel5)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(160, 160, 160) + .addComponent(jLabel4))) + .addGap(0, 67, Short.MAX_VALUE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(btnMapa) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnNovo))) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnSalvar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnExcluir) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel18)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(18, 18, 18) + .addComponent(btNavegar) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnbaixarCapa)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGap(27, 27, 27) + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + tabCadastroLayout.setVerticalGroup( + tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addContainerGap() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(173, 173, 173)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxFornecedor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel8)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6))) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(23, 23, 23) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel13) + .addComponent(boxPiso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel12)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxSecao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel9)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(tabCadastroLayout.createSequentialGroup() + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btNavegar) + .addComponent(btnbaixarCapa)))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnMapa, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(48, 48, 48)))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, tabCadastroLayout.createSequentialGroup() + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(txtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblNome)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblAutor)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtEditora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblEditora)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblIsbn) + .addComponent(txtIsbn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblAno) + .addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(lblEdicao) + .addComponent(txtSerie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel20) + .addComponent(txtIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, Short.MAX_VALUE) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(tabCadastroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnExcluir) + .addComponent(btnSalvar) + .addComponent(btnNovo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addComponent(jLabel18)) + .addGap(32, 32, 32)))) + ); + + tabbedFrameF.addTab("Cadastro de livros", tabCadastro); + + jButton1.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N + jButton1.setText("FECHAR"); + jButton1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton1ActionPerformed(evt); + } + }); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addComponent(tabbedFrameF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jButton1) + .addGap(16, 16, 16)) + ); + layout.setVerticalGroup( + 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(tabbedFrameF, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap()) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void btnSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSalvarActionPerformed + // salvar usuario + + Livro obj = new Livro(); + obj.setTitulo(txtTitulo.getText()); + obj.setAutor(txtAutor.getText()); + obj.setEditora(txtEditora.getText()); + obj.setIsbn(txtIsbn.getText()); + obj.setAno(txtAno.getText()); + obj.setSerie(txtSerie.getText()); + obj.setEdicao(txtEdicao.getText()); + obj.setIdioma(txtIdioma.getText()); + obj.setFornecedor((Fornecedor) boxFornecedor.getSelectedItem()); //cannot cast string to fornecedores error + obj.setPiso((String) boxPiso.getSelectedItem()); + obj.setCorredor((String) boxCorredor.getSelectedItem()); + obj.setPosicao((String) boxPosicao.getSelectedItem()); + obj.setSecao((String) boxSecao.getSelectedItem()); + try { + int dispo = Integer.valueOf((String) boxDisponibilidade.getSelectedItem()); + obj.setDisponibilidade(dispo); + } catch (Exception e) { + obj.setDisponibilidade((int) boxDisponibilidade.getSelectedItem()); //caso venha em txt combobbox + } + obj.setObservacoes(txtAreaObservacoes.getText()); + + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + if (txtTitulo.getText().isEmpty() || txtAutor.getText().isEmpty() + || txtIsbn.getText().isEmpty() || txtEditora.getText().isEmpty() + || txtIdioma.getText().isEmpty() || boxDisponibilidade.getSelectedItem() == null + || boxSecao == null) { + JOptionPane.showMessageDialog(null, "Campos com * são de preenchimento obrigatório!"); + } else { + // salvar/editar + if (!(txtId.getText()).equals("")) { + try { + obj.setId(Integer.valueOf(txtId.getText())); + dao.alterarLivro(obj); + System.out.println("fornecedor object: " + obj.getFornecedor().getId()); + } catch (IOException ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + } else { + dao.cadastrarLivro(obj); + } + } + + //dao.cadastrarLivro(obj); + //new Utilitarios().limpaTela(tabCadastro); + }//GEN-LAST:event_btnSalvarActionPerformed + + private void txtPesquisaLivrosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPesquisaLivrosActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPesquisaLivrosActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + try { + // listar suario pt4 + listarLivros(); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_formWindowActivated + + private void btnExcluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirActionPerformed + // excluir + Livro obj = new Livro(); + obj.setId(Integer.valueOf(txtId.getText())); + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + dao.excluirLivro(obj); + + }//GEN-LAST:event_btnExcluirActionPerformed + + + private void tabelaLivrosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaLivrosMouseClicked + try { + // tabela quando clicado + LimpaCampos(); + DefaultTableModel model = (DefaultTableModel) tabelaLivros.getModel(); + int selectedRowIndex = tabelaLivros.getSelectedRow(); + tabbedFrameF.setSelectedIndex(1); + txtId.setText(model.getValueAt(selectedRowIndex, 0).toString()); + txtTitulo.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtAutor.setText(model.getValueAt(selectedRowIndex, 2).toString()); + txtEditora.setText(model.getValueAt(selectedRowIndex, 3).toString()); + txtIsbn.setText(model.getValueAt(selectedRowIndex, 4).toString()); + txtAno.setText(model.getValueAt(selectedRowIndex, 5).toString()); + txtSerie.setText(model.getValueAt(selectedRowIndex, 6).toString()); + txtEdicao.setText(model.getValueAt(selectedRowIndex, 7).toString()); + txtIdioma.setText(model.getValueAt(selectedRowIndex, 8).toString()); + boxPiso.addItem((String) model.getValueAt(selectedRowIndex, 10)); + boxCorredor.addItem((String) model.getValueAt(selectedRowIndex, 11)); + boxPosicao.addItem((String) model.getValueAt(selectedRowIndex, 12)); + boxSecao.addItem((String) model.getValueAt(selectedRowIndex, 13)); + + String boxDisponibilidadeString = String.valueOf(model.getValueAt(selectedRowIndex, 14)); + LivroDao livrodao = new LivroDao(); + int selectLivro = livrodao.getLivroIndex(boxDisponibilidadeString); + List<Livro> ListaLivro = livrodao.buscarLivros(); + for (Livro f : ListaLivro) { + boxDisponibilidade.insertItemAt(f.getDisponibilidade(), boxDisponibilidade.getItemCount()); // era (f.getNome()) mas precisou soberscrecer mopetodo toString em fornecesdores + } + boxDisponibilidade.setSelectedIndex(selectLivro); + txtAreaObservacoes.setText((String) model.getValueAt(selectedRowIndex, 15)); + + String boxFornecedorString = String.valueOf(model.getValueAt(selectedRowIndex, 9)); + LivroDao livro = new LivroDao(); + FornecedorDao dao = new FornecedorDao(); + int select = livro.getFornecedorIndex(boxFornecedorString); + List<Fornecedor> ListaFornecedor = dao.listarFornecedores(); + for (Fornecedor f : ListaFornecedor) { + boxFornecedor.insertItemAt(f, boxFornecedor.getItemCount()); // era (f.getNome()) mas precisou soberscrecer mopetodo toString em fornecesdores + } + boxFornecedor.setSelectedIndex(select - 1); + String path = "C:\\Librography\\images\\books\\" + txtIsbn.getText(); + lblImagem.setIcon(ResizeBookImage(path)); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_tabelaLivrosMouseClicked + + private void btnNovoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNovoActionPerformed + // TODO add your handling code here: + LimpaCampos(); + Utilitarios util = new Utilitarios(); + util.limpaTela(tabCadastro); + boxFornecedor.setSelectedItem(-1); + boxPiso.setSelectedItem(-1); + boxCorredor.setSelectedIndex(-1); + boxPosicao.setSelectedIndex(-1); + boxSecao.setSelectedIndex(-1); + txtAreaObservacoes.selectAll(); + txtAreaObservacoes.replaceSelection(""); + }//GEN-LAST:event_btnNovoActionPerformed + + private void txtIdActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdActionPerformed + + private void txtTituloActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTituloActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtTituloActionPerformed + + private void btnPesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btnPesquisarKeyReleased + // TODO add your handling code here: + + }//GEN-LAST:event_btnPesquisarKeyReleased + + private void txtPesquisaLivrosKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtPesquisaLivrosKeyReleased + // TODO add your handling code here: + String nome = "%" + txtPesquisaLivros.getText() + "%"; + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + List<Livro> lista = dao.pesquisarNomeLivros(nome); + DefaultTableModel dados = (DefaultTableModel) tabelaLivros.getModel(); + dados.setNumRows(0); //limpa/zera pesquisa a cada digitacao + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getId(), + c.getTitulo(), + c.getAutor(), + c.getEditora(), + c.getIsbn(), + c.getAno(), + c.getSerie(), + c.getEdicao(), + c.getIdioma(), + c.getFornecedor().getNome(), + c.getPiso(), + c.getCorredor(), + c.getPosicao(), + c.getSecao(), + c.getDisponibilidade(), + c.getObservacoes() + }); + } + }//GEN-LAST:event_txtPesquisaLivrosKeyReleased + + private void btnPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnPesquisarActionPerformed + // TODO add your handling code here: + String nome = txtTitulo.getText(); + Livro obj = new Livro(); + LivroDao dao = null; + try { + dao = new LivroDao(); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + obj = dao.buscarLivro(nome); + if (obj.getTitulo() != null) { + txtId.setText(String.valueOf(obj.getId())); + txtTitulo.setText(obj.getTitulo()); + txtAutor.setText(obj.getAutor()); + txtEditora.setText(obj.getEditora()); + txtIsbn.setText(obj.getIsbn()); + txtAno.setText(obj.getAno()); + txtSerie.setText(obj.getSerie()); + txtEdicao.setText(obj.getEdicao()); + txtIdioma.setText(obj.getIdioma()); + boxFornecedor.setSelectedItem(obj.getFornecedor()); + boxPiso.setSelectedItem(obj.getPiso()); + boxCorredor.setSelectedItem(obj.getCorredor()); + boxPosicao.setSelectedItem(obj.getPosicao()); + boxSecao.setSelectedItem(obj.getSecao()); + boxDisponibilidade.setSelectedItem(obj.getDisponibilidade()); + txtAreaObservacoes.setText(obj.getObservacoes()); + + ImageIcon iconLogo = new ImageIcon("C:\\Librography\\images\\books\\" + txtIsbn.getText()); + lblImagem.setIcon(iconLogo); + + } else { + JOptionPane.showMessageDialog(null, "Livro não encontrado"); + } + + }//GEN-LAST:event_btnPesquisarActionPerformed + + private void txtIdiomaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdiomaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdiomaActionPerformed + + private void boxCorredorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxCorredorMouseClicked + + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarCorredor(); + boxCorredor.removeAllItems(); + ListaOptions.forEach((f) -> { + boxCorredor.addItem(f.getCorredor()); + }); + }//GEN-LAST:event_boxCorredorMouseClicked + + private void boxPisoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxPisoMouseClicked + String boxPisoString = String.valueOf(boxPiso.getSelectedIndex()); + boxPiso.removeAllItems(); + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarPiso(); + + for (Options f : ListaOptions) { + boxPiso.insertItemAt(f.getPiso(), boxPiso.getItemCount()); + } + boxPiso.setSelectedItem(boxPisoString); + }//GEN-LAST:event_boxPisoMouseClicked + + private void boxSecaoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxSecaoMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarSecao(); + boxSecao.removeAllItems(); + for (Options f : ListaOptions) { + boxSecao.addItem(f.getSecao()); + } + }//GEN-LAST:event_boxSecaoMouseClicked + + private void boxPosicaoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxPosicaoMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarPosicao(); + boxPosicao.removeAllItems(); + for (Options f : ListaOptions) { + boxPosicao.addItem(f.getPosicao()); + } + }//GEN-LAST:event_boxPosicaoMouseClicked + + private void btnMapaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMapaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_btnMapaActionPerformed + + private void boxDisponibilidadeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxDisponibilidadeMouseClicked + try { + String boxDisponibilidadeString = String.valueOf(boxDisponibilidade.getSelectedIndex()); + boxDisponibilidade.removeAllItems(); + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarDisponibilidade(); //boxDisponibilidadeString, Integer.parseInt(txtId.getText())); + for (Options f : ListaOptions) { + boxDisponibilidade.insertItemAt(f.getDisponibilidade(), boxDisponibilidade.getItemCount()); // era (f.getNome()) mas precisou soberscrecer mopetodo toString em fornecesdores + } + boxDisponibilidade.setSelectedItem(boxDisponibilidadeString); + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_boxDisponibilidadeMouseClicked + + private void btNavegarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNavegarActionPerformed + + JFileChooser jfile = new JFileChooser(); + int result = jfile.showSaveDialog(this); + File selectedFile = jfile.getSelectedFile(); + String filename = selectedFile.getName(); + if (filename.endsWith(".jpg") || filename.endsWith(".JPG") || filename.endsWith(".png") || filename.endsWith(".PNG") || filename.endsWith(".jpeg")) { + + FileNameExtensionFilter filter = new FileNameExtensionFilter("*.image", "jpg", "png"); + jfile.addChoosableFileFilter(filter); + if (result == JFileChooser.APPROVE_OPTION) { + File selectedImage = jfile.getSelectedFile(); + String path = selectedImage.getAbsolutePath(); + BufferedImage image; + try { + image = ImageIO.read(selectedImage); + ImageIO.write(image, "jpg", new File("C:\\Librography\\images\\books\\" + txtIsbn.getText())); + } catch (IOException ex) { + Logger.getLogger(Image.class.getName()).log(Level.SEVERE, null, ex); + } + try { + lblImagem.setIcon(ResizeBookImage(path)); + // imagePathStr = path; + + } catch (Exception e) { + JOptionPane.showMessageDialog(this, "Image Error" + e.getMessage()); + } + } + } else { + JOptionPane.showMessageDialog(rootPane, "Por Favor Seleciona um arquivo do tipo Imagem", "Tente Novamente!", 1); + } + }//GEN-LAST:event_btNavegarActionPerformed + + private void boxFornecedorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxFornecedorMouseClicked + String boxFornecedorString = String.valueOf(boxFornecedor.getSelectedIndex()); + boxFornecedor.removeAllItems(); + FornecedorDao dao = new FornecedorDao(); + List<Fornecedor> ListaFornecedor = dao.listarFornecedores(); + for (Fornecedor f : ListaFornecedor) { + boxFornecedor.insertItemAt(f, boxFornecedor.getItemCount()); // era (f.getNome()) mas precisou soberscrecer mopetodo toString em fornecesdores + } + boxFornecedor.setSelectedItem(boxFornecedorString); + }//GEN-LAST:event_boxFornecedorMouseClicked + + private void tabConsultaUsuariosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabConsultaUsuariosMouseClicked + // TODO add your handling code here: + + + }//GEN-LAST:event_tabConsultaUsuariosMouseClicked + + private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed + this.dispose(); + }//GEN-LAST:event_jButton1ActionPerformed + + private void btnXlsxExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnXlsxExportActionPerformed + Utilitarios util = new Utilitarios(); + JFileChooser fc = new JFileChooser(); + fc.setSelectedFile(new File("Livros")); + int option = fc.showSaveDialog(FormLivros.this); + if (option == JFileChooser.APPROVE_OPTION) { + try { + String filename = fc.getSelectedFile().getName(); + String path = fc.getSelectedFile().getParentFile().getPath(); + int len = filename.length(); + String ext = ""; + String file = ""; + if (len > 4) { + ext = filename.substring(len - 4, len); + } + if (ext.equals(".xlsx")) { + switch (util.getOS()) { + case WINDOWS: + file = path + "\\" + filename; + break; + case MAC: + file = path + "/" + filename;//estava \\ no windows /(ver) + break; + } + } else { + switch (util.getOS()) { + case WINDOWS: + file = path + "\\" + filename + ".xlsx"; + break; + case MAC: + file = path + "/" + filename + ".xlsx";//estava \\ no windows /(ver) + break; + } + file = path + "/" + filename + ".xlsx";//aqui tambem + } + util.toExcel(tabelaLivros, new File(file)); + JOptionPane.showMessageDialog(null, "Arquivo Salvo com sucesso em " + file + "!"); + } catch (IOException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + } + }//GEN-LAST:event_btnXlsxExportActionPerformed + + private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed + try { + LivroDao livroDao = new LivroDao(); + JFileChooser fileChooser = new JFileChooser(); + int returnValue = fileChooser.showOpenDialog(null); + File selectedFile = fileChooser.getSelectedFile(); + String filename = selectedFile.getName(); + if (filename.endsWith(".xlsx") || filename.endsWith(".XLSX")) { + FileNameExtensionFilter filter = new FileNameExtensionFilter("*.table", "xlsx"); + fileChooser.addChoosableFileFilter(filter); + if (returnValue == JFileChooser.APPROVE_OPTION) { + String path = selectedFile.getAbsolutePath(); + try { + try { + livroDao.importaLivrosXlsx(path);// ???? + } catch (FileNotFoundException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } catch (InvalidFormatException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + System.out.println("path= " + path); + } catch (IOException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } catch (SQLException ex) { + Logger.getLogger(FormLeitor.class.getName()).log(Level.SEVERE, null, ex); + } + } + } else { + JOptionPane.showMessageDialog(null, "Selecione o Arquivo de nome: 'Livros.xlsx'"); + } + } catch (Exception ex) { + Logger.getLogger(FormLivros.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_jButton3ActionPerformed + + /** + * @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(FormLivros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormLivros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormLivros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormLivros.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormLivros().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox<String> boxCorredor; + private javax.swing.JComboBox boxDisponibilidade; + private javax.swing.JComboBox boxFornecedor; + private javax.swing.JComboBox<String> boxPiso; + private javax.swing.JComboBox<String> boxPosicao; + private javax.swing.JComboBox<String> boxSecao; + private javax.swing.JButton btNavegar; + private javax.swing.JButton btnExcluir; + private javax.swing.JButton btnMapa; + private javax.swing.JButton btnNovo; + private javax.swing.JButton btnPesquisar; + private javax.swing.JButton btnSalvar; + private javax.swing.JButton btnXlsxExport; + private javax.swing.JButton btnbaixarCapa; + private javax.swing.JButton jButton1; + private javax.swing.JButton jButton3; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel12; + private javax.swing.JLabel jLabel13; + private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel18; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + 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.JMenu jMenu1; + private javax.swing.JPanel jPanel1; + private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JScrollPane jScrollPane2; + private javax.swing.JSeparator jSeparator1; + private javax.swing.JSeparator jSeparator2; + private javax.swing.JLabel lblAno; + private javax.swing.JLabel lblAutor; + private javax.swing.JLabel lblEdicao; + private javax.swing.JLabel lblEditora; + private javax.swing.JLabel lblImagem; + private javax.swing.JLabel lblIsbn; + private javax.swing.JLabel lblNome; + private javax.swing.JPanel tabCadastro; + private javax.swing.JPanel tabConsultaUsuarios; + private javax.swing.JTabbedPane tabbedFrameF; + private javax.swing.JTable tabelaLivros; + private javax.swing.JFormattedTextField txtAno; + private javax.swing.JTextArea txtAreaObservacoes; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextField txtEdicao; + private javax.swing.JTextField txtEditora; + private javax.swing.JTextField txtId; + private javax.swing.JTextField txtIdioma; + private javax.swing.JFormattedTextField txtIsbn; + private javax.swing.JTextField txtPesquisaLivros; + private javax.swing.JTextField txtSerie; + private javax.swing.JTextField txtTitulo; + // End of variables declaration//GEN-END:variables + //private String imagePathStr; + + //resize book image function + private ImageIcon ResizeBookImage(String imgPath) { //192x261 + int imageX = 162; + int imageY = 240; + lblImagem.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblImagem.getWidth(), lblImagem.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + +} diff --git a/src/br/com/projeto/view/FormLogin.form b/src/br/com/projeto/view/FormLogin.form new file mode 100644 index 0000000..262904f --- /dev/null +++ b/src/br/com/projeto/view/FormLogin.form @@ -0,0 +1,172 @@ +<?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="resizable" type="boolean" value="false"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="true"/> + </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="1" max="32767" attributes="0"/> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="121" max="-2" attributes="0"/> + <Component id="btnEntrarLogin" min="-2" pref="124" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="34" max="-2" attributes="0"/> + <Component id="btnCancelarLogin" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="58" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" 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="txtNomeLogin" max="32767" attributes="0"/> + <Component id="txtSenhaLogin" min="-2" pref="272" max="-2" attributes="0"/> + </Group> + </Group> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace pref="68" 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 min="-2" pref="28" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtNomeLogin" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="29" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSenhaLogin" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="31" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnCancelarLogin" alignment="3" min="-2" pref="42" max="-2" attributes="0"/> + <Component id="btnEntrarLogin" alignment="3" min="-2" pref="42" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="24" 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="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" 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"> + <EmptySpace min="-2" pref="22" max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace pref="20" max="32767" 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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Autenticação de Usuário"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome de Usuário:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Senha:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtNomeLogin"> + </Component> + <Component class="javax.swing.JPasswordField" name="txtSenhaLogin"> + </Component> + <Component class="javax.swing.JButton" name="btnCancelarLogin"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/cancel_small.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="btnCancelarLoginActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnEntrarLogin"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="14" style="1"/> + </Property> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/user_small.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Entrar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnEntrarLoginActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Dica: Credenciais iniciais padrão são: admin@admin e senha: admin"/> + </Properties> + </Component> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormLogin.java b/src/br/com/projeto/view/FormLogin.java new file mode 100644 index 0000000..f213c16 --- /dev/null +++ b/src/br/com/projeto/view/FormLogin.java @@ -0,0 +1,233 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import br.com.projeto.dao.FuncionarioDao; +import br.com.projeto.dao.OptionsDao; +import com.bulenkov.darcula.DarculaLaf; +import java.io.IOException; +import java.sql.SQLException; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JOptionPane; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.plaf.basic.BasicLookAndFeel; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormLogin extends javax.swing.JFrame { + + /** + * Creates new form formLogin + */ + public FormLogin() { + 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(); + txtNomeLogin = new javax.swing.JTextField(); + txtSenhaLogin = new javax.swing.JPasswordField(); + btnCancelarLogin = new javax.swing.JButton(); + btnEntrarLogin = new javax.swing.JButton(); + jLabel4 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setResizable(false); + + jPanel1.setBackground(new java.awt.Color(0, 0, 0)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Autenticação de Usuário"); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addGap(22, 22, 22) + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(20, Short.MAX_VALUE)) + ); + + jLabel2.setText("Nome de Usuário:"); + + jLabel3.setText("Senha:"); + + btnCancelarLogin.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnCancelarLogin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/cancel_small.png"))); // NOI18N + btnCancelarLogin.setText("Cancelar"); + btnCancelarLogin.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnCancelarLoginActionPerformed(evt); + } + }); + + btnEntrarLogin.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N + btnEntrarLogin.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/user_small.png"))); // NOI18N + btnEntrarLogin.setText("Entrar"); + btnEntrarLogin.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnEntrarLoginActionPerformed(evt); + } + }); + + jLabel4.setText("Dica: Credenciais iniciais padrão são: admin@admin e senha: admin"); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGap(121, 121, 121) + .addComponent(btnEntrarLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(34, 34, 34) + .addComponent(btnCancelarLogin)) + .addGroup(layout.createSequentialGroup() + .addGap(58, 58, 58) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel3) + .addComponent(jLabel2)) + .addGap(18, 18, 18) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtNomeLogin) + .addComponent(txtSenhaLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 272, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addComponent(jLabel4)))) + .addContainerGap(68, 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) + .addGap(28, 28, 28) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtNomeLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel2)) + .addGap(29, 29, 29) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel3) + .addComponent(txtSenhaLogin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(39, 39, 39) + .addComponent(jLabel4) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnCancelarLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnEntrarLogin, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(24, 24, 24)) + ); + + pack(); + setLocationRelativeTo(null); + }// </editor-fold>//GEN-END:initComponents + + private void btnEntrarLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEntrarLoginActionPerformed + String email, senha; + email = txtNomeLogin.getText(); + senha = txtSenhaLogin.getText(); + FuncionarioDao dao = new FuncionarioDao(); + try { + dao.efetuarLogin(email,senha); + } catch (IOException ex) { + Logger.getLogger(FormLogin.class.getName()).log(Level.SEVERE, null, ex); + } + dispose(); //fecha formulário + }//GEN-LAST:event_btnEntrarLoginActionPerformed + + private void btnCancelarLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarLoginActionPerformed + int op = JOptionPane.showConfirmDialog(null, "Tem certeza que deseja sair?"); + if(op == 0) { + System.exit(0); + } else if (op ==2) { + JOptionPane.showMessageDialog(null, "Cancelado"); + } + }//GEN-LAST:event_btnCancelarLoginActionPerformed + + /** + * @param args the command line arguments + */ + public static void main(String args[]) throws UnsupportedLookAndFeelException, SQLException { + /* 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 + */ + + OptionsDao optionsdao = new OptionsDao(); + String temaPadrao = optionsdao.retornaOption(30); + if (temaPadrao.equals("Tema Claro")) { + 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(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormLogin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + + } else if (temaPadrao.equals("Tema Escuro")) { + BasicLookAndFeel darcula = new DarculaLaf(); + UIManager.setLookAndFeel(darcula); + } + + + //</editor-fold> + //</editor-fold> + + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormLogin().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnCancelarLogin; + private javax.swing.JButton btnEntrarLogin; + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JPanel jPanel1; + private javax.swing.JTextField txtNomeLogin; + private javax.swing.JPasswordField txtSenhaLogin; + // End of variables declaration//GEN-END:variables +} diff --git a/src/br/com/projeto/view/FormMenu.form b/src/br/com/projeto/view/FormMenu.form new file mode 100644 index 0000000..1fbf862 --- /dev/null +++ b/src/br/com/projeto/view/FormMenu.form @@ -0,0 +1,296 @@ +<?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.JTextField" name="txtlogado"> + </Component> + <Menu class="javax.swing.JMenuBar" name="jMenuBar1"> + <SubComponents> + <Menu class="javax.swing.JMenu" name="jMenu1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/leitor.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Usuários"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem9"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+U"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de usuários"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem9ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu2"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/funcionario.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Funcionários"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem1"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+F"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de Funcionários"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem1ActionPerformed"/> + </Events> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem10"> + <Properties> + <Property name="text" type="java.lang.String" value="Alterar Funcionário"/> + </Properties> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu3"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/provider.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Fornecedores"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem2"> + <Properties> + <Property name="text" type="java.lang.String" value="Controle de Forncedores"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem2ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu4"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/boook.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Livraria"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem3"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+L"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de Livros"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu5"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/bookloc.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Empréstimos"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem4"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+E"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de Empréstimos"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem4ActionPerformed"/> + </Events> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem5"> + <Properties> + <Property name="text" type="java.lang.String" value="Histórico de Empréstimos"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem6"> + <Properties> + <Property name="text" type="java.lang.String" value="Controle de Multas"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu6"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/config.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Configurações"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem7"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+C"/> + </Property> + <Property name="text" type="java.lang.String" value="Configurarações"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem7ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu7"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem8"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+S"/> + </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="jMenuItem8ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + </SubComponents> + </Menu> + </NonVisualComponents> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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="1" attributes="0"> + <EmptySpace min="0" pref="357" max="32767" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" 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" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLogado" min="-2" pref="143" max="-2" attributes="0"/> + <EmptySpace pref="569" max="32767" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtIdLogado" min="-2" pref="29" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="109" 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 pref="10" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtIdLogado" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblLogado" alignment="1" min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Logado como:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblLogado"> + </Component> + <Component class="javax.swing.JTextField" name="txtIdLogado"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="enabled" type="boolean" value="false"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Id:"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormMenu.java b/src/br/com/projeto/view/FormMenu.java new file mode 100644 index 0000000..a954da9 --- /dev/null +++ b/src/br/com/projeto/view/FormMenu.java @@ -0,0 +1,379 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormMenu extends javax.swing.JFrame { + public String usuarioLogado; + public int idLogado; + /** + * Creates new form formMenu + */ + public FormMenu() { + 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() { + + txtlogado = new javax.swing.JTextField(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + lblLogado = new javax.swing.JLabel(); + txtIdLogado = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jMenuBar1 = new javax.swing.JMenuBar(); + jMenu1 = new javax.swing.JMenu(); + jMenuItem9 = new javax.swing.JMenuItem(); + jMenu2 = new javax.swing.JMenu(); + jMenuItem1 = new javax.swing.JMenuItem(); + jMenuItem10 = new javax.swing.JMenuItem(); + jMenu3 = new javax.swing.JMenu(); + jMenuItem2 = new javax.swing.JMenuItem(); + jMenu4 = new javax.swing.JMenu(); + jMenuItem3 = new javax.swing.JMenuItem(); + jMenu5 = new javax.swing.JMenu(); + jMenuItem4 = new javax.swing.JMenuItem(); + jMenuItem5 = new javax.swing.JMenuItem(); + jMenuItem6 = new javax.swing.JMenuItem(); + jMenu6 = new javax.swing.JMenu(); + jMenuItem7 = new javax.swing.JMenuItem(); + jMenu7 = new javax.swing.JMenu(); + jMenuItem8 = new javax.swing.JMenuItem(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jLabel1.setText("Logado como:"); + + txtIdLogado.setEditable(false); + txtIdLogado.setEnabled(false); + txtIdLogado.setFocusable(false); + txtIdLogado.setOpaque(false); + + jLabel2.setText("Id:"); + + 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(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 569, Short.MAX_VALUE) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(109, 109, 109)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(10, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblLogado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jLabel2))) + .addGap(10, 10, 10)) + ); + + jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/leitor.png"))); // NOI18N + jMenu1.setText("Usuários"); + jMenu1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem9.setText("Controle de usuários"); + jMenuItem9.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem9ActionPerformed(evt); + } + }); + jMenu1.add(jMenuItem9); + + jMenuBar1.add(jMenu1); + + jMenu2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/funcionario.png"))); // NOI18N + jMenu2.setText("Funcionários"); + jMenu2.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem1.setText("Controle de Funcionários"); + jMenuItem1.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem1ActionPerformed(evt); + } + }); + jMenu2.add(jMenuItem1); + + jMenuItem10.setText("Alterar Funcionário"); + jMenu2.add(jMenuItem10); + + jMenuBar1.add(jMenu2); + + jMenu3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/provider.png"))); // NOI18N + jMenu3.setText("Fornecedores"); + jMenu3.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem2.setText("Controle de Forncedores"); + jMenuItem2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem2ActionPerformed(evt); + } + }); + jMenu3.add(jMenuItem2); + + jMenuBar1.add(jMenu3); + + jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/boook.png"))); // NOI18N + jMenu4.setText("Livraria"); + jMenu4.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem3.setText("Controle de Livros"); + jMenuItem3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem3ActionPerformed(evt); + } + }); + jMenu4.add(jMenuItem3); + + jMenuBar1.add(jMenu4); + + jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/bookloc.png"))); // NOI18N + jMenu5.setText("Empréstimos"); + jMenu5.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem4.setText("Controle de Empréstimos"); + jMenuItem4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem4ActionPerformed(evt); + } + }); + jMenu5.add(jMenuItem4); + + jMenuItem5.setText("Histórico de Empréstimos"); + jMenu5.add(jMenuItem5); + + jMenuItem6.setText("Controle de Multas"); + jMenuItem6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem6ActionPerformed(evt); + } + }); + jMenu5.add(jMenuItem6); + + jMenuBar1.add(jMenu5); + + jMenu6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/config.png"))); // NOI18N + jMenu6.setText("Configurações"); + jMenu6.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem7.setText("Configurarações"); + jMenuItem7.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem7ActionPerformed(evt); + } + }); + jMenu6.add(jMenuItem7); + + jMenuBar1.add(jMenu6); + + jMenu7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N + jMenu7.setText("Sair"); + jMenu7.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem8.setText("Sair"); + jMenuItem8.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem8ActionPerformed(evt); + } + }); + jMenu7.add(jMenuItem8); + + jMenuBar1.add(jMenu7); + + setJMenuBar(jMenuBar1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 357, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jMenuItem6ActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + this.setExtendedState(this.MAXIMIZED_BOTH); + lblLogado.setText(usuarioLogado); + String logId = String.valueOf(idLogado); + txtIdLogado.setText(logId);// Int(idLogado); + txtlogado.setText(usuarioLogado); + PrintWriter out; + try { + out = new PrintWriter(new FileWriter("C:\\Librography\\LoggedIn")); + txtIdLogado.write(out); + } catch (IOException ex) { + Logger.getLogger(FormMenu.class.getName()).log(Level.SEVERE, null, ex); + }//totxt + + this.setVisible(true); + }//GEN-LAST:event_formWindowActivated + + private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed + // TODO add your handling code here: + FormLeitor leitor = new FormLeitor(); + //centralizar + leitor.pack(); + leitor.setLocationRelativeTo(null); + leitor.setVisible(true); + }//GEN-LAST:event_jMenuItem9ActionPerformed + + private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed + FormFuncionarios ctrlFuncWd = new FormFuncionarios(); + //centralizar + ctrlFuncWd.pack(); + ctrlFuncWd.setLocationRelativeTo(null); + ctrlFuncWd.setVisible(true); + }//GEN-LAST:event_jMenuItem1ActionPerformed + + private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed + + FormFornecedores ctrlForn = new FormFornecedores(); + //centralizar + ctrlForn.pack(); + ctrlForn.setLocationRelativeTo(null); + ctrlForn.setVisible(true); + }//GEN-LAST:event_jMenuItem2ActionPerformed + + private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed + FormLivros BookForn = new FormLivros(); + //centralizar + BookForn.pack(); + BookForn.setLocationRelativeTo(null); + BookForn.setVisible(true); + }//GEN-LAST:event_jMenuItem3ActionPerformed + + private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed + FormOptions optionsForn = new FormOptions(); + //centralizar + optionsForn.pack(); + optionsForn.setLocationRelativeTo(null); + optionsForn.setVisible(true); + }//GEN-LAST:event_jMenuItem7ActionPerformed + + private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed + FormEmprestimos emprestForn = new FormEmprestimos(); + //centralizar + emprestForn.pack(); + emprestForn.setLocationRelativeTo(null); + emprestForn.setVisible(true); + }//GEN-LAST:event_jMenuItem4ActionPerformed + + private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed + super.dispose(); + }//GEN-LAST:event_jMenuItem8ActionPerformed + + /** + * @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(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormMenu.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormMenu().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JMenu jMenu1; + private javax.swing.JMenu jMenu2; + private javax.swing.JMenu jMenu3; + private javax.swing.JMenu jMenu4; + private javax.swing.JMenu jMenu5; + private javax.swing.JMenu jMenu6; + private javax.swing.JMenu jMenu7; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JMenuItem jMenuItem1; + private javax.swing.JMenuItem jMenuItem10; + private javax.swing.JMenuItem jMenuItem2; + private javax.swing.JMenuItem jMenuItem3; + private javax.swing.JMenuItem jMenuItem4; + private javax.swing.JMenuItem jMenuItem5; + private javax.swing.JMenuItem jMenuItem6; + private javax.swing.JMenuItem jMenuItem7; + private javax.swing.JMenuItem jMenuItem8; + private javax.swing.JMenuItem jMenuItem9; + private javax.swing.JPanel jPanel1; + private javax.swing.JLabel lblLogado; + private javax.swing.JTextField txtIdLogado; + private javax.swing.JTextField txtlogado; + // End of variables declaration//GEN-END:variables +} diff --git a/src/br/com/projeto/view/FormMenuAtendente.form b/src/br/com/projeto/view/FormMenuAtendente.form new file mode 100644 index 0000000..d1fd56f --- /dev/null +++ b/src/br/com/projeto/view/FormMenuAtendente.form @@ -0,0 +1,222 @@ +<?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.JTextField" name="txtlogado"> + </Component> + <Menu class="javax.swing.JMenuBar" name="jMenuBar1"> + <SubComponents> + <Menu class="javax.swing.JMenu" name="jMenu1"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/leitor.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Usuários"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem9"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+U"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de usuários"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem9ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu4"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/boook.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Livraria"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem3"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+L"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de Livros"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu5"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/bookloc.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Empréstimos"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem4"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+E"/> + </Property> + <Property name="text" type="java.lang.String" value="Controle de Empréstimos"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem4ActionPerformed"/> + </Events> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem5"> + <Properties> + <Property name="text" type="java.lang.String" value="Histórico de Empréstimos"/> + </Properties> + </MenuItem> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem6"> + <Properties> + <Property name="text" type="java.lang.String" value="Controle de Multas"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem6ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + <Menu class="javax.swing.JMenu" name="jMenu7"> + <Properties> + <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> + <Image iconType="3" name="/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"/> + </Property> + <Property name="text" type="java.lang.String" value="Sair"/> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Segoe UI" size="18" style="1"/> + </Property> + </Properties> + <SubComponents> + <MenuItem class="javax.swing.JMenuItem" name="jMenuItem8"> + <Properties> + <Property name="accelerator" type="javax.swing.KeyStroke" editor="org.netbeans.modules.form.editors.KeyStrokeEditor"> + <KeyStroke key="Ctrl+S"/> + </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="jMenuItem8ActionPerformed"/> + </Events> + </MenuItem> + </SubComponents> + </Menu> + </SubComponents> + </Menu> + </NonVisualComponents> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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="1" attributes="0"> + <EmptySpace min="0" pref="357" max="32767" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" 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" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLogado" min="-2" pref="143" max="-2" attributes="0"/> + <EmptySpace pref="569" max="32767" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtIdLogado" min="-2" pref="29" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="109" 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 pref="10" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtIdLogado" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="lblLogado" alignment="1" min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Logado como:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblLogado"> + </Component> + <Component class="javax.swing.JTextField" name="txtIdLogado"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="enabled" type="boolean" value="false"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + </Component> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Id:"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormMenuAtendente.java b/src/br/com/projeto/view/FormMenuAtendente.java new file mode 100644 index 0000000..ffe2dbf --- /dev/null +++ b/src/br/com/projeto/view/FormMenuAtendente.java @@ -0,0 +1,298 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.logging.Level; +import java.util.logging.Logger; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormMenuAtendente extends javax.swing.JFrame { + public String usuarioLogado; + public int idLogado; + /** + * Creates new form formMenu + */ + public FormMenuAtendente() { + 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() { + + txtlogado = new javax.swing.JTextField(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + lblLogado = new javax.swing.JLabel(); + txtIdLogado = new javax.swing.JTextField(); + jLabel2 = new javax.swing.JLabel(); + jMenuBar1 = new javax.swing.JMenuBar(); + jMenu1 = new javax.swing.JMenu(); + jMenuItem9 = new javax.swing.JMenuItem(); + jMenu4 = new javax.swing.JMenu(); + jMenuItem3 = new javax.swing.JMenuItem(); + jMenu5 = new javax.swing.JMenu(); + jMenuItem4 = new javax.swing.JMenuItem(); + jMenuItem5 = new javax.swing.JMenuItem(); + jMenuItem6 = new javax.swing.JMenuItem(); + jMenu7 = new javax.swing.JMenu(); + jMenuItem8 = new javax.swing.JMenuItem(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jLabel1.setText("Logado como:"); + + txtIdLogado.setEditable(false); + txtIdLogado.setEnabled(false); + txtIdLogado.setFocusable(false); + txtIdLogado.setOpaque(false); + + jLabel2.setText("Id:"); + + 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(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 569, Short.MAX_VALUE) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(109, 109, 109)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(10, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtIdLogado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblLogado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(jLabel2))) + .addGap(10, 10, 10)) + ); + + jMenu1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/leitor.png"))); // NOI18N + jMenu1.setText("Usuários"); + jMenu1.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem9.setText("Controle de usuários"); + jMenuItem9.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem9ActionPerformed(evt); + } + }); + jMenu1.add(jMenuItem9); + + jMenuBar1.add(jMenu1); + + jMenu4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/boook.png"))); // NOI18N + jMenu4.setText("Livraria"); + jMenu4.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem3.setText("Controle de Livros"); + jMenuItem3.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem3ActionPerformed(evt); + } + }); + jMenu4.add(jMenuItem3); + + jMenuBar1.add(jMenu4); + + jMenu5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/bookloc.png"))); // NOI18N + jMenu5.setText("Empréstimos"); + jMenu5.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem4.setText("Controle de Empréstimos"); + jMenuItem4.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem4ActionPerformed(evt); + } + }); + jMenu5.add(jMenuItem4); + + jMenuItem5.setText("Histórico de Empréstimos"); + jMenu5.add(jMenuItem5); + + jMenuItem6.setText("Controle de Multas"); + jMenuItem6.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem6ActionPerformed(evt); + } + }); + jMenu5.add(jMenuItem6); + + jMenuBar1.add(jMenu5); + + jMenu7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png"))); // NOI18N + jMenu7.setText("Sair"); + jMenu7.setFont(new java.awt.Font("Segoe UI", 1, 18)); // NOI18N + + jMenuItem8.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK)); + jMenuItem8.setText("Sair"); + jMenuItem8.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jMenuItem8ActionPerformed(evt); + } + }); + jMenu7.add(jMenuItem8); + + jMenuBar1.add(jMenu7); + + setJMenuBar(jMenuBar1); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + layout.setVerticalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(0, 357, Short.MAX_VALUE) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + ); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_jMenuItem6ActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + // TODO add your handling code here: + this.setExtendedState(this.MAXIMIZED_BOTH); + lblLogado.setText(usuarioLogado); + //System.out.println(idLogado); + String logId = String.valueOf(idLogado); +// int number = Integer.parseInt(idLogado); + txtIdLogado.setText(logId);// Int(idLogado); + txtlogado.setText(usuarioLogado); + PrintWriter out; + try { + out = new PrintWriter(new FileWriter("C:\\Librography\\LoggedIn")); + txtIdLogado.write(out); + } catch (IOException ex) { + Logger.getLogger(FormMenuAtendente.class.getName()).log(Level.SEVERE, null, ex); + }//totxt//totxt + + this.setVisible(true); + }//GEN-LAST:event_formWindowActivated + + private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed + FormLivros BookForn = new FormLivros(); + //centralizar + BookForn.pack(); + BookForn.setLocationRelativeTo(null); + BookForn.setVisible(true); + }//GEN-LAST:event_jMenuItem3ActionPerformed + + private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed + FormEmprestimos emprestForn = new FormEmprestimos(); + //centralizar + emprestForn.pack(); + emprestForn.setLocationRelativeTo(null); + emprestForn.setVisible(true); + }//GEN-LAST:event_jMenuItem4ActionPerformed + + private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed + super.dispose(); + }//GEN-LAST:event_jMenuItem8ActionPerformed + + private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed + // TODO add your handling code here: + FormLeitor leitor = new FormLeitor(); + //centralizar + leitor.pack(); + leitor.setLocationRelativeTo(null); + leitor.setVisible(true); + }//GEN-LAST:event_jMenuItem9ActionPerformed + + /** + * @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(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormMenuAtendente.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormMenuAtendente().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; + private javax.swing.JMenu jMenu1; + private javax.swing.JMenu jMenu4; + private javax.swing.JMenu jMenu5; + private javax.swing.JMenu jMenu7; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JMenuItem jMenuItem3; + private javax.swing.JMenuItem jMenuItem4; + private javax.swing.JMenuItem jMenuItem5; + private javax.swing.JMenuItem jMenuItem6; + private javax.swing.JMenuItem jMenuItem8; + private javax.swing.JMenuItem jMenuItem9; + private javax.swing.JPanel jPanel1; + private javax.swing.JLabel lblLogado; + private javax.swing.JTextField txtIdLogado; + private javax.swing.JTextField txtlogado; + // End of variables declaration//GEN-END:variables +} diff --git a/src/br/com/projeto/view/FormMenuUsuario.form b/src/br/com/projeto/view/FormMenuUsuario.form new file mode 100644 index 0000000..f91b7cc --- /dev/null +++ b/src/br/com/projeto/view/FormMenuUsuario.form @@ -0,0 +1,606 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> + <NonVisualComponents> + <Component class="javax.swing.JTextField" name="txtlogado"> + </Component> + <Menu class="javax.swing.JMenuBar" name="jMenuBar1"> + </Menu> + </NonVisualComponents> + <Properties> + <Property name="defaultCloseOperation" type="int" value="2"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/> + </Property> + <Property name="undecorated" type="boolean" value="true"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="false"/> + </SyntheticProperties> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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,105,0,0,4,23"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="3" fill="0" ipadX="601" ipadY="8" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/> + </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="jLabel1" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLogado" min="-2" pref="143" max="-2" attributes="0"/> + <EmptySpace pref="607" 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="14" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="lblLogado" alignment="1" min="-2" pref="20" max="-2" attributes="0"/> + <Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="10" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Logado como:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblLogado"> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Id:"/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="20" insetsLeft="61" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/> + </Constraint> + </Constraints> + </Component> + <Component class="javax.swing.JTextField" name="txtIdLogado"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="enabled" type="boolean" value="false"/> + <Property name="focusable" type="boolean" value="false"/> + <Property name="opaque" type="boolean" value="false"/> + </Properties> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="2" gridY="2" gridWidth="4" gridHeight="2" fill="0" ipadX="15" ipadY="0" insetsTop="20" insetsLeft="6" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/> + </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="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="0" gridWidth="6" gridHeight="1" fill="0" ipadX="721" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel3" pref="945" 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="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace max="32767" 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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Terminal de Consulta"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="toolTipText" type="java.lang.String" value=""/> + </Properties> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> + <GridBagConstraints gridX="0" gridY="1" gridWidth="3" gridHeight="1" fill="0" ipadX="9" ipadY="12" insetsTop="10" insetsLeft="17" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/> + </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"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jScrollPane5" min="-2" pref="366" max="-2" attributes="0"/> + <Group type="102" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtBuscaLivro" min="-2" pref="242" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace min="-2" pref="25" 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="jLabel8" min="-2" max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="499" max="-2" attributes="0"/> + </Group> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="9" max="-2" attributes="0"/> + <Component id="txtPrazoEntrega" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="9" max="32767" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="lblImagem" min="-2" pref="126" max="-2" attributes="0"/> + <EmptySpace type="separate" 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 max="-2" attributes="0"/> + <Component id="txtBookId" min="-2" pref="93" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel10" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtISBN" min="-2" pref="178" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel11" min="-2" max="-2" attributes="0"/> + <Component id="jLabel23" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtTituloSelect" alignment="0" min="-2" pref="313" max="-2" attributes="0"/> + <Component id="txtStatus" alignment="1" min="-2" pref="313" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel20" min="-2" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="1" attributes="0"> + <Component id="lblAutor" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="lblEditora" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Component id="jLabel19" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Component id="txtEditora" alignment="0" max="32767" attributes="0"/> + <Component id="txtAutor" alignment="0" max="32767" attributes="0"/> + <Component id="txtSerie" alignment="0" min="-2" pref="313" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="3" max="-2" attributes="0"/> + <Component id="txtIdioma" min="-2" pref="154" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="lblAno" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtAno" min="-2" pref="43" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="lblEdicao" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtEdicao" min="-2" pref="45" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtTituloSelect" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel23" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtStatus" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Group type="103" alignment="1" groupAlignment="3" attributes="0"> + <Component id="txtBookId" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="jLabel10" alignment="1" min="-2" max="-2" attributes="0"/> + <Component id="txtISBN" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtAutor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblAutor" 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="txtEditora" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblEditora" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="20" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel19" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSerie" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="11" max="-2" attributes="0"/> + <Component id="lblImagem" min="-2" pref="190" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="lblEdicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEdicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel20" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtIdioma" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="lblAno" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtAno" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="8" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="txtPrazoEntrega" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jScrollPane3" min="-2" pref="106" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtBuscaLivro" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="jScrollPane5" min="-2" pref="398" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="18" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JTextField" name="txtBuscaLivro"> + <Events> + <EventHandler event="keyReleased" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtBuscaLivroKeyReleased"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane5"> + <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="tabelaLivrosFiltro"> + <Properties> + <Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor"> + <Table columnCount="7" rowCount="0"> + <Column editable="false" title="Disponibilidade" type="java.lang.Object"/> + <Column editable="false" title="Título" type="java.lang.Object"/> + <Column editable="true" title="Observações" type="java.lang.Object"/> + <Column editable="false" title="Localização" type="java.lang.Object"/> + <Column editable="false" title="Cod" type="java.lang.Object"/> + <Column editable="false" title="ISBN" type="java.lang.Object"/> + <Column editable="false" title="Emprestado" type="java.lang.Object"/> + </Table> + </Property> + <Property name="autoResizeMode" type="int" value="0"/> + <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="tabelaLivrosFiltroMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_AddingCodePost" type="java.lang.String" value="tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(0)).setPreferredWidth(34); tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(1)).setPreferredWidth(170); tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(2)).setPreferredWidth(150); tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(3)).setPreferredWidth(140);"/> + <AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JTable() /* { @Override public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){ Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex); Object value = getModel().getValueAt(rowIndex,columnIndex); System.out.println("value ===" +value); if(columnIndex == 6){ if(value.equals("true")) { componenet.setBackground(Color.RED); componenet.setForeground(Color.GREEN); } if(value.equals("false")){ componenet.setBackground(Color.GREEN); componenet.setForeground(Color.RED); } }else { componenet.setBackground(Color.WHITE); componenet.setForeground(Color.BLACK); } return componenet; } } */ "/> + </AuxValues> + </Component> + </SubComponents> + </Container> + <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/book_cover.png"/> + </Property> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> + <EtchetBorder bevelType="0"> + <Color PropertyName="highlight" blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/> + <Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/> + </EtchetBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel23"> + <Properties> + <Property name="text" type="java.lang.String" value="Título:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="text" type="java.lang.String" value="Status:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTituloSelect"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtTituloSelectActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtStatus"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtStatusActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtBookId"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="text" type="java.lang.String" value="<html>ISBN/<br>ISSN: "/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtISBN"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtISBNActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtAutor"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblAutor"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Autor:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEditora"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Editora:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEditora"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtSerie"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel19"> + <Properties> + <Property name="text" type="java.lang.String" value="Série:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel20"> + <Properties> + <Property name="text" type="java.lang.String" value="Idioma:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtIdioma"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtIdiomaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Localização"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPrazoEntrega"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtPrazoEntregaActionPerformed"/> + </Events> + </Component> + <Container class="javax.swing.JScrollPane" name="jScrollPane3"> + <AuxValues> + <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> + <SubComponents> + <Component class="javax.swing.JTextArea" name="txtObservacoes"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="columns" type="int" value="20"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <Property name="rows" type="int" value="5"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="text" type="java.lang.String" value="Ficha Técnica:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtEdicao"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JFormattedTextField" name="txtAno"> + <Properties> + <Property name="editable" type="boolean" value="false"/> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="66" green="66" red="66" type="rgb"/> + </Property> + <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="lblAno"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Ano:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="lblEdicao"> + <Properties> + <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> + <Font name="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Edição:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="text" type="java.lang.String" value="Livro ID:"/> + </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="Tahoma" size="12" style="0"/> + </Property> + <Property name="text" type="java.lang.String" value="Filtrar Livro:"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormMenuUsuario.java b/src/br/com/projeto/view/FormMenuUsuario.java new file mode 100644 index 0000000..e76b190 --- /dev/null +++ b/src/br/com/projeto/view/FormMenuUsuario.java @@ -0,0 +1,692 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import br.com.projeto.dao.EmprestimoDao; +import br.com.projeto.dao.LivroDao; +import br.com.projeto.model.Livro; +import java.awt.Image; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.ImageIcon; +import javax.swing.table.DefaultTableModel; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormMenuUsuario extends javax.swing.JFrame { + + public String usuarioLogado; + public int idLogado; + + /** + * Creates new form formMenu + */ + public FormMenuUsuario() { + 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() { + java.awt.GridBagConstraints gridBagConstraints; + + txtlogado = new javax.swing.JTextField(); + jPanel1 = new javax.swing.JPanel(); + jLabel1 = new javax.swing.JLabel(); + lblLogado = new javax.swing.JLabel(); + jLabel2 = new javax.swing.JLabel(); + txtIdLogado = new javax.swing.JTextField(); + jPanel2 = new javax.swing.JPanel(); + jLabel3 = new javax.swing.JLabel(); + jPanel3 = new javax.swing.JPanel(); + txtBuscaLivro = new javax.swing.JTextField(); + jScrollPane5 = new javax.swing.JScrollPane(); + tabelaLivrosFiltro = new javax.swing.JTable() + /* + { + @Override + public Component prepareRenderer (TableCellRenderer renderer, int rowIndex, int columnIndex){ + Component componenet = super.prepareRenderer(renderer, rowIndex, columnIndex); + Object value = getModel().getValueAt(rowIndex,columnIndex); + + System.out.println("value ===" +value); + if(columnIndex == 6){ + if(value.equals("true")) + { + componenet.setBackground(Color.RED); + componenet.setForeground(Color.GREEN); + } + if(value.equals("false")){ + componenet.setBackground(Color.GREEN); + componenet.setForeground(Color.RED); + } + }else { + componenet.setBackground(Color.WHITE); + componenet.setForeground(Color.BLACK); + } + return componenet; + } + + } + */ + ; + lblImagem = new javax.swing.JLabel(); + jLabel23 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + txtTituloSelect = new javax.swing.JTextField(); + txtStatus = new javax.swing.JTextField(); + txtBookId = new javax.swing.JTextField(); + jLabel10 = new javax.swing.JLabel(); + txtISBN = new javax.swing.JTextField(); + txtAutor = new javax.swing.JTextField(); + lblAutor = new javax.swing.JLabel(); + lblEditora = new javax.swing.JLabel(); + txtEditora = new javax.swing.JTextField(); + txtSerie = new javax.swing.JTextField(); + jLabel19 = new javax.swing.JLabel(); + jLabel20 = new javax.swing.JLabel(); + txtIdioma = new javax.swing.JTextField(); + jLabel4 = new javax.swing.JLabel(); + txtPrazoEntrega = new javax.swing.JTextField(); + jScrollPane3 = new javax.swing.JScrollPane(); + txtObservacoes = new javax.swing.JTextArea(); + jLabel8 = new javax.swing.JLabel(); + txtEdicao = new javax.swing.JTextField(); + txtAno = new javax.swing.JFormattedTextField(); + lblAno = new javax.swing.JLabel(); + lblEdicao = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jMenuBar1 = new javax.swing.JMenuBar(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setForeground(java.awt.Color.darkGray); + setUndecorated(true); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + getContentPane().setLayout(new java.awt.GridBagLayout()); + + jLabel1.setText("Logado como:"); + + 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(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLogado, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(607, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() + .addContainerGap(14, Short.MAX_VALUE) + .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(lblLogado, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING)) + .addGap(10, 10, 10)) + ); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridheight = 3; + gridBagConstraints.ipadx = 601; + gridBagConstraints.ipady = 8; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0); + getContentPane().add(jPanel1, gridBagConstraints); + + jLabel2.setText("Id:"); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(20, 61, 0, 0); + getContentPane().add(jLabel2, gridBagConstraints); + + txtIdLogado.setEditable(false); + txtIdLogado.setEnabled(false); + txtIdLogado.setFocusable(false); + txtIdLogado.setOpaque(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 2; + gridBagConstraints.gridwidth = 4; + gridBagConstraints.gridheight = 2; + gridBagConstraints.ipadx = 15; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(20, 6, 0, 0); + getContentPane().add(txtIdLogado, gridBagConstraints); + + jPanel2.setBackground(new java.awt.Color(0, 0, 0)); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); + jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel3.setText("Terminal de Consulta"); + + 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() + .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 945, Short.MAX_VALUE) + .addContainerGap()) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridwidth = 6; + gridBagConstraints.ipadx = 721; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + getContentPane().add(jPanel2, gridBagConstraints); + + jPanel3.setToolTipText(""); + + txtBuscaLivro.addKeyListener(new java.awt.event.KeyAdapter() { + public void keyReleased(java.awt.event.KeyEvent evt) { + txtBuscaLivroKeyReleased(evt); + } + }); + + tabelaLivrosFiltro.setModel(new javax.swing.table.DefaultTableModel( + new Object [][] { + + }, + new String [] { + "Disponibilidade", "Título", "Observações", "Localização", "Cod", "ISBN", "Emprestado" + } + ) { + boolean[] canEdit = new boolean [] { + false, false, true, false, false, false, false + }; + + public boolean isCellEditable(int rowIndex, int columnIndex) { + return canEdit [columnIndex]; + } + }); + tabelaLivrosFiltro.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF); + tabelaLivrosFiltro.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + tabelaLivrosFiltroMouseClicked(evt); + } + }); + jScrollPane5.setViewportView(tabelaLivrosFiltro); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(0)).setPreferredWidth(34); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(1)).setPreferredWidth(170); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(2)).setPreferredWidth(150); + tabelaLivrosFiltro.getColumn(tabelaLivrosFiltro.getColumnName(3)).setPreferredWidth(140); + + lblImagem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagens/book_cover.png"))); // NOI18N + lblImagem.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.white, java.awt.Color.darkGray)); + + jLabel23.setText("Título:"); + + jLabel11.setText("Status:"); + + txtTituloSelect.setEditable(false); + txtTituloSelect.setForeground(new java.awt.Color(102, 102, 102)); + txtTituloSelect.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtTituloSelectActionPerformed(evt); + } + }); + + txtStatus.setEditable(false); + txtStatus.setForeground(new java.awt.Color(102, 102, 102)); + txtStatus.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtStatusActionPerformed(evt); + } + }); + + txtBookId.setEditable(false); + txtBookId.setForeground(new java.awt.Color(102, 102, 102)); + + jLabel10.setText("<html>ISBN/<br>ISSN:\n"); + + txtISBN.setEditable(false); + txtISBN.setForeground(new java.awt.Color(102, 102, 102)); + txtISBN.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtISBNActionPerformed(evt); + } + }); + + txtAutor.setEditable(false); + txtAutor.setForeground(new java.awt.Color(102, 102, 102)); + + lblAutor.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblAutor.setText("Autor:"); + + lblEditora.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblEditora.setText("Editora:"); + + txtEditora.setEditable(false); + txtEditora.setForeground(new java.awt.Color(102, 102, 102)); + + txtSerie.setEditable(false); + txtSerie.setForeground(new java.awt.Color(102, 102, 102)); + + jLabel19.setText("Série:"); + + jLabel20.setText("Idioma:"); + + txtIdioma.setEditable(false); + txtIdioma.setForeground(new java.awt.Color(102, 102, 102)); + txtIdioma.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtIdiomaActionPerformed(evt); + } + }); + + jLabel4.setText("Localização"); + + txtPrazoEntrega.setEditable(false); + txtPrazoEntrega.setForeground(new java.awt.Color(102, 102, 102)); + txtPrazoEntrega.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtPrazoEntregaActionPerformed(evt); + } + }); + + txtObservacoes.setEditable(false); + txtObservacoes.setColumns(20); + txtObservacoes.setForeground(new java.awt.Color(102, 102, 102)); + txtObservacoes.setRows(5); + jScrollPane3.setViewportView(txtObservacoes); + + jLabel8.setText("Ficha Técnica:"); + + txtEdicao.setEditable(false); + txtEdicao.setForeground(new java.awt.Color(102, 102, 102)); + + txtAno.setEditable(false); + txtAno.setForeground(new java.awt.Color(102, 102, 102)); + try { + txtAno.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####"))); + } catch (java.text.ParseException ex) { + ex.printStackTrace(); + } + + lblAno.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblAno.setText("Ano:"); + + lblEdicao.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + lblEdicao.setText("Edição:"); + + jLabel7.setText("Livro ID:"); + + jLabel5.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N + jLabel5.setText("Filtrar Livro:"); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(16, 16, 16) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtBuscaLivro, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(25, 25, 25) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel8) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 499, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(0, 0, Short.MAX_VALUE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel4) + .addGap(9, 9, 9) + .addComponent(txtPrazoEntrega)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(0, 9, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtBookId, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel11) + .addComponent(jLabel23)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtTituloSelect, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtStatus, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE))))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addComponent(jLabel20) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(lblAutor) + .addComponent(lblEditora)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(11, 11, 11) + .addComponent(jLabel19))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(txtEditora, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtAutor, javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtSerie, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(3, 3, 3) + .addComponent(txtIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(lblAno) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(lblEdicao) + .addGap(18, 18, 18) + .addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE))))))) + .addContainerGap()) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtTituloSelect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel23)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel11) + .addComponent(txtStatus, 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.TRAILING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtBookId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7)) + .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtISBN, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtAutor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblAutor)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtEditora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblEditora)) + .addGap(20, 20, 20) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel19) + .addComponent(txtSerie, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addGap(11, 11, 11) + .addComponent(lblImagem, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(lblEdicao) + .addComponent(txtEdicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel20) + .addComponent(txtIdioma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblAno) + .addComponent(txtAno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(8, 8, 8) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtPrazoEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel8) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(txtBuscaLivro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addContainerGap(18, Short.MAX_VALUE)) + ); + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.gridwidth = 3; + gridBagConstraints.ipadx = 9; + gridBagConstraints.ipady = 12; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(10, 17, 0, 0); + getContentPane().add(jPanel3, gridBagConstraints); + setJMenuBar(jMenuBar1); + + pack(); + }// </editor-fold>//GEN-END:initComponents + + public void listarLivrosFiltro() throws Exception { + LivroDao dao = new LivroDao(); + List<Livro> lista = dao.buscarLivros(); + DefaultTableModel dados = (DefaultTableModel) tabelaLivrosFiltro.getModel(); + dados.setNumRows(0); + for (Livro c : lista) { + dados.addRow(new Object[]{ + c.getDisponibilidade(), + c.getTitulo(), + //trocar para ususario que emprestou + c.getObservacoes(), + c.getSecao(), + c.getId(), + c.getIsbn(), + c.isEmprestado(),}); + } + + } + + + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + + try { + listarLivrosFiltro(); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + this.setExtendedState(this.MAXIMIZED_BOTH); + lblLogado.setText(usuarioLogado); + String logId = String.valueOf(idLogado); + txtIdLogado.setText(logId);// Int(idLogado); + txtlogado.setText(usuarioLogado); + PrintWriter out; + try { + out = new PrintWriter(new FileWriter("C:\\Librography\\LoggedIn")); + txtIdLogado.write(out); + } catch (IOException ex) { + Logger.getLogger(FormMenuUsuario.class.getName()).log(Level.SEVERE, null, ex); + } + this.setVisible(true); + + }//GEN-LAST:event_formWindowActivated +//// + private void tabelaLivrosFiltroMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelaLivrosFiltroMouseClicked + try { + DefaultTableModel model = (DefaultTableModel) tabelaLivrosFiltro.getModel(); + int selectedRowIndex = tabelaLivrosFiltro.getSelectedRow(); + txtBookId.setText(model.getValueAt(selectedRowIndex, 4).toString()); + txtTituloSelect.setText(model.getValueAt(selectedRowIndex, 1).toString()); + txtObservacoes.setText(model.getValueAt(selectedRowIndex, 2).toString()); + String path = "C:\\Librography\\images\\books\\" + txtISBN.getText(); + EmprestimoDao emprestimodao = new EmprestimoDao(); + lblImagem.setIcon(ResizeBookImage(path)); + txtStatus.setText(emprestimodao.campoStatusLista(Integer.parseInt(txtBookId.getText()))); + Livro livro = new Livro(); + LivroDao livrodao = new LivroDao(); + livro = livrodao.buscarLivro(txtTituloSelect.getText()); + txtAutor.setText(livro.getAutor()); + txtEditora.setText(livro.getEditora()); + txtSerie.setText(livro.getSerie()); + txtIdioma.setText(livro.getIdioma()); + txtAno.setText(livro.getAno()); + txtEdicao.setText(livro.getEdicao()); + txtISBN.setText(livro.getIsbn()); + txtPrazoEntrega.setText(livro.getPiso() + " / " + livro.getCorredor() + " / " + livro.getPosicao() + " / " + livro.getSecao()); + } catch (Exception ex) { + Logger.getLogger(FormMenuUsuario.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_tabelaLivrosFiltroMouseClicked + + private void txtBuscaLivroKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_txtBuscaLivroKeyReleased + + }//GEN-LAST:event_txtBuscaLivroKeyReleased + + private void txtTituloSelectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtTituloSelectActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtTituloSelectActionPerformed + + private void txtISBNActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtISBNActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtISBNActionPerformed + + private void txtPrazoEntregaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPrazoEntregaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtPrazoEntregaActionPerformed + + private void txtIdiomaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtIdiomaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtIdiomaActionPerformed + + private void txtStatusActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtStatusActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtStatusActionPerformed + + /** + * @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(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormMenuUsuario.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormMenuUsuario().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel10; + private javax.swing.JLabel jLabel11; + private javax.swing.JLabel jLabel19; + private javax.swing.JLabel jLabel2; + private javax.swing.JLabel jLabel20; + private javax.swing.JLabel jLabel23; + private javax.swing.JLabel jLabel3; + private javax.swing.JLabel jLabel4; + private javax.swing.JLabel jLabel5; + private javax.swing.JLabel jLabel7; + private javax.swing.JLabel jLabel8; + private javax.swing.JMenuBar jMenuBar1; + private javax.swing.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JScrollPane jScrollPane3; + private javax.swing.JScrollPane jScrollPane5; + private javax.swing.JLabel lblAno; + private javax.swing.JLabel lblAutor; + private javax.swing.JLabel lblEdicao; + private javax.swing.JLabel lblEditora; + private javax.swing.JLabel lblImagem; + private javax.swing.JLabel lblLogado; + private javax.swing.JTable tabelaLivrosFiltro; + private javax.swing.JFormattedTextField txtAno; + private javax.swing.JTextField txtAutor; + private javax.swing.JTextField txtBookId; + private javax.swing.JTextField txtBuscaLivro; + private javax.swing.JTextField txtEdicao; + private javax.swing.JTextField txtEditora; + private javax.swing.JTextField txtISBN; + private javax.swing.JTextField txtIdLogado; + private javax.swing.JTextField txtIdioma; + private javax.swing.JTextArea txtObservacoes; + private javax.swing.JTextField txtPrazoEntrega; + private javax.swing.JTextField txtSerie; + private javax.swing.JTextField txtStatus; + private javax.swing.JTextField txtTituloSelect; + private javax.swing.JTextField txtlogado; + // End of variables declaration//GEN-END:variables +private ImageIcon ResizeBookImage(String imgPath) { //192x261 + int imageX = 126; + int imageY = 194; + lblImagem.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblImagem.getWidth(), lblImagem.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } +} diff --git a/src/br/com/projeto/view/FormMulta.form b/src/br/com/projeto/view/FormMulta.form new file mode 100644 index 0000000..9cf0436 --- /dev/null +++ b/src/br/com/projeto/view/FormMulta.form @@ -0,0 +1,280 @@ +<?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="focusable" type="boolean" value="false"/> + <Property name="focusableWindowState" type="boolean" value="false"/> + <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[448, 175]"/> + </Property> + <Property name="undecorated" type="boolean" value="true"/> + <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> + <Dimension value="[448, 175]"/> + </Property> + <Property name="resizable" type="boolean" value="false"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="true"/> + </SyntheticProperties> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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,0,-81,0,0,1,-63"/> + </AuxValues> + + <Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout"> + <Property name="useNullLayout" type="boolean" value="true"/> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> + <AbsoluteConstraints x="0" y="22" width="440" height="150"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="15" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtNumMulta" min="-2" pref="84" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="33" max="-2" attributes="0"/> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtLeitorId" 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="jLabel7" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtEmprestimoId" max="32767" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="59" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="txtDiasAtraso" min="-2" pref="53" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <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"/> + <Component id="txtNomeLivro" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtValorMulta" min="-2" pref="79" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="txtImprimeMulta" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnReceberMulta" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="jButton2" min="-2" max="-2" attributes="0"/> + <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"> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNumMulta" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtLeitorId" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel6" 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="txtDiasAtraso" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtEmprestimoId" 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="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtNomeLivro" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtValorMulta" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="txtImprimeMulta" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnReceberMulta" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace pref="10" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Nº da Multa:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel1"> + <Properties> + <Property name="text" type="java.lang.String" value="Livro:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Dias de Atraso:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="text" type="java.lang.String" value="Valor da Multa:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="Id de Usuário:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="text" type="java.lang.String" value="Referente Empréstimo nº:"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="txtImprimeMulta"> + <Properties> + <Property name="text" type="java.lang.String" value="Imprimir"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtImprimeMultaActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="jButton2"> + <Properties> + <Property name="text" type="java.lang.String" value="Fechar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtNumMulta"> + </Component> + <Component class="javax.swing.JTextField" name="txtEmprestimoId"> + </Component> + <Component class="javax.swing.JTextField" name="txtLeitorId"> + </Component> + <Component class="javax.swing.JTextField" name="txtDiasAtraso"> + </Component> + <Component class="javax.swing.JTextField" name="txtNomeLivro"> + </Component> + <Component class="javax.swing.JTextField" name="txtValorMulta"> + </Component> + <Component class="javax.swing.JButton" name="btnReceberMulta"> + <Properties> + <Property name="text" type="java.lang.String" value="Receber"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnReceberMultaActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel1"> + <Properties> + <Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="0" green="0" red="0" type="rgb"/> + </Property> + <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="0" y="0" width="520" height="30"/> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="jPanel3" min="-2" max="-2" attributes="0"/> + <EmptySpace min="0" pref="3" 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="jPanel3" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="9" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Properties> + <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> + <Color blue="ff" green="cc" red="66" 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="70" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" pref="306" max="-2" attributes="0"/> + <EmptySpace pref="141" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel3" alignment="0" pref="21" max="32767" attributes="0"/> + </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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="MULTA"/> + </Properties> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormMulta.java b/src/br/com/projeto/view/FormMulta.java new file mode 100644 index 0000000..a667948 --- /dev/null +++ b/src/br/com/projeto/view/FormMulta.java @@ -0,0 +1,410 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import br.com.projeto.dao.EmprestimoDao; +import br.com.projeto.dao.FuncionarioDao; +import br.com.projeto.dao.LivroDao; +import br.com.projeto.dao.MultaDao; +import br.com.projeto.dao.ReciboDao; +import br.com.projeto.model.Funcionario; +import br.com.projeto.model.Multa; +import br.com.projeto.model.Utilitarios; +import java.awt.Font; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.JEditorPane; +import javax.swing.JOptionPane; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormMulta extends javax.swing.JFrame { + + /** + * Creates new form FormMulta + */ + public FormMulta() { + initComponents(); + } + + public void listarMulta(int idDoEmprestimo) throws Exception { + MultaDao dao = new MultaDao(); + EmprestimoDao emprest = new EmprestimoDao(); + Utilitarios util = new Utilitarios(); + LivroDao lvr = new LivroDao(); + List<Multa> lista = dao.listaMulta(idDoEmprestimo); + for (Multa c : lista) { + txtNumMulta.setText(String.valueOf(c.getId())); + txtDiasAtraso.setText(String.valueOf(c.getDias_atraso())); + txtValorMulta.setText(util.campoMulta(c.getValor_multa()));//(util.campoMulta(multa)) + Boolean esta_pago = c.isEsta_pago(); + txtLeitorId.setText(emprest.getUserData("nome", c.getTb_leitores_id()));//formatter + txtEmprestimoId.setText(String.valueOf(c.getTb_emprestimos_id())); + txtNomeLivro.setText(lvr.getLivroData("titulo", emprest.getEmprestimoFKeyData("tb_livros_id", c.getTb_emprestimos_id())));//formatter + } + } + + public FormMulta(int msgEmpId) throws Exception { //cria construtor apenas com a variavel, que é usada para consulta no db e popular campos + initComponents(); + listarMulta(msgEmpId); + //esta criando uma multa a cada vez que clica no botao + + } + + public void imprimeMulta(int idDoEmprestimo) throws Exception { + Utilitarios util = new Utilitarios(); + Funcionario funcionario = new Funcionario(); + String contentid = new String(Files.readAllBytes(Paths.get("C:\\Librography\\LoggedIn"))); + funcionario.setId(Integer.parseInt(contentid)); + FuncionarioDao funcionariodao = new FuncionarioDao(); + String nomeFuncionario = funcionariodao.getFuncionarioData("nome", funcionario.getId()); + String toBCode = String.format("%08d", idDoEmprestimo); + //int code = Integer.parseInt(toBCode); + util.gerarBarCode("Multa", idDoEmprestimo); + util.gerarQrCode("Multa", idDoEmprestimo); + + //System.out.println("code==" + code); + + String QrImage = "file:C:\\\\Librography\\\\images\\\\Multas\\\\QrCode\\\\" + toBCode; + String BarCodeImage = "file:C:\\\\Librography\\\\images\\\\Multas\\\\BarCode\\\\" + toBCode; + String filepath = "C:\\Librography\\ticket"; + //LivroDao livro = new LivroDao(); + String livroNome = txtNomeLivro.getText(); + File arquivo = new File(filepath); + if (!arquivo.exists()) { + arquivo.createNewFile(); + } + String line = "Obrigado pela Preferencia"; + JEditorPane p = new JEditorPane("file:" + filepath); + p.setContentType("text/html"); + p.setFont(new Font("Helvetica", 0, 9)); + StringBuilder htmlContent = new StringBuilder(); + htmlContent.append("<html><head></head><body><p>"); + htmlContent.append("<h3><img src='file:C:\\Librography\\images\\libraryLogo.png' width=30 height=30></img>"); + htmlContent.append("BIBLIOTECA DE HOGWARTS</h3>"); + htmlContent.append("<h3 align=center>MULTA POR ATRASO</h3><br>"); + htmlContent.append("LIVRO:"); + htmlContent.append("<h4 align=right>").append(String.format("%26s", livroNome)).append("</h4>"); + htmlContent.append("Valor da Multa:"); + htmlContent.append("<h4 align=right>").append(String.format("%26s", txtValorMulta.getText())).append("</h4>"); + htmlContent.append("Referenmte Empréstimo nº::"); + htmlContent.append("<h4 align=right>").append(String.format("%26s", txtEmprestimoId.getText())).append("</h4>"); + htmlContent.append(" Multa: ").append(String.format("%26s", txtValorMulta.getText())).append("<br>"); + htmlContent.append("Dias de Atraso:: ").append(String.format("%26s", txtDiasAtraso.getText())).append("<br>"); + htmlContent.append(" Usuário: ").append(String.format("%26s", txtLeitorId.getText().toUpperCase())).append("<br>"); + htmlContent.append(" Atendente: ").append(String.format("%26s", nomeFuncionario.toUpperCase())).append("<br>"); + htmlContent.append("<img src='").append(BarCodeImage).append("' width=100 height=40></img>"); + htmlContent.append("<img src='").append(QrImage).append("' width=40 height=40></img><br>"); + htmlContent.append("<font face=\"monospace\">").append(line).append("</font><br><br><br>"); + htmlContent.append("</body>"); + htmlContent.append("</html>"); + p.setText(htmlContent.toString()); + ReciboDao recibodao = new ReciboDao(); + recibodao.imprimirTicket(p, 1); + arquivo.delete(); + } + + /** + * 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() { + + jPanel2 = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + jLabel1 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + jLabel6 = new javax.swing.JLabel(); + jLabel7 = new javax.swing.JLabel(); + txtImprimeMulta = new javax.swing.JButton(); + jButton2 = new javax.swing.JButton(); + txtNumMulta = new javax.swing.JTextField(); + txtEmprestimoId = new javax.swing.JTextField(); + txtLeitorId = new javax.swing.JTextField(); + txtDiasAtraso = new javax.swing.JTextField(); + txtNomeLivro = new javax.swing.JTextField(); + txtValorMulta = new javax.swing.JTextField(); + btnReceberMulta = new javax.swing.JButton(); + jPanel1 = new javax.swing.JPanel(); + jPanel3 = new javax.swing.JPanel(); + jLabel3 = new javax.swing.JLabel(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setFocusable(false); + setFocusableWindowState(false); + setMinimumSize(new java.awt.Dimension(448, 175)); + setUndecorated(true); + setPreferredSize(new java.awt.Dimension(448, 175)); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + getContentPane().setLayout(null); + + jLabel2.setText("Nº da Multa:"); + + jLabel1.setText("Livro:"); + + jLabel4.setText("Dias de Atraso:"); + + jLabel5.setText("Valor da Multa:"); + + jLabel6.setText("Id de Usuário:"); + + jLabel7.setText("Referente Empréstimo nº:"); + + txtImprimeMulta.setText("Imprimir"); + txtImprimeMulta.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtImprimeMultaActionPerformed(evt); + } + }); + + jButton2.setText("Fechar"); + jButton2.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButton2ActionPerformed(evt); + } + }); + + btnReceberMulta.setText("Receber"); + btnReceberMulta.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnReceberMultaActionPerformed(evt); + } + }); + + 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(15, 15, 15) + .addComponent(jLabel2) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNumMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(33, 33, 33) + .addComponent(jLabel6) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtLeitorId)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel7) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtEmprestimoId) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel4) + .addGap(59, 59, 59)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(txtDiasAtraso, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtNomeLivro)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(14, 14, 14) + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtValorMulta, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(txtImprimeMulta) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnReceberMulta) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButton2) + .addGap(12, 12, 12)) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addContainerGap() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(txtNumMulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtLeitorId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel6)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel4) + .addComponent(txtDiasAtraso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel7) + .addComponent(txtEmprestimoId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel1) + .addComponent(txtNomeLivro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel5) + .addComponent(txtValorMulta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtImprimeMulta) + .addComponent(jButton2) + .addComponent(btnReceberMulta))) + .addContainerGap(10, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanel2); + jPanel2.setBounds(0, 22, 440, 150); + + jPanel1.setForeground(new java.awt.Color(0, 0, 0)); + jPanel1.setOpaque(false); + + jPanel3.setBackground(new java.awt.Color(102, 204, 255)); + + jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel3.setForeground(new java.awt.Color(255, 255, 255)); + jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel3.setText("MULTA"); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(70, 70, 70) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(141, Short.MAX_VALUE)) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, 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(jPanel1Layout.createSequentialGroup() + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(0, 3, Short.MAX_VALUE)) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(9, Short.MAX_VALUE)) + ); + + getContentPane().add(jPanel1); + jPanel1.setBounds(0, 0, 520, 30); + + pack(); + setLocationRelativeTo(null); + }// </editor-fold>//GEN-END:initComponents + + private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed + // TODO add your handling code here: + super.dispose(); + }//GEN-LAST:event_jButton2ActionPerformed + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + //pegar dados de user + }//GEN-LAST:event_formWindowActivated + + private void btnReceberMultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnReceberMultaActionPerformed + String multa = txtValorMulta.getText(); + if (!multa.equals("Em dia")) { + + Utilitarios util = new Utilitarios(); + int i = util.okcancel("Confirma o recebimento do valor de " + multa + ", Recebimento do Livro e desbloqueio do usuário?"); + System.out.println("ret : " + i); + try { + EmprestimoDao devEmpres = new EmprestimoDao(); + MultaDao multaDao = new MultaDao(); + devEmpres.devolveLivro(Integer.parseInt(txtEmprestimoId.getText())); + multaDao.zeraMulta(Integer.parseInt(txtNumMulta.getText())); + } catch (Exception ex) { + Logger.getLogger(FormEmprestimos.class.getName()).log(Level.SEVERE, null, ex); + } + + } else { + JOptionPane.showMessageDialog(null, "Não há multa registrada"); + } + }//GEN-LAST:event_btnReceberMultaActionPerformed + + private void txtImprimeMultaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtImprimeMultaActionPerformed + try { + this.imprimeMulta(Integer.parseInt(txtEmprestimoId.getText())); + } catch (Exception ex) { + Logger.getLogger(FormMulta.class.getName()).log(Level.SEVERE, null, ex); + } + }//GEN-LAST:event_txtImprimeMultaActionPerformed + + /** + * @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(FormMulta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormMulta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormMulta.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormMulta.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 FormMulta().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JButton btnReceberMulta; + private javax.swing.JButton jButton2; + 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.JPanel jPanel1; + private javax.swing.JPanel jPanel2; + private javax.swing.JPanel jPanel3; + private javax.swing.JTextField txtDiasAtraso; + private javax.swing.JTextField txtEmprestimoId; + private javax.swing.JButton txtImprimeMulta; + private javax.swing.JTextField txtLeitorId; + private javax.swing.JTextField txtNomeLivro; + private javax.swing.JTextField txtNumMulta; + private javax.swing.JTextField txtValorMulta; + // End of variables declaration//GEN-END:variables +} diff --git a/src/br/com/projeto/view/FormOptions.form b/src/br/com/projeto/view/FormOptions.form new file mode 100644 index 0000000..e9aae99 --- /dev/null +++ b/src/br/com/projeto/view/FormOptions.form @@ -0,0 +1,914 @@ +<?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="resizable" type="boolean" value="false"/> + </Properties> + <SyntheticProperties> + <SyntheticProperty name="formSizePolicy" type="int" value="1"/> + <SyntheticProperty name="generateCenter" type="boolean" value="true"/> + </SyntheticProperties> + <Events> + <EventHandler event="windowActivated" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowActivated"/> + </Events> + <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" max="32767" attributes="0"/> + <Component id="jTabbedPane2" max="32767" attributes="0"/> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jPanel1" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="jTabbedPane2" max="32767" attributes="0"/> + <EmptySpace 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="0" green="0" red="0" type="rgb"/> + </Property> + </Properties> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel1" 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"> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel1" min="-2" pref="54" max="-2" attributes="0"/> + <EmptySpace max="32767" 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="Tahoma" size="24" 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="horizontalAlignment" type="int" value="0"/> + <Property name="text" type="java.lang.String" value="Opções"/> + </Properties> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JTabbedPane" name="jTabbedPane2"> + + <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> + <SubComponents> + <Container class="javax.swing.JPanel" name="jPanel2"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Geral"> + <Property name="tabTitle" type="java.lang.String" value="Geral"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="-2" pref="17" 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"> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel6" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtIp" min="-2" pref="251" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSaveIp" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel12" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtUserDB" min="-2" pref="251" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSaveUserDB" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <Component id="jLabel15" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtPassDB" min="-2" pref="251" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSavePassDB" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel21" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxDBType" min="-2" pref="251" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSaveDBType" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="1" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <Component id="jLabel9" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxPrinter" min="-2" pref="251" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnSavePrinter" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" attributes="0"> + <Component id="jLabel16" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="txtmsgRecibo" min="-2" pref="245" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Component id="btnSaveMsgRecibo" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + <EmptySpace min="-2" pref="66" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="38" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel13" alignment="0" min="-2" pref="146" max="-2" attributes="0"/> + <Component id="lblLibraryLogo" alignment="0" min="-2" pref="143" max="-2" attributes="0"/> + </Group> + </Group> + <Group type="102" attributes="0"> + <EmptySpace max="32767" attributes="0"/> + <Component id="btnSetLibraryLogo" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="7" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="jLabel11" alignment="0" min="-2" pref="144" max="-2" attributes="0"/> + <Component id="jLabel10" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="txtLibraryName" min="-2" pref="320" max="-2" attributes="0"/> + <Component id="txtLibraryAddress" min="-2" pref="317" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="24" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnLibraryName" alignment="0" min="-2" max="-2" attributes="0"/> + <Component id="btnLibraryAddress" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="32767" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </DimensionLayout> + <DimensionLayout dim="1"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" attributes="0"> + <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> + <Component id="jLabel13" min="-2" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="lblLibraryLogo" min="-2" pref="146" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnSetLibraryLogo" min="-2" max="-2" attributes="0"/> + <EmptySpace max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel21" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxDBType" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSaveDBType" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtIp" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSaveIp" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel12" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtUserDB" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSaveUserDB" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jLabel15" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSavePassDB" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="txtPassDB" alignment="0" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnSaveMsgRecibo" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel16" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtmsgRecibo" 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="jLabel9" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxPrinter" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSavePrinter" 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="jLabel10" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtLibraryName" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnLibraryName" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel11" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtLibraryAddress" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnLibraryAddress" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace min="-2" pref="132" max="-2" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JButton" name="btnSaveIp"> + <Properties> + <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="btnSaveIpActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel6"> + <Properties> + <Property name="text" type="java.lang.String" value="IP ou Url do Servidor"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtIp"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel9"> + <Properties> + <Property name="text" type="java.lang.String" value="Impressora Padrão:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxPrinter"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="<Selecione>"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPrinterMouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="boxPrinterActionPerformed"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JButton" name="btnSavePrinter"> + <Properties> + <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="btnSavePrinterActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel10"> + <Properties> + <Property name="text" type="java.lang.String" value="Nome da Instituição:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel11"> + <Properties> + <Property name="text" type="java.lang.String" value="Endereço da Instituição:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtLibraryName"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtLibraryNameActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnLibraryAddress"> + <Properties> + <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="btnLibraryAddressActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JTextField" name="txtLibraryAddress"> + </Component> + <Component class="javax.swing.JButton" name="btnLibraryName"> + <Properties> + <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="btnLibraryNameActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="lblLibraryLogo"> + <Properties> + <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> + <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo"> + <EtchetBorder bevelType="0"> + <Color PropertyName="highlight" blue="ff" green="ff" id="white" palette="1" red="ff" type="palette"/> + <Color PropertyName="shadow" blue="40" green="40" id="darkGray" palette="1" red="40" type="palette"/> + </EtchetBorder> + </Border> + </Property> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnSetLibraryLogo"> + <Properties> + <Property name="text" type="java.lang.String" value="Selecione"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSetLibraryLogoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel13"> + <Properties> + <Property name="text" type="java.lang.String" value="Logotipo da Instituição"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel12"> + <Properties> + <Property name="text" type="java.lang.String" value="Usuario banco de Dados:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtUserDB"> + </Component> + <Component class="javax.swing.JButton" name="btnSaveUserDB"> + <Properties> + <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="btnSaveUserDBActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel15"> + <Properties> + <Property name="text" type="java.lang.String" value="Senha Banco de Dados:"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnSavePassDB"> + <Properties> + <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="btnSavePassDBActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JPasswordField" name="txtPassDB"> + </Component> + <Component class="javax.swing.JButton" name="btnSaveMsgRecibo"> + <Properties> + <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="btnSaveMsgReciboActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel16"> + <Properties> + <Property name="text" type="java.lang.String" value="Mensagem Recibo:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtmsgRecibo"> + </Component> + <Component class="javax.swing.JLabel" name="jLabel21"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de Banco de Dados:"/> + </Properties> + </Component> + <Component class="javax.swing.JComboBox" name="boxDBType"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="2"> + <StringItem index="0" value="postgresql"/> + <StringItem index="1" value="mysql"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxDBTypeMouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="boxDBTypeActionPerformed"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JButton" name="btnSaveDBType"> + <Properties> + <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="btnSaveDBTypeActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel3"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Biblioteca"> + <Property name="tabTitle" type="java.lang.String" value="Biblioteca"/> + </JTabbedPaneConstraints> + </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="136" max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="21" max="-2" attributes="0"/> + <Group type="103" groupAlignment="1" attributes="0"> + <Component id="jLabel5" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel2" min="-2" max="-2" attributes="0"/> + <Component id="jLabel7" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" max="-2" attributes="0"> + <Component id="txtPiso" alignment="0" max="32767" attributes="0"/> + <Component id="txtCorredor" alignment="0" max="32767" attributes="0"/> + <Component id="txtPosicao" alignment="0" max="32767" attributes="0"/> + <Component id="txtSecao" max="32767" attributes="0"/> + <Component id="txtDisponibilidade" min="-2" pref="195" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnAddPosicao" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxPosicao" min="-2" pref="225" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnApagarPosicao" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnAddCorredor" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxCorredor" min="-2" pref="225" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnApagarCorredor" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnAddPiso" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxPiso" min="-2" pref="225" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnExcluirPiso" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Group type="103" groupAlignment="1" max="-2" attributes="0"> + <Group type="102" alignment="1" attributes="0"> + <Component id="btnAddDsiponibilidade" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxDisponibilidade" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="0" attributes="0"> + <Component id="btnAddSecao" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxSecao" min="-2" pref="225" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Component id="btnApagarSecao" min="-2" max="-2" attributes="0"/> + <Component id="btnApagarDisponibilidade" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + </Group> + </Group> + </Group> + <EmptySpace pref="54" max="32767" attributes="0"/> + </Group> + <Group type="102" alignment="1" attributes="0"> + <EmptySpace min="0" pref="0" max="32767" attributes="0"/> + <Component id="jLabel14" min="-2" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="txtTipos" min="-2" pref="195" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="btnAddtipos" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="boxTipos" min="-2" pref="225" max="-2" attributes="0"/> + <EmptySpace type="unrelated" max="-2" attributes="0"/> + <Component id="btnExcluirTipos" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="48" 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="37" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnAddPiso" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxPiso" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnExcluirPiso" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Component id="txtPiso" alignment="1" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnAddCorredor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxCorredor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnApagarCorredor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtCorredor" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel3" 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="txtPosicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnAddPosicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxPosicao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnApagarPosicao" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="btnAddSecao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtSecao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="boxSecao" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnApagarSecao" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="btnAddDsiponibilidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnApagarDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <Group type="103" alignment="0" groupAlignment="3" attributes="0"> + <Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtDisponibilidade" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + </Group> + <EmptySpace max="-2" attributes="0"/> + <Component id="jLabel8" min="-2" max="-2" attributes="0"/> + <EmptySpace min="-2" pref="14" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="btnAddtipos" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="boxTipos" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnExcluirTipos" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="txtTipos" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="jLabel14" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="140" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel2"> + <Properties> + <Property name="text" type="java.lang.String" value="Piso:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel3"> + <Properties> + <Property name="text" type="java.lang.String" value="Corredor:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel4"> + <Properties> + <Property name="text" type="java.lang.String" value="Posição:"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel5"> + <Properties> + <Property name="text" type="java.lang.String" value="Seção:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtPiso"> + </Component> + <Component class="javax.swing.JTextField" name="txtCorredor"> + </Component> + <Component class="javax.swing.JTextField" name="txtPosicao"> + </Component> + <Component class="javax.swing.JTextField" name="txtSecao"> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtSecaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnAddPiso"> + <Properties> + <Property name="text" type="java.lang.String" value="Add"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddPisoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnAddCorredor"> + <Properties> + <Property name="text" type="java.lang.String" value="Add"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddCorredorActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnAddPosicao"> + <Properties> + <Property name="text" type="java.lang.String" value="Add"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddPosicaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnAddSecao"> + <Properties> + <Property name="text" type="java.lang.String" value="Add"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddSecaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JComboBox" name="boxCorredor"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="<Lista de Corredores>"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxCorredorMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="boxPiso"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="<Lista de Pisos>"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPisoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="boxPosicao"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="<Lista de Posições>"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxPosicaoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JComboBox" name="boxSecao"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="<Lista de Seções>"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxSecaoMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JButton" name="btnExcluirPiso"> + <Properties> + <Property name="text" type="java.lang.String" value="Apagar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcluirPisoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnApagarCorredor"> + <Properties> + <Property name="text" type="java.lang.String" value="Apagar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarCorredorActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnApagarPosicao"> + <Properties> + <Property name="text" type="java.lang.String" value="Apagar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarPosicaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnApagarSecao"> + <Properties> + <Property name="text" type="java.lang.String" value="Apagar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarSecaoActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JButton" name="btnAddDsiponibilidade"> + <Properties> + <Property name="text" type="java.lang.String" value="Add"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddDsiponibilidadeActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel7"> + <Properties> + <Property name="text" type="java.lang.String" value="Disponibilidade:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtDisponibilidade"> + </Component> + <Component class="javax.swing.JComboBox" name="boxDisponibilidade"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="Quantos dias pode ser locado"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxDisponibilidadeMouseClicked"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + <Component class="javax.swing.JButton" name="btnApagarDisponibilidade"> + <Properties> + <Property name="text" type="java.lang.String" value="Apagar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnApagarDisponibilidadeActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JLabel" name="jLabel8"> + <Properties> + <Property name="text" type="java.lang.String" value="Configura para qtos dias o livro pode ser locado ( Zero para Apenas Leitura Interna)"/> + </Properties> + </Component> + <Component class="javax.swing.JLabel" name="jLabel14"> + <Properties> + <Property name="text" type="java.lang.String" value="Tipo de Usuários:"/> + </Properties> + </Component> + <Component class="javax.swing.JTextField" name="txtTipos"> + </Component> + <Component class="javax.swing.JButton" name="btnAddtipos"> + <Properties> + <Property name="text" type="java.lang.String" value="Add"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddtiposActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JComboBox" name="boxTipos"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="1"> + <StringItem index="0" value="<Lista de Tipos de Usuários>"/> + </StringArray> + </Property> + </Properties> + <Events> + <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="boxTiposMouseClicked"/> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="boxTiposActionPerformed"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value=""/> + </AuxValues> + </Component> + <Component class="javax.swing.JButton" name="btnExcluirTipos"> + <Properties> + <Property name="text" type="java.lang.String" value="Apagar"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExcluirTiposActionPerformed"/> + </Events> + </Component> + </SubComponents> + </Container> + <Container class="javax.swing.JPanel" name="jPanel4"> + <Constraints> + <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> + <JTabbedPaneConstraints tabName="Aparência"> + <Property name="tabTitle" type="java.lang.String" value="Aparência"/> + </JTabbedPaneConstraints> + </Constraint> + </Constraints> + + <Layout> + <DimensionLayout dim="0"> + <Group type="103" groupAlignment="0" attributes="0"> + <Group type="102" alignment="0" attributes="0"> + <EmptySpace min="-2" pref="39" max="-2" attributes="0"/> + <Component id="jLabel17" min="-2" max="-2" attributes="0"/> + <EmptySpace type="separate" max="-2" attributes="0"/> + <Component id="cboxTema" min="-2" pref="280" max="-2" attributes="0"/> + <EmptySpace max="-2" attributes="0"/> + <Component id="btnSaveTheme" min="-2" max="-2" attributes="0"/> + <EmptySpace pref="279" 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="38" max="-2" attributes="0"/> + <Group type="103" groupAlignment="3" attributes="0"> + <Component id="jLabel17" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="btnSaveTheme" alignment="3" min="-2" max="-2" attributes="0"/> + <Component id="cboxTema" alignment="3" min="-2" max="-2" attributes="0"/> + </Group> + <EmptySpace pref="407" max="32767" attributes="0"/> + </Group> + </Group> + </DimensionLayout> + </Layout> + <SubComponents> + <Component class="javax.swing.JLabel" name="jLabel17"> + <Properties> + <Property name="text" type="java.lang.String" value="Tema Padrão:"/> + </Properties> + </Component> + <Component class="javax.swing.JButton" name="btnSaveTheme"> + <Properties> + <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="btnSaveThemeActionPerformed"/> + </Events> + </Component> + <Component class="javax.swing.JComboBox" name="cboxTema"> + <Properties> + <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> + <StringArray count="2"> + <StringItem index="0" value="Tema Claro"/> + <StringItem index="1" value="Tema Escuro"/> + </StringArray> + </Property> + <Property name="selectedIndex" type="int" value="-1"/> + </Properties> + <Events> + <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cboxTemaActionPerformed"/> + </Events> + <AuxValues> + <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> + </AuxValues> + </Component> + </SubComponents> + </Container> + </SubComponents> + </Container> + </SubComponents> +</Form> diff --git a/src/br/com/projeto/view/FormOptions.java b/src/br/com/projeto/view/FormOptions.java new file mode 100644 index 0000000..ed0e51f --- /dev/null +++ b/src/br/com/projeto/view/FormOptions.java @@ -0,0 +1,1234 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package br.com.projeto.view; + +import br.com.projeto.dao.OptionsDao; +import br.com.projeto.model.Options; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.sql.SQLException; +import javax.swing.JOptionPane; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.imageio.ImageIO; +import javax.print.PrintService; +import javax.print.PrintServiceLookup; +import javax.swing.ImageIcon; +import javax.swing.JFileChooser; +import javax.swing.filechooser.FileNameExtensionFilter; + +/** + * + * @author Everton Luiz Kozloski - evertonkozloski@hotmail.com + */ +public class FormOptions extends javax.swing.JFrame { + + /** + * Creates new form formLogin + */ + public FormOptions() { + 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(); + jTabbedPane2 = new javax.swing.JTabbedPane(); + jPanel2 = new javax.swing.JPanel(); + btnSaveIp = new javax.swing.JButton(); + jLabel6 = new javax.swing.JLabel(); + txtIp = new javax.swing.JTextField(); + jLabel9 = new javax.swing.JLabel(); + boxPrinter = new javax.swing.JComboBox<>(); + btnSavePrinter = new javax.swing.JButton(); + jLabel10 = new javax.swing.JLabel(); + jLabel11 = new javax.swing.JLabel(); + txtLibraryName = new javax.swing.JTextField(); + btnLibraryAddress = new javax.swing.JButton(); + txtLibraryAddress = new javax.swing.JTextField(); + btnLibraryName = new javax.swing.JButton(); + lblLibraryLogo = new javax.swing.JLabel(); + btnSetLibraryLogo = new javax.swing.JButton(); + jLabel13 = new javax.swing.JLabel(); + jLabel12 = new javax.swing.JLabel(); + txtUserDB = new javax.swing.JTextField(); + btnSaveUserDB = new javax.swing.JButton(); + jLabel15 = new javax.swing.JLabel(); + btnSavePassDB = new javax.swing.JButton(); + txtPassDB = new javax.swing.JPasswordField(); + btnSaveMsgRecibo = new javax.swing.JButton(); + jLabel16 = new javax.swing.JLabel(); + txtmsgRecibo = new javax.swing.JTextField(); + jLabel21 = new javax.swing.JLabel(); + boxDBType = new javax.swing.JComboBox<>(); + btnSaveDBType = new javax.swing.JButton(); + jPanel3 = new javax.swing.JPanel(); + jLabel2 = new javax.swing.JLabel(); + jLabel3 = new javax.swing.JLabel(); + jLabel4 = new javax.swing.JLabel(); + jLabel5 = new javax.swing.JLabel(); + txtPiso = new javax.swing.JTextField(); + txtCorredor = new javax.swing.JTextField(); + txtPosicao = new javax.swing.JTextField(); + txtSecao = new javax.swing.JTextField(); + btnAddPiso = new javax.swing.JButton(); + btnAddCorredor = new javax.swing.JButton(); + btnAddPosicao = new javax.swing.JButton(); + btnAddSecao = new javax.swing.JButton(); + boxCorredor = new javax.swing.JComboBox<>(); + boxPiso = new javax.swing.JComboBox(); + boxPosicao = new javax.swing.JComboBox<>(); + boxSecao = new javax.swing.JComboBox<>(); + btnExcluirPiso = new javax.swing.JButton(); + btnApagarCorredor = new javax.swing.JButton(); + btnApagarPosicao = new javax.swing.JButton(); + btnApagarSecao = new javax.swing.JButton(); + btnAddDsiponibilidade = new javax.swing.JButton(); + jLabel7 = new javax.swing.JLabel(); + txtDisponibilidade = new javax.swing.JTextField(); + boxDisponibilidade = new javax.swing.JComboBox<>(); + btnApagarDisponibilidade = new javax.swing.JButton(); + jLabel8 = new javax.swing.JLabel(); + jLabel14 = new javax.swing.JLabel(); + txtTipos = new javax.swing.JTextField(); + btnAddtipos = new javax.swing.JButton(); + boxTipos = new javax.swing.JComboBox(); + btnExcluirTipos = new javax.swing.JButton(); + jPanel4 = new javax.swing.JPanel(); + jLabel17 = new javax.swing.JLabel(); + btnSaveTheme = new javax.swing.JButton(); + cboxTema = new javax.swing.JComboBox<>(); + + setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); + setResizable(false); + addWindowListener(new java.awt.event.WindowAdapter() { + public void windowActivated(java.awt.event.WindowEvent evt) { + formWindowActivated(evt); + } + }); + + jPanel1.setBackground(new java.awt.Color(0, 0, 0)); + + jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N + jLabel1.setForeground(new java.awt.Color(255, 255, 255)); + jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); + jLabel1.setText("Opções"); + + javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); + jPanel1.setLayout(jPanel1Layout); + jPanel1Layout.setHorizontalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + ); + jPanel1Layout.setVerticalGroup( + jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel1Layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + + btnSaveIp.setText("Salvar"); + btnSaveIp.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSaveIpActionPerformed(evt); + } + }); + + jLabel6.setText("IP ou Url do Servidor"); + + jLabel9.setText("Impressora Padrão:"); + + boxPrinter.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "<Selecione>" })); + boxPrinter.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxPrinterMouseClicked(evt); + } + }); + boxPrinter.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + boxPrinterActionPerformed(evt); + } + }); + + btnSavePrinter.setText("Salvar"); + btnSavePrinter.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSavePrinterActionPerformed(evt); + } + }); + + jLabel10.setText("Nome da Instituição:"); + + jLabel11.setText("Endereço da Instituição:"); + + txtLibraryName.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtLibraryNameActionPerformed(evt); + } + }); + + btnLibraryAddress.setText("Salvar"); + btnLibraryAddress.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnLibraryAddressActionPerformed(evt); + } + }); + + btnLibraryName.setText("Salvar"); + btnLibraryName.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnLibraryNameActionPerformed(evt); + } + }); + + lblLibraryLogo.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED, java.awt.Color.white, java.awt.Color.darkGray)); + + btnSetLibraryLogo.setText("Selecione"); + btnSetLibraryLogo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSetLibraryLogoActionPerformed(evt); + } + }); + + jLabel13.setText("Logotipo da Instituição"); + + jLabel12.setText("Usuario banco de Dados:"); + + btnSaveUserDB.setText("Salvar"); + btnSaveUserDB.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSaveUserDBActionPerformed(evt); + } + }); + + jLabel15.setText("Senha Banco de Dados:"); + + btnSavePassDB.setText("Salvar"); + btnSavePassDB.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSavePassDBActionPerformed(evt); + } + }); + + btnSaveMsgRecibo.setText("Salvar"); + btnSaveMsgRecibo.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSaveMsgReciboActionPerformed(evt); + } + }); + + jLabel16.setText("Mensagem Recibo:"); + + jLabel21.setText("Tipo de Banco de Dados:"); + + boxDBType.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "postgresql", "mysql" })); + boxDBType.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxDBTypeMouseClicked(evt); + } + }); + boxDBType.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + boxDBTypeActionPerformed(evt); + } + }); + + btnSaveDBType.setText("Salvar"); + btnSaveDBType.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSaveDBTypeActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); + jPanel2.setLayout(jPanel2Layout); + jPanel2Layout.setHorizontalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(17, 17, 17) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel6) + .addGap(18, 18, 18) + .addComponent(txtIp, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnSaveIp)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel12) + .addGap(18, 18, 18) + .addComponent(txtUserDB, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnSaveUserDB)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel15) + .addGap(18, 18, 18) + .addComponent(txtPassDB, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnSavePassDB)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel21) + .addGap(18, 18, 18) + .addComponent(boxDBType, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnSaveDBType)) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel9) + .addGap(18, 18, 18) + .addComponent(boxPrinter, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnSavePrinter)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addComponent(jLabel16) + .addGap(18, 18, 18) + .addComponent(txtmsgRecibo, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(24, 24, 24) + .addComponent(btnSaveMsgRecibo)))) + .addGap(66, 66, 66) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(38, 38, 38) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(lblLibraryLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(jPanel2Layout.createSequentialGroup() + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(btnSetLibraryLogo))) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(7, 7, 7) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel10)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(txtLibraryName, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(txtLibraryAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(24, 24, 24) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnLibraryName) + .addComponent(btnLibraryAddress)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) + ); + jPanel2Layout.setVerticalGroup( + jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createSequentialGroup() + .addGap(12, 12, 12) + .addComponent(jLabel13) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(lblLibraryLogo, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnSetLibraryLogo) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel21) + .addComponent(boxDBType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSaveDBType)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel6) + .addComponent(txtIp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSaveIp)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel12) + .addComponent(txtUserDB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSaveUserDB)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel15) + .addComponent(btnSavePassDB)) + .addComponent(txtPassDB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnSaveMsgRecibo) + .addComponent(jLabel16) + .addComponent(txtmsgRecibo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel9) + .addComponent(boxPrinter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnSavePrinter)) + .addGap(18, 18, 18) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel10) + .addComponent(txtLibraryName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnLibraryName)) + .addGap(23, 23, 23) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel11) + .addComponent(txtLibraryAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnLibraryAddress)) + .addGap(132, 132, 132)) + ); + + jTabbedPane2.addTab("Geral", jPanel2); + + jLabel2.setText("Piso:"); + + jLabel3.setText("Corredor:"); + + jLabel4.setText("Posição:"); + + jLabel5.setText("Seção:"); + + txtSecao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + txtSecaoActionPerformed(evt); + } + }); + + btnAddPiso.setText("Add"); + btnAddPiso.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddPisoActionPerformed(evt); + } + }); + + btnAddCorredor.setText("Add"); + btnAddCorredor.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddCorredorActionPerformed(evt); + } + }); + + btnAddPosicao.setText("Add"); + btnAddPosicao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddPosicaoActionPerformed(evt); + } + }); + + btnAddSecao.setText("Add"); + btnAddSecao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddSecaoActionPerformed(evt); + } + }); + + boxCorredor.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "<Lista de Corredores>" })); + boxCorredor.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxCorredorMouseClicked(evt); + } + }); + + boxPiso.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<Lista de Pisos>" })); + boxPiso.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxPisoMouseClicked(evt); + } + }); + + boxPosicao.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "<Lista de Posições>" })); + boxPosicao.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxPosicaoMouseClicked(evt); + } + }); + + boxSecao.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "<Lista de Seções>" })); + boxSecao.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxSecaoMouseClicked(evt); + } + }); + + btnExcluirPiso.setText("Apagar"); + btnExcluirPiso.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirPisoActionPerformed(evt); + } + }); + + btnApagarCorredor.setText("Apagar"); + btnApagarCorredor.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnApagarCorredorActionPerformed(evt); + } + }); + + btnApagarPosicao.setText("Apagar"); + btnApagarPosicao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnApagarPosicaoActionPerformed(evt); + } + }); + + btnApagarSecao.setText("Apagar"); + btnApagarSecao.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnApagarSecaoActionPerformed(evt); + } + }); + + btnAddDsiponibilidade.setText("Add"); + btnAddDsiponibilidade.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddDsiponibilidadeActionPerformed(evt); + } + }); + + jLabel7.setText("Disponibilidade:"); + + boxDisponibilidade.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Quantos dias pode ser locado" })); + boxDisponibilidade.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxDisponibilidadeMouseClicked(evt); + } + }); + + btnApagarDisponibilidade.setText("Apagar"); + btnApagarDisponibilidade.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnApagarDisponibilidadeActionPerformed(evt); + } + }); + + jLabel8.setText("Configura para qtos dias o livro pode ser locado ( Zero para Apenas Leitura Interna)"); + + jLabel14.setText("Tipo de Usuários:"); + + btnAddtipos.setText("Add"); + btnAddtipos.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnAddtiposActionPerformed(evt); + } + }); + + boxTipos.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "<Lista de Tipos de Usuários>" })); + boxTipos.addMouseListener(new java.awt.event.MouseAdapter() { + public void mouseClicked(java.awt.event.MouseEvent evt) { + boxTiposMouseClicked(evt); + } + }); + boxTipos.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + boxTiposActionPerformed(evt); + } + }); + + btnExcluirTipos.setText("Apagar"); + btnExcluirTipos.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnExcluirTiposActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); + jPanel3.setLayout(jPanel3Layout); + jPanel3Layout.setHorizontalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(136, 136, 136) + .addComponent(jLabel8)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(21, 21, 21) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel5) + .addComponent(jLabel4) + .addComponent(jLabel3) + .addComponent(jLabel2) + .addComponent(jLabel7)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(txtPiso) + .addComponent(txtCorredor) + .addComponent(txtPosicao) + .addComponent(txtSecao) + .addComponent(txtDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(btnAddPosicao) + .addGap(18, 18, 18) + .addComponent(boxPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnApagarPosicao)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(btnAddCorredor) + .addGap(18, 18, 18) + .addComponent(boxCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnApagarCorredor)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(btnAddPiso) + .addGap(18, 18, 18) + .addComponent(boxPiso, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnExcluirPiso)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(btnAddDsiponibilidade) + .addGap(18, 18, 18) + .addComponent(boxDisponibilidade, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup() + .addComponent(btnAddSecao) + .addGap(18, 18, 18) + .addComponent(boxSecao, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(btnApagarSecao) + .addComponent(btnApagarDisponibilidade)))))) + .addContainerGap(54, Short.MAX_VALUE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(jLabel14) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(txtTipos, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(btnAddtipos) + .addGap(18, 18, 18) + .addComponent(boxTipos, javax.swing.GroupLayout.PREFERRED_SIZE, 225, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(btnExcluirTipos) + .addGap(48, 48, 48)) + ); + jPanel3Layout.setVerticalGroup( + jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGap(37, 37, 37) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel2) + .addComponent(btnAddPiso) + .addComponent(boxPiso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnExcluirPiso)) + .addComponent(txtPiso, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnAddCorredor) + .addComponent(boxCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnApagarCorredor) + .addComponent(txtCorredor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel3)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(txtPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel4) + .addComponent(btnAddPosicao) + .addComponent(boxPosicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnApagarPosicao)) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnAddSecao) + .addComponent(txtSecao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel5)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(boxSecao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnApagarSecao))) + .addGap(18, 18, 18) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnAddDsiponibilidade) + .addComponent(boxDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnApagarDisponibilidade)) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel7) + .addComponent(txtDisponibilidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jLabel8) + .addGap(14, 14, 14) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(btnAddtipos) + .addComponent(boxTipos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(btnExcluirTipos) + .addComponent(txtTipos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(jLabel14)) + .addContainerGap(140, Short.MAX_VALUE)) + ); + + jTabbedPane2.addTab("Biblioteca", jPanel3); + + jLabel17.setText("Tema Padrão:"); + + btnSaveTheme.setText("Salvar"); + btnSaveTheme.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + btnSaveThemeActionPerformed(evt); + } + }); + + cboxTema.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Tema Claro", "Tema Escuro" })); + cboxTema.setSelectedIndex(-1); + cboxTema.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + cboxTemaActionPerformed(evt); + } + }); + + javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); + jPanel4.setLayout(jPanel4Layout); + jPanel4Layout.setHorizontalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(39, 39, 39) + .addComponent(jLabel17) + .addGap(18, 18, 18) + .addComponent(cboxTema, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(btnSaveTheme) + .addContainerGap(279, Short.MAX_VALUE)) + ); + jPanel4Layout.setVerticalGroup( + jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel4Layout.createSequentialGroup() + .addGap(38, 38, 38) + .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) + .addComponent(jLabel17) + .addComponent(btnSaveTheme) + .addComponent(cboxTema, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addContainerGap(407, Short.MAX_VALUE)) + ); + + jTabbedPane2.addTab("Aparência", jPanel4); + + javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); + getContentPane().setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(jTabbedPane2) + ); + 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) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(jTabbedPane2) + .addContainerGap()) + ); + + pack(); + setLocationRelativeTo(null); + }// </editor-fold>//GEN-END:initComponents + + private void txtSecaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSecaoActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtSecaoActionPerformed + + private void btnAddSecaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddSecaoActionPerformed + Options obj = new Options(); + obj.setSecao(txtSecao.getText()); + OptionsDao dao = new OptionsDao(); + dao.cadastrarSecao(obj); + }//GEN-LAST:event_btnAddSecaoActionPerformed + + // botao excluir corredor + private void btnApagarCorredorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApagarCorredorActionPerformed + Options obj = new Options(); + obj.setCorredor((String) boxCorredor.getSelectedItem());// aqui + OptionsDao dao = new OptionsDao(); + dao.excluirCorredor(obj); + }//GEN-LAST:event_btnApagarCorredorActionPerformed + + // botao add piso + private void btnAddPisoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddPisoActionPerformed + Options obj = new Options(); + obj.setPiso(txtPiso.getText()); + OptionsDao dao = new OptionsDao(); + dao.cadastrarPiso(obj); + }//GEN-LAST:event_btnAddPisoActionPerformed + + //combobox Piso + private void boxPisoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxPisoMouseClicked + String boxPisoString = (String) boxPiso.getSelectedItem(); + boxPiso.removeAllItems(); + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarPiso(); + for (Options f : ListaOptions) { + boxPiso.insertItemAt(f.getPiso(), boxPiso.getItemCount()); + } + boxPiso.setSelectedItem(boxPisoString); + }//GEN-LAST:event_boxPisoMouseClicked + + //botao excluir piso + private void btnExcluirPisoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirPisoActionPerformed + Options obj = new Options(); + obj.setPiso((String) boxPiso.getSelectedItem());// aqui + OptionsDao dao = new OptionsDao(); + dao.excluirPiso(obj); + }//GEN-LAST:event_btnExcluirPisoActionPerformed + + //botao add corredor + private void btnAddCorredorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddCorredorActionPerformed + Options obj = new Options(); + obj.setCorredor(txtCorredor.getText()); + OptionsDao dao = new OptionsDao(); + dao.cadastrarCorredor(obj); + }//GEN-LAST:event_btnAddCorredorActionPerformed + + // combobox corredor + private void boxCorredorMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxCorredorMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarCorredor(); + boxCorredor.removeAllItems(); + for (Options f : ListaOptions) { + boxCorredor.addItem(f.getCorredor()); + } + }//GEN-LAST:event_boxCorredorMouseClicked + + private void btnAddPosicaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddPosicaoActionPerformed + Options obj = new Options(); + obj.setPosicao(txtPosicao.getText()); + OptionsDao dao = new OptionsDao(); + dao.cadastrarPosicao(obj); + }//GEN-LAST:event_btnAddPosicaoActionPerformed + + private void boxPosicaoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxPosicaoMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarPosicao(); + boxPosicao.removeAllItems(); + for (Options f : ListaOptions) { + boxPosicao.addItem(f.getPosicao()); + } + }//GEN-LAST:event_boxPosicaoMouseClicked + + private void btnApagarPosicaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApagarPosicaoActionPerformed + Options obj = new Options(); + obj.setPosicao((String) boxPosicao.getSelectedItem());// aqui + OptionsDao dao = new OptionsDao(); + dao.excluirPosicao(obj); + }//GEN-LAST:event_btnApagarPosicaoActionPerformed + + private void boxSecaoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxSecaoMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarSecao(); + boxSecao.removeAllItems(); + for (Options f : ListaOptions) { + boxSecao.addItem(f.getSecao()); + } + }//GEN-LAST:event_boxSecaoMouseClicked + + private void btnApagarSecaoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApagarSecaoActionPerformed + Options obj = new Options(); + obj.setSecao((String) boxSecao.getSelectedItem());// aqui + OptionsDao dao = new OptionsDao(); + dao.excluirSecao(obj); + }//GEN-LAST:event_btnApagarSecaoActionPerformed + + private void btnAddDsiponibilidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddDsiponibilidadeActionPerformed + Options obj = new Options(); + obj.setDisponibilidade(txtDisponibilidade.getText()); + OptionsDao dao = new OptionsDao(); + dao.cadastrarDisponibilidade(obj); + }//GEN-LAST:event_btnAddDsiponibilidadeActionPerformed + + private void boxDisponibilidadeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxDisponibilidadeMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarDisponibilidade(); + boxDisponibilidade.removeAllItems(); + for (Options f : ListaOptions) { + boxDisponibilidade.addItem(f.getDisponibilidade()); + } + }//GEN-LAST:event_boxDisponibilidadeMouseClicked + + private void btnApagarDisponibilidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnApagarDisponibilidadeActionPerformed + Options obj = new Options(); + obj.setDisponibilidade((String) boxDisponibilidade.getSelectedItem());// aqui + OptionsDao dao = new OptionsDao(); + dao.excluirDisponibilidade(obj); + }//GEN-LAST:event_btnApagarDisponibilidadeActionPerformed + + private void txtLibraryNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtLibraryNameActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_txtLibraryNameActionPerformed + + private void btnAddtiposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddtiposActionPerformed + Options obj = new Options(); + obj.setTipos_de_usuarios(txtTipos.getText()); + OptionsDao dao = new OptionsDao(); + dao.cadastrarTipos_de_usuarios(obj); + }//GEN-LAST:event_btnAddtiposActionPerformed + + private void boxTiposMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxTiposMouseClicked + OptionsDao dao = new OptionsDao(); + List<Options> ListaOptions = dao.listarTipos_de_usuarios(); + boxTipos.removeAllItems(); + for (Options f : ListaOptions) { + boxTipos.addItem(f.getTipos_de_usuarios()); + } + }//GEN-LAST:event_boxTiposMouseClicked + + private void btnExcluirTiposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExcluirTiposActionPerformed + Options obj = new Options(); + obj.setTipos_de_usuarios((String) boxTipos.getSelectedItem());// aqui + OptionsDao dao = new OptionsDao(); + dao.excluirTipos_de_usuarios(obj); + }//GEN-LAST:event_btnExcluirTiposActionPerformed + + private void boxTiposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxTiposActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_boxTiposActionPerformed + + + private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated + //impressoas padrão aqui + OptionsDao op = new OptionsDao(); + try { + txtLibraryName.setText(op.retornaOption(15)); + txtLibraryAddress.setText(op.retornaOption(16)); + //set txtUserDB content at startup + String content; + content = new String(Files.readAllBytes(Paths.get("C:\\Librography\\DBUser"))); + txtUserDB.setText(content); + } catch (SQLException ex) { + Logger.getLogger(FormOptions.class.getName()).log(Level.SEVERE, null, ex); + } catch (IOException ex) { + Logger.getLogger(FormOptions.class.getName()).log(Level.SEVERE, null, ex); + } + //set ipserver txt + String contentUser = null; + try { + contentUser = new String(Files.readAllBytes(Paths.get("C:\\Librography\\ipserver"))); + } catch (IOException ex) { + Logger.getLogger(FormOptions.class.getName()).log(Level.SEVERE, null, ex); + } + txtIp.setText(contentUser); + + String contentPAss = null; + try { + contentPAss = new String(Files.readAllBytes(Paths.get("C:\\Librography\\DBPass"))); + } catch (IOException ex) { + Logger.getLogger(FormOptions.class.getName()).log(Level.SEVERE, null, ex); + } + txtPassDB.setText(contentPAss); + + //imagem logotipo mostrando aqui + String path = "C:\\Librography\\images\\libraryLogo.png"; + lblLibraryLogo.setIcon(ResizeLibraryLogoImage(path)); + + }//GEN-LAST:event_formWindowActivated + + private void btnSetLibraryLogoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSetLibraryLogoActionPerformed + JFileChooser jfile = new JFileChooser(); + int result = jfile.showSaveDialog(this); + File selectedFile = jfile.getSelectedFile(); + String filename = selectedFile.getName(); + if (filename.endsWith(".png") || filename.endsWith(".PNG")) { + FileNameExtensionFilter filter = new FileNameExtensionFilter("*.image", "png"); + jfile.addChoosableFileFilter(filter); + if (result == JFileChooser.APPROVE_OPTION) { + File selectedImage = jfile.getSelectedFile(); + String path = selectedImage.getAbsolutePath(); + BufferedImage image; + try { + image = ImageIO.read(selectedImage); + ImageIO.write(image, "png", new File("C:\\Librography\\images\\" + "libraryLogo.png")); + } catch (IOException ex) { + Logger.getLogger(Image.class.getName()).log(Level.SEVERE, null, ex); + } + try { + lblLibraryLogo.setIcon(ResizeLibraryLogoImage(path)); + // imagePathStr = path; + + } catch (Exception e) { + JOptionPane.showMessageDialog(this, "Image Error" + e.getMessage()); + } + } + } else { + JOptionPane.showMessageDialog(rootPane, "Por Favor Seleciona um arquivo do tipo png", "Tente Novamente!", 1); + } + }//GEN-LAST:event_btnSetLibraryLogoActionPerformed + + private void btnLibraryNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLibraryNameActionPerformed + try { + Options obj = new Options(); + obj.setLibrary_name((String) txtLibraryName.getText());// aqui + OptionsDao dao = new OptionsDao(); + dao.setLibraryName(obj); + JOptionPane.showMessageDialog(null, "Registro Salvo!"); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro:" + e); + } + }//GEN-LAST:event_btnLibraryNameActionPerformed + + private void btnLibraryAddressActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLibraryAddressActionPerformed + try { + Options obj = new Options(); + obj.setLibrary_name((String) txtLibraryAddress.getText());// aqui + OptionsDao dao = new OptionsDao(); + dao.setLibraryAddress(obj); + JOptionPane.showMessageDialog(null, "Registro Salvo!"); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro:" + e); + } + }//GEN-LAST:event_btnLibraryAddressActionPerformed + + private void boxPrinterMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxPrinterMouseClicked + PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null); + boxPrinter.addItem("Dialogo"); + for (PrintService printer : printServices) { + boxPrinter.addItem(printer.getName()); + } + }//GEN-LAST:event_boxPrinterMouseClicked + + private void btnSavePrinterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSavePrinterActionPerformed + try { + //mudar para dao com esse + PrintWriter out = new PrintWriter(new FileWriter("C:\\Librography\\DefaultPrinter")); + String printer = (String) boxPrinter.getSelectedItem(); + //System.out.println(printer); + out.println(printer); + out.close(); + } catch (IOException e1) { + System.err.println("Error occurred"); + e1.printStackTrace(); + } + }//GEN-LAST:event_btnSavePrinterActionPerformed + + private void btnSaveMsgReciboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveMsgReciboActionPerformed + try { + Options obj = new Options(); + obj.setReceiptMsg((String) txtmsgRecibo.getText());// aqui + OptionsDao dao = new OptionsDao(); + dao.setReceiptMsg(obj); + JOptionPane.showMessageDialog(null, "Registro Salvo!"); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro:" + e); + } + }//GEN-LAST:event_btnSaveMsgReciboActionPerformed + + private void btnSaveThemeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveThemeActionPerformed + OptionsDao optionsdao = new OptionsDao(); + optionsdao.setTheme((int) cboxTema.getSelectedIndex()); + JOptionPane.showMessageDialog(null, "Tema Salvo! reinicie o aplicativo para aplicar!"); + }//GEN-LAST:event_btnSaveThemeActionPerformed + + private void btnSavePassDBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSavePassDBActionPerformed + try { + PrintWriter out = new PrintWriter(new FileWriter("C:\\Librography\\DBPass")); + txtPassDB.write(out); + } catch (IOException e1) { + System.err.println("Error occurred"); + e1.printStackTrace(); + } + }//GEN-LAST:event_btnSavePassDBActionPerformed + + private void btnSaveUserDBActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveUserDBActionPerformed + try { + PrintWriter out = new PrintWriter(new FileWriter("C:\\Librography\\DBUser")); + txtUserDB.write(out); + } catch (IOException e1) { + System.err.println("Error occurred"); + e1.printStackTrace(); + } + + }//GEN-LAST:event_btnSaveUserDBActionPerformed + + private void btnSaveIpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveIpActionPerformed + try { + //mudar para dao com esse + PrintWriter out = new PrintWriter(new FileWriter("C:\\Librography\\ipserver")); + //txtIp.getText(); + txtIp.write(out); + } catch (IOException e1) { + System.err.println("Error occurred"); + e1.printStackTrace(); + } + //editar + //mostrar ip no inicio + try { + Options obj = new Options(); + obj.setServer_ip((String) txtIp.getText());// aqui + OptionsDao dao = new OptionsDao(); + dao.setIp(obj); + JOptionPane.showMessageDialog(null, "Ip Salvo!"); + } catch (Exception e) { + JOptionPane.showMessageDialog(null, "Erro:" + e); + } + }//GEN-LAST:event_btnSaveIpActionPerformed + + private void boxDBTypeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_boxDBTypeMouseClicked + // PrintService[] printServices = PrintServiceLookup.lookupPrintServices(null, null); + //boxDBType.addItem("Dialogo"); + // for (PrintService printer : printServices) { + //boxDBType.addItem(printer.getName()); + // erro + // } + }//GEN-LAST:event_boxDBTypeMouseClicked + + private void btnSaveDBTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveDBTypeActionPerformed + try { + //mudar para dao com esse + + FileOutputStream out = new FileOutputStream("C:\\Librography\\DBType"); + String printer = (String) boxDBType.getSelectedItem(); + out.write(printer.trim().getBytes()); + out.close(); + //System.out.println(printer); + + } catch (IOException e1) { + System.err.println("Error occurred"); + e1.printStackTrace(); + } + + }//GEN-LAST:event_btnSaveDBTypeActionPerformed + + private void boxDBTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxDBTypeActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_boxDBTypeActionPerformed + + private void boxPrinterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_boxPrinterActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_boxPrinterActionPerformed + + private void cboxTemaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cboxTemaActionPerformed + // TODO add your handling code here: + }//GEN-LAST:event_cboxTemaActionPerformed + + //############################################################################ + /** + * @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(FormOptions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (InstantiationException ex) { + java.util.logging.Logger.getLogger(FormOptions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (IllegalAccessException ex) { + java.util.logging.Logger.getLogger(FormOptions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (javax.swing.UnsupportedLookAndFeelException ex) { + java.util.logging.Logger.getLogger(FormOptions.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + //</editor-fold> + + /* Create and display the form */ + java.awt.EventQueue.invokeLater(new Runnable() { + public void run() { + new FormOptions().setVisible(true); + } + }); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JComboBox<String> boxCorredor; + private javax.swing.JComboBox<String> boxDBType; + private javax.swing.JComboBox<String> boxDisponibilidade; + private javax.swing.JComboBox boxPiso; + private javax.swing.JComboBox<String> boxPosicao; + private javax.swing.JComboBox<String> boxPrinter; + private javax.swing.JComboBox<String> boxSecao; + private javax.swing.JComboBox boxTipos; + private javax.swing.JButton btnAddCorredor; + private javax.swing.JButton btnAddDsiponibilidade; + private javax.swing.JButton btnAddPiso; + private javax.swing.JButton btnAddPosicao; + private javax.swing.JButton btnAddSecao; + private javax.swing.JButton btnAddtipos; + private javax.swing.JButton btnApagarCorredor; + private javax.swing.JButton btnApagarDisponibilidade; + private javax.swing.JButton btnApagarPosicao; + private javax.swing.JButton btnApagarSecao; + private javax.swing.JButton btnExcluirPiso; + private javax.swing.JButton btnExcluirTipos; + private javax.swing.JButton btnLibraryAddress; + private javax.swing.JButton btnLibraryName; + private javax.swing.JButton btnSaveDBType; + private javax.swing.JButton btnSaveIp; + private javax.swing.JButton btnSaveMsgRecibo; + private javax.swing.JButton btnSavePassDB; + private javax.swing.JButton btnSavePrinter; + private javax.swing.JButton btnSaveTheme; + private javax.swing.JButton btnSaveUserDB; + private javax.swing.JButton btnSetLibraryLogo; + private javax.swing.JComboBox<String> cboxTema; + 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 jLabel2; + private javax.swing.JLabel jLabel21; + 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 jPanel3; + private javax.swing.JPanel jPanel4; + private javax.swing.JTabbedPane jTabbedPane2; + private javax.swing.JLabel lblLibraryLogo; + private javax.swing.JTextField txtCorredor; + private javax.swing.JTextField txtDisponibilidade; + private javax.swing.JTextField txtIp; + private javax.swing.JTextField txtLibraryAddress; + private javax.swing.JTextField txtLibraryName; + private javax.swing.JPasswordField txtPassDB; + private javax.swing.JTextField txtPiso; + private javax.swing.JTextField txtPosicao; + private javax.swing.JTextField txtSecao; + private javax.swing.JTextField txtTipos; + private javax.swing.JTextField txtUserDB; + private javax.swing.JTextField txtmsgRecibo; + // End of variables declaration//GEN-END:variables +private ImageIcon ResizeLibraryLogoImage(String imgPath) { //192x261 + int imageX = 143; + int imageY = 146; + lblLibraryLogo.setSize(imageX, imageY); + + ImageIcon myImage = new ImageIcon(imgPath); + Image img = myImage.getImage(); + Image newImage = img.getScaledInstance(lblLibraryLogo.getWidth(), lblLibraryLogo.getHeight(), Image.SCALE_SMOOTH); + ImageIcon image = new ImageIcon(newImage); + return image; + } + +} diff --git a/src/imagens/book_cover.png b/src/imagens/book_cover.png new file mode 100644 index 0000000..8c2ce13 Binary files /dev/null and b/src/imagens/book_cover.png differ diff --git a/src/imagens/bookloc.png b/src/imagens/bookloc.png new file mode 100644 index 0000000..0d7bb9d Binary files /dev/null and b/src/imagens/bookloc.png differ diff --git a/src/imagens/books_small.png b/src/imagens/books_small.png new file mode 100644 index 0000000..031563a Binary files /dev/null and b/src/imagens/books_small.png differ diff --git a/src/imagens/boook.png b/src/imagens/boook.png new file mode 100644 index 0000000..1be3b6a Binary files /dev/null and b/src/imagens/boook.png differ diff --git a/src/imagens/cancel_small.png b/src/imagens/cancel_small.png new file mode 100644 index 0000000..9a0623f Binary files /dev/null and b/src/imagens/cancel_small.png differ diff --git a/src/imagens/cardBackground.jpg b/src/imagens/cardBackground.jpg new file mode 100644 index 0000000..f222622 Binary files /dev/null and b/src/imagens/cardBackground.jpg differ diff --git a/src/imagens/config.png b/src/imagens/config.png new file mode 100644 index 0000000..090a82c Binary files /dev/null and b/src/imagens/config.png differ diff --git a/src/imagens/delete_small.png b/src/imagens/delete_small.png new file mode 100644 index 0000000..37d8835 Binary files /dev/null and b/src/imagens/delete_small.png differ diff --git a/src/imagens/edit_small.png b/src/imagens/edit_small.png new file mode 100644 index 0000000..404d968 Binary files /dev/null and b/src/imagens/edit_small.png differ diff --git a/src/imagens/funcionario.png b/src/imagens/funcionario.png new file mode 100644 index 0000000..5bac88f Binary files /dev/null and b/src/imagens/funcionario.png differ diff --git a/src/imagens/iconfinder_20_Graduation_2064495.png b/src/imagens/iconfinder_20_Graduation_2064495.png new file mode 100644 index 0000000..a8f223d Binary files /dev/null and b/src/imagens/iconfinder_20_Graduation_2064495.png differ diff --git a/src/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png b/src/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png new file mode 100644 index 0000000..66bd80d Binary files /dev/null and b/src/imagens/iconfinder_Door_enter_entrance_exit_leave_logout_out_quit_4831032.png differ diff --git a/src/imagens/iconfinder_General_Office_01_3592874 (1).png b/src/imagens/iconfinder_General_Office_01_3592874 (1).png new file mode 100644 index 0000000..8f60cff Binary files /dev/null and b/src/imagens/iconfinder_General_Office_01_3592874 (1).png differ diff --git a/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (1).png b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (1).png new file mode 100644 index 0000000..7c36dca Binary files /dev/null and b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (1).png differ diff --git a/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (2).png b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (2).png new file mode 100644 index 0000000..11f22f6 Binary files /dev/null and b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (2).png differ diff --git a/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (3).png b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (3).png new file mode 100644 index 0000000..be4ac34 Binary files /dev/null and b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082 (3).png differ diff --git a/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082.png b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082.png new file mode 100644 index 0000000..5a82d65 Binary files /dev/null and b/src/imagens/iconfinder_ID-card-avatar-student-education-school-library_5269082.png differ diff --git a/src/imagens/iconfinder_Learner_pupil_reader_scholar_student_4763273.png b/src/imagens/iconfinder_Learner_pupil_reader_scholar_student_4763273.png new file mode 100644 index 0000000..b8d3012 Binary files /dev/null and b/src/imagens/iconfinder_Learner_pupil_reader_scholar_student_4763273.png differ diff --git a/src/imagens/iconfinder_education-school-learn-study-04_2125342.png b/src/imagens/iconfinder_education-school-learn-study-04_2125342.png new file mode 100644 index 0000000..5348b21 Binary files /dev/null and b/src/imagens/iconfinder_education-school-learn-study-04_2125342.png differ diff --git a/src/imagens/iconfinder_student_309036 (1).png b/src/imagens/iconfinder_student_309036 (1).png new file mode 100644 index 0000000..b9660d1 Binary files /dev/null and b/src/imagens/iconfinder_student_309036 (1).png differ diff --git a/src/imagens/iconfinder_student_309036 (2).png b/src/imagens/iconfinder_student_309036 (2).png new file mode 100644 index 0000000..25ae44b Binary files /dev/null and b/src/imagens/iconfinder_student_309036 (2).png differ diff --git a/src/imagens/iconfinder_student_309036.png b/src/imagens/iconfinder_student_309036.png new file mode 100644 index 0000000..fc063be Binary files /dev/null and b/src/imagens/iconfinder_student_309036.png differ diff --git a/src/imagens/iconfinder_user_student_black_93426.png b/src/imagens/iconfinder_user_student_black_93426.png new file mode 100644 index 0000000..74abafa Binary files /dev/null and b/src/imagens/iconfinder_user_student_black_93426.png differ diff --git a/src/imagens/leitor.png b/src/imagens/leitor.png new file mode 100644 index 0000000..48b1f22 Binary files /dev/null and b/src/imagens/leitor.png differ diff --git a/src/imagens/new_file_small.png b/src/imagens/new_file_small.png new file mode 100644 index 0000000..a7fea00 Binary files /dev/null and b/src/imagens/new_file_small.png differ diff --git a/src/imagens/pass-small.png b/src/imagens/pass-small.png new file mode 100644 index 0000000..eb61d3b Binary files /dev/null and b/src/imagens/pass-small.png differ diff --git a/src/imagens/print_small.png b/src/imagens/print_small.png new file mode 100644 index 0000000..3cfffe1 Binary files /dev/null and b/src/imagens/print_small.png differ diff --git a/src/imagens/provider.png b/src/imagens/provider.png new file mode 100644 index 0000000..586ee28 Binary files /dev/null and b/src/imagens/provider.png differ diff --git a/src/imagens/right_small.png b/src/imagens/right_small.png new file mode 100644 index 0000000..47adffa Binary files /dev/null and b/src/imagens/right_small.png differ diff --git a/src/imagens/save_small.png b/src/imagens/save_small.png new file mode 100644 index 0000000..c498cec Binary files /dev/null and b/src/imagens/save_small.png differ diff --git a/src/imagens/settings_small.png b/src/imagens/settings_small.png new file mode 100644 index 0000000..9871b2c Binary files /dev/null and b/src/imagens/settings_small.png differ diff --git a/src/imagens/update_small.png b/src/imagens/update_small.png new file mode 100644 index 0000000..364e41b Binary files /dev/null and b/src/imagens/update_small.png differ diff --git a/src/imagens/userPass_small.png b/src/imagens/userPass_small.png new file mode 100644 index 0000000..6cef08c Binary files /dev/null and b/src/imagens/userPass_small.png differ diff --git a/src/imagens/user_small.png b/src/imagens/user_small.png new file mode 100644 index 0000000..8458f15 Binary files /dev/null and b/src/imagens/user_small.png differ