Exemplo n.º 1
0
  public static void main(String[] argv) {
    List<String> args = Arrays.asList(argv);

    if (args.size() % 2 == 1 || args.contains("--help") || args.contains("-h")) {
      usage();
      return;
    }

    PApplet processing = new PApplet();

    processing.init();
    processing.start();

    try {
      WordCram wordCram =
          new WordCram(processing)
              .fromTextString(PApplet.loadStrings(System.in))
              .withColorer(Colorers.twoHuesRandomSats(processing))
              .withAngler(Anglers.mostlyHoriz())
              .withWordPadding(4)
              .withPlacer(Placers.centerClump());

      ImageConfiguration imageConfig = parseArgs(args, wordCram);

      PGraphics image = processing.createGraphics(imageConfig.width, imageConfig.height, JAVA2D);
      try {
        wordCram.withCustomCanvas(image);

        image.beginDraw();
        wordCram.drawAll();
        image.endDraw();

        image.save(imageConfig.fileName);

      } finally {
        image.dispose();
      }

      processing.stop();
      System.exit(0);

    } catch (Throwable t) {
      System.err.println(t.getMessage());
      System.exit(1);
    }
  }
Exemplo n.º 2
0
 public void stop() {
   mymod.stop();
   super.stop();
 }
 public void stop() {
   in.close();
   minim.stop();
   super.stop();
 }
Exemplo n.º 4
0
 // Close the sound engine
 public void stop() {
   Sonia.stop();
   super.stop();
 }
Exemplo n.º 5
0
 public void stop() {
   neuroSocket.stop();
   super.stop();
 }