Mercurial > hg > digilib-old
annotate servlet/src/digilib/Utils.java @ 68:35d32982106c
Changed JAI-ImageIO back to JAI only.
author | robcast |
---|---|
date | Wed, 08 Jan 2003 16:07:20 +0100 |
parents | 8d9a0abf3626 |
children | d493563ef672 |
rev | line source |
---|---|
1 | 1 /* Utils -- general utility classes for scaler servlet |
2 | |
3 Digital Image Library servlet components | |
4 | |
5 Copyright (C) 2001, 2002 Robert Casties (robcast@mail.berlios.de) | |
6 | |
7 This program is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 2 of the License, or (at your | |
10 option) any later version. | |
11 | |
12 Please read license.txt for the full details. A copy of the GPL | |
13 may be found at http://www.gnu.org/copyleft/lgpl.html | |
14 | |
15 You should have received a copy of the GNU General Public License | |
16 along with this program; if not, write to the Free Software | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 */ | |
20 | |
21 package digilib; | |
22 | |
23 public class Utils { | |
24 | |
25 public Utils() { | |
26 } | |
27 | |
28 public Utils(int dbg) { | |
29 debugLevel = dbg; | |
30 } | |
59
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
31 |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
32 public static int debugLevel = 10; |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
33 public void setDebugLevel(int lvl) { |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
34 debugLevel = lvl; |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
35 } |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
36 public int getDebugLevel() { |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
37 return debugLevel; |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
38 } |
8d9a0abf3626
Utils now has a setter for debugLevel. DocumentBean now properly sets
robcast
parents:
1
diff
changeset
|
39 |
1 | 40 /** |
41 * Debugging help | |
42 * dprintln(1, "blabla"); | |
43 * will be printed on stdout if debug >= 1 | |
44 */ | |
45 public static void dprintln(int dbg, String s) { | |
46 if (debugLevel >= dbg) { | |
47 String ind = ""; | |
48 // indent by debuglevel | |
49 for (int i = 0; i < dbg; i++) { | |
50 ind += " "; | |
51 } | |
52 System.out.println(ind+s); | |
53 } | |
54 } | |
55 } |