Ejemplo n.º 1
0
 public static void main(String[] args) {
   SwingUtilities.invokeLater(
       new Runnable() {
         public void run() {
           go();
         }
       });
 }
Ejemplo n.º 2
0
  public static void main(String[] args) {
    //      args = new String[]{"nothing=junk"};
    RSF par = new RSF(args);
    // RSFFrame sf = new RSFFrame();
    //
    //
    //
    //

    ArrayList<String> cubes = new ArrayList<String>();
    ArrayList<String> points = new ArrayList<String>();
    ArrayList<String> lines = new ArrayList<String>();
    for (String arg : args) {
      if (arg.contains("cube")) {
        String cube = par.getString(arg.split("=")[0], "");
        System.err.printf("Found cube: %s\n", cube);
        cubes.add(cube);
      } else if (arg.contains("point")) {
        String point = par.getString(arg.split("=")[0], "");
        System.err.printf("Found point: %s\n", point);
        points.add(point);
      } else if (arg.contains("line")) {
        String line = par.getString(arg.split("=")[0], "");
        System.err.printf("Found line: %s\n", line);
        lines.add(line);
      }
    }

    final String[] cubeNames = new String[cubes.size()];
    for (int i = 0; i < cubes.size(); ++i) {
      cubeNames[i] = cubes.get(i);
    }

    final String[] lineNames = new String[lines.size()];
    for (int i = 0; i < lines.size(); ++i) {
      lineNames[i] = lines.get(i);
    }
    final String[] pointNames = new String[points.size()];
    for (int i = 0; i < points.size(); ++i) {
      pointNames[i] = points.get(i);
    }

    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            RSFFrame frame = new RSFFrame();
            for (String name : cubeNames) {
              frame.addRSFCube(name);
            }
            for (String name : lineNames) {
              frame.addRSFLine(name);
            }
            for (String name : pointNames) {
              frame.addRSFPoint(name);
            }
          }
        });
  }