Example #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);
 }
Example #2
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);
      }
    }
  }
Example #3
0
  public void onImageAcquired(String IDLector, com.griaule.grfingerjava.FingerprintImage imagen) {

    try {
      // this.lblHuella.setIcon(new ImageIcon(imagen));

      this.matchContext = new MatchingContext();
      this.template = this.matchContext.extract(imagen);
      this.byteTemplate = this.template.getData();

      // consola.out.echo("Lector huella: imagen adquirida");
    } catch (GrFingerJavaException gr) {
      Dialogos.error("Error al procesar huella dactilar.", gr);
    }
  }
Example #4
0
  public void setParameters(
      int identifyThreshold,
      int identifyRotationTolerance,
      int verifyThreshold,
      int verifyRotationTolorance) {
    try {
      matchContext.setIdentificationThreshold(identifyThreshold);
      matchContext.setIdentificationRotationTolerance(identifyRotationTolerance);
      matchContext.setVerificationRotationTolerance(verifyRotationTolorance);
      matchContext.setVerificationThreshold(verifyThreshold);

    } catch (Exception e) {
      // write error to log
      Dialogos.error("Error al establecer parĂ¡metros del SDK de huellas", e);
    }
  }
Example #5
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();
  }