Exemple #1
0
  public static void writeParam(String xNameFile) {
    //
    // write to file xpar all parameters.....
    //
    IOseq xFile;

    xFile = new IOseq(xNameFile);
    xFile.IOseqOpenW(false);

    try {

      Class c = Class.forName("jneat.Neat");
      Field[] fieldlist = c.getDeclaredFields();

      for (int i = 0; i < fieldlist.length; i++) {
        Field f1 = fieldlist[i];
        String x1 = f1.getName();

        if (x1.startsWith("p_")) {
          Field f2 = c.getField("d_" + Neat.normalizeName(x1));
          Object s1 = f1.get(c);
          Object s2 = f2.get(c);
          //	   String riga = s1 + "  " + s2;
          String riga = x1 + "  " + s1;
          xFile.IOseqWrite(riga);
        }
      }

    } catch (Throwable e) {
      System.err.println(e);
    }

    xFile.IOseqCloseW();
  }
Exemple #2
0
 public static String getDescription(String xkey) {
   try {
     Class c = Class.forName("jneat.Neat");
     Field f = c.getField("d_" + xkey);
     return (String) f.get(c);
   } catch (Throwable e) {
     return null;
   }
 }
Exemple #3
0
  public static void getParam(vectTableModel _model) {

    String xline;
    StringTokenizer st = null;
    String s1 = null;
    String s2 = null;
    Object m1 = null;
    Field fx = null;
    int j = 0;

    try {
      Class c = Class.forName("jneat.Neat");
      Field[] fieldlist = c.getDeclaredFields();

      int number_params = fieldlist.length / 2;

      j = 0;
      for (int i = 0; i < number_params; i++) {
        Field f1 = fieldlist[i];
        String nomeF = f1.getName();
        String nomeF1 = nomeF.substring(2);
        if (nomeF.substring(0, 2).equalsIgnoreCase("p_")) {
          Object o1 = nomeF1;
          fx = c.getField("p_" + nomeF1);
          Object o2 = fx.get(c);

          _model.setValueAt(o1, j, 0);
          _model.setValueAt(o2, j, 1);

          j++;
        }
      }

    } catch (Throwable e) {
      System.err.println(e);
    }

    _model.rows = j;
    return;
  }