Esempio n. 1
0
  private void getSettings() {
    String sql = "Select * from experiment where id = " + expId;

    // Initialize the service remote procedure call
    if (databaseAccessSvc == null) {
      databaseAccessSvc = GWT.create(DatabaseAccess.class);
    }

    AsyncCallback<String[][]> callback =
        new AsyncCallback<String[][]>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String[][] result) {

            // SRC Lang
            for (int i = 0; i < srcLangList.getItemCount(); i++) {
              if (result[0][11].equals(srcLangList.getItemText(i))) {
                srcLangList.setItemSelected(i, true);
                break;
              }
            }

            // TRG Lang
            for (int i = 0; i < trgLangList.getItemCount(); i++) {
              if (result[0][12].equals(trgLangList.getItemText(i))) {
                trgLangList.setItemSelected(i, true);
                break;
              }
            }
          }
        };

    databaseAccessSvc.retrieveData(sql, callback);
  }
Esempio n. 2
0
  private void reloadSettings() {

    String sql = "Select * from experiment where id = " + expId;

    // Initialize the service remote procedure call
    if (databaseAccessSvc == null) {
      databaseAccessSvc = GWT.create(DatabaseAccess.class);
    }

    AsyncCallback<String[][]> callback =
        new AsyncCallback<String[][]>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String[][] result) {
            // update settings
            ssLang = result[0][8];
            mtSrc = result[0][9];
            mtTrg = result[0][10];
            mtoSrc = result[0][11];
            mtoTrg = result[0][12];
            asrLang = result[0][13];
            reloadLTCs();
          }
        };

    databaseAccessSvc.retrieveData(sql, callback);
  }
Esempio n. 3
0
  // reload LTCs
  private void reloadLTCs() {
    String sql =
        "Select * from experimentcomponent where experimentid = " + expId + " order by rank asc";

    // Initialize the service remote procedure call
    if (databaseAccessSvc == null) {
      databaseAccessSvc = GWT.create(DatabaseAccess.class);
    }

    AsyncCallback<String[][]> callback =
        new AsyncCallback<String[][]>() {
          public void onFailure(Throwable caught) {}

          public void onSuccess(String[][] result) {

            if (result != null) {
              components = null;
              components = new int[result.length][3];
              for (int i = 0; i < result.length; i++) {
                // add components to local array
                components[i][0] = Integer.parseInt(result[i][2]);
                components[i][1] = Integer.parseInt(result[i][3]);
                components[i][2] = Integer.parseInt(result[i][4]);
              }

              clearComponents();

            } else {
              // System.out.println("No components defined for this experiment!");
            }
          }
        };

    databaseAccessSvc.retrieveData(sql, callback);
  }