/** * Creates a set of HTML files (one for each size in {@link * GemIdentImageSets.ImageSetInterface.Size Size} with a global view (if the image set is a large * global image) where the thumbnails have colored borders where each cluster shares a common * color. After, each cluster's thumbnails are displayed without the global context. All * thumbnails link to the raw image. */ private void CreateHTMLOutputAndOpen() { int tWidth = Thumbnails.tWidth / 2; int tHeight = Thumbnails.tHeight / 2; int numThumbPerRow = (int) Math.round(TableWidth / (double) tWidth); ArrayList<Set<String>> clusters = GetImageListsFromClusters(); for (ImageSetInterface.Size size : ImageSetInterface.Size.values()) { int factor = 0; switch (size) { case XL: factor = 1; break; case L: factor = 2; break; case M: factor = 4; break; case S: factor = 8; break; case XS: factor = 16; break; case XXS: factor = 32; break; } PrintWriter out = null; try { out = new PrintWriter( new BufferedWriter( new FileWriter( Run.it.imageset.getFilenameWithHomePath( Subsets + NumClusters + size + ".html")))); } catch (IOException e) { System.out.println(Subsets + NumClusters + ".html" + " cannot be created"); } out.print("<HTML>"); CreateHTMLHeader(out); if (!(Run.it.imageset instanceof NonGlobalImageSet)) CreateHTMLForGlobal(out, factor, clusters, tWidth, tHeight); for (int c = 1; c <= NumClusters; c++) CreateHTMLCluster(out, clusters.get(c - 1), c, numThumbPerRow, tWidth, tHeight); out.print("</HTML>"); out.close(); } IOTools.RunProgramInOS(Subsets + NumClusters + "M.html"); }
/** * Print the header of the html - title and links to the other {@link * GemIdentImageSets.ImageSetInterface.Size Sizes} */ private void CreateHTMLHeader(PrintWriter out) { out.print("\n"); out.print("<head>"); out.print("\n"); out.print("<title>Image Set By Like Image Subsets</title>"); out.print("\n"); out.print("</head>"); out.print("\n"); out.print("<H1>Global view in " + NumClusters + " subsets</H1>"); out.print("<br>"); String link = "Zoom Level: "; for (ImageSetInterface.Size linkSize : ImageSetInterface.Size.values()) link += "<a href=\"" + Subsets + NumClusters + linkSize + ".html\">" + linkSize + "</a> "; out.print(link); out.print("\n"); }