.addGroup(layout.createSequentialGroup() .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jButton10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton8))) .addGap(66, 66, 66)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(23, 23, 23) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE) .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton8) .addComponent(jButton10) .addComponent(jButton11)) .addGap(20, 20, 20)) ); pack(); } private void passarParaTxt(int elementos) { readWrite.openOutputFile(filetxt); for(int i = 0;i<elementos;i++) { readWrite.writeOutputLine(""+teclas[i]); readWrite.writeOutputLine(""+tempoPressionado[i]+""); } readWrite.closeOutputFile(); } private void onExit() { readWrite.openInputFile("Hack/Hack.ino"); int j=0; while(readWrite.hasInputLine()) { texto[j] = readWrite.readInputLine(); System.out.println(texto[j]); j++; } readWrite.closeInputFile(); for(int i=0;i<qtdElementos;i++) { if(i==0) { texto[1]= (teclas[i]+""); } else{ texto[1]= (texto[1]+" ,"+ teclas[i]); } } for(int i=0;i<qtdElementos;i++) { if(i==0) { texto[4]= (tempoPressionado[i]+""); } else{ texto[4]= (texto[4]+" ,"+ tempoPressionado[i]); } } texto[6] = ("int qtdElementos ="+ qtdElementos+";"); readWrite.openOutputFile("Hack/Hack.ino"); j=0; while(texto[j]!=null) { readWrite.writeOutputLine(texto[j]); j++; } readWrite.closeOutputFile(); } private void comecarVazio() { tempoSemTocarInicial = System.currentTimeMillis(); } private void terminarVazio() { tempoSemTocarFinal = System.currentTimeMillis(); tempoSemTocarTotal = tempoSemTocarFinal - tempoSemTocarInicial; teclas[qtdElementos]= 0; tempoPressionado[qtdElementos] = tempoSemTocarTotal; qtdElementos++; qtdElementos = checarCheio(qtdElementos); } private int checarCheio(int numeroDeElementos) { if(numeroDeElementos>=99998) { passarParaTxt(numeroDeElementos); numeroDeElementos = 0; } return numeroDeElementos; } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { } private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) { } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { } private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) { onExit(); System.exit(0); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { } private void jButton1MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoDo = System.currentTimeMillis(); } private void jButton1MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoDo = System.currentTimeMillis(); tempoTotalDo = tempoSoltoDo - tempoApertadoDo; teclas[qtdElementos]= 1; tempoPressionado[qtdElementos] = tempoTotalDo; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } private void jButton2MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoRe = System.currentTimeMillis(); } private void jButton2MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoRe = System.currentTimeMillis(); tempoTotalRe = tempoSoltoRe - tempoApertadoRe; teclas[qtdElementos]= 2; tempoPressionado[qtdElementos] = tempoTotalRe; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) { tempoSemTocarFinal = System.currentTimeMillis(); tempoSemTocarTotal = tempoSemTocarFinal - tempoSemTocarInicial; passarParaTxt(qtdElementos); } private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) { tempoSemTocarInicial = System.currentTimeMillis(); } private void jButton3MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoMi = System.currentTimeMillis(); } private void jButton3MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoMi = System.currentTimeMillis(); tempoTotalMi = tempoSoltoMi - tempoApertadoMi; teclas[qtdElementos]= 3; tempoPressionado[qtdElementos] = tempoTotalMi; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } private void jButton4MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoFa = System.currentTimeMillis(); } private void jButton4MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoFa = System.currentTimeMillis(); tempoTotalFa = tempoSoltoFa - tempoApertadoFa; teclas[qtdElementos]= 4; tempoPressionado[qtdElementos] = tempoTotalFa; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } private void jButton5MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoSol = System.currentTimeMillis(); } private void jButton5MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoSol = System.currentTimeMillis(); tempoTotalSol = tempoSoltoSol - tempoApertadoSol; teclas[qtdElementos]= 5; tempoPressionado[qtdElementos] = tempoTotalSol; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } private void jButton6MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoLa = System.currentTimeMillis(); } private void jButton6MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoLa = System.currentTimeMillis(); tempoTotalLa = tempoSoltoLa - tempoApertadoLa; teclas[qtdElementos]= 6; tempoPressionado[qtdElementos] = tempoTotalLa; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } private void jButton7MousePressed(java.awt.event.MouseEvent evt) { terminarVazio(); tempoApertadoSi = System.currentTimeMillis(); } private void jButton7MouseReleased(java.awt.event.MouseEvent evt) { tempoSoltoSi = System.currentTimeMillis(); tempoTotalSi = tempoSoltoSi - tempoApertadoSi; teclas[qtdElementos]= 7; tempoPressionado[qtdElementos] = tempoTotalSi; qtdElementos++; qtdElementos = checarCheio(qtdElementos); comecarVazio(); } public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName()))