Esempio n. 1
0
 public void compile() {
   if (!compiled) {
     createOutputDirStructure();
     compileScreenShot();
     compileXML();
   }
 }
Esempio n. 2
0
 public void createImages() {
   compileScreenShot();
   File dir =
       new File(
           getCompileOutputCurrentDir(),
           ResourceHelper.getGoogleProperty(Constants.KEY_COMPILED_OUTPUT_IMAGE_DIR_NAME));
   if (dir.mkdirs()) {
     BufferedImage shot = ResourceHelper.getImageResource(googleScreenShot);
     Image img;
     Rectangle rect;
     String pre = ResourceHelper.getGoogleProperty(Constants.KEY_COMPILED_OUTPUT_IMAGE_NAME_PRE);
     File file;
     for (GrabbedImagePosition gip : getGrabbedImagePositions()) {
       try {
         rect = gip.getBounds();
         img = shot.getSubimage(rect.x, rect.y, rect.width, rect.height);
         file =
             new File(
                 dir,
                 String.format("%s_%s_%s.png", pre, gip.getSerialnumber(), gip.getRownumber()));
         ImageIO.write((RenderedImage) img, "png", file);
       } catch (IOException ex) {
         ResourceHelper.errLog("Compiler > createImages() > Error : %s", ex);
       }
     }
   } else {
     ResourceHelper.errLog("Compiler > createImages() > Unable to create image directory");
   }
 }