1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir package convwatch; 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir import java.io.File; 31*cdf0e10cSrcweir import java.io.FileWriter; 32*cdf0e10cSrcweir import helper.OSHelper; 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir public class HTMLOutputter 35*cdf0e10cSrcweir { 36*cdf0e10cSrcweir FileWriter m_aOut; 37*cdf0e10cSrcweir String m_sFilename; 38*cdf0e10cSrcweir String m_sNamePrefix; // the HTML files used a suffix to build it's right name 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir /** 41*cdf0e10cSrcweir * ls is the current line separator (carridge return) 42*cdf0e10cSrcweir */ 43*cdf0e10cSrcweir String ls; 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir HTMLOutputter() {} 46*cdf0e10cSrcweir public static HTMLOutputter create( String _sOutputPath, String _sHTMLFilename, String _sNamePrefix, String _sTitle ) 47*cdf0e10cSrcweir { 48*cdf0e10cSrcweir FileHelper.makeDirectories("", _sOutputPath); 49*cdf0e10cSrcweir HTMLOutputter a = new HTMLOutputter(); 50*cdf0e10cSrcweir String fs = System.getProperty("file.separator"); 51*cdf0e10cSrcweir String sFilename = _sOutputPath + fs + _sHTMLFilename; 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir try 54*cdf0e10cSrcweir { 55*cdf0e10cSrcweir File outputFile = new File(sFilename); 56*cdf0e10cSrcweir a.m_aOut = new FileWriter(outputFile.toString()); 57*cdf0e10cSrcweir a.ls = System.getProperty("line.separator"); 58*cdf0e10cSrcweir } 59*cdf0e10cSrcweir catch (java.io.IOException e) 60*cdf0e10cSrcweir { 61*cdf0e10cSrcweir e.printStackTrace(); 62*cdf0e10cSrcweir GlobalLogWriter.get().println("ERROR: Can't create HTML Outputter"); 63*cdf0e10cSrcweir return null; 64*cdf0e10cSrcweir } 65*cdf0e10cSrcweir a.m_sFilename = sFilename; 66*cdf0e10cSrcweir a.m_sNamePrefix = _sNamePrefix; 67*cdf0e10cSrcweir return a; 68*cdf0e10cSrcweir } 69*cdf0e10cSrcweir public String getFilename() {return m_sFilename;} 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir public void header(String _sTitle) 72*cdf0e10cSrcweir { 73*cdf0e10cSrcweir try 74*cdf0e10cSrcweir { 75*cdf0e10cSrcweir m_aOut.write( "<html>" + ls); 76*cdf0e10cSrcweir m_aOut.write( "<head>" + ls); 77*cdf0e10cSrcweir m_aOut.write( "<title>" + _sTitle + "</title>" + ls); 78*cdf0e10cSrcweir m_aOut.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/gfxcmp_ui/xmloff.css\" media=\"screen\" />" + ls); 79*cdf0e10cSrcweir m_aOut.write( "<link rel=\"stylesheet\" type=\"text/css\" href=\"/gfxcmp_ui/style.css\" media=\"screen\" />" + ls); 80*cdf0e10cSrcweir m_aOut.write( "</head>" + ls); 81*cdf0e10cSrcweir m_aOut.write( "<body bgcolor=white>" + ls); 82*cdf0e10cSrcweir m_aOut.flush(); 83*cdf0e10cSrcweir } 84*cdf0e10cSrcweir catch (java.io.IOException e) 85*cdf0e10cSrcweir { 86*cdf0e10cSrcweir } 87*cdf0e10cSrcweir } 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir final static String TEST_TABLETITLE = "Test"; 90*cdf0e10cSrcweir final static String VISUAL_STATUS_TABLETITLE = "Visual status"; 91*cdf0e10cSrcweir final static String VISUAL_STATUS_MESSAGE_TABLETITLE = "Message"; 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir public void indexSection(String _sOfficeInfo) 94*cdf0e10cSrcweir { 95*cdf0e10cSrcweir try 96*cdf0e10cSrcweir { 97*cdf0e10cSrcweir m_aOut.write( "<h2>Results for " + _sOfficeInfo + "</h2>" + ls); 98*cdf0e10cSrcweir m_aOut.write( "<p>Legend:<br>"); 99*cdf0e10cSrcweir m_aOut.write( stronghtml(FIRSTGFX_TABLETITLE) + " contains the output printed via 'ghostscript' as a jpeg picture.<br>"); 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir m_aOut.write( "<table class=\"infotable\">" + ls); 102*cdf0e10cSrcweir m_aOut.write( "<TR>"); 103*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(TEST_TABLETITLE)); 104*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(TEST_TABLETITLE)); 105*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(VISUAL_STATUS_TABLETITLE)); 106*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(VISUAL_STATUS_MESSAGE_TABLETITLE)); 107*cdf0e10cSrcweir m_aOut.write( "</TR>" + ls); 108*cdf0e10cSrcweir m_aOut.flush(); 109*cdf0e10cSrcweir } 110*cdf0e10cSrcweir catch (java.io.IOException e) 111*cdf0e10cSrcweir { 112*cdf0e10cSrcweir } 113*cdf0e10cSrcweir } 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir String getHREF(String _sHREF, String _sPathInfo) 116*cdf0e10cSrcweir { 117*cdf0e10cSrcweir StringBuffer a = new StringBuffer(); 118*cdf0e10cSrcweir if (! OSHelper.isWindows()) 119*cdf0e10cSrcweir { 120*cdf0e10cSrcweir // System.out.println("Tu'nix system."); 121*cdf0e10cSrcweir a.append("<A HREF=\""); 122*cdf0e10cSrcweir a.append(_sHREF); 123*cdf0e10cSrcweir a.append("\">"); 124*cdf0e10cSrcweir a.append(_sPathInfo); 125*cdf0e10cSrcweir a.append("</A>"); 126*cdf0e10cSrcweir } 127*cdf0e10cSrcweir else 128*cdf0e10cSrcweir { 129*cdf0e10cSrcweir // System.out.println("Windows system."); 130*cdf0e10cSrcweir //! this should be replaced by a better method 131*cdf0e10cSrcweir //! name(WIN|UNIX) 132*cdf0e10cSrcweir a.append("<A HREF=\""); 133*cdf0e10cSrcweir a.append(_sHREF); 134*cdf0e10cSrcweir a.append("\">"); 135*cdf0e10cSrcweir a.append(_sPathInfo); 136*cdf0e10cSrcweir // a.append("(first)"); 137*cdf0e10cSrcweir a.append("</A>"); 138*cdf0e10cSrcweir // if (_sHREF.charAt(1) == ':' && (_sHREF.charAt(0) == 'x' || _sHREF.charAt(0) == 'X')) 139*cdf0e10cSrcweir // int index = 0; 140*cdf0e10cSrcweir // index = _sHREF.indexOf("X:"); 141*cdf0e10cSrcweir // if (index == -1) 142*cdf0e10cSrcweir // { 143*cdf0e10cSrcweir // index = _sHREF.indexOf("x:"); 144*cdf0e10cSrcweir // } 145*cdf0e10cSrcweir // if (index >= 0) 146*cdf0e10cSrcweir // { 147*cdf0e10cSrcweir // // int index = 0; 148*cdf0e10cSrcweir // // remove "X:" and insert "/tausch" 149*cdf0e10cSrcweir // StringBuffer sbUNIXPath = new StringBuffer( _sHREF.substring(0, index) ); 150*cdf0e10cSrcweir // sbUNIXPath.append("/tausch"); 151*cdf0e10cSrcweir // sbUNIXPath.append(_sHREF.substring(index + 2)); 152*cdf0e10cSrcweir // String sUNIXPath = sbUNIXPath.toString(); 153*cdf0e10cSrcweir // sUNIXPath = utils.replaceAll13(sUNIXPath, "\\", "/"); 154*cdf0e10cSrcweir // 155*cdf0e10cSrcweir // a.append("<A HREF=\""); 156*cdf0e10cSrcweir // a.append(sUNIXPath); 157*cdf0e10cSrcweir // a.append("\">"); 158*cdf0e10cSrcweir // a.append("(second)"); 159*cdf0e10cSrcweir // a.append("</A>"); 160*cdf0e10cSrcweir // } 161*cdf0e10cSrcweir // else 162*cdf0e10cSrcweir // { 163*cdf0e10cSrcweir // System.out.println("Path is '" + _sHREF + "'"); 164*cdf0e10cSrcweir // } 165*cdf0e10cSrcweir 166*cdf0e10cSrcweir } 167*cdf0e10cSrcweir return a.toString(); 168*cdf0e10cSrcweir } 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir String tableDataCell(String _sValue) 171*cdf0e10cSrcweir { 172*cdf0e10cSrcweir StringBuffer a = new StringBuffer(); 173*cdf0e10cSrcweir a.append("<TD>"); 174*cdf0e10cSrcweir a.append(_sValue); 175*cdf0e10cSrcweir a.append("</TD>"); 176*cdf0e10cSrcweir return a.toString(); 177*cdf0e10cSrcweir } 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir String tableHeaderCell(String _sValue) 180*cdf0e10cSrcweir { 181*cdf0e10cSrcweir StringBuffer a = new StringBuffer(); 182*cdf0e10cSrcweir a.append("<TH>"); 183*cdf0e10cSrcweir a.append(_sValue); 184*cdf0e10cSrcweir a.append("</TH>"); 185*cdf0e10cSrcweir return a.toString(); 186*cdf0e10cSrcweir } 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir public void indexLine(String _sHTMLFile, String _sHTMLName, String _sHTMLFile2, String _sHTMLName2, String _sStatusRunThrough, String _sStatusMessage) 189*cdf0e10cSrcweir { 190*cdf0e10cSrcweir try 191*cdf0e10cSrcweir { 192*cdf0e10cSrcweir m_aOut.write( "<TR>"); 193*cdf0e10cSrcweir m_aOut.write(tableDataCell( getHREF(_sHTMLFile, _sHTMLName) ) ); 194*cdf0e10cSrcweir if (_sHTMLFile2.length() > 0) 195*cdf0e10cSrcweir { 196*cdf0e10cSrcweir m_aOut.write(tableDataCell( getHREF(_sHTMLFile2, _sHTMLName2) ) ); 197*cdf0e10cSrcweir } 198*cdf0e10cSrcweir else 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir m_aOut.write(tableDataCell( "" ) ); 201*cdf0e10cSrcweir } 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir m_aOut.write( tableDataCell(_sStatusRunThrough) ); 204*cdf0e10cSrcweir m_aOut.write( tableDataCell(_sStatusMessage) ); 205*cdf0e10cSrcweir m_aOut.write( "</TR>" + ls); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir m_aOut.flush(); 208*cdf0e10cSrcweir } 209*cdf0e10cSrcweir catch (java.io.IOException e) 210*cdf0e10cSrcweir { 211*cdf0e10cSrcweir } 212*cdf0e10cSrcweir } 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir public void close() 215*cdf0e10cSrcweir { 216*cdf0e10cSrcweir try 217*cdf0e10cSrcweir { 218*cdf0e10cSrcweir m_aOut.write( "</TABLE>" + ls); 219*cdf0e10cSrcweir m_aOut.write( "</BODY></HTML>" + ls); 220*cdf0e10cSrcweir m_aOut.flush(); 221*cdf0e10cSrcweir m_aOut.close(); 222*cdf0e10cSrcweir } 223*cdf0e10cSrcweir catch (java.io.IOException e) 224*cdf0e10cSrcweir { 225*cdf0e10cSrcweir } 226*cdf0e10cSrcweir } 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 229*cdf0e10cSrcweir String stronghtml(String _sValue) 230*cdf0e10cSrcweir { 231*cdf0e10cSrcweir StringBuffer a = new StringBuffer(); 232*cdf0e10cSrcweir a.append("<STRONG>"); 233*cdf0e10cSrcweir a.append(_sValue); 234*cdf0e10cSrcweir a.append("</STRONG>"); 235*cdf0e10cSrcweir return a.toString(); 236*cdf0e10cSrcweir } 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir final static String FIRSTGFX_TABLETITLE = "Original print file as jpeg"; 239*cdf0e10cSrcweir final static String SECONDGFX_TABLETITLE = "New print file as jpeg"; 240*cdf0e10cSrcweir final static String DIFFER_TABLETITLE = "Difference file"; 241*cdf0e10cSrcweir final static String STATUS_TABLETITLE = "Status"; 242*cdf0e10cSrcweir final static String PIXELDIFF_TABLETITLE = "Pixel difference in %"; 243*cdf0e10cSrcweir 244*cdf0e10cSrcweir final static String PIXELDIFF_BM_TABLETITLE = "P.diff. in % after remove border"; 245*cdf0e10cSrcweir final static String DIFFER_BM_TABLETITLE = "Diff file (RB)"; 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir final static String OK_TABLETITLE = "OK?"; 248*cdf0e10cSrcweir public void checkSection(String _sDocumentName) 249*cdf0e10cSrcweir { 250*cdf0e10cSrcweir try 251*cdf0e10cSrcweir { 252*cdf0e10cSrcweir m_aOut.write( "<H2>Results for the document " + _sDocumentName + "</H2>" + ls); 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir m_aOut.write( "<p>Legend:<br>"); 255*cdf0e10cSrcweir m_aOut.write( stronghtml(FIRSTGFX_TABLETITLE) + " contains the output printed via 'ghostscript' as a jpeg picture.<br>"); 256*cdf0e10cSrcweir m_aOut.write( stronghtml(SECONDGFX_TABLETITLE) + " contains the same document opened within OpenOffice.org also printed via ghostscript as jpeg.<br>"); 257*cdf0e10cSrcweir m_aOut.write( stronghtml(DIFFER_TABLETITLE)+" is build via composite from original and new picture. The result should be a whole black picture, if there are no differences.<br>At the moment "+stronghtml(STATUS_TABLETITLE)+" is only ok, if the difference file contains only one color (black).</p>" ); 258*cdf0e10cSrcweir m_aOut.write( stronghtml(DIFFER_BM_TABLETITLE) + " is build via composite from original and new picture after the border of both pictures are removed, so differences based on center problems may solved here"); 259*cdf0e10cSrcweir m_aOut.write( "</p>"); 260*cdf0e10cSrcweir m_aOut.write( "<p>Some words about the percentage value<br>"); 261*cdf0e10cSrcweir m_aOut.write( "If a character is on the original page (a) and on the new page this character is moved to an other position only (b) , this means the difference is 100%.<br>"); 262*cdf0e10cSrcweir m_aOut.write( "If character (b) is also bigger than character (a) the percentage is grow over the 100% mark.<br>"); 263*cdf0e10cSrcweir m_aOut.write( "This tool count only the pixels which are differ to it's background color. It makes no sense to count all pixels, or the difference percentage will most the time in a very low percentage range."); 264*cdf0e10cSrcweir m_aOut.write( "</p>"); 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir m_aOut.write( "<table class=\"infotable\">" + ls); 267*cdf0e10cSrcweir 268*cdf0e10cSrcweir m_aOut.write( "<TR>" + ls); 269*cdf0e10cSrcweir m_aOut.write( tableHeaderCell( FIRSTGFX_TABLETITLE) ); 270*cdf0e10cSrcweir m_aOut.write( tableHeaderCell( SECONDGFX_TABLETITLE ) ); 271*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(DIFFER_TABLETITLE ) ); 272*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(PIXELDIFF_TABLETITLE ) ); 273*cdf0e10cSrcweir 274*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(DIFFER_BM_TABLETITLE) ); 275*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(PIXELDIFF_BM_TABLETITLE ) ); 276*cdf0e10cSrcweir 277*cdf0e10cSrcweir m_aOut.write( tableHeaderCell( OK_TABLETITLE) ); 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir m_aOut.write( "</TR>" + ls); 280*cdf0e10cSrcweir m_aOut.flush(); 281*cdf0e10cSrcweir } 282*cdf0e10cSrcweir catch (java.io.IOException e) 283*cdf0e10cSrcweir { 284*cdf0e10cSrcweir } 285*cdf0e10cSrcweir } 286*cdf0e10cSrcweir 287*cdf0e10cSrcweir public void checkLine(StatusHelper _aStatus, boolean _bCurrentResult) 288*cdf0e10cSrcweir { 289*cdf0e10cSrcweir try 290*cdf0e10cSrcweir { 291*cdf0e10cSrcweir m_aOut.write( "<TR>" + ls); 292*cdf0e10cSrcweir String sLink = getHREF(FileHelper.getBasename(_aStatus.m_sOldGfx), FileHelper.getBasename(_aStatus.m_sOldGfx)); 293*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 294*cdf0e10cSrcweir 295*cdf0e10cSrcweir sLink = getHREF(FileHelper.getBasename(_aStatus.m_sNewGfx), FileHelper.getBasename(_aStatus.m_sNewGfx)); 296*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir sLink = getHREF(FileHelper.getBasename(_aStatus.m_sDiffGfx), FileHelper.getBasename(_aStatus.m_sDiffGfx)); 299*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir String sPercent = String.valueOf(_aStatus.nPercent) + "%"; 302*cdf0e10cSrcweir if (_aStatus.nPercent > 0 && _aStatus.nPercent < 5) 303*cdf0e10cSrcweir { 304*cdf0e10cSrcweir sPercent += " (less 5% is ok)"; 305*cdf0e10cSrcweir } 306*cdf0e10cSrcweir m_aOut.write(tableDataCell( sPercent ) ); 307*cdf0e10cSrcweir 308*cdf0e10cSrcweir if (_aStatus.m_sDiff_BM_Gfx == null) 309*cdf0e10cSrcweir { 310*cdf0e10cSrcweir sLink = "No diffs, therefore no moves"; 311*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 312*cdf0e10cSrcweir m_aOut.write(tableDataCell( "" ) ); 313*cdf0e10cSrcweir } 314*cdf0e10cSrcweir else 315*cdf0e10cSrcweir { 316*cdf0e10cSrcweir sLink = getHREF(FileHelper.getBasename(_aStatus.m_sDiff_BM_Gfx), FileHelper.getBasename(_aStatus.m_sDiff_BM_Gfx)); 317*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir String sPercent2 = String.valueOf(_aStatus.nPercent2) + "%"; 320*cdf0e10cSrcweir if (_aStatus.nPercent2 > 0 && _aStatus.nPercent2 < 5) 321*cdf0e10cSrcweir { 322*cdf0e10cSrcweir sPercent2 += " (less 5% is ok)"; 323*cdf0e10cSrcweir } 324*cdf0e10cSrcweir m_aOut.write(tableDataCell( sPercent2 ) ); 325*cdf0e10cSrcweir } 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir // is the check positiv, in a defined range 328*cdf0e10cSrcweir if (_bCurrentResult) 329*cdf0e10cSrcweir { 330*cdf0e10cSrcweir m_aOut.write(tableDataCell( "YES" ) ); 331*cdf0e10cSrcweir } 332*cdf0e10cSrcweir else 333*cdf0e10cSrcweir { 334*cdf0e10cSrcweir m_aOut.write(tableDataCell( "NO" ) ); 335*cdf0e10cSrcweir } 336*cdf0e10cSrcweir 337*cdf0e10cSrcweir m_aOut.write( "</TR>" + ls); 338*cdf0e10cSrcweir } 339*cdf0e10cSrcweir catch (java.io.IOException e) 340*cdf0e10cSrcweir { 341*cdf0e10cSrcweir } 342*cdf0e10cSrcweir } 343*cdf0e10cSrcweir 344*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 345*cdf0e10cSrcweir public void checkDiffDiffSection(String _sDocumentName) 346*cdf0e10cSrcweir { 347*cdf0e10cSrcweir try 348*cdf0e10cSrcweir { 349*cdf0e10cSrcweir m_aOut.write( "<H2>Results for the document " + _sDocumentName + "</H2>" + ls); 350*cdf0e10cSrcweir 351*cdf0e10cSrcweir m_aOut.write( "<p>Legend:<br>"); 352*cdf0e10cSrcweir m_aOut.write( "</p>"); 353*cdf0e10cSrcweir 354*cdf0e10cSrcweir m_aOut.write( "<table class=\"infotable\">" + ls); 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir m_aOut.write( "<TR>" + ls); 357*cdf0e10cSrcweir m_aOut.write( tableHeaderCell( "Source to actual difference" ) ); 358*cdf0e10cSrcweir m_aOut.write( tableHeaderCell( "Actual difference" ) ); 359*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(DIFFER_TABLETITLE ) ); 360*cdf0e10cSrcweir m_aOut.write( tableHeaderCell(PIXELDIFF_TABLETITLE ) ); 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir m_aOut.write( tableHeaderCell( OK_TABLETITLE) ); 363*cdf0e10cSrcweir 364*cdf0e10cSrcweir m_aOut.write( "</TR>" + ls); 365*cdf0e10cSrcweir m_aOut.flush(); 366*cdf0e10cSrcweir } 367*cdf0e10cSrcweir catch (java.io.IOException e) 368*cdf0e10cSrcweir { 369*cdf0e10cSrcweir } 370*cdf0e10cSrcweir } 371*cdf0e10cSrcweir 372*cdf0e10cSrcweir public void checkDiffDiffLine(StatusHelper _aStatus, boolean _bCurrentResult) 373*cdf0e10cSrcweir { 374*cdf0e10cSrcweir try 375*cdf0e10cSrcweir { 376*cdf0e10cSrcweir m_aOut.write( "<TR>" + ls); 377*cdf0e10cSrcweir // the link to the old difference can't offer here 378*cdf0e10cSrcweir // String sLink = getHREF(FileHelper.getBasename(_aStatus.m_sOldGfx), FileHelper.getBasename(_aStatus.m_sOldGfx)); 379*cdf0e10cSrcweir // m_aOut.write( tableDataCell(sLink) ); 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir String sBasename = FileHelper.getBasename(m_sFilename); 382*cdf0e10cSrcweir String sNew = sBasename.substring(m_sNamePrefix.length()); 383*cdf0e10cSrcweir 384*cdf0e10cSrcweir String sLink; 385*cdf0e10cSrcweir sLink = getHREF(sNew, sNew); 386*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 387*cdf0e10cSrcweir 388*cdf0e10cSrcweir sLink = getHREF(FileHelper.getBasename(_aStatus.m_sNewGfx), FileHelper.getBasename(_aStatus.m_sNewGfx)); 389*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 390*cdf0e10cSrcweir 391*cdf0e10cSrcweir sLink = getHREF(FileHelper.getBasename(_aStatus.m_sDiffGfx), FileHelper.getBasename(_aStatus.m_sDiffGfx)); 392*cdf0e10cSrcweir m_aOut.write( tableDataCell(sLink) ); 393*cdf0e10cSrcweir 394*cdf0e10cSrcweir String sPercent = String.valueOf(_aStatus.nPercent) + "%"; 395*cdf0e10cSrcweir // if (_aStatus.nPercent > 0 && _aStatus.nPercent < 5) 396*cdf0e10cSrcweir // { 397*cdf0e10cSrcweir // sPercent += " (less 5% is ok)"; 398*cdf0e10cSrcweir // } 399*cdf0e10cSrcweir m_aOut.write(tableDataCell( sPercent ) ); 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir // is the check positiv, in a defined range 402*cdf0e10cSrcweir if (_bCurrentResult) 403*cdf0e10cSrcweir { 404*cdf0e10cSrcweir m_aOut.write(tableDataCell( "YES" ) ); 405*cdf0e10cSrcweir } 406*cdf0e10cSrcweir else 407*cdf0e10cSrcweir { 408*cdf0e10cSrcweir m_aOut.write(tableDataCell( "NO" ) ); 409*cdf0e10cSrcweir } 410*cdf0e10cSrcweir 411*cdf0e10cSrcweir m_aOut.write( "</TR>" + ls); 412*cdf0e10cSrcweir } 413*cdf0e10cSrcweir catch (java.io.IOException e) 414*cdf0e10cSrcweir { 415*cdf0e10cSrcweir } 416*cdf0e10cSrcweir } 417*cdf0e10cSrcweir 418*cdf0e10cSrcweir } 419