List of usage examples for com.squareup.okhttp FormEncodingBuilder FormEncodingBuilder
FormEncodingBuilder
From source file:reportes.c_op.java
void buscardir(String text) { System.out.println();// w w w. j a v a 2 s.c o m RequestBody formBody = new FormEncodingBuilder().add("dato1", text).build(); String tam = enviardato("matrizbdir", formBody); //System.out.println(tam); System.out.println("Datos"); for (int i = Integer.parseInt(tam) - 1; i >= 0; i--) { RequestBody formBody1 = new FormEncodingBuilder().add("dato1", text).add("dato2", String.valueOf(i)) .build(); String mos = enviardato("matrizbdir1", formBody1); System.out.print(mos + " "); } System.out.println(); }
From source file:reportes.c_op.java
String eliminar(String text) { RequestBody formBody = new FormEncodingBuilder().add("dato1", text).build(); String g = enviardato("matrizeliminar1", formBody); System.out.println(g);// ww w. ja va 2s.c om return g; // String r = getString("listasm", formBody); // System.out.println(r + "---"); }
From source file:reportes.c_op.java
String matriz() { RequestBody formBody = new FormEncodingBuilder().add("dato1", "solomando").build(); String g = enviardato("ver_grafica", formBody); System.out.println(g);/*from w ww . jav a 2 s.co m*/ return g; }
From source file:reportes.PantallaReportes.java
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("empresa", "none").add("departamento", "none") .add("user", "none").add("password", "none").build(); String r = metodoWS("graficarMatriz", formBody); try {// w w w . j ava 2 s . c om String dotPath = "C:\\release\\bin\\dot.exe"; String fileInputPath = "C:\\graficas\\MatrizDispersa.dot"; String fileOutputPath = "C:\\graficas\\MatrizDispersa.png"; String tParam = "-Tjpg"; String tOParam = "-o"; String[] cmd = new String[5]; cmd[0] = dotPath; cmd[1] = tParam; cmd[2] = fileInputPath; cmd[3] = tOParam; cmd[4] = fileOutputPath; Runtime rt = Runtime.getRuntime(); rt.exec(cmd); } catch (Exception ex) { System.out.println("Error: " + ex.getMessage()); } finally { } System.out.println(r); }
From source file:reportes.PantallaReportes.java
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed try {/* w w w . ja v a 2 s . c o m*/ ImageIcon icono = new javax.swing.ImageIcon("C:\\graficas\\MatrizDispersa.png"); Image imagen = icono.getImage(); ImageIcon iconoEscalado = new ImageIcon(imagen.getScaledInstance(450, 590, Image.SCALE_SMOOTH)); jLabel2.setIcon(iconoEscalado); } catch (Exception ex) { System.out.println("Error: " + ex.getMessage()); } RequestBody formBody = new FormEncodingBuilder().add("empresa", "none").add("departamento", "none") .add("user", "none").add("password", "none").build(); String r = metodoWS("recorrerMatriz", formBody); jTextArea1.setText(r); }
From source file:reportes.PantallaReportes.java
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("empresa", jTextField2.getText()).build(); String r = metodoWS("activosEmpresa", formBody); try {/*ww w. jav a 2s .com*/ String dotPath = "C:\\release\\bin\\dot.exe"; String fileInputPath = "C:\\graficas\\ActivosEmpresa.dot"; String fileOutputPath = "C:\\graficas\\ActivosEmpresa.png"; String tParam = "-Tjpg"; String tOParam = "-o"; String[] cmd = new String[5]; cmd[0] = dotPath; cmd[1] = tParam; cmd[2] = fileInputPath; cmd[3] = tOParam; cmd[4] = fileOutputPath; Runtime rt = Runtime.getRuntime(); rt.exec(cmd); } catch (Exception ex) { System.out.println("Error: " + ex.getMessage()); } finally { } jTextArea1.setText(r); }
From source file:reportes.PantallaReportes.java
private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed RequestBody formBody = new FormEncodingBuilder().add("empresa", "none") .add("departamento", jTextField3.getText()).add("user", "none").add("password", "none").build(); String r = metodoWS("activosDepartamento", formBody); try {/*from www . j a va 2s . c o m*/ String dotPath = "C:\\release\\bin\\dot.exe"; String fileInputPath = "C:\\graficas\\ActivosDepartamento.dot"; String fileOutputPath = "C:\\graficas\\ActivosDepartamento.png"; String tParam = "-Tjpg"; String tOParam = "-o"; String[] cmd = new String[5]; cmd[0] = dotPath; cmd[1] = tParam; cmd[2] = fileInputPath; cmd[3] = tOParam; cmd[4] = fileOutputPath; Runtime rt = Runtime.getRuntime(); rt.exec(cmd); } catch (Exception ex) { System.out.println("Error: " + ex.getMessage()); } finally { } jTextArea1.setText(r); }
From source file:reportes.PantallaReportes.java
private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed jComboBox1.removeAllItems();/*from w w w .j a va 2 s . c o m*/ jComboBox2.removeAllItems(); jComboBox3.removeAllItems(); RequestBody formBody = new FormEncodingBuilder().add("empresa", "none").build(); String r = metodoWS("verEmpresas", formBody); System.out.println(r); char[] aa = r.toCharArray(); String temp = ""; for (int i = 0; i < r.length(); i++) { char b = aa[i]; if (b == '$') { jComboBox1.addItem(temp); temp = ""; } else { temp = temp + b; } } }
From source file:reportes.PantallaReportes.java
private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed try {// w w w. j a v a 2 s .c om jComboBox2.removeAllItems(); jComboBox3.removeAllItems(); String empresa = (String) jComboBox1.getSelectedItem(); RequestBody formBody = new FormEncodingBuilder().add("empresa", empresa).build(); String r = metodoWS("verDepartamentos", formBody); jComboBox2.removeAllItems(); char[] aa = r.toCharArray(); String temp = ""; for (int i = 0; i < r.length(); i++) { char b = aa[i]; if (b == '$') { jComboBox2.addItem(temp); temp = ""; } else { temp = temp + b; } } } catch (Exception ex) { } // TODO add your handling code here: }
From source file:reportes.PantallaReportes.java
private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed try {//from ww w. j av a 2s.co m jComboBox3.removeAllItems(); String empresa = (String) jComboBox1.getSelectedItem(); String departamento = (String) jComboBox2.getSelectedItem(); RequestBody formBody = new FormEncodingBuilder().add("empresa", empresa) .add("departamento", departamento).build(); String r = metodoWS("verUsuarios", formBody); jComboBox3.removeAllItems(); char[] aa = r.toCharArray(); String temp = ""; for (int i = 0; i < r.length(); i++) { char b = aa[i]; if (b == '$') { jComboBox3.addItem(temp); temp = ""; } else { temp = temp + b; } } } catch (Exception ex) { } // TODO add your handling code here: }