Package carcel.views

Examples of carcel.views.PanelListener


                 if (CarcelConstants.INTERNA.equals(type)) {
                     setCelda(celda);
                     ec.persist(celda, false);
                     CeldaInternaController cic = new CeldaInternaController(celda, null);
                     final WindowsCreator wc = new WindowsCreator(frame, cic,true);
                     cic.setPanelListener(new PanelListener() {

                        public void onPanelClose() {
                            wc.dispose();
                        }
                    });
                 }
                 else if (CarcelConstants.DOMICILIARIA.equals(type)) {
                     setCelda(celda);
                     ec.persist(celda, false);
                     CeldaDomiciliariaController cdc = new CeldaDomiciliariaController(celda, null);
                     final WindowsCreator wc = new WindowsCreator(frame, cdc,true);
                     cdc.setPanelListener(new PanelListener() {

                        public void onPanelClose() {
                            wc.dispose();
                        }
                    });
View Full Code Here


            @Override
            public void onActionExecute(Pabellon entity) {
                System.out.println("APreto?");
                PabellonController pabellonController = new PabellonController(null, null);
                final WindowsCreator wc = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), pabellonController, true);
                pabellonController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        wc.dispose();
                    }
                });  
View Full Code Here

    private void addButtonHand() {
        nuevoPabellonPR.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                PabellonController pabellonController = new PabellonController(null, null);
                final WindowsCreator wc = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), pabellonController, true);
                pabellonController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        wc.dispose();
                    }
                });
View Full Code Here


                    final EstadoPresoController estadoPresoController = new EstadoPresoController(null, p, true);

                    final WindowsCreator ventana = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), estadoPresoController, true);
                    estadoPresoController.setPanelListener(new PanelListener() {

                        public void onPanelClose() {
                            ventana.dispose();
                        }
                    });
                    listener.onPanelClose();
                } catch (UIValidateException ex) {
                    MessageGenerator.showWarningMsj("Guardar", ex.getMessage());
                }

            }
        });
        eliminarButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                if (p != null) {
                    if (MessageGenerator.showYesNoMsj("Eliminar", "Desea eliminar el detenido? No podra deshacer el cambio.") == JOptionPane.YES_OPTION) {
                        p.setEnabled(false);
                        Celda c = (Celda) ec.createQuery("select a.celda from AsignacionPresoCelda a where a.preso = :preso and a.fechaDesde >= (select max(a2.fechaDesde) from AsignacionPresoCelda a2 where a2.preso = a.preso)", AsignacionPresoCelda.class).setParameter("preso", p).getSingleResult();
                        modificarEstadoCelda(c);
                        ec.updateEntity(p);
                        MessageGenerator.showWarningMsj("Eliminar", "Dato Eliminado");
                        listener.onPanelClose();
                    }

                }
            }
        });

        asignarCeldaButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                final AsignacionPresoController asignacionPresoController = new AsignacionPresoController(p, false);
                final WindowsCreator v2 = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), asignacionPresoController, true);
                asignacionPresoController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        v2.dispose();
                    }
                });
                listener.onPanelClose();
            }
        });

        asignarEstadoButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                final EstadoPresoController estadoPresoController = new EstadoPresoController(null, p, false);

                final WindowsCreator ventana = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), estadoPresoController, true);
                estadoPresoController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        ventana.dispose();
                    }
                });
                listener.onPanelClose();
            }
        });

        cargarFotoButt.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                FileChooser chooser = new FileChooser();
                int returnVal = chooser.showOpenDialog(PresoController.this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    try {
                        File file = chooser.getSelectedFile();
                        if (file.exists()) {
                            System.out.println("File " + file.getPath());
                            fotoPersonal = new ImageIcon(file.getPath());
                            if (fotoPersonal.getIconHeight() <= ICON_HEIGHT && fotoPersonal.getIconWidth() <= ICON_WIDTH) {
                                fotoLabel.setIcon(fotoPersonal);
                                InputStream fis = new FileInputStream(file);
                                bufferFoto = new byte[(int) file.length()];
                                int readers = fis.read(bufferFoto);
                                System.out.println("Hola");
                            } else {
                                MessageGenerator.showWarningMsj("Imagen", "La imagen es muy grande");
                            }
                        }
                    } catch (IOException ex) {
                        Logger.getLogger(PresoController.class.getName()).log(Level.SEVERE, null, ex);
                    }

                }

            }
        });


        cargarHuellaBt.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                FileChooser chooser = new FileChooser();
                int returnVal = chooser.showOpenDialog(PresoController.this);

                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    File file = chooser.getSelectedFile();
                    //This is where a real application would open the file.
                    System.out.println("File " + file.getPath());

                    if (file.exists()) {
                        System.out.println("Tamaño " + file.length());
                        InputStream fis = null;
                        try {
                            System.out.println("File " + file.getPath());
                            huellaDactilar = new ImageIcon(file.getPath());
                            if (huellaDactilar.getIconHeight() <= ICON_HEIGHT && huellaDactilar.getIconWidth() <= ICON_WIDTH) {
                                huellaLabel.setIcon(huellaDactilar);
                                fis = new FileInputStream(file);
                                bufferHuella = new byte[(int) file.length()];
                                int readers = fis.read(bufferHuella);
                                System.out.println("Hola");
                            } else {
                                MessageGenerator.showWarningMsj("Imagen", "La imagen es muy grande");
                            }
                        } catch (IOException ex) {
                            Logger.getLogger(PresoController.class.getName()).log(Level.SEVERE, null, ex);
                        } finally {
                            try {
                                fis.close();
                            } catch (IOException ex) {
                                Logger.getLogger(PresoController.class.getName()).log(Level.SEVERE, null, ex);
                            }
                        }
                    }
                }
            }
        });
        salirButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                listener.onPanelClose();
            }
        });

        verCondenaButton.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                final ListadoCondenaController listadoCondena = new ListadoCondenaController(p);

                    final WindowsCreator ventana = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), listadoCondena, true);
                    listadoCondena.setPanelListener(new PanelListener() {

                        public void onPanelClose() {
                            ventana.dispose();
                        }
                    });
View Full Code Here

            @Override
            public void onActionExecute(CeldaInterna entity) {
                CeldaInternaController celdaInternaController = new CeldaInternaController(entity.getCelda(), entity);
                final WindowsCreator creator = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), celdaInternaController, true);
                celdaInternaController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        creator.dispose();
                        createCeldaTable();
                    }
                });
                panelListener.onPanelClose();
            }
        }, null);

        EntityTable<CeldaDomiciliaria> table2 = new EntityTable<CeldaDomiciliaria>(CeldaDomiciliaria.class, null);
        //Botoncito
        //Lista de los titulos de los encabezados, es decir que campos quiero que se muestrne en la tabla
        table2.buildTable(celdaDomLista, ActionButton.EDIT, VistasCarceles.CELDA_DOMICILIARIA_LISTA_VIEW, new ActionColumnListener<CeldaDomiciliaria>() {

            @Override
            public void onActionExecute(CeldaDomiciliaria entity) {
                CeldaDomiciliariaController celdaDomiciliariaController = new CeldaDomiciliariaController(entity.getCelda(), entity);
                final WindowsCreator creator = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), celdaDomiciliariaController, true);
                celdaDomiciliariaController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        creator.dispose();
                        createCeldaTable();
                    }
View Full Code Here

            public void actionPerformed(ActionEvent e) {

                CeldaController celdaController = new CeldaController();
                final WindowsCreator wc = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), celdaController, true);
                celdaController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        wc.dispose();
                        createCeldaTable();
                    }
View Full Code Here

            @Override
            public void onActionExecute(Preso entity) {

                PresoController presoController = new PresoController(PrincipalController.getLogedUser(), entity, CarcelConstants.OPERACION_MODIFICACION);
                final WindowsCreator creator = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), presoController, true);
                presoController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        creator.dispose();
                        List<Preso> lista2 = ec.createQuery("select p from Preso p where p.enabled = 1", Preso.class).getResultList();
                        createPresoTable(true, lista2);
View Full Code Here

            public void actionPerformed(ActionEvent e) {

                PresoController presoController = new PresoController(PrincipalController.getLogedUser(), null, CarcelConstants.OPERACION_ALTA);
                final WindowsCreator wc = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), presoController, true);
                presoController.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        wc.dispose();
                    }
                });
View Full Code Here

           
            public void onActionExecute(Usuario entity) {
              
                UsuarioController usuariocontrolador = new UsuarioController(entity);
                final WindowsCreator creator = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(),usuariocontrolador,true);
                usuariocontrolador.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        creator.dispose();
                           createUsuarioTable(true,null);
                    }
View Full Code Here

            public void actionPerformed(ActionEvent e) {
            
                UsuarioController usuariocontrolador = new UsuarioController ();
                final WindowsCreator wc = new WindowsCreator(PrincipalController.instanciaControllerPrincipal(), usuariocontrolador,true);
                usuariocontrolador.setPanelListener(new PanelListener() {

                    public void onPanelClose() {
                        wc.dispose();
                    }
                });
View Full Code Here

TOP

Related Classes of carcel.views.PanelListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.