Пример #1
0
 public void onSensorPlug(String IDLector) {
   // consola.out.echo("Lector conectado");
   try {
     // Start capturing from plugged sensor.
     com.griaule.grfingerjava.GrFingerJava.startCapture(IDLector, this, this);
   } catch (com.griaule.grfingerjava.GrFingerJavaException e) {
     // write error to log
     Dialogos.error("Error al iniciar captura de huella dactilar", e);
   }
   this.IDLector = IDLector;
   super.setLectorActivo(true);
 }
Пример #2
0
  public Huellas(JInternalDialog2 parent) {
    this.setVisible(true);
    this.setBounds(0, 0, 500, 500);
    this.parent = parent;

    // getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
    // "cerrar");
    // getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0),
    // "cerrar");
    // getActionMap().put("cerrar" , new adminAcciones(this, adminAcciones.CERRAR));
    // this.btnCancelar.getActionMap().put("cerrar", new adminAcciones(this, adminAcciones.CERRAR));
    // this.btnCancelar.addActionListener(new adminAcciones(this, adminAcciones.CERRAR));

    // this.btnCancelar.getActionMap().put("cerrar", new adminAcciones(this, adminAcciones.CERRAR));

    try {
      System.out.println(System.getProperty("user.dir"));
      String grFingerNativeDirectory = (new File(".")).getAbsolutePath();

      File directory = new File(grFingerNativeDirectory);

      GrFingerJava.setNativeLibrariesDirectory(directory);
      GrFingerJava.setLicenseDirectory(directory);
      // com.griaule.grfingerjava.GrFingerJava.setNativeLibrariesDirectory();
      System.out.println("Carpeta dependencias griaule: " + grFingerNativeDirectory);

      matchContext = new MatchingContext();
      GrFingerJava.initializeCapture(this);
      System.out.println("Lector Huella inicializada");

    } catch (Exception GrEx) {
      System.out.println("Error griaule: " + GrEx.getMessage());
      Dialogos.error("Error al inicializar SDK lector", GrEx);
    }
    HiloParaCerrar HPC = new HiloParaCerrar(this);
    HPC.start();
  }
Пример #3
0
  public void cerrar() {
    synchronized (focoCerrar) {
      try {
        focoCerrar.wait();
      } catch (InterruptedException ie) {
        Dialogos.error("Error al cerrar capturador de huella", ie);
      }
      try {
        com.griaule.grfingerjava.GrFingerJava.finalizeCapture();
        // com.griaule.grfingerjava.GrFingerJava.stopCapture(IDLector);

        if (matchContext != null) {
          matchContext.destroy();
        }

        // Main.entornoBase.pantalla.getLayeredPane().grabFocus();

        parent.setActivo(false);
      } catch (GrFingerJavaException gr) {
        Dialogos.error("Error al finalizar lector de huella.", gr);
      }
    }
  }