Update ooo320-m1
[ooovba.git] / qadevOOo / runner / convwatch / StatusHelper.java
bloba4a207396d0a5cedae34e4830b6077566733ef68
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: StatusHelper.java,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package convwatch;
33 public class StatusHelper
35 final static public int DIFF_NOT_REALLY_INITIALISED = 1;
36 final static public int DIFF_NO_DIFFERENCES = 2;
37 final static public int DIFF_DIFFERENCES_FOUND = 3;
38 final static public int DIFF_AFTER_MOVE_DONE_NO_PROBLEMS = 4;
39 final static public int DIFF_AFTER_MOVE_DONE_DIFFERENCES_FOUND = 5;
41 // public String m_sOutputPath;
42 public String m_sMainName;
44 public String m_sOldGfx;
45 public String m_sNewGfx;
46 public String m_sDiffGfx;
47 public int nDiffStatus = DIFF_NOT_REALLY_INITIALISED;
48 public int nPercent = 0;
50 // BorderMove Values
51 public int nPercent2 = 0;
52 public String m_sOld_BM_Gfx;
53 public String m_sNew_BM_Gfx;
54 public String m_sDiff_BM_Gfx;
56 public StatusHelper(String _sOldGfx, String _sNewGfx, String _sDiffGfx)
58 m_sOldGfx = _sOldGfx;
59 m_sNewGfx = _sNewGfx;
60 m_sDiffGfx = _sDiffGfx;
62 public void setFilesForBorderMove(String _sOldGfx, String _sNewGfx, String _sDiffGfx)
64 m_sOld_BM_Gfx = _sOldGfx;
65 m_sNew_BM_Gfx = _sNewGfx;
66 m_sDiff_BM_Gfx = _sDiffGfx;
70 public void printStatus()
72 GlobalLogWriter.get().println(" Original file: " + m_sOldGfx);
73 GlobalLogWriter.get().println(" New file: " + m_sNewGfx);
74 GlobalLogWriter.get().println("Difference file: " + m_sDiffGfx);
75 if (nDiffStatus == DIFF_NOT_REALLY_INITIALISED)
77 GlobalLogWriter.get().println("Early problem, may be the files doesn't exist.");
79 else if (nDiffStatus == DIFF_NO_DIFFERENCES)
81 GlobalLogWriter.get().println("No differences found, ok.");
83 else if (nDiffStatus == DIFF_DIFFERENCES_FOUND)
85 GlobalLogWriter.get().println("Files differ by " + String.valueOf(nPercent) + "%");
87 else if (nDiffStatus == DIFF_AFTER_MOVE_DONE_NO_PROBLEMS)
89 GlobalLogWriter.get().println("No differences found, after move picture.");
91 else if (nDiffStatus == DIFF_AFTER_MOVE_DONE_DIFFERENCES_FOUND)
93 GlobalLogWriter.get().println("A picture move is done, the files differ by " + String.valueOf(nPercent2) + " old was " + String.valueOf(nPercent) + "%");
95 else
97 GlobalLogWriter.get().println("Unknown DIFF_ values used, not handles yet.");
105 // TODO: stream output
106 // public stream& statusline(stream)
107 // {
108 // stream << name << "PASS" << nDiff==0?"PASS":"FAIL" << endl;
109 // return stream;
110 // }