You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(19) |
Jul
(39) |
Aug
(30) |
Sep
(14) |
Oct
(4) |
Nov
(12) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(2) |
2009 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <doc...@us...> - 2007-10-26 03:55:16
|
Revision: 180 http://openpcl.svn.sourceforge.net/openpcl/?rev=180&view=rev Author: documentsystems Date: 2007-10-25 20:55:13 -0700 (Thu, 25 Oct 2007) Log Message: ----------- Howard Hoagland. Delete the jdom.jar file because the code was changed to not reference it. Removed Paths: ------------- openpcl/lib/jdom.jar Deleted: openpcl/lib/jdom.jar =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-10-02 19:47:09
|
Revision: 179 http://openpcl.svn.sourceforge.net/openpcl/?rev=179&view=rev Author: documentsystems Date: 2007-10-02 12:46:58 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Howard Hoagland. Changed char widths for chars 128 to 255 in the 16 tables so that Spanish documents using the 9U ANSI character set, view and print OK with no wrong char spacing and no chars too close together. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriCharWidthTables.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriCharWidthTables.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriCharWidthTables.java 2007-09-26 00:02:33 UTC (rev 178) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriCharWidthTables.java 2007-10-02 19:46:58 UTC (rev 179) @@ -36,6 +36,9 @@ * b. 4 tables for Plain, Bold, Italic, BoldItalic in PC8 * * @author howard 5/19/2006 + * 9/27/07 HowardH Changed the char widths of char codes 128 to 255 of the 16 tables + * for the 9U Windows 1252 ANSI Char set so that Spanish docs view and print OK. + * Previously, the char widths were wrong for a e i o u with the accents over them, and the n with the tilde over it. */ public class PriCharWidthTables { @@ -66,541 +69,541 @@ // Times 4101, Plain, Roman8=8U protected int[] mTimesPlainRoman8 = { - //begin unsure data - 59, // 0 "" - 415, // 1 "" - 415, // 2 "" - 415, // 3 "" - 415, // 4 "" - 415, // 5 "" - 415, // 6 "" - 300, // 7 "" - 415, // 8 "" - 415, // 9 "" - 415, // 10 "" - 300, // 11 "" - 300, // 12 "" - 207, // 13 "" - 300, // 14 "" - 415, // 15 "" - 300, // 16 "" - 300, // 17 "" - 300, // 18 "" - 238, // 19 "" - 207, // 20 "" - 207, // 21 "" - 415, // 22 "" - 300, // 23 "" - 300, // 24 "" - 300, // 25 "" - 300, // 26 "" - 300, // 27 "" - 369, // 28 "" - 300, // 29 "" - 300, // 30 "" - 300, // 31 "" - mSpaceCharWidthForTimes, // 32 " " 123, 300? - // end unsure + //TODO TimesPlainRoman8 + 59, // 0 "" + 415, // 1 "" + 415, // 2 "" + 415, // 3 "" + 415, // 4 "" + 415, // 5 "" + 415, // 6 "" + 300, // 7 "" + 415, // 8 "" + 415, // 9 "" + 415, // 10 "" + 300, // 11 "" + 300, // 12 "" + 207, // 13 "" + 300, // 14 "" + 415, // 15 "" + 300, // 16 "" + 300, // 17 "" + 300, // 18 "" + 238, // 19 "" + 207, // 20 "" + 207, // 21 "" + 415, // 22 "" + 300, // 23 "" + 300, // 24 "" + 300, // 25 "" + 300, // 26 "" + 300, // 27 "" + 369, // 28 "" + 300, // 29 "" + 300, // 30 "" + 300, // 31 "" + mSpaceCharWidthForTimes, // 32 " " 123, 300? + // end unsure - 138, // 33 "!" - 192, // 34 """ - 207, // 35 "#" - 207, // 36 "$" - 369, // 37 "%" - 323, // 38 "&" - 138, // 39 "'" - 138, // 40 "(" - 138, // 41 ")" - 207, // 42 "*" - 369, // 43 "+" - 138, // 44 "," - 138, // 45 "-" - 138, // 46 "." - 138, // 47 "/" - 207, // 48 "0" - 207, // 49 "1" - 207, // 50 "2" - 207, // 51 "3" - 207, // 52 "4" - 207, // 53 "5" - 207, // 54 "6" - 207, // 55 "7" - 207, // 56 "8" - 207, // 57 "9" - 138, // 58 ":" - 138, // 59 ";" - 415, // 60 "<" - 369, // 61 "=" - 415, // 62 ">" - 184, // 63 "?" - 369, // 64 "@" - 300, // 65 "A" - 261, // 66 "B" - 284, // 67 "C" - 307, // 68 "D" - 261, // 69 "E" - 246, // 70 "F" - 300, // 71 "G" - 307, // 72 "H" - 138, // 73 "I" - 161, // 74 "J" - 292, // 75 "K" - 261, // 76 "L" - 376, // 77 "M" - 307, // 78 "N" - 300, // 79 "O" - 238, // 80 "P" - 300, // 81 "Q" - 277, // 82 "R" - 223, // 83 "S" - 261, // 84 "T" - 307, // 85 "U" - 300, // 86 "V" - 392, // 87 "W" - 300, // 88 "X" - 300, // 89 "Y" - 269, // 90 "Z" - 138, // 91 "[" - 138, // 92 "\" - 138, // 93 "]" - 207, // 94 "^" - 207, // 95 "_" - 138, // 96 "`" - 184, // 97 "a" - 207, // 98 "b" - 184, // 99 "c" - 207, // 100 "d" - 184, // 101 "e" - 138, // 102 "f" - 207, // 103 "g" - 207, // 104 "h" - 115, // 105 "i" - 115, // 106 "j" - 207, // 107 "k" - 115, // 108 "l" - 323, // 109 "m" - 207, // 110 "n" - 207, // 111 "o" - 207, // 112 "p" - 207, // 113 "q" - 154, // 114 "r" - 161, // 115 "s" - 115, // 116 "t" - 207, // 117 "u" - 207, // 118 "v" - 300, // 119 "w" - 207, // 120 "x" - 207, // 121 "y" - 184, // 122 "z" - 184, // 123 "" - 207, // 124 "" - 184, // 125 "" - 415, // 126 "" - 415, // 127 "" + 138, // 33 "!" + 192, // 34 """ + 207, // 35 "#" + 207, // 36 "$" + 369, // 37 "%" + 323, // 38 "&" + 138, // 39 "'" + 138, // 40 "(" + 138, // 41 ")" + 207, // 42 "*" + 369, // 43 "+" + 138, // 44 "," + 138, // 45 "-" + 138, // 46 "." + 138, // 47 "/" + 207, // 48 "0" + 207, // 49 "1" + 207, // 50 "2" + 207, // 51 "3" + 207, // 52 "4" + 207, // 53 "5" + 207, // 54 "6" + 207, // 55 "7" + 207, // 56 "8" + 207, // 57 "9" + 138, // 58 ":" + 138, // 59 ";" + 415, // 60 "<" + 369, // 61 "=" + 415, // 62 ">" + 184, // 63 "?" + 369, // 64 "@" + 300, // 65 "A" + 261, // 66 "B" + 284, // 67 "C" + 307, // 68 "D" + 261, // 69 "E" + 246, // 70 "F" + 300, // 71 "G" + 307, // 72 "H" + 138, // 73 "I" + 161, // 74 "J" + 292, // 75 "K" + 261, // 76 "L" + 376, // 77 "M" + 307, // 78 "N" + 300, // 79 "O" + 238, // 80 "P" + 300, // 81 "Q" + 277, // 82 "R" + 223, // 83 "S" + 261, // 84 "T" + 307, // 85 "U" + 300, // 86 "V" + 392, // 87 "W" + 300, // 88 "X" + 300, // 89 "Y" + 269, // 90 "Z" + 138, // 91 "[" + 138, // 92 "\" + 138, // 93 "]" + 207, // 94 "^" + 207, // 95 "_" + 138, // 96 "`" + 184, // 97 "a" + 207, // 98 "b" + 184, // 99 "c" + 207, // 100 "d" + 184, // 101 "e" + 138, // 102 "f" + 207, // 103 "g" + 207, // 104 "h" + 115, // 105 "i" + 115, // 106 "j" + 207, // 107 "k" + 115, // 108 "l" + 323, // 109 "m" + 207, // 110 "n" + 207, // 111 "o" + 207, // 112 "p" + 207, // 113 "q" + 154, // 114 "r" + 161, // 115 "s" + 115, // 116 "t" + 207, // 117 "u" + 207, // 118 "v" + 300, // 119 "w" + 207, // 120 "x" + 207, // 121 "y" + 184, // 122 "z" + 184, // 123 "" + 207, // 124 "" + 184, // 125 "" + 415, // 126 "" + 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 184, // 133 "" - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 59, // 160 "" - 300, // 161 "" - 300, // 162 "" - 261, // 163 "" - 261, // 164 "" - 261, // 165 "" - 138, // 166 "" - 138, // 167 "" - 207, // 168 "" - 207, // 169 "" - 207, // 170 "" - 207, // 171 "" - 207, // 172 "" - 307, // 173 "" - 307, // 174 "" - 207, // 175 "" - 207, // 176 "" - 300, // 177 "" - 207, // 178 "" - 207, // 179 "" - 284, // 180 "" - 184, // 181 "" - 307, // 182 "" - 207, // 183 "" - 138, // 184 "" - 184, // 185 "" - 207, // 186 "" - 207, // 187 "" - 207, // 188 "" - 207, // 189 "" - 207, // 190 "" - 207, // 191 "" - 184, // 192 "" - 184, // 193 "" - 207, // 194 "" - 207, // 195 "" - 184, // 196 "" - 184, // 197 "" - 207, // 198 "" - 207, // 199 "" - 184, // 200 "" - 184, // 201 "" - 207, // 202 "" - 207, // 203 "" - 184, // 204 "" - 184, // 205 "" - 207, // 206 "" - 207, // 207 "" - 300, // 208 "" - 115, // 209 "" - 300, // 210 "" - 369, // 211 "" - 184, // 212 "" - 115, // 213 "" - 207, // 214 "" - 277, // 215 "" - 300, // 216 "" - 115, // 217 "" - 300, // 218 "" - 307, // 219 "" - 261, // 220 "" - 115, // 221 "" - 207, // 222 "" - 300, // 223 "" - 300, // 224 "" - 300, // 225 "" - 184, // 226 "" - 307, // 227 "" - 207, // 228 "" - 138, // 229 "" - 138, // 230 "" - 300, // 231 "" - 300, // 232 "" - 300, // 233 "" - 207, // 234 "" - 223, // 235 "" - 161, // 236 "" - 307, // 237 "" - 300, // 238 "" - 207, // 239 "" - 238, // 240 "" - 207, // 241 "" - 0, // 242 "" - 231, // 243 "" - 207, // 244 "" - 369, // 245 "" - 369, // 246 "" - 369, // 247 "" - 369, // 248 "" - 207, // 249 "" - 207, // 250 "" - 169, // 251 "" - 300, // 252 "" - 169, // 253 "" - 369, // 254 "" - 59 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Times font, Plain (not bold, not italics), using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 223, // 128 \x80 use 83 S + 184, // 129 x use 97 a + 184, // 130 x use 97 a + 184, // 131 x use 97 a + 184, // 132 x use 97 a + 184, // 133 x use 97 a + 184, // 134 x use 97 a + 184, // 135 x use 97 a + 184, // 136 x use 97 a + 184, // 137 x use 97 a + 184, // 138 x use 97 a + 184, // 139 x use 97 a + 184, // 140 x use 97 a + 184, // 141 x use 97 a + 184, // 142 x use 97 a + 184, // 143 x use 97 a + 184, // 144 x use 97 a + 138, // 145 \x91 use 44 , + 138, // 146 \x92 use 44 , + 184, // 147 x use 97 a + 184, // 148 x use 97 a + 184, // 149 x use 97 a + 184, // 150 x use 97 a + 184, // 151 x use 97 a + 184, // 152 x use 97 a + 184, // 153 x use 97 a + 184, // 154 x use 97 a + 184, // 155 x use 97 a + 184, // 156 x use 97 a + 184, // 157 x use 97 a + 184, // 158 x use 97 a + 184, // 159 x use 97 a + 123, // 160 NSB use 32 space + 138, // 161 \xA1 use 33 ! + 184, // 162 \xA2 use 99 c + 223, // 163 \xA3 use 83 S + 223, // 164 \xA4 use 83 S + 223, // 165 \xA5 use 83 S + 138, // 166 \xA6 use 33 ! + 223, // 167 \xA7 use 83 S + 184, // 168 \xA8 use 97 a + 223, // 169 \xA9 use 83 S + 184, // 170 \xAA use 97 a + 184, // 171 \xAB use 97 a + 207, // 172 \xAC use 98 b + 138, // 173 \xAD use 45 - + 223, // 174 \xAE use 83 S + 184, // 175 \xAF use 97 a + 138, // 176 \xB0 use 33 ! + 261, // 177 \xB1 use 84 T + 138, // 178 \xB2 use 33 ! + 138, // 179 \xB3 use 33 ! + 138, // 180 \xB4 use 33 ! + 184, // 181 \xB5 use 97 a + 184, // 182 \xB6 use 97 a + 138, // 183 \xB7 use 46 . + 138, // 184 \xB8 use 46 . + 138, // 185 \xB9 use 33 ! + 138, // 186 \xBA use 33 ! + 184, // 187 \xBB use 97 a + 261, // 188 \xBC use 84 T + 261, // 189 \xBD use 84 T + 261, // 190 \xBE use 84 T + 184, // 191 \xBF use 63 ? + 300, // 192 \xC0 use 65 A + 300, // 193 \xC1 use 65 A + 300, // 194 \xC2 use 65 A + 300, // 195 \xC3 use 65 A + 300, // 196 \xC4 use 65 A + 300, // 197 \xC5 use 65 A + 376, // 198 \xC6 use 77 M + 284, // 199 \xC7 use 67 C + 261, // 200 \xC8 use 69 E + 261, // 201 \xC9 use 69 E + 261, // 202 \xCA use 69 E + 261, // 203 \xCB use 69 E + 138, // 204 \xCC use 73 I + 138, // 205 \xCD use 73 I + 138, // 206 \xCE use 73 I + 138, // 207 \xCF use 73 I + 307, // 208 \xD0 use 68 D + 307, // 209 \xD1 use 78 N + 300, // 210 \xD2 use 79 O + 300, // 211 \xD3 use 79 O + 300, // 212 \xD4 use 79 O + 300, // 213 \xD5 use 79 O + 300, // 214 \xD6 use 79 O + 261, // 215 \xD7 use 84 T + 300, // 216 \xD8 use 79 O + 307, // 217 \xD9 use 85 U + 307, // 218 \xDA use 85 U + 307, // 219 \xDB use 85 U + 307, // 220 \xDC use 85 U + 300, // 221 \xDD use 89 Y + 207, // 222 \xDE use 112 p + 261, // 223 \xDF use 84 T + 184, // 224 \xE0 use 97 a + 184, // 225 \xE1 use 97 a + 184, // 226 \xE2 use 97 a + 184, // 227 \xE3 use 97 a + 184, // 228 \xE4 use 97 a + 184, // 229 \xE5 use 97 a + 261, // 230 \xE6 use 84 T + 184, // 231 \xE7 use 99 c + 184, // 232 \xE8 use 101 e + 184, // 233 \xE9 use 101 e + 184, // 234 \xEA use 101 e + 184, // 235 \xEB use 101 e + 115, // 236 \xEC use 105 i + 115, // 237 \xED use 105 i + 115, // 238 \xEE use 105 i + 115, // 239 \xEF use 105 i + 207, // 240 \xF0 use 111 o + 207, // 241 \xF1 use 110 n + 207, // 242 \xF2 use 111 o + 207, // 243 \xF3 use 111 o + 207, // 244 \xF4 use 111 o + 207, // 245 \xF5 use 111 o + 207, // 246 \xF6 use 111 o + 261, // 247 \xF7 use 84 T + 207, // 248 \xF8 use 111 o + 207, // 249 \xF9 use 117 u + 207, // 250 \xFA use 117 u + 207, // 251 \xFB use 117 u + 207, // 252 \xFC use 117 u + 207, // 253 \xFD use 121 y + 207, // 254 \xFE use 112 p + 207 // 255 \xFF use 121 y }; // Times 4101, Bold, Roman8=8U protected int[] mTimesBoldRoman8 = { - //begin unsure data - 59, // 0 "" - 415, // 1 "" - 415, // 2 "" - 415, // 3 "" - 415, // 4 "" - 415, // 5 "" - 415, // 6 "" - 300, // 7 "" - 415, // 8 "" - 415, // 9 "" - 415, // 10 "" - 300, // 11 "" - 300, // 12 "" - 207, // 13 "" - 300, // 14 "" - 415, // 15 "" - 300, // 16 "" - 300, // 17 "" - 300, // 18 "" - 238, // 19 "" - 207, // 20 "" - 207, // 21 "" - 415, // 22 "" - 300, // 23 "" - 300, // 24 "" - 300, // 25 "" - 300, // 26 "" - 300, // 27 "" - 369, // 28 "" - 300, // 29 "" - 300, // 30 "" - 300, // 31 "" - mSpaceCharWidthForTimes, // 32 " " 123, 300? - // end unsure + //TODO TimesBoldRoman8 + 59, // 0 "" + 415, // 1 "" + 415, // 2 "" + 415, // 3 "" + 415, // 4 "" + 415, // 5 "" + 415, // 6 "" + 300, // 7 "" + 415, // 8 "" + 415, // 9 "" + 415, // 10 "" + 300, // 11 "" + 300, // 12 "" + 207, // 13 "" + 300, // 14 "" + 415, // 15 "" + 300, // 16 "" + 300, // 17 "" + 300, // 18 "" + 238, // 19 "" + 207, // 20 "" + 207, // 21 "" + 415, // 22 "" + 300, // 23 "" + 300, // 24 "" + 300, // 25 "" + 300, // 26 "" + 300, // 27 "" + 369, // 28 "" + 300, // 29 "" + 300, // 30 "" + 300, // 31 "" + mSpaceCharWidthForTimes, // 32 " " 123, 300? + // end unsure - 138, // 33 "!" - 192, // 34 """ - 207, // 35 "#" - 207, // 36 "$" - 369, // 37 "%" - 346, // 38 "&" - 138, // 39 "'" - 138, // 40 "(" - 138, // 41 ")" - 207, // 42 "*" - 369, // 43 "+" - 138, // 44 "," - 138, // 45 "-" - 138, // 46 "." - 138, // 47 "/" - 207, // 48 "0" - 207, // 49 "1" - 207, // 50 "2" - 207, // 51 "3" - 207, // 52 "4" - 207, // 53 "5" - 207, // 54 "6" - 207, // 55 "7" - 207, // 56 "8" - 207, // 57 "9" - 138, // 58 ":" - 138, // 59 ";" - 415, // 60 "<" - 369, // 61 "=" - 415, // 62 ">" - 207, // 63 "?" - 369, // 64 "@" - 300, // 65 "A" - 277, // 66 "B" - 300, // 67 "C" - 300, // 68 "D" - 277, // 69 "E" - 254, // 70 "F" - 323, // 71 "G" - 323, // 72 "H" - 161, // 73 "I" - 200, // 74 "J" - 323, // 75 "K" - 277, // 76 "L" - 392, // 77 "M" - 300, // 78 "N" - 323, // 79 "O" - 254, // 80 "P" - 323, // 81 "Q" - 300, // 82 "R" - 231, // 83 "S" - 277, // 84 "T" - 300, // 85 "U" - 300, // 86 "V" - 415, // 87 "W" - 300, // 88 "X" - 300, // 89 "Y" - 277, // 90 "Z" - 138, // 91 "[" - 138, // 92 "\" - 138, // 93 "]" - 207, // 94 "^" - 207, // 95 "_" - 138, // 96 "`" - 207, // 97 "a" - 231, // 98 "b" - 184, // 99 "c" - 231, // 100 "d" - 184, // 101 "e" - 146, // 102 "f" - 207, // 103 "g" - 231, // 104 "h" - 115, // 105 "i" - 138, // 106 "j" - 231, // 107 "k" - 115, // 108 "l" - 346, // 109 "m" - 231, // 110 "n" - 207, // 111 "o" - 231, // 112 "p" - 231, // 113 "q" - 184, // 114 "r" - 161, // 115 "s" - 138, // 116 "t" - 231, // 117 "u" - 207, // 118 "v" - 300, // 119 "w" - 207, // 120 "x" - 207, // 121 "y" - 184, // 122 "z" - 207, // 123 "" - 207, // 124 "" - 207, // 125 "" - 415, // 126 "" - 415, // 127 "" + 138, // 33 "!" + 192, // 34 """ + 207, // 35 "#" + 207, // 36 "$" + 369, // 37 "%" + 346, // 38 "&" + 138, // 39 "'" + 138, // 40 "(" + 138, // 41 ")" + 207, // 42 "*" + 369, // 43 "+" + 138, // 44 "," + 138, // 45 "-" + 138, // 46 "." + 138, // 47 "/" + 207, // 48 "0" + 207, // 49 "1" + 207, // 50 "2" + 207, // 51 "3" + 207, // 52 "4" + 207, // 53 "5" + 207, // 54 "6" + 207, // 55 "7" + 207, // 56 "8" + 207, // 57 "9" + 138, // 58 ":" + 138, // 59 ";" + 415, // 60 "<" + 369, // 61 "=" + 415, // 62 ">" + 207, // 63 "?" + 369, // 64 "@" + 300, // 65 "A" + 277, // 66 "B" + 300, // 67 "C" + 300, // 68 "D" + 277, // 69 "E" + 254, // 70 "F" + 323, // 71 "G" + 323, // 72 "H" + 161, // 73 "I" + 200, // 74 "J" + 323, // 75 "K" + 277, // 76 "L" + 392, // 77 "M" + 300, // 78 "N" + 323, // 79 "O" + 254, // 80 "P" + 323, // 81 "Q" + 300, // 82 "R" + 231, // 83 "S" + 277, // 84 "T" + 300, // 85 "U" + 300, // 86 "V" + 415, // 87 "W" + 300, // 88 "X" + 300, // 89 "Y" + 277, // 90 "Z" + 138, // 91 "[" + 138, // 92 "\" + 138, // 93 "]" + 207, // 94 "^" + 207, // 95 "_" + 138, // 96 "`" + 207, // 97 "a" + 231, // 98 "b" + 184, // 99 "c" + 231, // 100 "d" + 184, // 101 "e" + 146, // 102 "f" + 207, // 103 "g" + 231, // 104 "h" + 115, // 105 "i" + 138, // 106 "j" + 231, // 107 "k" + 115, // 108 "l" + 346, // 109 "m" + 231, // 110 "n" + 207, // 111 "o" + 231, // 112 "p" + 231, // 113 "q" + 184, // 114 "r" + 161, // 115 "s" + 138, // 116 "t" + 231, // 117 "u" + 207, // 118 "v" + 300, // 119 "w" + 207, // 120 "x" + 207, // 121 "y" + 184, // 122 "z" + 207, // 123 "" + 207, // 124 "" + 207, // 125 "" + 415, // 126 "" + 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 184, // 133 "" - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 59, // 160 "" - 300, // 161 "" - 300, // 162 "" - 277, // 163 "" - 277, // 164 "" - 277, // 165 "" - 161, // 166 "" - 161, // 167 "" - 207, // 168 "" - 207, // 169 "" - 207, // 170 "" - 207, // 171 "" - 207, // 172 "" - 300, // 173 "" - 300, // 174 "" - 207, // 175 "" - 207, // 176 "" - 300, // 177 "" - 207, // 178 "" - 207, // 179 "" - 300, // 180 "" - 184, // 181 "" - 300, // 182 "" - 231, // 183 "" - 138, // 184 "" - 207, // 185 "" - 207, // 186 "" - 207, // 187 "" - 207, // 188 "" - 207, // 189 "" - 207, // 190 "" - 207, // 191 "" - 207, // 192 "" - 184, // 193 "" - 207, // 194 "" - 231, // 195 "" - 207, // 196 "" - 184, // 197 "" - 207, // 198 "" - 231, // 199 "" - 207, // 200 "" - 184, // 201 "" - 207, // 202 "" - 231, // 203 "" - 207, // 204 "" - 184, // 205 "" - 207, // 206 "" - 231, // 207 "" - 300, // 208 "" - 115, // 209 "" - 323, // 210 "" - 430, // 211 "" - 207, // 212 "" - 115, // 213 "" - 207, // 214 "" - 300, // 215 "" - 300, // 216 "" - 115, // 217 "" - 323, // 218 "" - 300, // 219 "" - 277, // 220 "" - 115, // 221 "" - 231, // 222 "" - 323, // 223 "" - 300, // 224 "" - 300, // 225 "" - 207, // 226 "" - 300, // 227 "" - 207, // 228 "" - 161, // 229 "" - 161, // 230 "" - 323, // 231 "" - 323, // 232 "" - 323, // 233 "" - 207, // 234 "" - 231, // 235 "" - 161, // 236 "" - 300, // 237 "" - 300, // 238 "" - 207, // 239 "" - 254, // 240 "" - 231, // 241 "" - 46, // 242 "" - 231, // 243 "" - 207, // 244 "" - 369, // 245 "" - 369, // 246 "" - 369, // 247 "" - 369, // 248 "" - 207, // 249 "" - 207, // 250 "" - 177, // 251 "" - 300, // 252 "" - 177, // 253 "" - 369, // 254 "" - 59 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Times font, Bold, not italic, using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 231, // 128 \x80 use 83 S + 207, // 129 x use 97 a + 207, // 130 x use 97 a + 207, // 131 x use 97 a + 207, // 132 x use 97 a + 207, // 133 x use 97 a + 207, // 134 x use 97 a + 207, // 135 x use 97 a + 207, // 136 x use 97 a + 207, // 137 x use 97 a + 207, // 138 x use 97 a + 207, // 139 x use 97 a + 207, // 140 x use 97 a + 207, // 141 x use 97 a + 207, // 142 x use 97 a + 207, // 143 x use 97 a + 207, // 144 x use 97 a + 138, // 145 \x91 use 44 , + 138, // 146 \x92 use 44 , + 207, // 147 x use 97 a + 207, // 148 x use 97 a + 207, // 149 x use 97 a + 207, // 150 x use 97 a + 207, // 151 x use 97 a + 207, // 152 x use 97 a + 207, // 153 x use 97 a + 207, // 154 x use 97 a + 207, // 155 x use 97 a + 207, // 156 x use 97 a + 207, // 157 x use 97 a + 207, // 158 x use 97 a + 207, // 159 x use 97 a + 123, // 160 NSB use 32 space + 138, // 161 \xA1 use 33 ! + 184, // 162 \xA2 use 99 c + 231, // 163 \xA3 use 83 S + 231, // 164 \xA4 use 83 S + 231, // 165 \xA5 use 83 S + 138, // 166 \xA6 use 33 ! + 231, // 167 \xA7 use 83 S + 207, // 168 \xA8 use 97 a + 231, // 169 \xA9 use 83 S + 207, // 170 \xAA use 97 a + 207, // 171 \xAB use 97 a + 231, // 172 \xAC use 98 b + 138, // 173 \xAD use 45 - + 231, // 174 \xAE use 83 S + 207, // 175 \xAF use 97 a + 138, // 176 \xB0 use 33 ! + 277, // 177 \xB1 use 84 T + 138, // 178 \xB2 use 33 ! + 138, // 179 \xB3 use 33 ! + 138, // 180 \xB4 use 33 ! + 207, // 181 \xB5 use 97 a + 207, // 182 \xB6 use 97 a + 138, // 183 \xB7 use 46 . + 138, // 184 \xB8 use 46 . + 138, // 185 \xB9 use 33 ! + 138, // 186 \xBA use 33 ! + 207, // 187 \xBB use 97 a + 277, // 188 \xBC use 84 T + 277, // 189 \xBD use 84 T + 277, // 190 \xBE use 84 T + 207, // 191 \xBF use 63 ? + 300, // 192 \xC0 use 65 A + 300, // 193 \xC1 use 65 A + 300, // 194 \xC2 use 65 A + 300, // 195 \xC3 use 65 A + 300, // 196 \xC4 use 65 A + 300, // 197 \xC5 use 65 A + 392, // 198 \xC6 use 77 M + 300, // 199 \xC7 use 67 C + 277, // 200 \xC8 use 69 E + 277, // 201 \xC9 use 69 E + 277, // 202 \xCA use 69 E + 277, // 203 \xCB use 69 E + 161, // 204 \xCC use 73 I + 161, // 205 \xCD use 73 I + 161, // 206 \xCE use 73 I + 161, // 207 \xCF use 73 I + 300, // 208 \xD0 use 68 D + 300, // 209 \xD1 use 78 N + 323, // 210 \xD2 use 79 O + 323, // 211 \xD3 use 79 O + 323, // 212 \xD4 use 79 O + 323, // 213 \xD5 use 79 O + 323, // 214 \xD6 use 79 O + 277, // 215 \xD7 use 84 T + 323, // 216 \xD8 use 79 O + 300, // 217 \xD9 use 85 U + 300, // 218 \xDA use 85 U + 300, // 219 \xDB use 85 U + 300, // 220 \xDC use 85 U + 300, // 221 \xDD use 89 Y + 231, // 222 \xDE use 112 p + 277, // 223 \xDF use 84 T + 207, // 224 \xE0 use 97 a + 207, // 225 \xE1 use 97 a + 207, // 226 \xE2 use 97 a + 207, // 227 \xE3 use 97 a + 207, // 228 \xE4 use 97 a + 207, // 229 \xE5 use 97 a + 277, // 230 \xE6 use 84 T + 184, // 231 \xE7 use 99 c + 184, // 232 \xE8 use 101 e + 184, // 233 \xE9 use 101 e + 184, // 234 \xEA use 101 e + 184, // 235 \xEB use 101 e + 115, // 236 \xEC use 105 i + 115, // 237 \xED use 105 i + 115, // 238 \xEE use 105 i + 115, // 239 \xEF use 105 i + 207, // 240 \xF0 use 111 o + 231, // 241 \xF1 use 110 n + 207, // 242 \xF2 use 111 o + 207, // 243 \xF3 use 111 o + 207, // 244 \xF4 use 111 o + 207, // 245 \xF5 use 111 o + 207, // 246 \xF6 use 111 o + 277, // 247 \xF7 use 84 T + 207, // 248 \xF8 use 111 o + 231, // 249 \xF9 use 117 u + 231, // 250 \xFA use 117 u + 231, // 251 \xFB use 117 u + 231, // 252 \xFC use 117 u + 207, // 253 \xFD use 121 y + 231, // 254 \xFE use 112 p + 207 // 255 \xFF use 121 y }; // Times 4101,Italic, Roman8=8U protected int[] mTimesItalicRoman8 = { - //begin of unsure data + //TODO TimesItalicRoman8 59, // 0 "" 415, // 1 "" 415, // 2 "" @@ -732,143 +735,143 @@ 415, // 126 "" 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 184, // 133 "" - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 59, // 160 "" - 254, // 161 "" - 254, // 162 "" - 254, // 163 "" - 254, // 164 "" - 254, // 165 "" - 138, // 166 "" - 138, // 167 "" - 207, // 168 "" - 207, // 169 "" - 207, // 170 "" - 207, // 171 "" - 207, // 172 "" - 300, // 173 "" - 300, // 174 "" - 207, // 175 "" - 207, // 176 "" - 231, // 177 "" - 184, // 178 "" - 207, // 179 "" - 277, // 180 "" - 184, // 181 "" - 277, // 182 "" - 207, // 183 "" - 138, // 184 "" - 207, // 185 "" - 207, // 186 "" - 207, // 187 "" - 207, // 188 "" - 207, // 189 "" - 207, // 190 "" - 207, // 191 "" - 207, // 192 "" - 184, // 193 "" - 207, // 194 "" - 207, // 195 "" - 207, // 196 "" - 184, // 197 "" - 207, // 198 "" - 207, // 199 "" - 207, // 200 "" - 184, // 201 "" - 207, // 202 "" - 207, // 203 "" - 207, // 204 "" - 184, // 205 "" - 207, // 206 "" - 207, // 207 "" - 254, // 208 "" - 115, // 209 "" - 300, // 210 "" - 369, // 211 "" - 207, // 212 "" - 115, // 213 "" - 207, // 214 "" - 277, // 215 "" - 254, // 216 "" - 115, // 217 "" - 300, // 218 "" - 300, // 219 "" - 254, // 220 "" - 115, // 221 "" - 207, // 222 "" - 300, // 223 "" - 254, // 224 "" - 254, // 225 "" - 207, // 226 "" - 300, // 227 "" - 207, // 228 "" - 138, // 229 "" - 138, // 230 "" - 300, // 231 "" - 300, // 232 "" - 300, // 233 "" - 207, // 234 "" - 207, // 235 "" - 161, // 236 "" - 300, // 237 "" - 231, // 238 "" - 184, // 239 "" - 254, // 240 "" - 207, // 241 "" - 0, // 242 "" - 231, // 243 "" - 207, // 244 "" - 369, // 245 "" - 369, // 246 "" - 369, // 247 "" - 369, // 248 "" - 207, // 249 "" - 207, // 250 "" - 192, // 251 "" - 300, // 252 "" - 192, // 253 "" - 369, // 254 "" - 59 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Times font, Italic, not bold, using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 207, // 128 \x80 use 83 S + 207, // 129 x use 97 a + 207, // 130 x use 97 a + 207, // 131 x use 97 a + 207, // 132 x use 97 a + 207, // 133 x use 97 a + 207, // 134 x use 97 a + 207, // 135 x use 97 a + 207, // 136 x use 97 a + 207, // 137 x use 97 a + 207, // 138 x use 97 a + 207, // 139 x use 97 a + 207, // 140 x use 97 a + 207, // 141 x use 97 a + 207, // 142 x use 97 a + 207, // 143 x use 97 a + 207, // 144 x use 97 a + 138, // 145 \x91 use 44 , + 138, // 146 \x92 use 44 , + 207, // 147 x use 97 a + 207, // 148 x use 97 a + 207, // 149 x use 97 a + 207, // 150 x use 97 a + 207, // 151 x use 97 a + 207, // 152 x use 97 a + 207, // 153 x use 97 a + 207, // 154 x use 97 a + 207, // 155 x use 97 a + 207, // 156 x use 97 a + 207, // 157 x use 97 a + 207, // 158 x use 97 a + 207, // 159 x use 97 a + 123, // 160 NSB use 32 space + 138, // 161 \xA1 use 33 ! + 184, // 162 \xA2 use 99 c + 207, // 163 \xA3 use 83 S + 207, // 164 \xA4 use 83 S + 207, // 165 \xA5 use 83 S + 138, // 166 \xA6 use 33 ! + 207, // 167 \xA7 use 83 S + 207, // 168 \xA8 use 97 a + 207, // 169 \xA9 use 83 S + 207, // 170 \xAA use 97 a + 207, // 171 \xAB use 97 a + 207, // 172 \xAC use 98 b + 138, // 173 \xAD use 45 - + 207, // 174 \xAE use 83 S + 207, // 175 \xAF use 97 a + 138, // 176 \xB0 use 33 ! + 231, // 177 \xB1 use 84 T + 138, // 178 \xB2 use 33 ! + 138, // 179 \xB3 use 33 ! + 138, // 180 \xB4 use 33 ! + 207, // 181 \xB5 use 97 a + 207, // 182 \xB6 use 97 a + 138, // 183 \xB7 use 46 . + 138, // 184 \xB8 use 46 . + 138, // 185 \xB9 use 33 ! + 138, // 186 \xBA use 33 ! + 207, // 187 \xBB use 97 a + 231, // 188 \xBC use 84 T + 231, // 189 \xBD use 84 T + 231, // 190 \xBE use 84 T + 207, // 191 \xBF use 63 ? + 254, // 192 \xC0 use 65 A + 254, // 193 \xC1 use 65 A + 254, // 194 \xC2 use 65 A + 254, // 195 \xC3 use 65 A + 254, // 196 \xC4 use 65 A + 254, // 197 \xC5 use 65 A + 346, // 198 \xC6 use 77 M + 277, // 199 \xC7 use 67 C + 254, // 200 \xC8 use 69 E + 254, // 201 \xC9 use 69 E + 254, // 202 \xCA use 69 E + 254, // 203 \xCB use 69 E + 138, // 204 \xCC use 73 I + 138, // 205 \xCD use 73 I + 138, // 206 \xCE use 73 I + 138, // 207 \xCF use 73 I + 300, // 208 \xD0 use 68 D + 277, // 209 \xD1 use 78 N + 300, // 210 \xD2 use 79 O + 300, // 211 \xD3 use 79 O + 300, // 212 \xD4 use 79 O + 300, // 213 \xD5 use 79 O + 300, // 214 \xD6 use 79 O + 231, // 215 \xD7 use 84 T + 300, // 216 \xD8 use 79 O + 300, // 217 \xD9 use 85 U + 300, // 218 \xDA use 85 U + 300, // 219 \xDB use 85 U + 300, // 220 \xDC use 85 U + 231, // 221 \xDD use 89 Y + 207, // 222 \xDE use 112 p + 231, // 223 \xDF use 84 T + 207, // 224 \xE0 use 97 a + 207, // 225 \xE1 use 97 a + 207, // 226 \xE2 use 97 a + 207, // 227 \xE3 use 97 a + 207, // 228 \xE4 use 97 a + 207, // 229 \xE5 use 97 a + 231, // 230 \xE6 use 84 T + 184, // 231 \xE7 use 99 c + 184, // 232 \xE8 use 101 e + 184, // 233 \xE9 use 101 e + 184, // 234 \xEA use 101 e + 184, // 235 \xEB use 101 e + 115, // 236 \xEC use 105 i + 115, // 237 \xED use 105 i + 115, // 238 \xEE use 105 i + 115, // 239 \xEF use 105 i + 207, // 240 \xF0 use 111 o + 207, // 241 \xF1 use 110 n + 207, // 242 \xF2 use 111 o + 207, // 243 \xF3 use 111 o + 207, // 244 \xF4 use 111 o + 207, // 245 \xF5 use 111 o + 207, // 246 \xF6 use 111 o + 231, // 247 \xF7 use 84 T + 207, // 248 \xF8 use 111 o + 207, // 249 \xF9 use 117 u + 207, // 250 \xFA use 117 u + 207, // 251 \xFB use 117 u + 207, // 252 \xFC use 117 u + 184, // 253 \xFD use 121 y + 207, // 254 \xFE use 112 p + 184 // 255 \xFF use 121 y }; // Times 4101, BoldItalic, Roman8=8U protected int[] mTimesBoldItalicRoman8 = { - //begin of unsure data - 59, // 0 "" + //TODO TimesBoldItalicRoman8 + 59, // 0 "" 415, // 1 "" 415, // 2 "" 415, // 3 "" @@ -999,143 +1002,143 @@ 415, // 126 "" 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 184, // 133 "" - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 59, // 160 "" - 277, // 161 "" - 277, // 162 "" - 277, // 163 "" - 277, // 164 "" - 277, // 165 "" - 161, // 166 "" - 161, // 167 "" - 207, // 168 "" - 207, // 169 "" - 207, // 170 "" - 207, // 171 "" - 207, // 172 "" - 300, // 173 "" - 300, // 174 "" - 207, // 175 "" - 207, // 176 "" - 254, // 177 "" - 184, // 178 "" - 207, // 179 "" - 277, // 180 "" - 184, // 181 "" - 300, // 182 "" - 231, // 183 "" - 161, // 184 "" - 207, // 185 "" - 207, // 186 "" - 207, // 187 "" - 207, // 188 "" - 207, // 189 "" - 207, // 190 "" - 207, // 191 "" - 207, // 192 "" - 184, // 193 "" - 207, // 194 "" - 231, // 195 "" - 207, // 196 "" - 184, // 197 "" - 207, // 198 "" - 231, // 199 "" - 207, // 200 "" - 184, // 201 "" - 207, // 202 "" - 231, // 203 "" - 207, // 204 "" - 184, // 205 "" - 207, // 206 "" - 231, // 207 "" - 277, // 208 "" - 115, // 209 "" - 300, // 210 "" - 384, // 211 "" - 207, // 212 "" - 115, // 213 "" - 207, // 214 "" - 292, // 215 "" - 277, // 216 "" - 115, // 217 "" - 300, // 218 "" - 300, // 219 "" - 277, // 220 "" - 115, // 221 "" - 207, // 222 "" - 300, // 223 "" - 277, // 224 "" - 277, // 225 "" - 207, // 226 "" - 300, // 227 "" - 207, // 228 "" - 161, // 229 "" - 161, // 230 "" - 300, // 231 "" - 300, // 232 "" - 300, // 233 "" - 207, // 234 "" - 231, // 235 "" - 161, // 236 "" - 300, // 237 "" - 254, // 238 "" - 184, // 239 "" - 254, // 240 "" - 207, // 241 "" - 31, // 242 "" - 231, // 243 "" - 207, // 244 "" - 369, // 245 "" - 369, // 246 "" - 369, // 247 "" - 369, // 248 "" - 207, // 249 "" - 207, // 250 "" - 184, // 251 "" - 300, // 252 "" - 184, // 253 "" - 369, // 254 "" - 59 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Times font, Bold and Italic, using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 231, // 128 \x80 use 83 S + 207, // 129 x use 97 a + 207, // 130 x use 97 a + 207, // 131 x use 97 a + 207, // 132 x use 97 a + 207, // 133 x use 97 a + 207, // 134 x use 97 a + 207, // 135 x use 97 a + 207, // 136 x use 97 a + 207, // 137 x use 97 a + 207, // 138 x use 97 a + 207, // 139 x use 97 a + 207, // 140 x use 97 a + 207, // 141 x use 97 a + 207, // 142 x use 97 a + 207, // 143 x use 97 a + 207, // 144 x use 97 a + 138, // 145 \x91 use 44 , + 138, // 146 \x92 use 44 , + 207, // 147 x use 97 a + 207, // 148 x use 97 a + 207, // 149 x use 97 a + 207, // 150 x use 97 a + 207, // 151 x use 97 a + 207, // 152 x use 97 a + 207, // 153 x use 97 a + 207, // 154 x use 97 a + 207, // 155 x use 97 a + 207, // 156 x use 97 a + 207, // 157 x use 97 a + 207, // 158 x use 97 a + 207, // 159 x use 97 a + 123, // 160 NSB use 32 space + 161, // 161 \xA1 use 33 ! + 184, // 162 \xA2 use 99 c + 231, // 163 \xA3 use 83 S + 231, // 164 \xA4 use 83 S + 231, // 165 \xA5 use 83 S + 161, // 166 \xA6 use 33 ! + 231, // 167 \xA7 use 83 S + 207, // 168 \xA8 use 97 a + 231, // 169 \xA9 use 83 S + 207, // 170 \xAA use 97 a + 207, // 171 \xAB use 97 a + 207, // 172 \xAC use 98 b + 138, // 173 \xAD use 45 - + 231, // 174 \xAE use 83 S + 207, // 175 \xAF use 97 a + 161, // 176 \xB0 use 33 ! + 254, // 177 \xB1 use 84 T + 161, // 178 \xB2 use 33 ! + 161, // 179 \xB3 use 33 ! + 161, // 180 \xB4 use 33 ! + 207, // 181 \xB5 use 97 a + 207, // 182 \xB6 use 97 a + 138, // 183 \xB7 use 46 . + 138, // 184 \xB8 use 46 . + 161, // 185 \xB9 use 33 ! + 161, // 186 \xBA use 33 ! + 207, // 187 \xBB use 97 a + 254, // 188 \xBC use 84 T + 254, // 189 \xBD use 84 T + 254, // 190 \xBE use 84 T + 207, // 191 \xBF use 63 ? + 277, // 192 \xC0 use 65 A + 277, // 193 \xC1 use 65 A + 277, // 194 \xC2 use 65 A + 277, // 195 \xC3 use 65 A + 277, // 196 \xC4 use 65 A + 277, // 197 \xC5 use 65 A + 369, // 198 \xC6 use 77 M + 277, // 199 \xC7 use 67 C + 277, // 200 \xC8 use 69 E + 277, // 201 \xC9 use 69 E + 277, // 202 \xCA use 69 E + 277, // 203 \xCB use 69 E + 161, // 204 \xCC use 73 I + 161, // 205 \xCD use 73 I + 161, // 206 \xCE use 73 I + 161, // 207 \xCF use 73 I + 300, // 208 \xD0 use 68 D + 300, // 209 \xD1 use 78 N + 300, // 210 \xD2 use 79 O + 300, // 211 \xD3 use 79 O + 300, // 212 \xD4 use 79 O + 300, // 213 \xD5 use 79 O + 300, // 214 \xD6 use 79 O + 254, // 215 \xD7 use 84 T + 300, // 216 \xD8 use 79 O + 300, // 217 \xD9 use 85 U + 300, // 218 \xDA use 85 U + 300, // 219 \xDB use 85 U + 300, // 220 \xDC use 85 U + 254, // 221 \xDD use 89 Y + 207, // 222 \xDE use 112 p + 254, // 223 \xDF use 84 T + 207, // 224 \xE0 use 97 a + 207, // 225 \xE1 use 97 a + 207, // 226 \xE2 use 97 a + 207, // 227 \xE3 use 97 a + 207, // 228 \xE4 use 97 a + 207, // 229 \xE5 use 97 a + 254, // 230 \xE6 use 84 T + 184, // 231 \xE7 use 99 c + 184, // 232 \xE8 use 101 e + 184, // 233 \xE9 use 101 e + 184, // 234 \xEA use 101 e + 184, // 235 \xEB use 101 e + 115, // 236 \xEC use 105 i + 115, // 237 \xED use 105 i + 115, // 238 \xEE use 105 i + 115, // 239 \xEF use 105 i + 207, // 240 \xF0 use 111 o + 231, // 241 \xF1 use 110 n + 207, // 242 \xF2 use 111 o + 207, // 243 \xF3 use 111 o + 207, // 244 \xF4 use 111 o + 207, // 245 \xF5 use 111 o + 207, // 246 \xF6 use 111 o + 254, // 247 \xF7 use 84 T + 207, // 248 \xF8 use 111 o + 231, // 249 \xF9 use 117 u + 231, // 250 \xFA use 117 u + 231, // 251 \xFB use 117 u + 231, // 252 \xFC use 117 u + 184, // 253 \xFD use 121 y + 207, // 254 \xFE use 112 p + 184 // 255 \xFF use 121 y }; // Univers 4148, Plain, Roman8=8U protected int[] mUniversPlainRoman8 = { - //begin of unsure data - 59, // 0 "" + //TODO UniversPlainRoman8 + 59, // 0 "" 415, // 1 "" 415, // 2 "" 415, // 3 "" @@ -1206,7 +1209,7 @@ 261, // 66 "B" 292, // 67 "C" 300, // 68 "D" - 248, // 69 "E" WAS 238 + 238, // 69 "E" 231, // 70 "F" 307, // 71 "G" 300, // 72 "H" @@ -1219,7 +1222,7 @@ 315, // 79 "O" 246, // 80 "P" 323, // 81 "Q" - 279, // 82 "R" WAS 269 + 269, // 82 "R" 269, // 83 "S" 261, // 84 "T" 300, // 85 "U" @@ -1266,143 +1269,143 @@ 415, // 126 "" 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 415, // 133 "..." - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 10, // 160 "" - 307, // 161 "" - 307, // 162 "" - 238, // 163 "" - 238, // 164 "" - 238, // 165 "" - 115, // 166 "" - 115, // 167 "" - 261, // 168 "" - 261, // 169 "" - 261, // 170 "" - 261, // 171 "" - 261, // 172 "" - 300, // 173 "" - 300, // 174 "" - 261, // 175 "" - 207, // 176 "" - 284, // 177 "" - 231, // 178 "" - 261, // 179 "" - 292, // 180 "" - 223, // 181 "" - 300, // 182 "" - 238, // 183 "" - 138, // 184 "" - 215, // 185 "" - 261, // 186 "" - 261, // 187 "" - 261, // 188 "" - 261, // 189 "" - 261, // 190 "" - 261, // 191 "" - 223, // 192 "" - 223, // 193 "" - 238, // 194 "" - 238, // 195 "" - 223, // 196 "" - 223, // 197 "" - 238, // 198 "" - 238, // 199 "" - 223, // 200 "" - 223, // 201 "" - 238, // 202 "" - 238, // 203 "" - 223, // 204 "" - 223, // 205 "" - 238, // 206 "" - 238, // 207 "" - 307, // 208 "" - 100, // 209 "" - 315, // 210 "" - 407, // 211 "" - 223, // 212 "" - 100, // 213 "" - 238, // 214 "" - 353, // 215 "" - 307, // 216 "" - 100, // 217 "" - 315, // 218 "" - 300, // 219 "" - 238, // 220 "" - 100, // 221 "" - 254, // 222 "" - 315, // 223 "" - 307, // 224 "" - 307, // 225 "" - 223, // 226 "" - 300, // 227 "" - 238, // 228 "" - 115, // 229 "" - 115, // 230 "" - 315, // 231 "" - 315, // 232 "" - 315, // 233 "" - 238, // 234 "" - 269, // 235 "" - 207, // 236 "" - 300, // 237 "" - 284, // 238 "" - 231, // 239 "" - 246, // 240 "" - 238, // 241 "" - 51, // 242 "" - 231, // 243 "" - 261, // 244 "" - 415, // 245 "" - 415, // 246 "" - 415, // 247 "" - 415, // 248 "" - 169, // 249 "" - 169, // 250 "" - 231, // 251 "" - 300, // 252 "" - 231, // 253 "" - 415, // 254 "" - 10 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Univers font, Plain (not bold, not italics), using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 269, // 128 \x80 use 83 S + 223, // 129 x use 97 a + 223, // 130 x use 97 a + 223, // 131 x use 97 a + 223, // 132 x use 97 a + 223, // 133 x use 97 a + 223, // 134 x use 97 a + 223, // 135 x use 97 a + 223, // 136 x use 97 a + 223, // 137 x use 97 a + 223, // 138 x use 97 a + 223, // 139 x use 97 a + 223, // 140 x use 97 a + 223, // 141 x use 97 a + 223, // 142 x use 97 a + 223, // 143 x use 97 a + 223, // 144 x use 97 a + 138, // 145 \x91 use 44 , + 138, // 146 \x92 use 44 , + 223, // 147 x use 97 a + 223, // 148 x use 97 a + 223, // 149 x use 97 a + 223, // 150 x use 97 a + 223, // 151 x use 97 a + 223, // 152 x use 97 a + 223, // 153 x use 97 a + 223, // 154 x use 97 a + 223, // 155 x use 97 a + 223, // 156 x use 97 a + 223, // 157 x use 97 a + 223, // 158 x use 97 a + 223, // 159 x use 97 a + 138, // 160 NSB use 32 space + 138, // 161 \xA1 use 33 ! + 223, // 162 \xA2 use 99 c + 269, // 163 \xA3 use 83 S + 269, // 164 \xA4 use 83 S + 269, // 165 \xA5 use 83 S + 138, // 166 \xA6 use 33 ! + 269, // 167 \xA7 use 83 S + 223, // 168 \xA8 use 97 a + 269, // 169 \xA9 use 83 S + 223, // 170 \xAA use 97 a + 223, // 171 \xAB use 97 a + 238, // 172 \xAC use 98 b + 138, // 173 \xAD use 45 - + 269, // 174 \xAE use 83 S + 223, // 175 \xAF use 97 a + 138, // 176 \xB0 use 33 ! + 261, // 177 \xB1 use 84 T + 138, // 178 \xB2 use 33 ! + 138, // 179 \xB3 use 33 ! + 138, // 180 \xB4 use 33 ! + 223, // 181 \xB5 use 97 a + 223, // 182 \xB6 use 97 a + 138, // 183 \xB7 use 46 . + 138, // 184 \xB8 use 46 . + 138, // 185 \xB9 use 33 ! + 138, // 186 \xBA use 33 ! + 223, // 187 \xBB use 97 a + 261, // 188 \xBC use 84 T + 261, // 189 \xBD use 84 T + 261, // 190 \xBE use 84 T + 215, // 191 \xBF use 63 ? + 307, // 192 \xC0 use 65 A + 307, // 193 \xC1 use 65 A + 307, // 194 \xC2 use 65 A + 307, // 195 \xC3 use 65 A + 307, // 196 \xC4 use 65 A + 307, // 197 \xC5 use 65 A + 376, // 198 \xC6 use 77 M + 292, // 199 \xC7 use 67 C + 238, // 200 \xC8 use 69 E + 238, // 201 \xC9 use 69 E + 238, // 202 \xCA use 69 E + 238, // 203 \xCB use 69 E + 115, // 204 \xCC use 73 I + 115, // 205 \xCD use 73 I + 115, // 206 \xCE use 73 I + 115, // 207 \xCF use 73 I + 300, // 208 \xD0 use 68 D + 300, // 209 \xD1 use 78 N + 315, // 210 \xD2 use 79 O + 315, // 211 \xD3 use 79 O + 315, // 212 \xD4 use 79 O + 315, // 213 \xD5 use 79 O + 315, // 214 \xD6 use 79 O + 261, // 215 \xD7 use 84 T + 315, // 216 \xD8 use 79 O + 300, // 217 \xD9 use 85 U + 300, // 218 \xDA use 85 U + 300, // 219 \xDB use 85 U + 300, // 220 \xDC use 85 U + 284, // 221 \xDD use 89 Y + 238, // 222 \xDE use 112 p + 261, // 223 \xDF use 84 T + 223, // 224 \xE0 use 97 a + 223, // 225 \xE1 use 97 a + 223, // 226 \xE2 use 97 a + 223, // 227 \xE3 use 97 a + 223, // 228 \xE4 use 97 a + 223, // 229 \xE5 use 97 a + 261, // 230 \xE6 use 84 T + 223, // 231 \xE7 use 99 c + 223, // 232 \xE8 use 101 e + 223, // 233 \xE9 use 101 e + 223, // 234 \xEA use 101 e + 223, // 235 \xEB use 101 e + 100, // 236 \xEC use 105 i + 100, // 237 \xED use 105 i + 100, // 238 \xEE use 105 i + 100, // 239 \xEF use 105 i + 238, // 240 \xF0 use 111 o + 238, // 241 \xF1 use 110 n + 238, // 242 \xF2 use 111 o + 238, // 243 \xF3 use 111 o + 238, // 244 \xF4 use 111 o + 238, // 245 \xF5 use 111 o + 238, // 246 \xF6 use 111 o + 261, // 247 \xF7 use 84 T + 238, // 248 \xF8 use 111 o + 238, // 249 \xF9 use 117 u + 238, // 250 \xFA use 117 u + 238, // 251 \xFB use 117 u + 238, // 252 \xFC use 117 u + 231, // 253 \xFD use 121 y + 238, // 254 \xFE use 112 p + 231 // 255 \xFF use 121 y }; // Univers 4148, Bold, Roman8=8U protected int[] mUniversBoldRoman8 = { - //begin of unsure data - 59, // 0 "" + //TODO UniversBoldRoman8 + 59, // 0 "" 415, // 1 "" 415, // 2 "" 415, // 3 "" @@ -1473,7 +1476,7 @@ 261, // 66 "B" 292, // 67 "C" 300, // 68 "D" - 248, // 69 "E" WAS 238 + 238, // 69 "E" 231, // 70 "F" 307, // 71 "G" 300, // 72 "H" @@ -1486,7 +1489,7 @@ 315, // 79 "O" 246, // 80 "P" 323, // 81 "Q" - 279, // 82 "R" WAS 269 + 269, // 82 "R" 269, // 83 "S" 261, // 84 "T" 300, // 85 "U" @@ -1533,143 +1536,143 @@ 415, // 126 "" 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 184, // 133 "" - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 10, // 160 "" - 307, // 161 "" - 307, // 162 "" - 238, // 163 "" - 238, // 164 "" - 238, // 165 "" - 115, // 166 "" - 115, // 167 "" - 261, // 168 "" - 261, // 169 "" - 261, // 170 "" - 261, // 171 "" - 261, // 172 "" - 300, // 173 "" - 300, // 174 "" - 261, // 175 "" - 207, // 176 "" - 284, // 177 "" - 231, // 178 "" - 261, // 179 "" - 292, // 180 "" - 223, // 181 "" - 300, // 182 "" - 238, // 183 "" - 138, // 184 "" - 215, // 185 "" - 261, // 186 "" - 261, // 187 "" - 261, // 188 "" - 261, // 189 "" - 261, // 190 "" - 261, // 191 "" - 223, // 192 "" - 223, // 193 "" - 238, // 194 "" - 238, // 195 "" - 223, // 196 "" - 223, // 197 "" - 238, // 198 "" - 238, // 199 "" - 223, // 200 "" - 223, // 201 "" - 238, // 202 "" - 238, // 203 "" - 223, // 204 "" - 223, // 205 "" - 238, // 206 "" - 238, // 207 "" - 307, // 208 "" - 100, // 209 "" - 315, // 210 "" - 407, // 211 "" - 223, // 212 "" - 100, // 213 "" - 238, // 214 "" - 353, // 215 "" - 307, // 216 "" - 100, // 217 "" - 315, // 218 "" - 300, // 219 "" - 238, // 220 "" - 100, // 221 "" - 254, // 222 "" - 315, // 223 "" - 307, // 224 "" - 307, // 225 "" - 223, // 226 "" - 300, // 227 "" - 238, // 228 "" - 115, // 229 "" - 115, // 230 "" - 315, // 231 "" - 315, // 232 "" - 315, // 233 "" - 238, // 234 "" - 269, // 235 "" - 207, // 236 "" - 300, // 237 "" - 284, // 238 "" - 231, // 239 "" - 246, // 240 "" - 238, // 241 "" - 63, // 242 "" - 246, // 243 "" - 261, // 244 "" - 415, // 245 "" - 415, // 246 "" - 415, // 247 "" - 415, // 248 "" - 169, // 249 "" - 169, // 250 "" - 231, // 251 "" - 300, // 252 "" - 231, // 253 "" - 415, // 254 "" - 10 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Univers font, Bold, not italic, using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 269, // 128 \x80 use 83 S + 223, // 129 x use 97 a + 223, // 130 x use 97 a + 223, // 131 x use 97 a + 223, // 132 x use 97 a + 223, // 133 x use 97 a + 223, // 134 x use 97 a + 223, // 135 x use 97 a + 223, // 136 x use 97 a + 223, // 137 x use 97 a + 223, // 138 x use 97 a + 223, // 139 x use 97 a + 223, // 140 x use 97 a + 223, // 141 x use 97 a + 223, // 142 x use 97 a + 223, // 143 x use 97 a + 223, // 144 x use 97 a + 138, // 145 \x91 use 44 , + 138, // 146 \x92 use 44 , + 223, // 147 x use 97 a + 223, // 148 x use 97 a + 223, // 149 x use 97 a + 223, // 150 x use 97 a + 223, // 151 x use 97 a + 223, // 152 x use 97 a + 223, // 153 x use 97 a + 223, // 154 x use 97 a + 223, // 155 x use 97 a + 223, // 156 x use 97 a + 223, // 157 x use 97 a + 223, // 158 x use 97 a + 223, // 159 x use 97 a + 138, // 160 NSB use 32 space + 138, // 161 \xA1 use 33 ! + 223, // 162 \xA2 use 99 c + 269, // 163 \xA3 use 83 S + 269, // 164 \xA4 use 83 S + 269, // 165 \xA5 use 83 S + 138, // 166 \xA6 use 33 ! + 269, // 167 \xA7 use 83 S + 223, // 168 \xA8 use 97 a + 269, // 169 \xA9 use 83 S + 223, // 170 \xAA use 97 a + 223, // 171 \xAB use 97 a + 238, // 172 \xAC use 98 b + 138, // 173 \xAD use 45 - + 269, // 174 \xAE use 83 S + 223, // 175 \xAF use 97 a + 138, // 176 \xB0 use 33 ! + 261, // 177 \xB1 use 84 T + 138, // 178 \xB2 use 33 ! + 138, // 179 \xB3 use 33 ! + 138, // 180 \xB4 use 33 ! + 223, // 181 \xB5 use 97 a + 223, // 182 \xB6 use 97 a + 138, // 183 \xB7 use 46 . + 138, // 184 \xB8 use 46 . + 138, // 185 \xB9 use 33 ! + 138, // 186 \xBA use 33 ! + 223, // 187 \xBB use 97 a + 261, // 188 \xBC use 84 T + 261, // 189 \xBD use 84 T + 261, // 190 \xBE use 84 T + 215, // 191 \xBF use 63 ? + 307, // 192 \xC0 use 65 A + 307, // 193 \xC1 use 65 A + 307, // 194 \xC2 use 65 A + 307, // 195 \xC3 use 65 A + 307, // 196 \xC4 use 65 A + 307, // 197 \xC5 use 65 A + 376, // 198 \xC6 use 77 M + 292, // 199 \xC7 use 67 C + 238, // 200 \xC8 use 69 E + 238, // 201 \xC9 use 69 E + 238, // 202 \xCA use 69 E + 238, // 203 \xCB use 69 E + 115, // 204 \xCC use 73 I + 115, // 205 \xCD use 73 I + 115, // 206 \xCE use 73 I + 115, // 207 \xCF use 73 I + 300, // 208 \xD0 use 68 D + 300, // 209 \xD1 use 78 N + 315, // 210 \xD2 use 79 O + 315, // 211 \xD3 use 79 O + 315, // 212 \xD4 use 79 O + 315, // 213 \xD5 use 79 O + 315, // 214 \xD6 use 79 O + 261, // 215 \xD7 use 84 T + 315, // 216 \xD8 use 79 O + 300, // 217 \xD9 use 85 U + 300, // 218 \xDA use 85 U + 300, // 219 \xDB use 85 U + 300, // 220 \xDC use 85 U + 284, // 221 \xDD use 89 Y + 238, // 222 \xDE use 112 p + 261, // 223 \xDF use 84 T + 223, // 224 \xE0 use 97 a + 223, // 225 \xE1 use 97 a + 223, // 226 \xE2 use 97 a + 223, // 227 \xE3 use 97 a + 223, // 228 \xE4 use 97 a + 223, // 229 \xE5 use 97 a + 261, // 230 \xE6 use 84 T + 223, // 231 \xE7 use 99 c + 223, // 232 \xE8 use 101 e + 223, // 233 \xE9 use 101 e + 223, // 234 \xEA use 101 e + 223, // 235 \xEB use 101 e + 100, // 236 \xEC use 105 i + 100, // 237 \xED use 105 i + 100, // 238 \xEE use 105 i + 100, // 239 \xEF use 105 i + 238, // 240 \xF0 use 111 o + 238, // 241 \xF1 use 110 n + 238, // 242 \xF2 use 111 o + 238, // 243 \xF3 use 111 o + 238, // 244 \xF4 use 111 o + 238, // 245 \xF5 use 111 o + 238, // 246 \xF6 use 111 o + 261, // 247 \xF7 use 84 T + 238, // 248 \xF8 use 111 o + 238, // 249 \xF9 use 117 u + 238, // 250 \xFA use 117 u + 238, // 251 \xFB use 117 u + 238, // 252 \xFC use 117 u + 231, // 253 \xFD use 121 y + 238, // 254 \xFE use 112 p + 231 // 255 \xFF use 121 y }; // Univers 4148, Italic, Roman8=8U protected int[] mUniversItalicRoman8 = { - //begin of unsure data - 59, // 0 "" + //TODO UniversItalicRoman8 + 59, // 0 "" 415, // 1 "" 415, // 2 "" 415, // 3 "" @@ -1800,410 +1803,410 @@ 415, // 126 "" 415, // 127 "" - //begin of unsure data - 284, // 128 "" - 207, // 129 "" - 184, // 130 "" - 184, // 131 "" - 184, // 132 "" - 184, // 133 "" - 184, // 134 "" - 184, // 135 "" - 184, // 136 "" - 184, // 137 "" - 184, // 138 "" - 115, // 139 "" - 115, // 140 "" - 115, // 141 "" - 300, // 142 "" - 300, // 143 "" - 261, // 144 "" - 277, // 145 "" - 369, // 146 "" - 207, // 147 "" - 207, // 148 "" - 207, // 149 "" - 207, // 150 "" - 207, // 151 "" - 207, // 152 "" - 300, // 153 "" - 307, // 154 "" - 207, // 155 "" - 207, // 156 "" - 207, // 157 "" - 364, // 158 "" - 207, // 159 "" - // end unsure - - 10, // 160 "" - 307, // 161 "" - 307, // 162 "" - 238, // 163 "" - 238, // 164 "" - 238, // 165 "" - 115, // 166 "" - 115, // 167 "" - 261, // 168 "" - 261, // 169 "" - 261, // 170 "" - 261, // 171 "" - 261, // 172 "" - 300, // 173 "" - 300, // 174 "" - 261, // 175 "" - 207, // 176 "" - 284, // 177 "" - 231, // 178 "" - 261, // 179 "" - 292, // 180 "" - 223, // 181 "" - 300, // 182 "" - 238, // 183 "" - 138, // 184 "" - 215, // 185 "" - 261, // 186 "" - 261, // 187 "" - 261, // 188 "" - 261, // 189 "" - 261, // 190 "" - 261, // 191 "" - 223, // 192 "" - 223, // 193 "" - 238, // 194 "" - 238, // 195 "" - 223, // 196 "" - 223, // 197 "" - 238, // 198 "" - 238, // 199 "" - 223, // 200 "" - 223, // 201 "" - 238, // 202 "" - 238, // 203 "" - 223, // 204 "" - 223, // 205 "" - 238, // 206 "" - 238, // 207 "" - 307, // 208 "" - 100, // 209 "" - 315, // 210 "" - 407, // 211 "" - 223, // 212 "" - 100, // 213 "" - 238, // 214 "" - 353, // 215 "" - 307, // 216 "" - 100, // 217 "" - 315, // 218 "" - 300, // 219 "" - 238, // 220 "" - 100, // 221 "" - 254, // 222 "" - 315, // 223 "" - 307, // 224 "" - 307, // 225 "" - 223, // 226 "" - 300, // 227 "" - 238, // 228 "" - 115, // 229 "" - 115, // 230 "" - 315, // 231 "" - 315, // 232 "" - 315, // 233 "" - 238, // 234 "" - 269, // 235 "" - 207, // 236 "" - 300, // 237 "" - 284, // 238 "" - 231, // 239 "" - 246, // 240 "" - 238, // 241 "" - 31, // 242 "" - 231, // 243 "" - 261, // 244 "" - 415, // 245 "" - 415, // 246 "" - 415, // 247 "" - 415, // 248 "" - 169, // 249 "" - 169, // 250 "" - 231, // 251 "" - 300, // 252 "" - 231, // 253 "" - 415, // 254 "" - 10 // 255 "" + // The below 128 to 255 char width values changed 9/27/07 HowardH. + // Univers font, Italic, not bold, using the 9U Windows 1252 ANSI char set + // Key: width, // # char use # char + 269, // 128 \x80 use 83 S + 223, // 129 x use 97 a + 223, // 130 x use 97 a + 223, // 131 x use 97 a + 223, // 132 x use 97 a + 223, // 133 ... [truncated message content] |
From: <doc...@us...> - 2007-09-26 00:02:33
|
Revision: 178 http://openpcl.svn.sourceforge.net/openpcl/?rev=178&view=rev Author: documentsystems Date: 2007-09-25 17:02:33 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. Changed to use Jim Gabriel's new PCLPrintJob class, which meant to remove the PCL Direct printing and Windows Printing code in PosPrintPages, but keep the building of all the PCL bytes, so that the whole print operation is handled in PCLPrintJob with it's API being the initializePrintJob parameters. Implemented print duplex for Windows Print. Fixed bug when printing two pages, and doing Letter first then Legal, the two pages wouldn't reorder. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-09-25 23:57:34 UTC (rev 177) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-09-26 00:02:33 UTC (rev 178) @@ -7,17 +7,12 @@ import java.awt.Frame; import java.awt.print.PrinterException; import java.awt.print.PrinterJob; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Locale; -import javax.print.DocFlavor; -import javax.print.DocPrintJob; -import javax.print.PrintException; import javax.print.PrintService; -import javax.print.SimpleDoc; import javax.print.attribute.DocAttributeSet; import javax.print.attribute.HashDocAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; @@ -50,9 +45,8 @@ private PosView mPosView = null; private Frame mParentFrame = null; - private PosPrintBufferedImage mPosPrintBufferedImage = null; - private PosPrintPageableInterface mPosPrintPageableInterface = null; - private PrinterJob mPrinterJob = null; + private PrinterJob mPrinterJob = null; // This is the SUN JRE java.awt.print.PrinterJob + private PCLPrintJob mPCLPrintJob = null; // This is our own com.openpcl.viewer.printing.PCLPrintJob in this project private PrintRequestAttributeSet mPrintRequestAttributeSet = null; private PrintService mPrintService = null; private PosPrintSetupDialog mPosPrintSetupDialog = null; @@ -69,6 +63,7 @@ public static final int sPageOrientationLandscape = 2; private int mProcessPrintType = 0; private int mNumberOfPagesThatWillPrint = 0; + private int mNumberBlankBackPages = 0; private static final String[] mTitleBarTextForPrintDialog = { "Print All", "Print Selected", "Print Changed", "Print Remaining"}; private PriModifyPclBytes mPriModifyPclBytes = null; @@ -88,13 +83,12 @@ public PosPrintPages(PosView pPosView) { super(); mPosView = pPosView; + mPCLPrintJob = mPosView.getOpenPCLViewer().getPCLPrintJob(); mParentFrame = mPosView.getOpenPCLViewer().getAppFrame(); mPrintRequestAttributeSet = mPosView.getOpenPCLViewer().getPrintRequestAttributeSet(); mPosPrintSetupDialogChoices = mPosView.getOpenPCLViewer().getPosPrintSetupDialogChoices(); mDocAttributeSet = new HashDocAttributeSet(); mDocAttributeSet.add(new DocumentName(mPosView.getOpenPCLViewer().getAppName() + " print", Locale.getDefault())); - mPosPrintBufferedImage = new PosPrintBufferedImage(mPosView); - mPosPrintPageableInterface = new PosPrintPageableInterface(mPosView); mPriModifyPclBytes = new PriModifyPclBytes(); mPrintingProgressBar = new JProgressBar(); mPrintingProgressBar.setStringPainted(true); @@ -112,7 +106,6 @@ mPrintingProgressJDialog.setLayout(new BorderLayout()); mPrintingProgressJDialog.add(tJPanel, BorderLayout.CENTER); mPrintingProgressJDialog.pack(); - mPosPrintBufferedImage.setPrintingProgressBar(mPrintingProgressBar); } /** @@ -319,14 +312,9 @@ // Call the print of the all/selected/remaining/changed pages "N" times depending on Additional Copies field for (int tNumCopies = 1; tNumCopies <= mNumberOfCopies; tNumCopies++) { - // Call "Use Windows Print" or "Print PCL Direct" - if (mPosPrintSetupDialogChoices.isPrintFormatWindowsPrint()) { - mPrintedOkReturn = imagePrint(mPagesToPrintArrayList, mPosPrintSetupDialogChoices, - mPrintingProgressBar, mPrintRequestAttributeSet); - } else { - mPrintedOkReturn = printPclDirect(mPagesToPrintArrayList, mPosPrintSetupDialogChoices, - mPrintingProgressBar, mPrintRequestAttributeSet); - } + // Call to "Print PCL Direct" or to "Windows/Image/GDI Print" + mPrintedOkReturn = printPclDirectOrWindowsPrint(mPagesToPrintArrayList, mPosPrintSetupDialogChoices, + mPrintingProgressBar); } // end "for (int tNumCopies = 1; tNumCopies <= mNumberOfCopies; tNumCopies++)" @@ -337,9 +325,11 @@ public void finished() { mPosView.getOpenPCLViewer().setIsDrawingForPrinting(false); mPosView.getOpenPCLViewer().renderImageCurrentPageAndZoom(); + int tTotalPagesPrinted = mPrintingProgressBar.getMaximum(); + JOptionPane.showMessageDialog(mPrintingProgressJDialog, mPosView.getOpenPCLViewer().getAppName() + "\nFinished printing " + - mPagesToPrintArrayList.size() + " page" + (mPagesToPrintArrayList.size() > 1 ? "s." : "."), + tTotalPagesPrinted + " page" + (tTotalPagesPrinted > 1 ? "s." : "."), "Finished Printing", JOptionPane.INFORMATION_MESSAGE); mPrintingProgressJDialog.setVisible(false); } @@ -362,7 +352,7 @@ } // If there were any Letter size pages that got moved to the "move to bottom" ArrayList - if (tMoveToBottomArrayList.size() > 1) { + if (tMoveToBottomArrayList.size() > 0) { for (PosTreeNode removeThisPosTreeNode : tMoveToBottomArrayList) { // Remove the Letter pages from the passed in ArrayList pPagesToPrintArrayList.remove(removeThisPosTreeNode); @@ -385,7 +375,7 @@ } // If there were any Legal size pages that got moved to the "move to bottom" ArrayList - if (tMoveToBottomArrayList.size() > 1) { + if (tMoveToBottomArrayList.size() > 0) { for (PosTreeNode removeThisPosTreeNode : tMoveToBottomArrayList) { // Remove the Legal pages from the passed in ArrayList pPagesToPrintArrayList.remove(removeThisPosTreeNode); @@ -513,26 +503,20 @@ * @param pPagesToPrintArrayList * @param pPosPrintSetupDialogChoices * @param pPrintingProgressBar - * @param pPrintRequestAttributeSet * @return boolean */ - private boolean printPclDirect(ArrayList<PosTreeNode> pPagesToPrintArrayList, - PosPrintSetupDialogChoices pPosPrintSetupDialogChoices, JProgressBar pPrintingProgressBar, - PrintRequestAttributeSet pPrintRequestAttributeSet) { + private boolean printPclDirectOrWindowsPrint(ArrayList<PosTreeNode> pPagesToPrintArrayList, + PosPrintSetupDialogChoices pPosPrintSetupDialogChoices, JProgressBar pPrintingProgressBar) { - DocFlavor tDocFlavor = DocFlavor.INPUT_STREAM.AUTOSENSE; - SimpleDoc tSimpleDoc = null; - DocPrintJob tDocPrintJob = null; PosTreeNode tPrintThisTreeNode = null; - ByteArrayInputStream tByteArrayInputStream = null; ByteArrayOutputStream tByteArrayOutputStream =null; int tPageNumber = 0; - String tProgressBarBaseString = "Generating page: "; byte[] tPclBytes = null; - byte[] tLetterlSizePaperBytes = new byte[] {sbESC, '&', 'l', '2', 'A'}; - byte[] tLegalSizePaperBytes = new byte[] {sbESC, '&', 'l', '3', 'A'}; - byte[] tTopMargin3LinesBytes = new byte[] {sbESC, '&', 'l', '3', 'E'}; - + final byte[] tLetterSizePaperBytes = new byte[] {sbESC, '&', 'l', '2', 'A'}; + final byte[] tLegalSizePaperBytes = new byte[] {sbESC, '&', 'l', '3', 'A'}; + final byte[] tTopMargin3LinesBytes = new byte[] {sbESC, '&', 'l', '3', 'E'}; + mNumberBlankBackPages = 0; + // return if there's no current pages to print if (pPagesToPrintArrayList == null || pPagesToPrintArrayList.size() < 1) { return false; } @@ -596,25 +580,27 @@ try { if (pPosPrintSetupDialogChoices.isPaperSizePrintAllOnLegal()) { // The user has a check in the Print Setup dialog box for "Print all on Legal paper" - // so FORCE ALL PAGES TO LEGAL SIZE no matter if LTR in the Blockument DSP values + // so FORCE ALL PAGES TO LEGAL SIZE no matter if LTR is in the Blockument DSP values // or if this is a PCL file with a letter size PCL command if ( (mPreviousPagePaperSize == null) || (mPreviousPagePaperSize.equalsIgnoreCase("LTR")) ) { // Only if the previous page was null or Letter, write the Legal size page bytes tByteArrayOutputStream.write(tLegalSizePaperBytes); mCurrentPagePaperSize = "LGL"; } else { - // If the page size didn't change, don't write the page size, but the top margin needs to be set after a form feed + // The top margin needs to be set after the paper size change tByteArrayOutputStream.write(tTopMargin3LinesBytes); } - + } else { + // Here for both "Print all on Letter" and for "Print as in original PCL". Keep original paper size works for both. + // The PCLPrintJob print() needs to see the original page size. If Letter, keep letter. If Legal then scale down to Letter. if (mCurrentPagePaperSize.equalsIgnoreCase("LTR")) { // Letter size if ( (mPreviousPagePaperSize == null) || (mPreviousPagePaperSize.equalsIgnoreCase("LGL")) ) { // Only if the previous page was null or Legal, write the Letter size page bytes - tByteArrayOutputStream.write(tLetterlSizePaperBytes); + tByteArrayOutputStream.write(tLetterSizePaperBytes); } else { - // If the page size didn't change, don't write the page size, but the top margin needs to be set after a form feed + // The top margin needs to be set after the paper size change tByteArrayOutputStream.write(tTopMargin3LinesBytes); } } else { @@ -624,30 +610,33 @@ tByteArrayOutputStream.write(tLegalSizePaperBytes); mCurrentPagePaperSize = "LGL"; } else { - // If the page size didn't change, don't write the page size, but the top margin needs to be set after a form feed + // The top margin needs to be set after the paper size change tByteArrayOutputStream.write(tTopMargin3LinesBytes); } } } } catch (IOException e) { + PriDebug.releaseln("Error. Couldn't write page size PCL bytes to ByteArrayOutputStream.\n" + e); return false; } - + // If there were any PCL bytes to include only at print time (not to be viewed on the screen) then write the bytes here byte[] tPrintTimePclBytes = tPrintThisTreeNode.getPrintTimePclBytes(); if (tPrintTimePclBytes != null) { try { tByteArrayOutputStream.write(tPrintTimePclBytes); } catch (IOException e3) { - PriDebug.releaseln("Error. Couldn't write print time only PCL bytes to printer.\n" + e3); + PriDebug.releaseln("Error. Couldn't write print time only PCL bytes to ByteArrayOutputStream.\n" + e3); + return false; } } try { // Write the current page bytes tByteArrayOutputStream.write(tModifiedPclBytes); - } catch (IOException e) { - PriDebug.releaseln("Error. Couldn't write base page PCL bytes to printer.\n" + e); + } catch (IOException e4) { + PriDebug.releaseln("Error. Couldn't write the page PCL bytes to ByteArrayOutputStream.\n" + e4); + return false; } // Write form feed at the end of each page @@ -655,36 +644,66 @@ // Save the current page size to the previous page size to compare the next page with this page mPreviousPagePaperSize = mCurrentPagePaperSize; - - // Update the progress bar at each page - if (mPrintingProgressBar != null) { - mPrintingProgressBar.setValue(tPageNumber + 1); - mPrintingProgressBar.setString(tProgressBarBaseString + (tPageNumber + 1) + " of " + pPagesToPrintArrayList.size()); - } } // end for (tPageNumber = 0; tPageNumber < pPagesToPrintArrayList.size(); tPageNumber++) // Send a printer reset ESC E at the end of all the pages tByteArrayOutputStream.write(sbESC); tByteArrayOutputStream.write('E'); - // The input stream for the DocPrintJob - if (tByteArrayOutputStream == null || tByteArrayOutputStream.size() < 1) { return false; } - tByteArrayInputStream = new ByteArrayInputStream(tByteArrayOutputStream.toByteArray()); - tSimpleDoc = new SimpleDoc(tByteArrayInputStream, tDocFlavor, mDocAttributeSet); - if (tSimpleDoc == null) { return false; } - - if (mPrintService == null) { return false; } + // Set the PrintModeEnum + PCLPrintJob.PrintModeEnum tPrintModeEnum; + if (mPosPrintSetupDialogChoices.isPrintFormatWindowsPrint()) { + tPrintModeEnum = PCLPrintJob.PrintModeEnum.PrintModeGDI; + } else { + tPrintModeEnum = PCLPrintJob.PrintModeEnum.PrintModePCLDirect; + } + + // Set the OutputPageSizeEnum + PCLPrintJob.OutputPageSizeEnum tOutputPageSizeEnum; + if (mPosPrintSetupDialogChoices.isPaperSizePrintAllOnLegal()) { + tOutputPageSizeEnum = PCLPrintJob.OutputPageSizeEnum.OutputPageSizeAllOnLegal; + } else if (mPosPrintSetupDialogChoices.isPaperSizePrintAllOnLetterShrinksLegal()) { + tOutputPageSizeEnum = PCLPrintJob.OutputPageSizeEnum.OutputPageSizeAllOnLetter; + } else { + tOutputPageSizeEnum = PCLPrintJob.OutputPageSizeEnum.OutputPageSizeAsSpecifiedInPCL; + } - tDocPrintJob = mPrintService.createPrintJob(); - if (tDocPrintJob == null) { return false; } - + // Ajust the total number of pages in the Progress bar by the number of blank back pages when duplexing + int tLogicalPageCount = pPrintingProgressBar.getMaximum(); + int tPhysicalPageCount = tLogicalPageCount + mNumberBlankBackPages; + if (mNumberBlankBackPages > 0) { + pPrintingProgressBar.setMaximum(tPhysicalPageCount); + } + + // Set the print job name + String tPrintJobName = mPosView.getOpenPCLViewer().getAppName() + // Could be name of a subclass plugin app + " " + mPosView.getShortName() + ", " + tPhysicalPageCount + " page" + (tPhysicalPageCount == 1 ? "." : "s."); + + // Set the user selected printer from the custom print options dialog on the mPrintService which is + // passed in the below PCLPrintJob.initializePrintJob() try { - tDocPrintJob.print(tSimpleDoc, pPrintRequestAttributeSet); - } catch (PrintException e) { - PriDebug.error("In PosPrintPages, PrintException trying to print PCL Direct.", e); + mPrinterJob.setPrintService(mPrintService); + } catch (PrinterException ePrintService) { + PriDebug.releaseln("PrinterException PosPrintPages calling mPrinterJob.setPrintService()"); return false; } + // Initialize the PCLPrintJob + mPCLPrintJob.initializePrintJob(tPrintModeEnum, tOutputPageSizeEnum, tPrintJobName, + tByteArrayOutputStream.toByteArray(), mPrinterJob); + + // Set the JProgressBar in the PCLPrintJob + mPCLPrintJob.setPrintingProgressBar(pPrintingProgressBar); + + // Kick off the actual printing on paper + try { + mPrinterJob.print(mPCLPrintJob.getPrintRequestAttributeSet()); + } catch (PrinterException ex) { + // The job did not successfully complete + PriDebug.releaseln("PrinterException in PosPrintPages calling mPrinterJob.print()"); + return false; + } + // The pages printed out return true; } @@ -701,6 +720,7 @@ // Write an extra form feed here, and say the next page is going to print on the back pByteArrayOutputStream.write(sbFF); + mNumberBlankBackPages++; mDuplexModePaperSide = DUPLEX_MODE_NEXTPAGE_ONBACK; } else { @@ -713,59 +733,4 @@ } } - - /** - * Image print (instead of PCL Direct) - * @author Howard 6/1/06. Implemented mult page printing on 8/24/06 - * @param pPagesToPrintArrayList - * @param pPosPrintSetupDialogChoices - * @param pPrintingProgressBar - * @param pPrintRequestAttributeSet - * @return boolean - */ - private boolean imagePrint(ArrayList<PosTreeNode> pPagesToPrintArrayList, - PosPrintSetupDialogChoices pPosPrintSetupDialogChoices, JProgressBar pPrintingProgressBar, - PrintRequestAttributeSet pPrintRequestAttributeSet) { - // Set the pages to print so that when PrinterJob calls Printable.print(), it uses the PosTreeNode values - // that are the Objects in this ArrayList, to do Graphics draw commands from the PCL to render the image - mPosPrintBufferedImage.setPagesToPrint(pPagesToPrintArrayList); - - // Set the Print Setup choices object on the Printable Interface object - mPosPrintBufferedImage.setPosPrintSetupDialogChoices(pPosPrintSetupDialogChoices); - - // The below PosPrintBufferedImage implements the java.awt.print.Printable interface - // which has the interface required method: int print(Graphics g, PageFormat format, int pageNumber) - mPosPrintPageableInterface.setPrintable(mPosPrintBufferedImage); - - // Also pass the print ArrayList to the Pageable interface object for it to return the number of pages - // and more importantly to return the PageFormat for each page that has Letter or Legal for each page - mPosPrintPageableInterface.setPagesToPrint(pPagesToPrintArrayList); - - // Set the Print Setup choices object on the Pageable Interface object - mPosPrintPageableInterface.setPosPrintSetupDialogChoices(pPosPrintSetupDialogChoices); - - // Set the Pageable Interface object on the PrinterJob. - // Note that this Pageable Interface object has the Printable Interface object set in it from above - mPrinterJob.setPageable(mPosPrintPageableInterface); - - try { - // Set the user selected printer on the PrinterJob - mPrinterJob.setPrintService(mPrintService); - } catch (PrinterException e) { - PriDebug.releaseln("PrinterException in PosPrintPages image print, mPrinterJob.setPrintService()"); - return false; - } - - try { - // Print all the pages - mPrinterJob.print(pPrintRequestAttributeSet); - } catch (PrinterException e) { - PriDebug.releaseln("PrinterException in PosPrintPages image print, mPrinterJob.print()"); - return false; - } - - // The page printed out - return true; - } - -} +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-25 23:57:34
|
Revision: 177 http://openpcl.svn.sourceforge.net/openpcl/?rev=177&view=rev Author: documentsystems Date: 2007-09-25 16:57:34 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. New class made by Jim Gabriel 9/18/07, then modified by Howard Hoagland 9/18 to 9/25. The purpose of this class is to handle the printing of a PCL bytestream to the printer, whether it uses PCLDirect or GDI. PCLDirect is the fastest but requires the printer selected to handle PCL 5 or higher. GDI is compatible with all printers but is slower since each page must be rendered before being sent to the printer. 9/18/07 to 9/25/07 Howard Hoagland. Changed significantly to make it work with OpenPCLViewer and PosPrintPages so that printing PCL Direct and Windows Print uses this class only and doesn't use PosPrintBufferedImage and PosPrintPageableInterface, because this class implements the methods of both those Interfaces and in fact the code from those two classes was cut and pasted into this class to make it do the job of those two. The main benefit of this class is to implement printing duplex for Windows Print. Added Paths: ----------- openpcl/src/com/openpcl/viewer/printing/PCLPrintJob.java Added: openpcl/src/com/openpcl/viewer/printing/PCLPrintJob.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PCLPrintJob.java (rev 0) +++ openpcl/src/com/openpcl/viewer/printing/PCLPrintJob.java 2007-09-25 23:57:34 UTC (rev 177) @@ -0,0 +1,553 @@ +package com.openpcl.viewer.printing; + +import java.awt.Color; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.geom.AffineTransform; +import java.awt.image.BufferedImage; +import java.awt.image.ImageObserver; +import java.awt.print.PageFormat; +import java.awt.print.Pageable; +import java.awt.print.Paper; +import java.awt.print.Printable; +import java.awt.print.PrinterException; +import java.awt.print.PrinterJob; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Locale; + +import javax.print.PrintException; +import javax.print.SimpleDoc; +import javax.print.DocFlavor; +import javax.print.DocPrintJob; +import javax.print.PrintService; + +import javax.print.attribute.HashPrintRequestAttributeSet; +import javax.print.attribute.PrintRequestAttributeSet; +import javax.print.attribute.standard.Chromaticity; +import javax.print.attribute.standard.JobKOctets; +import javax.print.attribute.standard.JobName; +import javax.print.attribute.standard.MediaPrintableArea; +import javax.print.attribute.standard.MediaSizeName; +import javax.print.attribute.standard.OrientationRequested; +import javax.print.attribute.standard.PrintQuality; +import javax.print.attribute.standard.Sides; +import javax.swing.JOptionPane; +import javax.swing.JProgressBar; + +import com.openpcl.pclrenderimage.render.PriPageSettings; +import com.openpcl.pclrenderimage.util.PriDebug; +import com.openpcl.pclrenderimage.PclRenderImage; + +/** +* The purpose of this class is to handle the printing of a PCL bytestream to the printer, whether it uses +* PCLDirect or GDI. PCLDirect is the fastest but requires the printer selected to handle PCL 5 or higher. +* GDI is compatible with all printers but is slower since each page must be rendered before being sent to the printer. +* +* @author DocMagic, Document Systems Inc, Jim Gabriel. Sept 18, 2007 +* +* 9/18/07 to 9/25/07 Howard Hoagland. Changed significantly to make it work with OpenPCLViewer and PosPrintPages +* so that printing PCL Direct and Windows Print uses this class only and doesn't use PosPrintBufferedImage +* and PosPrintPageableInterface, because this class implements the methods of both those Interfaces and in fact +* the code from those two classes was cut and pasted into this class to make it do the job of those two. The main benefit +* of this class is to implement printing duplex for Windows Print. +* +* Helpful reference URLs used to create and design this class<br> +* http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-print.html<br> +* http://java.sun.com/products/java-media/2D/forDevelopers/sdk12print.html<br> +* http://www.java2s.com/Code/Java/2D-Graphics-GUI/PageableText.htm<br> +*/ +public class PCLPrintJob implements Pageable, Printable, ImageObserver { + + enum PrintModeEnum { PrintModePCLDirect, PrintModeGDI }; + enum OutputPageSizeEnum { OutputPageSizeAsSpecifiedInPCL, OutputPageSizeAllOnLetter, OutputPageSizeAllOnLegal }; + + protected ByteArrayOutputStream mByteArrayOutputStream; + private PrinterJob mPrinterJob; + private BufferedImage mImageToPrintOn = null; + private AffineTransform mOrigAffineTransform = null; + private AffineTransform mScaleAffineTransform = null; + protected PrintService mPrintService = null; + protected PclRenderImage mPrintDocGDI = null; // only needed for GDI printing + private Paper mLetterPaperPortrait = null; + private Paper mLegalPaperPortrait = null; + protected int mPagesPrinted = 0; + protected String mCurrentPageSize = ""; + protected boolean mPrintAllOnLegal = false; + protected String mPrintJobName = ""; + protected PrintRequestAttributeSet mAttr = null; + protected String mLastFormName = ""; + protected int mLastPageNumber = 0; + protected boolean mIsDuplex = false; + private double mPrintScale = 72.0d / 300.0d; + private JProgressBar mPrintingProgressBar = null; + private static final String sProgressBarBaseString = "Generating page: "; + private static final String sCantAllocate = "Can't allocate memory for temporary image used for printing."; + + // Enums are PrintModePCLDirect, PrintModeGDI + public PrintModeEnum mPrintModeEnum; + + // Enums are OutputPageSizeAsSpecifiedInPCL, OutputPageSizeAllOnLetter, OutputPageSizeAllOnLegal + public OutputPageSizeEnum mOutputPageSizeEnum; + + // required for shrinking legal to letter when GDI printing + private AffineTransform mShrinkLegalToLetter = null; + private double mPageWidthPixels = 8.5 * 300; + private double mShrinkLegalToLetterRatio = (11.0d / 14.0d); // shrink in both directions height 14" to 11" + private double mShrinkLegalToLetterScale = mPrintScale * mShrinkLegalToLetterRatio; + private double mShrinkLegalToLetterMargins = 0.27d * 300.0d; + private double mXOffsetForCenteringShrinkLegalOnLetter = + ((mPageWidthPixels - (mPageWidthPixels * mShrinkLegalToLetterRatio)) / 2) + mShrinkLegalToLetterMargins; + + /** Constructor */ + public PCLPrintJob() { + mPrintDocGDI = new PclRenderImage(); + + // Letter size portrait with .2 inch margins + mLetterPaperPortrait = new Paper(); + mLetterPaperPortrait.setSize(8.5d * 72, 11.0d * 72); + mLetterPaperPortrait.setImageableArea(.18d * 72, .18d * 72, 8.14d * 72, 10.64d * 72); + + // Legal size portraint with .2 inch margins + mLegalPaperPortrait = new Paper(); + mLegalPaperPortrait.setSize(8.5d * 72, 14.0d * 72); + mLegalPaperPortrait.setImageableArea(.18d * 72, .18d * 72, 8.14d * 72, 13.64d * 72); + + mScaleAffineTransform = AffineTransform.getScaleInstance(mPrintScale, mPrintScale); + mShrinkLegalToLetter = AffineTransform.getScaleInstance(mShrinkLegalToLetterScale, mShrinkLegalToLetterScale); + + mImageToPrintOn = createNewBWBufferedImageToPrintOn(); + + //Set the default choices on the print dialog for portrait, Legal, one sided, 4 margins + mAttr = new HashPrintRequestAttributeSet(); + mAttr.add(OrientationRequested.PORTRAIT); + + // Don't set to "DRAFT" or else the print driver picks the lowest resolution the printer can do. + mAttr.add(PrintQuality.HIGH); + + mAttr.add(MediaSizeName.NA_LEGAL); + mAttr.add(new MediaPrintableArea(0.20f, 0.20f, 8.1f, 13.6f, MediaPrintableArea.INCH)); + mAttr.add(Chromaticity.MONOCHROME); + + mAttr.add(new JobKOctets((int)(256))); // Total job K bytes. Default but is changed at print time with the exact number + mAttr.add(Sides.ONE_SIDED); // Default but is changed in the Printable.print() callback and when setDuplex() is called + mAttr.add(new JobName("PCL print", Locale.getDefault())); // Default but is changed when setPrintJobName(String) is called + } + + public PrintRequestAttributeSet getPrintRequestAttributeSet() { return mAttr; } + + /** + * Pass in parameters needed to initialize the printing for the next printout. + * @param pPrintMode + * @param pOutputPageSize + * @param pPrintJobName + * @param pPCLData + * @param pPrinterJob + * @param pIsDuplex + */ + public void initializePrintJob(PrintModeEnum pPrintModeEnum, OutputPageSizeEnum pOutputPageSizeEnum, + String pPrintJobName, byte[] pPCLData, PrinterJob pPrinterJob) { + mByteArrayOutputStream = new ByteArrayOutputStream(); + mPrinterJob = pPrinterJob; + + // Get the PrintService out of the passed in PrinterJob + mPrintService = mPrinterJob.getPrintService(); + + setPCLDataToPrint(pPCLData); + setPrintMode(pPrintModeEnum, pOutputPageSizeEnum); + setPrintJobName(pPrintJobName); + } + + private void setPCLDataToPrint(byte[] pPCLData) { + try { + mByteArrayOutputStream.write(pPCLData); + } catch (IOException e) { + System.out.println("Error. Can't set the bytes to print in Class PCLPrintJob, method is setPCLDataToPrint(byte[]). "); + } + } + + private void setPrintMode (PrintModeEnum pPrintModeEnum, OutputPageSizeEnum pOutputPageSizeEnum ) { + mPrintModeEnum=pPrintModeEnum; + mOutputPageSizeEnum = pOutputPageSizeEnum; + + switch (mPrintModeEnum) { + case PrintModeGDI : { + + // Take the stream and break it up into pages + mPrintDocGDI.splitIntoSeparatePclPages(mByteArrayOutputStream.toByteArray()); + System.out.println("setPrintMode() GDI printing " + mPrintDocGDI.getPclPageCount() + " pages total"); + + // Set duplex mode here from if the multi page PCL bytes parsed in the above splitIntoSeparatePclPages() had "duplex on" + setIsDuplex(mPrintDocGDI.getPriPageSettings().getIsDuplexMode()); + + // DO NOT CALL setPrintable since this will be set in the getPrintable method + mPrinterJob.setPageable(this); + break; + } + case PrintModePCLDirect : { + // Important: "All on Letter" works for GDI Windows Print, and not for PCL Direct because it's possible to shrink the image + // to fit a Legal image on Letter paper, but to do this for PCL Direct, all the PCL (x,y) positioning and drawing sizes would + // need to be modified, which would make the resulting image printed on paper not exact + System.out.println("setPrintMode() Pcl Direct printing " + mByteArrayOutputStream.size() + " bytes"); + mPrinterJob.setPrintable(this); + break; + } + default : mPrinterJob.setPrintable(this); + } + } + + /** Pass in the printjob name how it is displayed in the job queue. */ + private void setPrintJobName(String pPrintJobName) { + mPrintJobName=pPrintJobName; + mAttr.add(new JobName(mPrintJobName, Locale.getDefault())); + } + + /** If the PCL doesn't have the duplex codes in it, you can still print DUPLEX GDI. + * This has no affect when doing PCL Direct (sending the PCL directly to the printer). */ + private void setIsDuplex(boolean pIsDuplex) { + mIsDuplex = pIsDuplex; + if (mIsDuplex) { + mAttr.add(Sides.TWO_SIDED_LONG_EDGE); + } else { + mAttr.add(Sides.ONE_SIDED); + } + } + + /** + *This is the main CALLBACK method for the java.awt.print.Prinable interface + * Note that the page number passed in is 0 based. + */ + public int print(Graphics pGraphics, PageFormat pPageFormat, int pPageNumber) throws PrinterException { + Graphics2D tGraphics2DToPrintOn = null; + BufferedImage tBufferedColorImage = null; + SimpleDoc tSimpleDoc = null; + DocFlavor tDocFlavor = DocFlavor.INPUT_STREAM.AUTOSENSE; + ByteArrayInputStream tByteArrayInputStream = null; + DocPrintJob tDocPrintJob = null; + boolean tShouldSetRenderingHints = false; + + switch (mPrintModeEnum) { + case PrintModePCLDirect : { + System.out.println("PCL Direct"); + + // The input stream for the DocPrintJob + if (mByteArrayOutputStream == null || mByteArrayOutputStream.size() < 1) { return Printable.NO_SUCH_PAGE; } + + tByteArrayInputStream = new ByteArrayInputStream(mByteArrayOutputStream.toByteArray()); + tSimpleDoc = new SimpleDoc(tByteArrayInputStream, tDocFlavor, null); + + if (tSimpleDoc == null) { return Printable.NO_SUCH_PAGE; } + if (mPrintService == null) { return Printable.NO_SUCH_PAGE; } + + tDocPrintJob = mPrintService.createPrintJob(); + if (tDocPrintJob == null) { return Printable.NO_SUCH_PAGE; } + + try { + tDocPrintJob.print(tSimpleDoc, mAttr); + } catch (PrintException e) { + PriDebug.error("In class PCLPrintJob, PrintException trying to print PCL Direct.", e); + return Printable.NO_SUCH_PAGE; + } + + // Update the progress bar once because the byte[] was sent to the printer no matter how many pages + if (mPrintingProgressBar != null) { + mPrintingProgressBar.setValue(mPrintingProgressBar.getMaximum()); + mPrintingProgressBar.setString(sProgressBarBaseString + (mPrintingProgressBar.getMaximum()) + + " of " + mPrintingProgressBar.getMaximum()); + } + + // All the pages printed out because all the pages were sent to the printer all at one time above. + // Returning NO_SUCH_PAGE makes the JDK printing not call this callback method later, so this terminates the printing. + return Printable.NO_SUCH_PAGE; + } + + case PrintModeGDI : { + System.out.println("GDI printing pg " + (pPageNumber + 1) + " of " + mPrintDocGDI.getPclPageCount()); + + if ((pPageNumber < 0) || (pPageNumber >= mPrintDocGDI.getPclPageCount())) { + return Printable.NO_SUCH_PAGE; + } + + // Cast passed in Graphics to Graphics2D + Graphics2D g2D = (Graphics2D)pGraphics; + // Set rendering hints + if (tShouldSetRenderingHints) { setRenderingHints(g2D); } + // Set background color white + g2D.setBackground(Color.WHITE); + // Make drawing text and rectangles and pixels be in black + g2D.setPaint(Color.BLACK); + // Save the passed in AffineTransform (to put it back before returning) + mOrigAffineTransform = g2D.getTransform(); + + String tPageSizeInPCL = mPrintDocGDI.getPaperSizeForPage(pPageNumber + 1); + String tPageSize = tPageSizeInPCL; + + switch(mOutputPageSizeEnum) { + + case OutputPageSizeAllOnLetter : { + tPageSize = "LTR"; + if (tPageSizeInPCL == "LGL") { + // Original size was Legal, but need to shrink down to Letter size. + // The method getPageFormat() in this class PCLPrintJob returns Letter when "All on Letter" and original size was Legal. + g2D.transform(mShrinkLegalToLetter); + // Center the Legal image on the Letter page size buy bumping to + // the right half the available horizontal space + g2D.translate(mXOffsetForCenteringShrinkLegalOnLetter, 0.0d); + } else { + // Set the 72/300 = .24 AffineTransform on the current Graphics2D, to scale smaller to fit exactly on the printed page + g2D.transform(mScaleAffineTransform); + } + break; + } + + case OutputPageSizeAllOnLegal : { + tPageSize = "LGL"; + g2D.transform(mScaleAffineTransform); + break; + } + + case OutputPageSizeAsSpecifiedInPCL : + // Set the 72/300 = .24 AffineTransform on the current Graphics2D, to scale smaller to fit exactly on the printed page + g2D.transform(mScaleAffineTransform); + } + + if (mImageToPrintOn != null) { tGraphics2DToPrintOn = mImageToPrintOn.createGraphics(); } + + // Draw the screen image on the printer Graphics2D using the scale down transform + byte[] tPrintTimeBytes = new byte[1]; + tBufferedColorImage = mPrintDocGDI.getImageForPage(pPageNumber + 1, tPrintTimeBytes, true, tPageSize, 1.00d); + + if (tBufferedColorImage == null) { + // The image for this page is blank page because two form feeds are together when duplexing to force a blank back page. + tGraphics2DToPrintOn.setPaint(Color.WHITE); + // Draw a white rectangle 8.5 inches by 14 inches which blanks out the image + tGraphics2DToPrintOn.fillRect(0, 0, PriPageSettings.sNumPixels85Inches, PriPageSettings.sNumPixels14Inches); + + } else { + // Convert to 2 color black and white, so that the file in the print queue is smaller and prints faster + tGraphics2DToPrintOn.drawImage(tBufferedColorImage, 0, 0, this); + } + + // Draw the image on the printer Graphics2D using the scale down transform + g2D.drawImage(mImageToPrintOn, 0, 0, this); + + // Revert back to the passed in AffineTransform because the JDK doc for printing says put back the + // passed in Graphics object's settings back if you modified it in this Printable interface print() callback + g2D.transform(mOrigAffineTransform); + + // Update the progress bar at each page + if (mPrintingProgressBar != null) { + mPrintingProgressBar.setValue(pPageNumber + 1); + mPrintingProgressBar.setString(sProgressBarBaseString + (pPageNumber + 1) + " of " + mPrintingProgressBar.getMaximum()); + } + + return Printable.PAGE_EXISTS; + } + default : + return Printable.NO_SUCH_PAGE; + } + } + + /** + * Create a new BufferredImage all ready to print on + * @return BufferedImage + */ + private BufferedImage createNewBWBufferedImageToPrintOn() { + BufferedImage tToPrintOnBufferedImage = null; + try { + tToPrintOnBufferedImage = new BufferedImage ( + PriPageSettings.sNumPixels85Inches, // make the BufferedImage be 8.5 inches by 14 inches + PriPageSettings.sNumPixels14Inches, + BufferedImage.TYPE_BYTE_BINARY); // 2 color only image is black and white (not full color) for printing not on screen + } catch (OutOfMemoryError e1) { + tToPrintOnBufferedImage = null; + JOptionPane.showMessageDialog(null, "Out of heap space memory. " + sCantAllocate , "Heap space memory", + JOptionPane.ERROR_MESSAGE); + + } catch (Error e2) { + tToPrintOnBufferedImage = null; + JOptionPane.showMessageDialog(null, "Error. " + sCantAllocate , "Error", + JOptionPane.ERROR_MESSAGE); + + } catch (Exception e3) { + tToPrintOnBufferedImage = null; + JOptionPane.showMessageDialog(null, "Exception. " + sCantAllocate , "Exception", + JOptionPane.ERROR_MESSAGE); + } + return tToPrintOnBufferedImage; + } + + public boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h) { + if ( (infoflags & ALLBITS) != 0 ) { + // The image drawing has completed + return false; + } else { + // The image is still drawing + return true; + } + } + + public int getNumberOfPages() { + // System.out.println("getNumberOfPages called"); + switch (mPrintModeEnum) { + case PrintModeGDI : {return mPrintDocGDI.getPclPageCount(); } + default : { return 10000; } + } + } + + public Printable getPrintable(int pForPageNumber) throws IndexOutOfBoundsException { + if (pForPageNumber >= mPrintDocGDI.getPclPageCount()) { + throw new IndexOutOfBoundsException( + makeIndexOutOfBoundsInfoString(pForPageNumber, mPrintDocGDI.getPclPageCount())); + } else { + return this; + } + } + + public PageFormat getPageFormat(int pPageNumber) throws IndexOutOfBoundsException { + PageFormat tBuiltPageFormat = new PageFormat(); + switch (mPrintModeEnum) { + + case PrintModeGDI : { + if (pPageNumber >= mPrintDocGDI.getPclPageCount()) { + throw new IndexOutOfBoundsException( + makeIndexOutOfBoundsInfoString(pPageNumber, mPrintDocGDI.getPclPageCount())); + + } else { + // If original page size was Letter, or if "Print all on Letter" even for pages that are Legal size, return Letter size + if ((mPrintDocGDI.getPaperSizeForPage(pPageNumber + 1) == "LTR") || + (mOutputPageSizeEnum == OutputPageSizeEnum.OutputPageSizeAllOnLetter)) { + tBuiltPageFormat.setPaper(mLetterPaperPortrait); + + } else { + tBuiltPageFormat.setPaper(mLegalPaperPortrait); + } + } + System.out.println("getPageFormat called for page " + pPageNumber + + " size = " + mPrintDocGDI.getPaperSizeForPage(pPageNumber + 1) ); + break; + } + + default : + tBuiltPageFormat.setPaper(mLegalPaperPortrait); + } + return tBuiltPageFormat; + } + + private String makeIndexOutOfBoundsInfoString(int pForPageNumber, int pNumberOfPages) { + return ("Not allowed to print page #" + (pForPageNumber + 1) + " because only " + + pNumberOfPages + (pNumberOfPages == 1 ? "page was" : "pages were)" ) + + " selected to print."); + } + + private void setRenderingHints(Graphics2D pG2D) { + // Turn on antialiasing + pG2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); + pG2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + // Pick text quality instead of speed + pG2D.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY); + // Turn dithering on. Dithering approximates color values by drawing groups of pixels of similar colors + pG2D.setRenderingHint(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_ENABLE); + // Alpha composites for Quality + pG2D.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY); + // Turn the computation of fractional character dimensions on. + // Fractional character dimensions lead to better placement of characters + pG2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); + // Select quality or speed for color rendering. + pG2D.setRenderingHint(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY); + // Interpolating pixels when scaling or rotating images. + pG2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC); + // Combining strokes + pG2D.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE); + } + + public void setPrintingProgressBar(JProgressBar pPrintingProgressBar) { + mPrintingProgressBar = pPrintingProgressBar; + } + + /** Used only for unit testing from the main() in this class. Returns the contents of the file in a byte array. */ + private static byte[] getBytesFromFile(File file) throws IOException { + InputStream tInputStream = new FileInputStream(file); + + // Note that the lengh of the file returned from java.io.File.lenght() is a long, not an int + long tFileLength = file.length(); + + // You cannot create an array using a long type. It needs to be an int type. + // Before converting to an int type, check to ensure that file is not larger than Integer.MAX_VALUE. + if (tFileLength > Integer.MAX_VALUE) { tFileLength = Integer.MAX_VALUE; } + + // Create the byte array to hold the data + byte[] tFileBytes = new byte[(int)tFileLength]; + + // Read in the bytes + int tOffset = 0; + int tNumBytesRead = 0; + while (tOffset < tFileBytes.length + && (tNumBytesRead = tInputStream.read(tFileBytes, tOffset, tFileBytes.length - tOffset)) >= 0) { + tOffset += tNumBytesRead; + } + + // Ensure all the bytes have been read in + if (tOffset < tFileBytes.length) { + throw new IOException("Could not completely read file "+file.getName()); + } + + // Close the input stream and return bytes + tInputStream.close(); + return tFileBytes; + } + + /** + * The main() here is for unit testing and to show how to use this class from the app using this class. + * @param args + */ + public static void main(String[] args) { + byte[] tFileByteArray = null; + + String tFileName = "c:/temp/ltrlegal.DBK"; + try { + // If you have a PCL diskfile, load it here + tFileByteArray = getBytesFromFile(new File(tFileName)); + } catch (IOException e) { + System.out.println("IOException reading bytes from file: " + tFileName ); + } + + // Be sure the program sets the number of pages from 1 to 1000 so that + // the print call back routine can control the number of loops. + PrinterJob tPrinterJob = PrinterJob.getPrinterJob(); + + // Call the constructor once for all print jobs. Don't do a "new PCLPrintJob()" for each printout. + PCLPrintJob tPCLPrintJob = new PCLPrintJob(); + + // Until we have the ability to retrieve the DUPLEX flag from PCLRender image, + // we'll just set it here. This is only has effect for GDI printing. + tPCLPrintJob.setIsDuplex(true); + + boolean tUserHitOK = tPrinterJob.printDialog(); + if (tUserHitOK) { + + // Call the initializePrintJob(...) for each printout + tPCLPrintJob.initializePrintJob(PrintModeEnum.PrintModeGDI, // Tell the object whether GDI or PCLDirect + // With GDI, you can set all the forms to print on LETTER, or on LEGAL or as defined in the PCL + OutputPageSizeEnum.OutputPageSizeAllOnLetter , + "Testing PCLPrintJob.java", // This is the job name as it will appear in the print queue + tFileByteArray, // The PCL bytes get sent here + tPrinterJob // This is the job + ); + + try { + tPrinterJob.print(tPCLPrintJob.getPrintRequestAttributeSet()); + } catch (PrinterException ex) { + // The job did not successfully complete + System.out.println("PrinterException calling PCLPrintJob"); + } + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-25 23:45:57
|
Revision: 176 http://openpcl.svn.sourceforge.net/openpcl/?rev=176&view=rev Author: documentsystems Date: 2007-09-25 16:46:00 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. 1. Instantiate the new PCLPrintJob class. 2. Moved all the PrintRequestAttributes to the PCLPrintJob class. 3. Set and Get for the PrintRequestAttributes in the PCLPrintJob class. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-25 23:41:08 UTC (rev 175) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-25 23:46:00 UTC (rev 176) @@ -21,21 +21,10 @@ import java.io.FileOutputStream; import java.io.IOException; import java.net.URL; -import java.util.Locale; import java.util.Vector; import java.util.prefs.Preferences; -import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; -import javax.print.attribute.Size2DSyntax; -import javax.print.attribute.standard.Chromaticity; -import javax.print.attribute.standard.JobKOctets; -import javax.print.attribute.standard.JobName; -import javax.print.attribute.standard.MediaPrintableArea; -import javax.print.attribute.standard.MediaSize; -import javax.print.attribute.standard.OrientationRequested; -import javax.print.attribute.standard.PrintQuality; -import javax.print.attribute.standard.Sides; import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JApplet; @@ -74,6 +63,7 @@ import com.openpcl.viewer.panels.PosView; import com.openpcl.viewer.panels.PosWindowControlList; import com.openpcl.viewer.panels.PosZoomSlider; +import com.openpcl.viewer.printing.PCLPrintJob; import com.openpcl.viewer.printing.PosPersistPrintOptionsValues; import com.openpcl.viewer.printing.PosPrintPages; import com.openpcl.viewer.printing.PosPrintSetupDialogChoices; @@ -189,7 +179,7 @@ private PosPersistPrintOptionsValues mPosPersistPrintOptionsValues = null; private PosStartupOptions mPosStartupOptions = null; private PosPrintSetupDialogChoices mPosPrintSetupDialogChoices = null; - private PrintRequestAttributeSet mPrintRequestAttributeSet = null; + private PCLPrintJob mPCLPrintJob = null; private int mViewframeX = 0; private int mViewframeY = 0; private int mViewframeWidth = 100; @@ -570,6 +560,8 @@ showStatusBar(); // Show the status bar now so the user doesn't have to wait longer while the rest of the items are built validate(); + // Instantiate the PCLPrintJob class + buildPrintingSupport(); // Build popup dialogs but don't show them at startup time. They get shown only when the user clicks later buildPopupDialogs(); @@ -648,6 +640,11 @@ return tPosMdiDesktopPane; } + // Instantiate the PCLPrintJob class + protected void buildPrintingSupport() { + mPCLPrintJob = new PCLPrintJob(); + } + // Build popup dialogs but don't show them at startup time. They get shown only when the user clicks later protected void buildPopupDialogs() { @@ -671,20 +668,6 @@ mHelpAboutDialog.pack(); } - // Set the default choices on the print dialog for portrait, Legal, one sided, print job name, 4 margins - mPrintRequestAttributeSet = new HashPrintRequestAttributeSet(); - mPrintRequestAttributeSet.add(OrientationRequested.PORTRAIT); - - // Don't set to "DRAFT" or else the print driver picks the lowest resolution the printer can do. - mPrintRequestAttributeSet.add(PrintQuality.HIGH); - - mPrintRequestAttributeSet.add(MediaSize.findMedia(8.5f, 14.0f, Size2DSyntax.INCH)); - mPrintRequestAttributeSet.add(Sides.ONE_SIDED); - mPrintRequestAttributeSet.add(Chromaticity.MONOCHROME); - mPrintRequestAttributeSet.add(new JobKOctets((int)(256))); // each page image bytes max - mPrintRequestAttributeSet.add(new JobName(getAppName() + " print", Locale.getDefault())); - mPrintRequestAttributeSet.add(new MediaPrintableArea(0.18f, 0.18f, 8.14f, 13.64f, MediaPrintableArea.INCH)); - // 8/22/07 HowardH. Commented out the below line. Don't set the DPI here, let the print driver set the DPI and // the printing framework will auto scale the image to the print driver's DPI setting. // If you set the DPI here, you're forcing it to that exact resolution which will result in @@ -695,7 +678,7 @@ // Print Setup Defaults dialog and Print dialog (same dialog for both defaults and per print) mPosPrintSetupDialogChoices = new PosPrintSetupDialogChoices(); mPosUserOptionsDialog = new PosUserOptionsDialog( - mPosPrintSetupDialogChoices, mPrintRequestAttributeSet, this, "Options Dialog", true); + mPosPrintSetupDialogChoices, this.getPrintRequestAttributeSet(), this, "Options Dialog", true); //----- Print choices list mPosPrintChoicesList = new PosPrintChoicesList(createPrintChoicesListSelectionListener()); @@ -927,7 +910,16 @@ public String getFilePathAndFileName() { return mFilePathAndFileName; } public PosStartupOptions getPosStartupOptions() { return mPosStartupOptions; } public PosPrintSetupDialogChoices getPosPrintSetupDialogChoices() { return mPosPrintSetupDialogChoices; } - public PrintRequestAttributeSet getPrintRequestAttributeSet() { return mPrintRequestAttributeSet; } + public PCLPrintJob getPCLPrintJob() { return mPCLPrintJob; } + + // Get the PrintRequestAttributeSet out of the PCLPrintJob object + public PrintRequestAttributeSet getPrintRequestAttributeSet() { + if (mPCLPrintJob != null) { + return mPCLPrintJob.getPrintRequestAttributeSet(); + } else { + return null; + } + } // One line setters public void setIsDrawingForPrinting(boolean pIsDrawingForPrinting) { mIsDrawingForPrinting = pIsDrawingForPrinting; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-25 23:41:13
|
Revision: 175 http://openpcl.svn.sourceforge.net/openpcl/?rev=175&view=rev Author: documentsystems Date: 2007-09-25 16:41:08 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. Added set and get IsDuplex, and 3 ints for the possible values. Previously, all duplex cmds were being stripped out and not put back in one time at the top of the PCL bytes. Now, it strips out all duplex PCL cmds, then if the use picks Duplex=Yes on the print options dialog, then put in one duplex On command at the top of the PCL bytes. Then when printing for duplex Windows Print, and duplex was in the PCL bytes, set the print request attribute for duplex, which causes duplex to happen. For PCL Direct, the duplex bytes in the PCL causes the printer to go into duplex mode. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java 2007-09-25 23:36:34 UTC (rev 174) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriPageSettings.java 2007-09-25 23:41:08 UTC (rev 175) @@ -33,6 +33,12 @@ // When a Page Size command is found in the Pcl, this is set to the found Page Size. protected int mCurrentPaperSize = sDefaultPaperSize; + // Duplex on/off + public static final int sDuplexOff = 0; + public static final int sDuplexOnLongEdge = 1; + public static final int sDuplexOnShortEdge = 2; + protected int mDuplexMode = sDuplexOff; + /** Constructor */ public PriPageSettings() { super(); @@ -45,6 +51,7 @@ mCurrentPaperSize = sDefaultPaperSize; setLineSpacing(6); setTopMarginAdjustment(3); + setDuplexMode(sDuplexOff); } /** When the user is done with this rendering session, then free up memory */ @@ -105,22 +112,46 @@ public void setPaperSize(int pPaperSize) { mCurrentPaperSize = pPaperSize; } + + /** Set the duplex mode.<br> + * @param pDuplexMode + * 0 is Duplex off (Simplex) + * 1 is Duplex on long edge of paper + * 2 is Duplex on short edge of paper + */ + public void setDuplexMode(int pDuplexMode) { + mDuplexMode = pDuplexMode; + } /** set PrintPattern * @param pPattern */ public void setPrintPattern(int pPattern) { mPrintPatternMode = pPattern; } - /** get LinesPerInch */ + /** get Lines Per Inch */ public float getLinesPerInch() { return mLinesPerInch; } - /** get NumPixelsPerLine */ + /** get Num Pixels Per Line */ public int getNumPixelsPerLine() { return (int)(sPrintDotsPerInch / mLinesPerInch); } - /** get TopMarginPixelOffset */ + /** get Top Margin Pixel Offset */ public int getTopMarginPixelOffset() { return mTopMarginPixelOffset; } - /** get LeftMarginPixelOffset */ + /** get Left Margin Pixel Offset */ public int getLeftMarginPixelOffset() { return mLeftMarginPixelOffset; } - /** get PrintPatternMode */ + /** get Print Pattern Mode */ public int getPrintPatternMode() { return mPrintPatternMode; } - /** get mCurrentPaperSize */ + /** get Current Paper Size */ public int getCurrentPaperSize() { return mCurrentPaperSize; } + /** get Duplex Mode number */ + public int getDuplexMode() { return mDuplexMode; } + + /** + * Returns true if the duplex command was in the PCL bytes. ESC & l # S + * @return boolean + */ + public boolean getIsDuplexMode() { + if (mDuplexMode == sDuplexOnLongEdge || mDuplexMode == sDuplexOnShortEdge) { + return true; + } else { + return false; + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-25 23:36:34
|
Revision: 174 http://openpcl.svn.sourceforge.net/openpcl/?rev=174&view=rev Author: documentsystems Date: 2007-09-25 16:36:34 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. Add call to mPriPageSettings.setDuplexMode() when the duplex PCL command &l#S is parsed. Previously, all duplex cmds were being stripped out and not put back in one time at the top of the PCL bytes. Now, it strips out all duplex PCL cmds, then if the use picks Duplex=Yes on the print options dialog, then put in one duplex On command at the top of the PCL bytes. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-25 23:31:13 UTC (rev 173) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-25 23:36:34 UTC (rev 174) @@ -414,7 +414,8 @@ } else if (cmdCharArray[3] == 'O') { //&l,O // TODO Page orientation Portrait or Landscape } else if (cmdCharArray[3] == 'S') { //&l,S - // TODO Simplex/Duplex + // Duplex mode. 0=off (simplex), 1=Duplex on Long Edge of page, 2=Duplex on Short Edge of page + mPriPageSettings.setDuplexMode(cmdValueInt); } else if (cmdCharArray[3] == 'X') { //&l,X // TODO Number of Copies } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-25 23:31:11
|
Revision: 173 http://openpcl.svn.sourceforge.net/openpcl/?rev=173&view=rev Author: documentsystems Date: 2007-09-25 16:31:13 -0700 (Tue, 25 Sep 2007) Log Message: ----------- Howard Hoagland. Don't gray out the Duplex=Yes radio button when Windows Print Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-09-14 18:58:01 UTC (rev 172) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintSetupDialog.java 2007-09-25 23:31:13 UTC (rev 173) @@ -277,7 +277,7 @@ mIsPclPrinterJCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { checkforGrayOutShrinkToLetter(); - checkforGrayOutDuplexYes(); + // checkforGrayOutDuplexYes(); } }); @@ -385,7 +385,7 @@ putPrintChoicesOnScreen(); setHoverHelpOnItems(); checkforGrayOutShrinkToLetter(); - checkforGrayOutDuplexYes(); + // checkforGrayOutDuplexYes(); // Make dialog box outer frame width and height exactly to be all item's preferred sizes pack(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-14 18:57:59
|
Revision: 172 http://openpcl.svn.sourceforge.net/openpcl/?rev=172&view=rev Author: documentsystems Date: 2007-09-14 11:58:01 -0700 (Fri, 14 Sep 2007) Log Message: ----------- Fixed bug in PosStartupOptions to pass false in PriDebug.setBlueAndGreenRaster() if the startup command line string has "N" for -ShowDebugRasterColors=N and true if there is only -ShowDebugRasterColors without the =Y or =N. Before, PriDebug.setBlueAndGreenRaster() was passing true for both "Y" and "N" and blank. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java Modified: openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java =================================================================== --- openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java 2007-09-14 04:34:18 UTC (rev 171) +++ openpcl/src/com/openpcl/viewer/options/PosStartupOptions.java 2007-09-14 18:58:01 UTC (rev 172) @@ -287,10 +287,10 @@ mModeToRun = sModeToRunEmbedded; } else if (commandLineArg.startsWith("-showdebugrastercolors")) { mShowDebugRasterColors = argTrueFalse; - PriDebug.setBlueAndGreenRaster(true); + PriDebug.setBlueAndGreenRaster(mShowDebugRasterColors); } else if (commandLineArg.startsWith("-writedebuglog")) { - mWriteDebugLog = true; - PriDebug.setDebugVersion(); + mWriteDebugLog = argTrueFalse; + if (mWriteDebugLog) { PriDebug.setDebugVersion(); } // Strings This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-14 04:34:17
|
Revision: 171 http://openpcl.svn.sourceforge.net/openpcl/?rev=171&view=rev Author: documentsystems Date: 2007-09-13 21:34:18 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Howard Hoagland. Made changes to 4 classes (PclRenderImage, PriDrawText, OpenPCLViewer, IPluginHooksOpenPCL) to implement this new feature: If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java Modified: openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/pclrenderimage/PclRenderImage.java 2007-09-14 04:34:18 UTC (rev 171) @@ -96,6 +96,9 @@ protected boolean mIsStateBuildingPclPages = true; protected boolean mWantToCenterCharInCharCellBox = true; + // For showing/hiding hidden tags + protected String mShowHideTagBaseString = null; + /** Constructor. There are no callback methods, only call into methods that can return an object value */ public PclRenderImage() { mBufferedImageToDrawOn = createNewBufferedImageToDrawOn(); @@ -143,6 +146,7 @@ public boolean getIsDrawingForPrinting() { return mIsDrawingForPrinting; } public boolean getIsStateBuildingPclPages() { return mIsStateBuildingPclPages; } public boolean getWantToCenterCharInCharCellBox() { return mWantToCenterCharInCharCellBox; } + public String getShowHideTagBaseString() { return mShowHideTagBaseString; } public String getFileNameNoPath() { return mFileNameNoPath; } public String getFullFilePathAndName() { return mFullFilePathAndName; } @@ -153,6 +157,8 @@ mIsDrawingForPrinting = pIsDrawingForPrinting; } public void setWantToCenterCharInCharCellBox(boolean pWantToCenterCharInCharCellBox) { mWantToCenterCharInCharCellBox = pWantToCenterCharInCharCellBox; } + public void setShowHideTagBaseString(String pShowHideTagBaseString) { + mShowHideTagBaseString = pShowHideTagBaseString; } public void setCurrentZoomFactor(double pCurrentZoomFactor) { mCurrentZoomFactor = pCurrentZoomFactor; } protected void handleFormFeedFound(int pBufferPos) { Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriDrawText.java 2007-09-14 04:34:18 UTC (rev 171) @@ -1,6 +1,7 @@ package com.openpcl.pclrenderimage.render; import java.awt.Color; +import java.awt.FontMetrics; import java.awt.Graphics2D; import java.awt.font.TextLayout; import java.awt.geom.Rectangle2D; @@ -34,7 +35,13 @@ protected PriFontBase mPriFontBase = null; protected PriBitmapFont mPriBitmapFont = null; protected PriBitmapCharacter mPriBitmapCharacter = null; - + private char[] mBufferUpChars = null; + private static final int mBufferedUpMax = 1000; + private int mBufferUpIndex = -1; + private int mBufferUpXpos = 0; + private int mBufferUpYpos = 0; + private Color mDarkGreenColor = new Color(0,120,0); + /**Constructor * @param pPclRenderImage * @param pGraphics2D @@ -43,7 +50,9 @@ super(); mPclRenderImage = pPclRenderImage; mGraphics2D = pGraphics2D; - + // Non auto expanding byte array for execution speed. 1000 chars is way enough for all the chars that can fit on one line. + mBufferUpChars = new char[mBufferedUpMax]; + // if (mPclRenderImage == null) { // PriDebug.error("Missing reference to PclRenderImage in PriDrawText constructor.", // new InvalidParameterException()); @@ -354,6 +363,25 @@ mPclRenderImage.getPriCursorPos().getYpos()); } + // Buffer up the chars to draw hidden tag text in black instead of white + if (mBufferUpIndex < 0) { + // Upon the first char of the buffered up string, save the current X,Y point + mBufferUpXpos = mPclRenderImage.getPriCursorPos().getXpos(); + mBufferUpYpos = mPclRenderImage.getPriCursorPos().getYpos(); + // First char of String of chars starts at index 0 + mBufferUpIndex = 0; + } else { + // This isn't the very first char in the string, so just bump the index into the byte array here + mBufferUpIndex++; + } + + // If already reached the max size of the non growing char array, then stop drawing any more chars. + // This shouldn't happen because there's no way to get more than "mBufferedUpMax" chars on a print line anyways. + if (mBufferUpIndex < mBufferedUpMax) { + // Buffer up the chars into a char array + mBufferUpChars[mBufferUpIndex] = afterSubstitutionsCharToDraw; + } + // Alternate way to draw the character through TextLayout reference, // but the Graphics2D.drawString() works Ok too. // The below is if a visual comparison is wanted to see if one or the other is visually better @@ -373,12 +401,41 @@ } /** Draw buffered up chars as one String. + * Overridden methods in a subclass of this class will have code to buffer up viewable text, and write out the text + * as one write operation to save space in it's output stream. For example, a subclass plugin that has this method + * can "save to a PDF file" by using the itext.jar classes. The output .PDF file will be much bigger if chars are written + * to the PDF file one at a time compared to one write operation for the string of chars.<br> + * <br> + * PclRenderImage uses the internal printer font character width tables, so for printing, chars drawn one at a time + * outside of this method. However, code in this method here is for viewing only, and not printing.<br> + * <br> + * If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings + * on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt. + * <br> * Subclass plugins override this method so do not delete or rename this method. */ public void drawBufferedUpCharsAs1String() { - // Just return here with no code to execute because overridden methods in a subclass of this class will have code in the - // overridden method. Subclass plugins override this method so do not delete or rename this method. - // Since PclRenderImage uses the internal printer font character width tables, then no code is needed here. - return; + // If there are no characters buffered up to draw, then return here + if (mBufferUpIndex < 0) { return; } + + // Get the String of several chars to draw + String tDrawCharsAsString = String.valueOf(mBufferUpChars, 0, mBufferUpIndex + 1); + + // Re-draw string only if the string starts with the currently set hidden tag base string + if ( (mPclRenderImage.getShowHideTagBaseString() != null) && + (tDrawCharsAsString.toLowerCase().startsWith(mPclRenderImage.getShowHideTagBaseString().toLowerCase())) ) { + // Send the buffered up chars to be drawn as one String, not using the internal printer font character width tables + mGraphics2D.setPaint(mDarkGreenColor); + mGraphics2D.drawString(tDrawCharsAsString, mBufferUpXpos, mBufferUpYpos); + FontMetrics tFontMetrics = mGraphics2D.getFontMetrics(); + + mGraphics2D.drawRect(mBufferUpXpos, mBufferUpYpos - tFontMetrics.getAscent(), + tFontMetrics.stringWidth(tDrawCharsAsString), tFontMetrics.getHeight()); + + mGraphics2D.setPaint(Color.BLACK); + } + + // Reset the index into the char array to be no chars are in there now + mBufferUpIndex = -1; } } Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-14 04:34:18 UTC (rev 171) @@ -217,7 +217,10 @@ " Views is already open so can't open another one right now.\n" + "Close one or more views then try again."; - public static final String sNotSupportedAtThisTime = "Not supported at this time"; + public static final String sNotSupportedAtThisTime = "Not supported at this time"; + + // For showing/hiding hidden tags + private String[] mHiddenTagBaseArray = { "HIDDENTAG:"} ; // os.name property public static String sOsNameString = null; @@ -1077,7 +1080,7 @@ } } - /** Apply the selected LookAndFeel to the screen + /** Apply the selected LookAndFeel to the screen. * Subclass plugins override this method so do not delete or rename this method. */ public void applySelectedLookAndFeel() { SwingUtilities.updateComponentTreeUI(mParentFrame); @@ -1310,7 +1313,7 @@ return determineFileTypeByFileExtension(tExtensionOfFileName); } - /** Determine the file type by the file extension + /** Determine the file type by the file extension. * Subclass plugins override this method so do not delete or rename this method. */ public int determineFileTypeByFileExtension(String pExtensionOfFileName) { if (pExtensionOfFileName.equalsIgnoreCase(".PCL") || @@ -1435,7 +1438,7 @@ return false; } - /** Create a new view panel + /** Create a new view panel. * Subclass plugins override this method so do not delete or rename this method. */ public PosView createNewViewPanel(String pShortName) { return new PosView(this, pShortName); @@ -1549,13 +1552,13 @@ return tErrorString; } - /** Allow subclases to set their own icon + /** Allow subclases to set their own icon. * Subclass plugins override this method so do not delete or rename this method. */ public Icon getJInternalFrameIcon() { return (PosReadImageIcon.read("V221MultiDoc.png")); } - /** Allow subclases to set their own title + /** Allow subclases to set their own title. * Subclass plugins override this method so do not delete or rename this method. */ public String getJInternalFrameTitleBar(String defaultTitle) { return (defaultTitle); @@ -1993,7 +1996,7 @@ parseFileBytesIntoTreeNodes(tFileNameOnly, pFilePathAndFileName); } - /** Open the file on disk. Read and parse all bytes in the file into tree nodes + /** Open the file on disk. Read and parse all bytes in the file into tree nodes. * Subclass plugins override this method so do not delete or rename this method. */ public void parseFileBytesIntoTreeNodes(String pFileNameOnly, String pFilePathAndFileName) { if (mPosViewSelected.getFileType() == sFileTypePCL) { @@ -2448,8 +2451,18 @@ mPosUserOptionsDialog.setLocationRelativeTo(getAppFrame()); mPosUserOptionsDialog.setVisible(true); } else { - // Hidden feature. If the Control key is pressed when clicking this button, then toggle show/hide to see white text - // by redrawing the text in black, only if the text starts with the specified text. Also draw a box around the now visible txt. + // If the user Control-Clicks the toolbar "Options" button, then toggle show/hide to see white text hidden tag strings + // on the screen by redrawing the white text in dark green. Also draw a dark green box around the now visible txt. + if (mPosViewSelected == null) { return; } + + if (mPosViewSelected.getPclRenderImage().getShowHideTagBaseString() == null) { + // Toggle to show + mPosViewSelected.getPclRenderImage().setShowHideTagBaseString(getHiddenTagBaseString(1)); + } else { + mPosViewSelected.getPclRenderImage().setShowHideTagBaseString(null); + } + // Redraw the current page with the toggle show/hide tag base string + renderImageCurrentPageAndZoom(); } } @@ -2507,34 +2520,44 @@ return mParentFrame; } - /** Get the app name + /** Get the app name. * Subclass plugins override this method so do not delete or rename this method. */ public String getAppName() { return mAppName; } - /** Get the app description + /** Get the app description. * Subclass plugins override this method so do not delete or rename this method. */ public String getAppDescription() { return mAppDescription; } - /** Get the app version + /** Get the app version. * Subclass plugins override this method so do not delete or rename this method. */ public String getAppVersion() { return mAppVersion; } - /** Get the package path to the license info .html file + /** Get the package path to the license info .html file. * Subclass plugins override this method so do not delete or rename this method. */ public String getPackagePathLicenseInfo() { return mPackagePathLicenseInfo; } - /** Get the package path to the help about .html file + /** Get the package path to the help about .html file. * Subclass plugins override this method so do not delete or rename this method. */ public String getPackageHelpAboutInfo() { return mPackagePathHelpAbout; } + + /** Get the hidden tag base String. + * Subclass plugins override this method so do not delete or rename this method. */ + public String getHiddenTagBaseString(int pTagIndex) { + if (mHiddenTagBaseArray == null || mHiddenTagBaseArray.length < pTagIndex) { + return null; + } else { + return mHiddenTagBaseArray[pTagIndex - 1]; + } + } } Modified: openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java 2007-09-14 00:17:27 UTC (rev 170) +++ openpcl/src/com/openpcl/viewer/api/IPluginHooksOpenPCL.java 2007-09-14 04:34:18 UTC (rev 171) @@ -90,5 +90,7 @@ /** Allow subclases to set their own title */ public String getJInternalFrameTitleBar(String defaultTitle); - + + /** Get the hidden tag base String */ + public String getHiddenTagBaseString(int pTagIndex); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-14 00:17:28
|
Revision: 170 http://openpcl.svn.sourceforge.net/openpcl/?rev=170&view=rev Author: documentsystems Date: 2007-09-13 17:17:27 -0700 (Thu, 13 Sep 2007) Log Message: ----------- Howard Hoagland. I changed 4 classes (OpenPCLViewer, PosView, PosWindowControlList, PosStatusBar) to move the full file path and file name from the JInternalFrame title bar to a subpanel in the status bar. Since there is only one status bar for several possible open files, I added code to update the file path and file name in the status bar every time the user clicks to a differernt open file or uses the toolbar icon to switch views. Also I changed 3 classes (IOpenPCL, PosToolBar, OpenPCLViewer) to include a hidden feature to execute code to show hidden white text "Signer Tags" that are in the PCL bytes to view, and draw the hidden text in black instead of in white to show the hidden text on the screen, upon a Control-Click on the Options button in the toolbar. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/api/IOpenPCL.java openpcl/src/com/openpcl/viewer/panels/PosView.java openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-12 21:48:54 UTC (rev 169) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-14 00:17:27 UTC (rev 170) @@ -1227,7 +1227,8 @@ mPosViewSelected = pPosView; double tZoomFactor = mPosViewSelected.getPosZoomLogic().getCurrentZoomFactor(); showZoomFactorOnToolbarButton(tZoomFactor); - PriDebug.releaseln(mPosViewSelected.getPageNameForTitleBar()); + mPosStatusBar.setFileNameText(mPosViewSelected.getFilePathAndFileName()); + PriDebug.releaseln(mPosViewSelected.getPageNameForTitleBar() + ", " + mPosViewSelected.getFilePathAndFileName()); } } @@ -1244,6 +1245,8 @@ // There is only one JInternalFrame showing now and when this one closes, then none will be showing // so write the JInternalFrame's (x,y) and (width, height) and last opened file to the local client platform savePersistedViewValues(pPosView.getJInternalFrame(), mPackagePreferences, mPosPersistViewValues); + mPosStatusBar.setFileNameText("File name"); + mPosStatusBar.setCursorPixelLocationText(""); mPosManageToolBar.setNoViewsOpen(); } } @@ -1330,7 +1333,7 @@ // Update the zoom slider and pass false to not allow recursive event screen updating mPosZoomSlider.setZoomSliderLocationFromZoomFactor(pZoomFactor, false); } - + /** Get the current view window width */ public int getCurrentViewWindowWidth() { if (mPosViewSelected != null && mPosViewSelected.getIsMultiPageParseFinished()) { @@ -1423,7 +1426,7 @@ public String getFormNameForTreeNode(PosTreeNode pPosTreeNode) { if (pPosTreeNode == null) { return null; } // Important: Subclasses that override this method will have more complex code than just the one line below. - return getPosViewSelected().getBaseNameOnJInternalFrameTitleBar() + ", " + pPosTreeNode.toString(); + return pPosTreeNode.toString() + ", " + getPosViewSelected().getFilePathAndFileName(); } /** Returns true if this tree node page must print on the front side (not on the back of a page) when duplexing. @@ -1454,7 +1457,7 @@ tErrorString = tPosView.getPclRenderImage().getLastRenderErrorString(); if (tErrorString != null) { return tErrorString ; } - tPosView.setBaseNameOnJInternalFrameTitleBar(pLongName); + tPosView.setFilePathAndFileName(pLongName); // Make sure max views hasn't been reached int tLowestIndex = findLowestIndexAvailableView(); @@ -2440,9 +2443,14 @@ } /** Show the Options dialog */ - public void actionShowOptionsDialog() { - mPosUserOptionsDialog.setLocationRelativeTo(getAppFrame()); - mPosUserOptionsDialog.setVisible(true); + public void actionShowOptionsDialog(boolean pControlKeyPressed) { + if (!pControlKeyPressed) { + mPosUserOptionsDialog.setLocationRelativeTo(getAppFrame()); + mPosUserOptionsDialog.setVisible(true); + } else { + // Hidden feature. If the Control key is pressed when clicking this button, then toggle show/hide to see white text + // by redrawing the text in black, only if the text starts with the specified text. Also draw a box around the now visible txt. + } } /** Toggle show/hide the help choices popup */ Modified: openpcl/src/com/openpcl/viewer/api/IOpenPCL.java =================================================================== --- openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-09-12 21:48:54 UTC (rev 169) +++ openpcl/src/com/openpcl/viewer/api/IOpenPCL.java 2007-09-14 00:17:27 UTC (rev 170) @@ -250,7 +250,7 @@ public void actionCascadeWindows(); /** Show the Options dialog */ - public void actionShowOptionsDialog(); + public void actionShowOptionsDialog(boolean pControlKeyPressed); /** Toggle show/hide the print choices popup */ public void actionShowHideHelpChoicesPopup(); Modified: openpcl/src/com/openpcl/viewer/panels/PosView.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosView.java 2007-09-12 21:48:54 UTC (rev 169) +++ openpcl/src/com/openpcl/viewer/panels/PosView.java 2007-09-14 00:17:27 UTC (rev 170) @@ -55,7 +55,7 @@ private PosPrintPages mPosPrintPages =null; private PosBuildListOfPagesToPrint mPosBuildListOfPagesToPrint = null; private String mShortName = null; - private String mBaseNameOnJInternalFrameTitleBar = null; + private String mFilePathAndFileName = null; private String mChangingPartNameOnJInternalFrameTitleBar = null; private StringBuffer mToStringStringBuffer = null; private PosTreeNode mCurrentTreeNode = null; @@ -362,35 +362,24 @@ return PosView.sDefaultSplitterLocPclFiles; } - public String getBaseNameOnJInternalFrameTitleBar() { return mBaseNameOnJInternalFrameTitleBar; } - - public void setBaseNameOnJInternalFrameTitleBar(String pBaseNameOnJInternalFrameTitleBar) { - mBaseNameOnJInternalFrameTitleBar = pBaseNameOnJInternalFrameTitleBar; - } + public String getFilePathAndFileName() { return mFilePathAndFileName; } + public void setFilePathAndFileName(String pFilePathAndFileName) { mFilePathAndFileName = pFilePathAndFileName; } public String toString() { mToStringStringBuffer = new StringBuffer(100); - mToStringStringBuffer.append("View #" + mViewNumber + "."); + mToStringStringBuffer.append("View #" + mViewNumber); if (mShortName != null && mShortName.length() > 0) { - mToStringStringBuffer.append(" " + mShortName); + mToStringStringBuffer.append(", " + mShortName); } return mToStringStringBuffer.toString(); } public String getPageNameForTitleBar() { mToStringStringBuffer = new StringBuffer(100); - if (mOpenPCLViewer.getPosStartupOptions().getShowFileNameOnViewTitleBar()) { - mToStringStringBuffer.append("View #" + mViewNumber + "."); - if (mBaseNameOnJInternalFrameTitleBar != null && mBaseNameOnJInternalFrameTitleBar.length() > 0) { - mToStringStringBuffer.append(" " + mBaseNameOnJInternalFrameTitleBar); - } - } + mToStringStringBuffer.append("View #" + mViewNumber); if (mChangingPartNameOnJInternalFrameTitleBar != null && mChangingPartNameOnJInternalFrameTitleBar.length() > 0) { - if (mOpenPCLViewer.getPosStartupOptions().getShowFileNameOnViewTitleBar()) { - mToStringStringBuffer.append(", "); - } - mToStringStringBuffer.append(mChangingPartNameOnJInternalFrameTitleBar); + mToStringStringBuffer.append(", " + mChangingPartNameOnJInternalFrameTitleBar); } return mToStringStringBuffer.toString(); } Modified: openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java 2007-09-12 21:48:54 UTC (rev 169) +++ openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java 2007-09-14 00:17:27 UTC (rev 170) @@ -141,16 +141,16 @@ return -1; } - /* Parse the String that looks like "View# 1. filename.ext" to the int which is the view number */ + /* Parse the String that looks like "View# 1, filename.ext" to the int which is the view number */ private int getViewNumberFromString(String pViewString) { if (pViewString == null) { return -1; } // if null passed then return -1 meaning view number not found int tLocOfPoundsign = pViewString.indexOf("#"); // Find the # in the string if (tLocOfPoundsign >= 0) { - int tLocOfPeriod = pViewString.indexOf(".", tLocOfPoundsign); // Find the . after the # - if (tLocOfPeriod >= 0) { + int tLocEnd = pViewString.indexOf(",", tLocOfPoundsign); // Find the , after the # + if (tLocEnd >= 0) { // Pull out the substring that is only the view number - String tViewNumberString = pViewString.substring( tLocOfPoundsign + 1, tLocOfPeriod); + String tViewNumberString = pViewString.substring( tLocOfPoundsign + 1, tLocEnd); try { int tViewNumber = Integer.parseInt(tViewNumberString); // Convert to int if (tViewNumber > 0) { Modified: openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java 2007-09-12 21:48:54 UTC (rev 169) +++ openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java 2007-09-14 00:17:27 UTC (rev 170) @@ -21,12 +21,14 @@ // Panels private JPanel mStatusBarMsgsJPanel = null; private JPanel mZoomSliderJPanel = null; + private JPanel mOnScreenZoomSliderJPanel = new JPanel(); + private JPanel mFileNameJPanel = null; private JPanel mCursorPixelLocationJPanel = null; - private JPanel mOnScreenZoomSliderJPanel = new JPanel(); // Text labels private JLabel mStatusTextLineJLabel = null; private JLabel mCursorLocationJLabel = null; + private JLabel mFileNameJLabel = null; // TableLayout private double mTloPref = TableLayout.PREFERRED; @@ -52,16 +54,27 @@ // One liner getters public String getStatusBarText() { return mStatusTextLineJLabel.getText(); } + public String getFileNameJLabelText() { return mFileNameJLabel.getText(); } public String getCursorPixelLocationText() { return mCursorLocationJLabel.getText(); } public JPanel getOnScreenZoomSliderJPanel() { return mOnScreenZoomSliderJPanel; } // One liner setters public void setStatusBarText(String pText) { mStatusTextLineJLabel.setText(pText); } - public void setCursorPixelLocationText(String pText) { mCursorLocationJLabel.setText(pText); } + public void setFileNameJLabel(String pText) { mFileNameJLabel.setText(pText); } + + public void setCursorPixelLocationText(String pText) { + mCursorLocationJLabel.setText(pText); + adjustCursorPixelLocationPanelSize(); + } public void setDefaultStatusBarMsg() { mStatusTextLineJLabel.setText(""); } + + public void setFileNameText(String pFileNameString) { + setFileNameJLabel(pFileNameString); + adjustFileNamePanelSize(); + } public void setMouseMoveLocation(int pViewNum, int pXPixel, int pYPixel, double pXInches, double pYInches) { String tPixelLocationString = "View #" + pViewNum + ". " + @@ -75,7 +88,8 @@ private void buildUI() { mStatusTextLineJLabel = new JLabel(""); setDefaultStatusBarMsg(); - + + mFileNameJLabel = new JLabel("File name"); mCursorLocationJLabel = new JLabel(""); mStatusBarMsgsJPanel = makeStatusLineMsgsPanel(); @@ -84,23 +98,29 @@ } mCursorPixelLocationJPanel = makeCursorPixelLocationPanel(); + mFileNameJPanel = makeFileNamePanel(); TableLayout tloLayout = null; - double tloGridSpecWithZoomPanel[][] = new double[][] {{mTloFill, mTloPref, mTloPref}, {mTloFill }}; - double tloGridSpecWithoutZoomPanel[][] = new double[][] {{mTloFill, mTloPref}, {mTloFill }}; + double tloGridSpecWithZoomPanel[][] = new double[][] {{mTloFill, mTloPref, mTloPref, mTloPref}, {mTloFill }}; + double tloGridSpecWithoutZoomPanel[][] = new double[][] {{mTloFill, mTloPref, mTloPref}, {mTloFill }}; if (mWantZoomSliderPanel) { tloLayout = new TableLayout(tloGridSpecWithZoomPanel); setLayout(tloLayout); add("0,0", mStatusBarMsgsJPanel); add("1,0", mZoomSliderJPanel); - add("2,0", mCursorPixelLocationJPanel); + add("2,0", mFileNameJPanel); + add("3,0", mCursorPixelLocationJPanel); } else { tloLayout = new TableLayout(tloGridSpecWithoutZoomPanel); setLayout(tloLayout); add("0,0", mStatusBarMsgsJPanel); - add("1,0", mCursorPixelLocationJPanel); + add("1,0", mFileNameJPanel); + add("2,0", mCursorPixelLocationJPanel); } + + adjustFileNamePanelSize(); + adjustCursorPixelLocationPanelSize(); } private JPanel makeStatusLineMsgsPanel() { @@ -122,11 +142,21 @@ panel.add("0,0", mOnScreenZoomSliderJPanel); return panel; } + + private JPanel makeFileNamePanel() { + JPanel panel = new JPanel(); + setStatusBarSectionAttributes(panel); + double tloGridSpec[][] = new double[][] {{mTloPref}, {mTloPref }}; + TableLayout tloLayout = new TableLayout(tloGridSpec); + panel.setLayout(tloLayout); + panel.add("0,0", mFileNameJLabel); + return panel; + } + private JPanel makeCursorPixelLocationPanel() { JPanel panel = new JPanel(); setStatusBarSectionAttributes(panel); - adjustCursorPixelLocationPanelSize(); double tloGridSpec[][] = new double[][] {{mTloPref}, {mTloPref }}; TableLayout tloLayout = new TableLayout(tloGridSpec); panel.setLayout(tloLayout); @@ -143,12 +173,23 @@ BorderFactory.createEmptyBorder(1, 2, 0, 2))); } + private void adjustFileNamePanelSize() { + Font tJLabelFont = mFileNameJLabel.getFont(); + FontMetrics tJLabelFontMetrics = mFileNameJLabel.getFontMetrics(tJLabelFont); + mCursorLocationJLabel.setPreferredSize(new Dimension( + tJLabelFontMetrics.stringWidth(mFileNameJLabel.getText()), tJLabelFontMetrics.getHeight())); + } + public void adjustCursorPixelLocationPanelSize() { Font tJLabelFont = mCursorLocationJLabel.getFont(); FontMetrics tJLabelFontMetrics = mCursorLocationJLabel.getFontMetrics(tJLabelFont); - mCalculatedMaxWidthOfMouseLocationString = tJLabelFontMetrics.stringWidth( - "View #9. 9.99 x 99.99 inches (9999,9999)"); - mCursorLocationJLabel.setPreferredSize( - new Dimension(mCalculatedMaxWidthOfMouseLocationString, tJLabelFontMetrics.getHeight())); + if (mCursorLocationJLabel.getText().length() < 1) { + mCursorLocationJLabel.setPreferredSize(new Dimension(20, tJLabelFontMetrics.getHeight())); + } else { + mCalculatedMaxWidthOfMouseLocationString = tJLabelFontMetrics.stringWidth( + "View #9. 9.99 x 99.99 inches (9999,9999)"); + mCursorLocationJLabel.setPreferredSize( + new Dimension(mCalculatedMaxWidthOfMouseLocationString, tJLabelFontMetrics.getHeight())); + } } } Modified: openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-09-12 21:48:54 UTC (rev 169) +++ openpcl/src/com/openpcl/viewer/toolbar/PosToolBar.java 2007-09-14 00:17:27 UTC (rev 170) @@ -274,7 +274,13 @@ protected JButton createOptionsButton() { JButton tJButton = createToolBarButton("V221Options.png", "Options"); tJButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) {mOpenPCLViewer.actionShowOptionsDialog();} + public void actionPerformed(ActionEvent e) { + if ((e.getModifiers() & ActionEvent.CTRL_MASK) > 1) { + mOpenPCLViewer.actionShowOptionsDialog(true); + } else { + mOpenPCLViewer.actionShowOptionsDialog(false); + } + } }); return tJButton; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-12 21:48:51
|
Revision: 169 http://openpcl.svn.sourceforge.net/openpcl/?rev=169&view=rev Author: documentsystems Date: 2007-09-12 14:48:54 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Howard Hoagland. Added the method setRootNodeName() so that the tree root name can be changed after constructor time. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java Modified: openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java =================================================================== --- openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java 2007-09-12 21:46:58 UTC (rev 168) +++ openpcl/src/com/openpcl/viewer/tree/PosTreeNode.java 2007-09-12 21:48:54 UTC (rev 169) @@ -71,8 +71,19 @@ public void setPriRenderCounters(PriRenderCounters pPriRenderCounters) { mPriRenderCounters = pPriRenderCounters; } - - // toString() here is used to show on the screen the name of the node + + /** + * Set the root node name after this PosTreeNode has been constructed. + * @param pRootNodeName + */ + public void setRootNodeName(String pRootNodeName) { + mRootNodeName = pRootNodeName; + mNodeName = pRootNodeName; + } + + /** + * toString() here is needed to show on the screen the name of the node + */ public String toString() { // This is a Pcl file page node if (mRootNodeName != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-12 21:46:57
|
Revision: 168 http://openpcl.svn.sourceforge.net/openpcl/?rev=168&view=rev Author: documentsystems Date: 2007-09-12 14:46:58 -0700 (Wed, 12 Sep 2007) Log Message: ----------- Howard Hoagland. Added text color change in addition to the already background color change as user hovers over the different choices in the toolbar button drop down dialogs. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java Modified: openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java =================================================================== --- openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java 2007-09-08 00:53:51 UTC (rev 167) +++ openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java 2007-09-12 21:46:58 UTC (rev 168) @@ -21,7 +21,9 @@ public class PosToolbarDropdownItemRenderer extends DefaultListCellRenderer { private static final long serialVersionUID = 1L; private Color mBkgSelectionColor = null; + private Color mFrgSelectionColor = null; private Color mBkgNonSelectionColor = null; + private Color mFrgNonSelectionColor = null; @Override public Component getListCellRendererComponent( @@ -32,7 +34,9 @@ // Need to get the color again every time because the user might have changed the Look and Feel from last time mBkgSelectionColor = UIManager.getColor("List.selectionBackground"); + mFrgSelectionColor = UIManager.getColor("List.selectionForeground"); mBkgNonSelectionColor = UIManager.getColor("List.background"); + mFrgNonSelectionColor = UIManager.getColor("List.foreground"); if (pValue instanceof JLabel) { JLabel tJLabel = (JLabel)pValue; @@ -43,8 +47,10 @@ // Setting the vertical alignment to TOP doesn't change the text placement when a JLabel is in a JList, but this // is a trick to use something in a JLabel to know which JLabel in the JList the mouse is hovering over right now. setBackground(mBkgSelectionColor); + setForeground(mFrgSelectionColor); } else { setBackground(mBkgNonSelectionColor); + setForeground(mFrgNonSelectionColor); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-08 00:53:50
|
Revision: 167 http://openpcl.svn.sourceforge.net/openpcl/?rev=167&view=rev Author: documentsystems Date: 2007-09-07 17:53:51 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Howard Hoagland. Updated from "Version 0.07 August 6, 2007" to "Version 0.08 September 7, 2007" that is shown on the title bar, and in the Help About and the License Info. This 0.08 version changes are: 1. Added code to center the page image horizontally when the user clicked on "Print all on Letter (shrinks Legal)" for the Legal pages to look centered after they've been shrunk to fit on Letter paper. 2. Changed 38 icons to the ones that Yuko Miyahara made, and changed 7 source code files to have the names of the new icons. 3. Added new class PosHoverColorMouseMotionAdapter to set a value in the hovered over JLabel in the JList that causes the PosToolbarDropdownItemRenderer to set the background color as the user moves the mouse from one selection to another so the user has visual confirmation of which item in the drop down will be seleced if clicked there. 4. If System.getProperty("os.name") has "WIN" anywhere (could be any version of Windows), then at app startup time, set the LookAndFeel to com.sun.java.swing.plaf.windows.WindowsLookAndFeel" so that it doesn't default to the Metal Ocean Theme look and feel like it was doing before. Else, let the running JVM set it's default look and feel (for when this app is run on a non Windows platform like a Macintosh, Unix, Linux. 5. In the OpenPCLViewer class, changed the setPreferredSize on the status bar to be 1 line of text high instead of 2 lines of text for the status bar. Also, don't initially put the app name and version and description on the status bar at app startup time. 6. In the PosStatusBar class, added the method adjustCursorPixelLocationPanelSize() and called it from OpenPCLViewer to change the status bar height and the width of the right side subpanel in the status bar depending on the on the fly font height and width calculation when the user changes the LookAndFeel, changed the lowered bevel look of the status bar to a non 3D looking line border so it won't remind people of the old school Windows 3.1 days. 7. Fixed problem where printers that don't do 300 dpi but do 600 dpi were printing the page image 1/2 the size width and height, making the page image be on the upper left corner of the paper. Now the page image prints at the right size no matter if the printer's max resolution is 300 dpi or is a printer that doesn't have 300 dpi but has 600 or 1200 dpi, buy not setting any particular printer resolution by commenting out the line: mPrintRequestAttributeSet.add(new PrinterResolution(300, 300, ResolutionSyntax.DPI));, and specifying mPrintRequestAttributeSet.add(PrintQuality.HIGH) instead of mPrintRequestAttributeSet.add(PrintQuality.DRAFT). 7. Added 3 lines of code to fix bug 1790142 "Does not render", submitted By: David Hill of www.davesplanet.net, where if the horizontal cpi pitch is 0 in the PCL command "ESC ( s 0 h" in an input PCL file, that would cause the PCL parsing to stop. Modified Paths: -------------- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html openpcl/src/com/openpcl/viewer/OpenPCLViewer.java openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html Modified: openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/install/localinstaller/HelpAbout.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 August 17, 2007<br> +Version 0.08 September 7, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/install/localinstaller/LicenseInfo.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 August 17, 2007 +<br>Version 0.08 September 7, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-09-08 00:53:51 UTC (rev 167) @@ -151,7 +151,7 @@ // Instance variables protected String mAppName = "OpenPCL Viewer"; protected String mAppDescription = " - Free Open Source PCL Viewer for the World"; - protected String mAppVersion = "Version 0.08 August 17, 2007"; + protected String mAppVersion = "Version 0.08 September 7, 2007"; private Frame mParentFrame = null; private JApplet mJApplet = null; Modified: openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/viewer/htmlfiles/HelpAbout.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer Help About</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b><br> -Version 0.08 August 17, 2007<br> +Version 0.08 September 7, 2007<br> OpenPCL is made up of OpenPCLViewer and PclRenderImage.<br> <br> <b>Features:</b> Modified: openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html =================================================================== --- openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-09-08 00:31:56 UTC (rev 166) +++ openpcl/src/com/openpcl/viewer/htmlfiles/LicenseInfo.html 2007-09-08 00:53:51 UTC (rev 167) @@ -2,7 +2,7 @@ <html><head><title>OpenPCL Viewer License</title></head> <body><font size=4 face="arial"> <b>OpenPCL Viewer - Free Open Source PCL Viewer for the World.</b> -<br>Version 0.08 August 17, 2007 +<br>Version 0.08 September 7, 2007 <br>OpenPCL is made up of OpenPCLViewer and PclRenderImage. <br> <p>The OpenPCL license is the GNU Lesser General Public License (LGPL) which you can view at This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-08 00:31:55
|
Revision: 166 http://openpcl.svn.sourceforge.net/openpcl/?rev=166&view=rev Author: documentsystems Date: 2007-09-07 17:31:56 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Changed "v.0.07" to "v0.08" on the link to download file openpclviewer-setup.exe and openpclviewer-installer.jar Modified Paths: -------------- openpcl/src/com/openpcl/install/website/index.html Modified: openpcl/src/com/openpcl/install/website/index.html =================================================================== --- openpcl/src/com/openpcl/install/website/index.html 2007-09-07 23:32:50 UTC (rev 165) +++ openpcl/src/com/openpcl/install/website/index.html 2007-09-08 00:31:56 UTC (rev 166) @@ -226,12 +226,12 @@ <div id="downloadWin32Div"> <a href="openpclviewer-setup.exe" class="downloadLink"> Download OpenPCL Viewer Now!</a><br/> - v0.07 (Alpha) for Windows<br/> + v0.08 (Alpha) for Windows<br/> </div> <div id="downloadOtherDiv" style="display:none"> <a href="openpclviewer-installer.jar" class="downloadLink"> Download OpenPCL Viewer Now!</a><br/> - v0.07 (Alpha) for Mac/Linux<br/> + v0.08 (Alpha) for Mac/Linux<br/> <span class="downloadReq"> Requires Java JRE 1.5<br/> </span> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-09-07 23:32:47
|
Revision: 165 http://openpcl.svn.sourceforge.net/openpcl/?rev=165&view=rev Author: documentsystems Date: 2007-09-07 16:32:50 -0700 (Fri, 07 Sep 2007) Log Message: ----------- Howard Hoagland. Added 3 lines of code to fix bug 1790142 "Does not render", submitted By: David Hill of www.davesplanet.net, where if the horizontal cpi pitch is 0 in the PCL command "ESC ( s 0 h" in an input PCL file, that would cause the PCL parsing to stop. Modified Paths: -------------- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java Modified: openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java =================================================================== --- openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2007-08-29 02:34:00 UTC (rev 164) +++ openpcl/src/com/openpcl/pclrenderimage/render/PriFonts.java 2007-09-07 23:32:50 UTC (rev 165) @@ -420,7 +420,13 @@ * @param pNumCharactersPerInch */ public void setFontHorizontalPitch(int pNumCharactersPerInch) { - mCurrentHorizontalPitch = pNumCharactersPerInch; + if (pNumCharactersPerInch == 0) { + // Avoid divide by zero stops the PCL parsing when the passed in chars per inch is 0 + mCurrentHorizontalPitch = 12; + } else { + mCurrentHorizontalPitch = pNumCharactersPerInch; + } + mCurrentHorizontalMotionIndexHMI = (120 / mCurrentHorizontalPitch); // PriDebug.infoln(PriDebug.spacesForPclParseMsgs + // "PriFonts set Horizontal Pitch (number of characters per inch) to " + mCurrentHorizontalPitch); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-29 02:34:02
|
Revision: 164 http://openpcl.svn.sourceforge.net/openpcl/?rev=164&view=rev Author: documentsystems Date: 2007-08-28 19:34:00 -0700 (Tue, 28 Aug 2007) Log Message: ----------- Howard Hoagland. Fixed problem where printers that don't do 300 dpi but do 600 dpi were printing the page image 1/2 the size width and height, making the page image be on the upper left corner of the paper. Now the page image prints at the right size no matter if the printer's max resolution is 300 dpi or is a printer that doesn't have 300 dpi but has 600 or 1200 dpi, buy not setting any particular printer resolution by commenting out the line: mPrintRequestAttributeSet.add(new PrinterResolution(300, 300, ResolutionSyntax.DPI));, and specifying mPrintRequestAttributeSet.add(PrintQuality.HIGH) instead of mPrintRequestAttributeSet.add(PrintQuality.DRAFT). Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-29 02:26:53 UTC (rev 163) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-29 02:34:00 UTC (rev 164) @@ -27,7 +27,6 @@ import javax.print.attribute.HashPrintRequestAttributeSet; import javax.print.attribute.PrintRequestAttributeSet; -import javax.print.attribute.ResolutionSyntax; import javax.print.attribute.Size2DSyntax; import javax.print.attribute.standard.Chromaticity; import javax.print.attribute.standard.JobKOctets; @@ -36,7 +35,6 @@ import javax.print.attribute.standard.MediaSize; import javax.print.attribute.standard.OrientationRequested; import javax.print.attribute.standard.PrintQuality; -import javax.print.attribute.standard.PrinterResolution; import javax.print.attribute.standard.Sides; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -673,15 +671,24 @@ // Set the default choices on the print dialog for portrait, Legal, one sided, print job name, 4 margins mPrintRequestAttributeSet = new HashPrintRequestAttributeSet(); mPrintRequestAttributeSet.add(OrientationRequested.PORTRAIT); - mPrintRequestAttributeSet.add(PrintQuality.DRAFT); // (before this was "HIGH") + + // Don't set to "DRAFT" or else the print driver picks the lowest resolution the printer can do. + mPrintRequestAttributeSet.add(PrintQuality.HIGH); + mPrintRequestAttributeSet.add(MediaSize.findMedia(8.5f, 14.0f, Size2DSyntax.INCH)); mPrintRequestAttributeSet.add(Sides.ONE_SIDED); mPrintRequestAttributeSet.add(Chromaticity.MONOCHROME); - mPrintRequestAttributeSet.add(new PrinterResolution(600, 600, ResolutionSyntax.DPI)); - mPrintRequestAttributeSet.add(new JobKOctets((int)(1.3 * 1024))); // each page is 1.3 MB + mPrintRequestAttributeSet.add(new JobKOctets((int)(256))); // each page image bytes max mPrintRequestAttributeSet.add(new JobName(getAppName() + " print", Locale.getDefault())); mPrintRequestAttributeSet.add(new MediaPrintableArea(0.18f, 0.18f, 8.14f, 13.64f, MediaPrintableArea.INCH)); + // 8/22/07 HowardH. Commented out the below line. Don't set the DPI here, let the print driver set the DPI and + // the printing framework will auto scale the image to the print driver's DPI setting. + // If you set the DPI here, you're forcing it to that exact resolution which will result in + // too small an image on paper for for printers that do 600dpi but can't do 300dpi, and if you set this to 600dpi then + // the image on paper is too big for printers that do 300dpi but can't do 600dpi. + // Commented out: mPrintRequestAttributeSet.add(new PrinterResolution(300, 300, ResolutionSyntax.DPI)); + // Print Setup Defaults dialog and Print dialog (same dialog for both defaults and per print) mPosPrintSetupDialogChoices = new PosPrintSetupDialogChoices(); mPosUserOptionsDialog = new PosUserOptionsDialog( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-29 02:27:35
|
Revision: 163 http://openpcl.svn.sourceforge.net/openpcl/?rev=163&view=rev Author: documentsystems Date: 2007-08-28 19:26:53 -0700 (Tue, 28 Aug 2007) Log Message: ----------- Howard Hoagland. 1. Get the dpi that the print driver of the selected printer picked (examples 300 or 600 or 1200 dpi). 2. Added comment line for centering Legal image on Letter paper. 3. For Legal image on Legal paper (not forcing paper change), bumped the image to the right slightly so that the vertical lines on the left edge of the image won't be chopped off on the left. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintBufferedImage.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintBufferedImage.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintBufferedImage.java 2007-08-29 02:20:53 UTC (rev 162) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintBufferedImage.java 2007-08-29 02:26:53 UTC (rev 163) @@ -38,16 +38,15 @@ private JProgressBar mPrintingProgressBar = null; private static final String sProgressBarBaseString = "Generating page: "; private static final String sCantAllocate = "Can't allocate memory for temporary image used for printing."; + private boolean mShouldSetRendingHints = false; // Printing looks the same on paper if rending hints are set or not private double mPrintScale = 72.0d / 300.0d; // making width and height using 72 / 300 scale private double mPageWidthPixels = 8.5 * 300; private double mShrinkLegalToLetterRatio = (11.0d / 14.0d); // shrink in both directions height 14" to 11" private double mShrinkLegalToLetterScale = mPrintScale * mShrinkLegalToLetterRatio; - private double mShrinkLegalToLetterMargins = 0.27 * 300; - + private double mShrinkLegalToLetterMargins = 0.27d * 300.0d; private double mXOffsetForCenteringShrinkLegalOnLetter = ((mPageWidthPixels - (mPageWidthPixels * mShrinkLegalToLetterRatio)) / 2) + mShrinkLegalToLetterMargins; - private boolean mShouldSetRendingHints = false; // Printing looks the same on paper if rending hints are set or not public PosPrintBufferedImage(PosView pPosView) { super(); @@ -101,16 +100,24 @@ g2D.setPaint(Color.BLACK); // Save the passed in AffineTransform (to put it back before returning) mOrigAffineTransform = g2D.getTransform(); + // The below is the resolution that the selected printer's print driver set, + // and will be 4.1667 on a 300dpi printer, or 8.333 on a 600dpi printer. + // The below 2 lines would help debugging any future problems if different printer resolutions print too small or too big. + // long tDpiSetByPrintDriver = Math.round( mOrigAffineTransform.getScaleX() * 72); + // System.out.println("The print driver selected dpi is " + tDpiSetByPrintDriver ); if (mPosPrintSetupDialogChoices.isPaperSizePrintAllOnLetterShrinksLegal() && ( !(mPosView.getOpenPCLViewer().isTreeNodePageLetterSize(mPrintThisTreeNode)) )) { // The user has clicked the "Print all on Letter paper (shrinks Legal)" radio button so shrink Legal to fit on Letter g2D.transform(mShrinkLegalToLetterAffineTransform); + // Center the Legal image on the Letter page size buy bumping to the right half the available horizontal space g2D.translate(mXOffsetForCenteringShrinkLegalOnLetter, 0.0d); } else { // Set the 72/300 = .24 AffineTransform on the current Graphics2D, to scale smaller to fit exactly on the printed page g2D.transform(mScaleAffineTransform); + // So that the vertical lines at the very left edge aren't chopped off, need to bump the whole image 4 pixels to the right + g2D.translate(4.0d, 0.0d); } // Make the BufferedImage from the tree node. @@ -222,18 +229,32 @@ // import javax.print.attribute.Attribute; // import javax.print.attribute.PrintJobAttributeSet; // import javax.print.attribute.PrintServiceAttributeSet; +// import javax.print.attribute.standard.PrinterMakeAndModel; +// import javax.print.attribute.standard.PrinterName; // import javax.print.attribute.standard.PrinterResolution; // import sun.awt.windows.WPrinterJob; // import sun.print.Win32PrintService; // private PrinterJob mPrinterJob = null; // private DocPrintJob mDocPrintJob = null; +// private PrintService mPrintService = null; // public void setPrinterJob(PrinterJob pPrinterJob) { // mPrinterJob = pPrinterJob; // mDocPrintJob = pPrinterJob.getPrintService().createPrintJob(); // } +// public void setPrintService(PrintService pPrintService) { +// mPrintService = pPrintService; +// } + +// PrintServiceAttributeSet tPas = mPrintService.getAttributes(); +// Attribute tPname = tPas.get(PrinterName.class); // works Ok. It returns the PrinterName that the user can change. +// Attribute tPmm = tPas.get(PrinterMakeAndModel.class); // returns null but shouldn't http://bugs.sun.com/view_bug.do?bug_id=4673400 +// System.out.println("Number of print service attributes: " + tPas.size()); +// System.out.println("Printer name: " + tPname ); +// System.out.println("PrinterMakeAndModel: " + tPmm); + //GraphicsConfiguration tGc = g2D.getDeviceConfiguration(); //ColorModel tColorModel = tGc.getColorModel(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-29 02:21:03
|
Revision: 162 http://openpcl.svn.sourceforge.net/openpcl/?rev=162&view=rev Author: documentsystems Date: 2007-08-28 19:20:53 -0700 (Tue, 28 Aug 2007) Log Message: ----------- Howard Hoagland. Added separate PrinterException try block for mPrinterJob.setPrintService() so it's not in the same try block with mPrinterJob.print() Modified Paths: -------------- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java Modified: openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java =================================================================== --- openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-08-22 00:24:16 UTC (rev 161) +++ openpcl/src/com/openpcl/viewer/printing/PosPrintPages.java 2007-08-29 02:20:53 UTC (rev 162) @@ -751,10 +751,16 @@ try { // Set the user selected printer on the PrinterJob mPrinterJob.setPrintService(mPrintService); + } catch (PrinterException e) { + PriDebug.releaseln("PrinterException in PosPrintPages image print, mPrinterJob.setPrintService()"); + return false; + } + + try { // Print all the pages mPrinterJob.print(pPrintRequestAttributeSet); } catch (PrinterException e) { - PriDebug.error("PrinterException in PosPrintPages", e); + PriDebug.releaseln("PrinterException in PosPrintPages image print, mPrinterJob.print()"); return false; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-22 00:24:13
|
Revision: 161 http://openpcl.svn.sourceforge.net/openpcl/?rev=161&view=rev Author: documentsystems Date: 2007-08-21 17:24:16 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Howard Hoagland. In the PosStatusBar class, 1. added the method adjustCursorPixelLocationPanelSize() and called it from OpenPCLViewer to change the status bar height and the width of the right side subpanel in the status bar depending on the on the fly font height and width calculation when the user changes the LookAndFeel, 2. Made the status bar 1 text line tall instead of 2 lines tall, 3. Changed the lowered bevel look of the status bar to a non 3D looking line border so it won't remind people of the old school Windows 3.1 days. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java Modified: openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java =================================================================== --- openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java 2007-08-22 00:08:10 UTC (rev 160) +++ openpcl/src/com/openpcl/viewer/statusbar/PosStatusBar.java 2007-08-22 00:24:16 UTC (rev 161) @@ -1,6 +1,7 @@ package com.openpcl.viewer.statusbar; import java.awt.Color; +import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; @@ -10,6 +11,10 @@ import javax.swing.JLabel; import javax.swing.JPanel; +/** + * Status bar panel + * @author DocMagic, Document Systems Inc, HowardH. + */ public class PosStatusBar extends JPanel { private static final long serialVersionUID = 1L; @@ -20,10 +25,8 @@ private JPanel mOnScreenZoomSliderJPanel = new JPanel(); // Text labels - private JLabel mStatusTextLine1JLabel = null; - private JLabel mStatusTextLine2JLabel = null; + private JLabel mStatusTextLineJLabel = null; private JLabel mCursorLocationJLabel = null; - private JLabel mMouseMoveLocationJLabel = null; // TableLayout private double mTloPref = TableLayout.PREFERRED; @@ -44,46 +47,36 @@ } public PosStatusBar() { - this(null); + this((JPanel)null); } // One liner getters - public String getStatusBarText() { return mStatusTextLine1JLabel.getText(); } - public String getStatusBarTextLine2() { return mStatusTextLine2JLabel.getText(); } + public String getStatusBarText() { return mStatusTextLineJLabel.getText(); } public String getCursorPixelLocationText() { return mCursorLocationJLabel.getText(); } public JPanel getOnScreenZoomSliderJPanel() { return mOnScreenZoomSliderJPanel; } // One liner setters - public void setStatusBarText(String pText) { mStatusTextLine1JLabel.setText(pText); } - public void setStatusBarTextLine2(String pText) { mStatusTextLine2JLabel.setText(pText); } + public void setStatusBarText(String pText) { mStatusTextLineJLabel.setText(pText); } public void setCursorPixelLocationText(String pText) { mCursorLocationJLabel.setText(pText); } public void setDefaultStatusBarMsg() { - mStatusTextLine1JLabel.setText(""); - mStatusTextLine2JLabel.setText(""); + mStatusTextLineJLabel.setText(""); } public void setMouseMoveLocation(int pViewNum, int pXPixel, int pYPixel, double pXInches, double pYInches) { - String tPixelLocationString = "View #" + pViewNum + ". (" + pXPixel + "," + pYPixel + ")"; - String tInchesLocationString = String.format("%1$.2f", pXInches) + - " x " + String.format("%1$.2f", pYInches) + " inches"; + String tPixelLocationString = "View #" + pViewNum + ". " + + String.format("%1$.2f", pXInches) + " x " + + String.format("%1$.2f", pYInches) + " inches (" + + pXPixel + "," + pYPixel + ")"; mCursorLocationJLabel.setText(tPixelLocationString); - mMouseMoveLocationJLabel.setText(tInchesLocationString); + adjustCursorPixelLocationPanelSize(); } private void buildUI() { - mStatusTextLine1JLabel = new JLabel(""); - mStatusTextLine2JLabel = new JLabel(""); + mStatusTextLineJLabel = new JLabel(""); setDefaultStatusBarMsg(); - mStatusTextLine1JLabel.setForeground(Color.BLUE); - mStatusTextLine2JLabel.setForeground(Color.BLUE); mCursorLocationJLabel = new JLabel(""); - mCursorLocationJLabel.setForeground(Color.BLUE); - - mMouseMoveLocationJLabel = new JLabel(""); - mMouseMoveLocationJLabel.setForeground(Color.BLUE); - mStatusBarMsgsJPanel = makeStatusLineMsgsPanel(); if (mWantZoomSliderPanel) { @@ -113,11 +106,10 @@ private JPanel makeStatusLineMsgsPanel() { JPanel panel = new JPanel(); setStatusBarSectionAttributes(panel); - double tloGridSpec[][] = new double[][] {{mTloFill }, {mTloPref, mTloPref }}; + double tloGridSpec[][] = new double[][] {{mTloFill }, {mTloPref }}; TableLayout tloLayout = new TableLayout(tloGridSpec); panel.setLayout(tloLayout); - panel.add("0,0", mStatusTextLine1JLabel); - panel.add("0,1", mStatusTextLine2JLabel); + panel.add("0,0", mStatusTextLineJLabel); return panel; } @@ -134,15 +126,11 @@ private JPanel makeCursorPixelLocationPanel() { JPanel panel = new JPanel(); setStatusBarSectionAttributes(panel); - Font tJLabelFont = mMouseMoveLocationJLabel.getFont(); - FontMetrics tJLabelFontMetrics = mMouseMoveLocationJLabel.getFontMetrics(tJLabelFont); - mCalculatedMaxWidthOfMouseLocationString = tJLabelFontMetrics.stringWidth("View #99. (9999,9999"); - double tloGridSpec[][] = new double[][] {{mCalculatedMaxWidthOfMouseLocationString }, - {mTloPref, mTloPref }}; + adjustCursorPixelLocationPanelSize(); + double tloGridSpec[][] = new double[][] {{mTloPref}, {mTloPref }}; TableLayout tloLayout = new TableLayout(tloGridSpec); panel.setLayout(tloLayout); panel.add("0,0", mCursorLocationJLabel); - panel.add("0,1", mMouseMoveLocationJLabel); return panel; } @@ -150,9 +138,17 @@ sectionPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createCompoundBorder( // The below line makes the separator bars wider - BorderFactory.createEmptyBorder(2, 4, 2, 4),BorderFactory.createLoweredBevelBorder()), + BorderFactory.createEmptyBorder(2, 2, 0, 2),BorderFactory.createLineBorder(Color.GRAY)), // The below line makes empty space to the left and right of the text in the sectional box - BorderFactory.createEmptyBorder(2, 5, 2, 5))); + BorderFactory.createEmptyBorder(1, 2, 0, 2))); } + public void adjustCursorPixelLocationPanelSize() { + Font tJLabelFont = mCursorLocationJLabel.getFont(); + FontMetrics tJLabelFontMetrics = mCursorLocationJLabel.getFontMetrics(tJLabelFont); + mCalculatedMaxWidthOfMouseLocationString = tJLabelFontMetrics.stringWidth( + "View #9. 9.99 x 99.99 inches (9999,9999)"); + mCursorLocationJLabel.setPreferredSize( + new Dimension(mCalculatedMaxWidthOfMouseLocationString, tJLabelFontMetrics.getHeight())); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-22 00:08:08
|
Revision: 160 http://openpcl.svn.sourceforge.net/openpcl/?rev=160&view=rev Author: documentsystems Date: 2007-08-21 17:08:10 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Howard Hoagland. In the OpenPCLViewer class, changed the setPreferredSize on the status bar to be 1 line of text high instead of 2 lines of text for the status bar. Also, don't initially put the app name and version and description on the status bar at app startup time. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java Modified: openpcl/src/com/openpcl/viewer/OpenPCLViewer.java =================================================================== --- openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-21 21:03:25 UTC (rev 159) +++ openpcl/src/com/openpcl/viewer/OpenPCLViewer.java 2007-08-22 00:08:10 UTC (rev 160) @@ -632,9 +632,8 @@ mPosStatusBar = new PosStatusBar(); FontMetrics tFm = getFontMetrics((new JLabel("H")).getFont()); // Make the height of the status bar from the current font for JLabels - mPosStatusBar.setPreferredSize(new Dimension(1, (tFm.getHeight() * 2) + 12)); - mPosStatusBar.setStatusBarText(getAppName() + getAppDescription()); - mPosStatusBar.setStatusBarTextLine2(getAppVersion()); + mPosStatusBar.setPreferredSize(new Dimension(1, tFm.getHeight() + 6)); + mPosStatusBar.setStatusBarText(""); // If startup options allows, add the status bar if (mPosStartupOptions.getShowStatusbar()) { add(mPosStatusBar, BorderLayout.SOUTH); @@ -1065,7 +1064,8 @@ FontMetrics tFm = getFontMetrics((new JLabel("H")).getFont()); // Adjust the height of the status bar - mPosStatusBar.setPreferredSize(new Dimension(1, (tFm.getHeight() * 2) + 12)); + mPosStatusBar.adjustCursorPixelLocationPanelSize(); + mPosStatusBar.setPreferredSize(new Dimension(1, tFm.getHeight() + 6)); revalidate(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-21 21:03:27
|
Revision: 159 http://openpcl.svn.sourceforge.net/openpcl/?rev=159&view=rev Author: documentsystems Date: 2007-08-21 14:03:25 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Howard Hoagland. If System.getProperty("os.name") has "WIN" anywhere (could be any version of Windows), then at app startup time, set the LookAndFeel to com.sun.java.swing.plaf.windows.WindowsLookAndFeel" so that it doesn't default to the Metal Ocean Theme look and feel like it was doing before. Else, let the running JVM set it's default look and feel (for when this app is run on a non Windows platform like a Macintosh, Unix, Linux. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java Modified: openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java =================================================================== --- openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java 2007-08-21 20:22:41 UTC (rev 158) +++ openpcl/src/com/openpcl/viewer/jframe/PosSimpleJFrame.java 2007-08-21 21:03:25 UTC (rev 159) @@ -27,12 +27,23 @@ import javax.swing.JTextField; import javax.swing.JToolBar; import javax.swing.KeyStroke; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; import javax.swing.WindowConstants; import com.openpcl.viewer.OpenPCLViewer; import com.openpcl.viewer.options.PosStartupOptions; import com.openpcl.viewer.util.PosReadImageIcon; +/** + * PosSimpleJFrame is a JFrame that puts the OpenPCLViewer (a JPanel) on the screen in the JFrame's layout. + * The OpenPCLViewer panel sends PCL bytes to the PclRenderImage class that is in the .jar file of that name. + * PclRenderImage and its related classes parse the PCL bytes and then draws/renders the PCL image on a + * BufferedImage which OpenPCLViewer puts on the screen along with the JTree that has tree nodes for the + * possibly multi page PCL bytes. + * + * @author DocMagic, Document Systems Inc, HowardH. 9/20/06 + */ public class PosSimpleJFrame extends JFrame { private static final long serialVersionUID = 1L; @@ -54,15 +65,6 @@ protected JPanel mPclViewerOuterJPanel = null; protected int mModeToRun = PosStartupOptions.sModeToRunNotSelected; - /** - * Constructor - * PosSimpleJFrame is a JFrame that puts the OpenPCLViewer (a JPanel) on the screen in the JFrame's layout. - * The OpenPCLViewer panel sends PCL bytes to the PclRenderImage class that is in the .jar file of that name. - * PclRenderImage and its related classes parse the PCL bytes and then draws/renders the PCL image on a - * BufferedImage which OpenPCLViewer puts on the screen along with the JTree that has tree nodes for the - * possibly multi page PCL bytes. - * @author howard 9/20/06 - */ public PosSimpleJFrame(int pModeToRun) { mModeToRun = pModeToRun; @@ -104,18 +106,17 @@ // The above WindowListener.windowClosing() will be called setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); - // Uncomment the below code if you want to specify a specific LookAndFeel at program startup time - // instead of let the client's JVM (could be Macintosh or Unix for example) set it's default LookAndFeel -// try { -// UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); -// OR -// UIManager.setLookAndFeel("/* Any other full package path and LookAndFeel subclass */"); -// } catch (ClassNotFoundException e) {e.printStackTrace(); -// } catch (InstantiationException e) {e.printStackTrace(); -// } catch (IllegalAccessException e) {e.printStackTrace(); -// } catch (UnsupportedLookAndFeelException e) {e.printStackTrace(); -// } - + // Specify a specific LookAndFeel at program startup time instead of let the client's JVM set it's default LookAndFeel + // (could be Windows or Macintosh or Unix for example) + if ((OpenPCLViewer.sOsNameString).toUpperCase().contains("WIN")) { + try { + UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); + } catch (ClassNotFoundException e) {e.printStackTrace(); + } catch (InstantiationException e) {e.printStackTrace(); + } catch (IllegalAccessException e) {e.printStackTrace(); + } catch (UnsupportedLookAndFeelException e) {e.printStackTrace(); + } + } // Build the UI elements buildSimpleUI(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-21 20:22:38
|
Revision: 158 http://openpcl.svn.sourceforge.net/openpcl/?rev=158&view=rev Author: documentsystems Date: 2007-08-21 13:22:41 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Howard Hoagland. Changed 5 classes that are for showing the drop down JLists when the user clicks toolbar buttons for Print, Change the Look, Window layout and selection, Help About and License. The code changes set the PosToolbarDropdownItemRenderer on the JLists that to changes the background color on JLabels in JLists by which one the mouse is hovering over, which was set in PosHoverColorMouseMotionAdapter that was added to the JLists, so the user has visual confirmation of which item in the drop down will be seleced if clicked there. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/panels/PosChangeTheLookList.java openpcl/src/com/openpcl/viewer/panels/PosHelpChoicesList.java openpcl/src/com/openpcl/viewer/panels/PosPrintChoicesList.java openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java openpcl/src/com/openpcl/viewer/util/PosPickAppLook.java Modified: openpcl/src/com/openpcl/viewer/panels/PosChangeTheLookList.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosChangeTheLookList.java 2007-08-21 20:14:39 UTC (rev 157) +++ openpcl/src/com/openpcl/viewer/panels/PosChangeTheLookList.java 2007-08-21 20:22:41 UTC (rev 158) @@ -5,13 +5,17 @@ import java.awt.Dimension; import javax.swing.BorderFactory; +import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; +import javax.swing.SwingConstants; import javax.swing.event.ListSelectionListener; +import com.openpcl.viewer.util.PosHoverColorMouseMotionAdapter; import com.openpcl.viewer.util.PosPickAppLook; +import com.openpcl.viewer.util.PosToolbarDropdownItemRenderer; public class PosChangeTheLookList extends JPanel { private static final long serialVersionUID = 1L; @@ -28,9 +32,11 @@ private void buildUI() { mLookJList = new JList(mPickAppLook.getLookChoicesArray()); + mLookJList.setCellRenderer(new PosToolbarDropdownItemRenderer()); mLookJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); if (mListSelectionListener != null) {mLookJList.addListSelectionListener(mListSelectionListener);} - + mLookJList.addMouseMotionListener(new PosHoverColorMouseMotionAdapter(mLookJList)); + mJScrollPane = new JScrollPane(mLookJList); mJScrollPane.setBorder(BorderFactory.createLineBorder(Color.BLUE)); mJScrollPane.setPreferredSize(new Dimension(240, 116)); // was (250,200) using JGoodies Looks @@ -41,5 +47,14 @@ } public int getSelectedIndex() {return mLookJList.getSelectedIndex();} - public void unSelectRows() { mLookJList.clearSelection(); } + + public void unSelectRows() { + mLookJList.clearSelection(); + int tSize = mLookJList.getModel().getSize(); + for (int i = 0; i < tSize; i++) { + // Set vertical alignment of the JLabel in the JList to Center because Top is a doing double duty trick for changing + // the hover over background color in the PosToolbarDropdownItemRenderer + ((JLabel)mLookJList.getModel().getElementAt((i))).setVerticalAlignment(SwingConstants.CENTER); + } + } } Modified: openpcl/src/com/openpcl/viewer/panels/PosHelpChoicesList.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosHelpChoicesList.java 2007-08-21 20:14:39 UTC (rev 157) +++ openpcl/src/com/openpcl/viewer/panels/PosHelpChoicesList.java 2007-08-21 20:22:41 UTC (rev 158) @@ -14,29 +14,29 @@ import javax.swing.SwingConstants; import javax.swing.event.ListSelectionListener; +import com.openpcl.viewer.util.PosHoverColorMouseMotionAdapter; +import com.openpcl.viewer.util.PosToolbarDropdownItemRenderer; + public class PosHelpChoicesList extends JPanel { private static final long serialVersionUID = 1L; protected JList mHelpChoicesJList = null; protected JScrollPane mJScrollPane = null; protected ListSelectionListener mListSelectionListener = null; - protected Vector<String> mChoicesStrings = new Vector<String>(2); protected Vector<JLabel> mChoicesVector = new Vector<JLabel>(2); public PosHelpChoicesList(ListSelectionListener pListSelectionListener, String pAppName) { mListSelectionListener = pListSelectionListener; - mChoicesStrings.add("Show License Info"); - mChoicesStrings.add("About " + pAppName); + mChoicesVector.add(new JLabel("Show License Info", SwingConstants.LEFT)); + mChoicesVector.add(new JLabel("About " + pAppName, SwingConstants.LEFT)); buildUI(); } private void buildUI() { - for (String tEachString : mChoicesStrings) { - mChoicesVector.add(new JLabel(tEachString, SwingConstants.LEFT)); - } - - mHelpChoicesJList = new JList(mChoicesStrings); + mHelpChoicesJList = new JList(mChoicesVector); + mHelpChoicesJList.setCellRenderer(new PosToolbarDropdownItemRenderer()); mHelpChoicesJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); if (mListSelectionListener != null) {mHelpChoicesJList.addListSelectionListener(mListSelectionListener);} + mHelpChoicesJList.addMouseMotionListener(new PosHoverColorMouseMotionAdapter(mHelpChoicesJList)); mJScrollPane = new JScrollPane(); mJScrollPane.setBorder(BorderFactory.createLineBorder(Color.BLUE)); @@ -57,13 +57,21 @@ int tHeightOfItem = ((JLabel)(mChoicesVector.elementAt(0))).getPreferredSize().height + 2; setPreferredSize(new Dimension((tBorderAdjustment + tWidestPixelWidth), - tBorderAdjustment + (mChoicesStrings.size() * tHeightOfItem))); + tBorderAdjustment + (mChoicesVector.size() * tHeightOfItem))); setLayout(new BorderLayout()); add(mJScrollPane, BorderLayout.CENTER); } public int getSelectedIndex() { return mHelpChoicesJList.getSelectedIndex(); } - public void unSelectRows() { mHelpChoicesJList.clearSelection(); } + public void unSelectRows() { + mHelpChoicesJList.clearSelection(); + int tSize = mHelpChoicesJList.getModel().getSize(); + for (int i = 0; i < tSize; i++) { + // Set vertical alignment of the JLabel in the JList to Center because Top is a doing double duty trick for changing + // the hover over background color in the PosToolbarDropdownItemRenderer + ((JLabel)mHelpChoicesJList.getModel().getElementAt((i))).setVerticalAlignment(SwingConstants.CENTER); + } + } } Modified: openpcl/src/com/openpcl/viewer/panels/PosPrintChoicesList.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosPrintChoicesList.java 2007-08-21 20:14:39 UTC (rev 157) +++ openpcl/src/com/openpcl/viewer/panels/PosPrintChoicesList.java 2007-08-21 20:22:41 UTC (rev 158) @@ -3,30 +3,42 @@ import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; +import java.util.Vector; import javax.swing.BorderFactory; +import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; +import javax.swing.SwingConstants; import javax.swing.event.ListSelectionListener; +import com.openpcl.viewer.util.PosHoverColorMouseMotionAdapter; +import com.openpcl.viewer.util.PosToolbarDropdownItemRenderer; + public class PosPrintChoicesList extends JPanel { private static final long serialVersionUID = 1L; protected JList mPrintChoicesJList = null; protected JScrollPane mJScrollPane = null; protected ListSelectionListener mListSelectionListener = null; - protected String[] mPrintChoices = {"Print All", "Print Selected", "Print Remaining", "Print Changed"}; + protected Vector<JLabel> mPrintChoicesVector = new Vector<JLabel> (4); public PosPrintChoicesList(ListSelectionListener pListSelectionListener) { mListSelectionListener = pListSelectionListener; + mPrintChoicesVector.add(new JLabel("Print All", SwingConstants.LEFT)); + mPrintChoicesVector.add(new JLabel("Print Selected", SwingConstants.LEFT)); + mPrintChoicesVector.add(new JLabel("Print Remaining", SwingConstants.LEFT)); + mPrintChoicesVector.add(new JLabel("Print Changed", SwingConstants.LEFT)); buildUI(); } private void buildUI() { - mPrintChoicesJList = new JList(mPrintChoices); + mPrintChoicesJList = new JList(mPrintChoicesVector); + mPrintChoicesJList.setCellRenderer(new PosToolbarDropdownItemRenderer()); mPrintChoicesJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - if (mListSelectionListener != null) {mPrintChoicesJList.addListSelectionListener(mListSelectionListener);} + if (mListSelectionListener != null) { mPrintChoicesJList.addListSelectionListener(mListSelectionListener); } + mPrintChoicesJList.addMouseMotionListener(new PosHoverColorMouseMotionAdapter(mPrintChoicesJList)); mJScrollPane = new JScrollPane(mPrintChoicesJList); mJScrollPane.setBorder(BorderFactory.createLineBorder(Color.BLUE)); @@ -38,5 +50,13 @@ } public int getSelectedIndex() { return mPrintChoicesJList.getSelectedIndex(); } - public void unSelectRows() { mPrintChoicesJList.clearSelection(); } + public void unSelectRows() { + mPrintChoicesJList.clearSelection(); + int tSize = mPrintChoicesJList.getModel().getSize(); + for (int i = 0; i < tSize; i++) { + // Set vertical alignment of the JLabel in the JList to Center because Top is a doing double duty trick for changing + // the hover over background color in the PosToolbarDropdownItemRenderer + ((JLabel)mPrintChoicesJList.getModel().getElementAt((i))).setVerticalAlignment(SwingConstants.CENTER); + } + } } Modified: openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java =================================================================== --- openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java 2007-08-21 20:14:39 UTC (rev 157) +++ openpcl/src/com/openpcl/viewer/panels/PosWindowControlList.java 2007-08-21 20:22:41 UTC (rev 158) @@ -15,6 +15,7 @@ import javax.swing.SwingConstants; import javax.swing.event.ListSelectionListener; +import com.openpcl.viewer.util.PosHoverColorMouseMotionAdapter; import com.openpcl.viewer.util.PosReadImageIcon; import com.openpcl.viewer.util.PosToolbarDropdownItemRenderer; @@ -50,6 +51,7 @@ mBaseVector.add(new JLabel("Tile Horizontal", mTileHorizontalIcon, SwingConstants.LEFT)); mBaseVector.add(new JLabel("Tile Vertical", mTileVerticalIcon, SwingConstants.LEFT)); mBaseVector.add(new JLabel("Cascade", mCascadeIcon, SwingConstants.LEFT)); + mBaseVector.add(new JLabel("<html>___________</html>", null, SwingConstants.LEFT)); mJScrollPane = new JScrollPane(); mJScrollPane.setBorder(BorderFactory.createLineBorder(Color.BLUE)); setLayout(new BorderLayout()); @@ -58,13 +60,21 @@ } public Object getSelectedValue() { return mWindowControlJList.getSelectedValue(); } - public void unSelectRows() { mWindowControlJList.clearSelection(); } + public void unSelectRows() { + mWindowControlJList.clearSelection(); + for (int i = 0; i < 4; i++) { + // Set vertical alignment of the JLabel in the JList to Center because Top is a doing double duty trick for changing + // the hover over background color in the PosToolbarDropdownItemRenderer + ((JLabel)mWindowControlJList.getModel().getElementAt((i))).setVerticalAlignment(SwingConstants.CENTER); + } + } + public void putViewsInWindowDropdown(Vector<JLabel> pVector, int pCurrentViewNumber) { if (pVector == null || pVector.size() < 1) { - mChoicesVector = new Vector<JLabel>(3); + mChoicesVector = new Vector<JLabel>(4); } else { - mChoicesVector = new Vector<JLabel>(pVector.size() + 3); + mChoicesVector = new Vector<JLabel>(pVector.size() + 4); } // Add the Tile Horizontal, Tile Vertical, Cascade @@ -76,7 +86,7 @@ if (pCurrentViewNumber == getViewNumberFromString(eachJLabel.getText())) { eachJLabel.setIcon(mWindowSelectedIcon); // This view is the currently selected one, so make it's icon be a check mark } else { - eachJLabel.setIcon(mWindowUnselectedIcon); // Not the currently selected view, so make its icon be a little dot + eachJLabel.setIcon(mWindowUnselectedIcon); // Not the currently selected view, so make its icon be the unselected window } // Add this JLabel to see on the screen in the Window control dropdown @@ -98,6 +108,7 @@ if (mListSelectionListener != null) {mWindowControlJList.addListSelectionListener(mListSelectionListener);} mWindowControlJList.setCellRenderer(new PosToolbarDropdownItemRenderer()); mWindowControlJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + mWindowControlJList.addMouseMotionListener(new PosHoverColorMouseMotionAdapter(mWindowControlJList)); // Put the JList in the JScrollPane mJScrollPane.setViewportView(mWindowControlJList); @@ -116,7 +127,7 @@ /** Parse the String that looks like "View# 1. filename.ext" to the int which is the view number */ public int getViewNumberClicked() { int tRowClicked = mWindowControlJList.getSelectedIndex(); - if ( tRowClicked > 2) { + if ( tRowClicked > 3) { JLabel tSelectedJLabel = (JLabel)mWindowControlJList.getModel().getElementAt(tRowClicked); if (tSelectedJLabel != null) { String tSelectedRowString = tSelectedJLabel.getText(); Modified: openpcl/src/com/openpcl/viewer/util/PosPickAppLook.java =================================================================== --- openpcl/src/com/openpcl/viewer/util/PosPickAppLook.java 2007-08-21 20:14:39 UTC (rev 157) +++ openpcl/src/com/openpcl/viewer/util/PosPickAppLook.java 2007-08-21 20:22:41 UTC (rev 158) @@ -1,5 +1,6 @@ package com.openpcl.viewer.util; +import javax.swing.JLabel; import javax.swing.LookAndFeel; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; @@ -12,7 +13,7 @@ import com.openpcl.viewer.OpenPCLViewer; /** - * JComboBox choices for the user to change the LookAndFeel at run time while using the UI + * Choices for the user to change the LookAndFeel at run time while using the UI * @author howard 9/14/06 */ public class PosPickAppLook { @@ -23,13 +24,13 @@ // and added the below in place of the JGoodies Looks ExperienceBlue() private DefaultMetalTheme mMetalNonOceanTheme = new DefaultMetalTheme(); - private String[] mLookChoicesArray = { - "Look: Client JVM Startup Default", - "Look: Client Native System", - "Look: Windows XP (SunJava)", - "Look: Windows Classic (SunJava)", - "Look: Metal OceanTheme (Javax)", - "Look: Metal Non OceanTheme (Javax)" + private JLabel[] mLookChoicesArray = { + new JLabel("Look: Client JVM Startup Default"), + new JLabel("Look: Client Native System"), + new JLabel("Look: Windows XP (SunJava)"), + new JLabel("Look: Windows Classic (SunJava)"), + new JLabel("Look: Metal OceanTheme (Javax)"), + new JLabel("Look: Metal Non OceanTheme (Javax)") }; /* JGoodies Looks Commented out 11/17/06 HowardH. @@ -94,7 +95,7 @@ mLookArray[5] = null; // was 9 using JGoodies Looks } - public String[] getLookChoicesArray() { return mLookChoicesArray; } + public JLabel[] getLookChoicesArray() { return mLookChoicesArray; } public LookAndFeel[] getLookArray() { return mLookArray; } public void changeLookListSelection(int pItemIndex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-21 20:15:16
|
Revision: 157 http://openpcl.svn.sourceforge.net/openpcl/?rev=157&view=rev Author: documentsystems Date: 2007-08-21 13:14:39 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Howard Hoagland. Changed PosToolbarDropdownItemRenderer to change the background color on JLabels in JLists by which one the mouse is hovering over, which was set in PosHoverColorMouseMotionAdapter so the user has visual confirmation of which item in the drop down will be seleced if clicked there. Modified Paths: -------------- openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java Modified: openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java =================================================================== --- openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java 2007-08-21 20:09:04 UTC (rev 156) +++ openpcl/src/com/openpcl/viewer/util/PosToolbarDropdownItemRenderer.java 2007-08-21 20:14:39 UTC (rev 157) @@ -1,10 +1,13 @@ package com.openpcl.viewer.util; +import java.awt.Color; import java.awt.Component; import javax.swing.DefaultListCellRenderer; import javax.swing.JLabel; import javax.swing.JList; +import javax.swing.SwingConstants; +import javax.swing.UIManager; /** * Subclass of the DefaultListCellRenderer which is a subclass of JLabel. @@ -17,6 +20,8 @@ */ public class PosToolbarDropdownItemRenderer extends DefaultListCellRenderer { private static final long serialVersionUID = 1L; + private Color mBkgSelectionColor = null; + private Color mBkgNonSelectionColor = null; @Override public Component getListCellRendererComponent( @@ -24,11 +29,23 @@ super.getListCellRendererComponent(pList, pValue, pIndex, pIsSelected, pCellHasFocus); - + + // Need to get the color again every time because the user might have changed the Look and Feel from last time + mBkgSelectionColor = UIManager.getColor("List.selectionBackground"); + mBkgNonSelectionColor = UIManager.getColor("List.background"); + if (pValue instanceof JLabel) { JLabel tJLabel = (JLabel)pValue; setIcon(tJLabel.getIcon()); setText(tJLabel.getText()); + + if (tJLabel.getVerticalAlignment() == SwingConstants.TOP) { + // Setting the vertical alignment to TOP doesn't change the text placement when a JLabel is in a JList, but this + // is a trick to use something in a JLabel to know which JLabel in the JList the mouse is hovering over right now. + setBackground(mBkgSelectionColor); + } else { + setBackground(mBkgNonSelectionColor); + } } return this; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <doc...@us...> - 2007-08-21 20:09:16
|
Revision: 156 http://openpcl.svn.sourceforge.net/openpcl/?rev=156&view=rev Author: documentsystems Date: 2007-08-21 13:09:04 -0700 (Tue, 21 Aug 2007) Log Message: ----------- Howard Hoagland. Added new class PosHoverColorMouseMotionAdapter to set a value in the hovered over JLabel in the JList that causes the PosToolbarDropdownItemRenderer to set the background color as the user moves the mouse from one selection to another so the user has visual confirmation of which item in the drop down will be seleced if clicked there. Added Paths: ----------- openpcl/src/com/openpcl/viewer/util/PosHoverColorMouseMotionAdapter.java Added: openpcl/src/com/openpcl/viewer/util/PosHoverColorMouseMotionAdapter.java =================================================================== --- openpcl/src/com/openpcl/viewer/util/PosHoverColorMouseMotionAdapter.java (rev 0) +++ openpcl/src/com/openpcl/viewer/util/PosHoverColorMouseMotionAdapter.java 2007-08-21 20:09:04 UTC (rev 156) @@ -0,0 +1,65 @@ +package com.openpcl.viewer.util; + +import java.awt.Point; +import java.awt.event.MouseEvent; +import java.awt.event.MouseMotionAdapter; + +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.SwingConstants; + +/** + * Mouse motion adapter to set a value in the hovered over JLabel in the JList that causes the + * PosToolbarDropdownItemRenderer to set the background color as the user moves the mouse from one selection to another + * so the user has visual confirmation of which item in the drop down will be seleced if clicked there. + * + * @author DocMagic, Document Systems Inc, HowardH. 8/20/07 + */ +public class PosHoverColorMouseMotionAdapter extends MouseMotionAdapter { + private JList mJList = null; + private int mLastHoverIndex = -1; + private int mCurrentHoverIndex = -1; + private Object mHoverObject = null; + + public PosHoverColorMouseMotionAdapter(JList pJList) { + super(); + mJList = pJList; + } + + public void mouseMoved(MouseEvent pE) { + mCurrentHoverIndex = mJList.locationToIndex(new Point(pE.getX(), pE.getY())); + if (mCurrentHoverIndex < 0) { return; } + + if (mLastHoverIndex < 0 ) { + // Get the item in the JList that is being hovered over + mHoverObject = mJList.getModel().getElementAt(mCurrentHoverIndex); + if (mHoverObject instanceof JLabel) { + // Change the background to the current Look and Feel selection color + ((JLabel)mHoverObject).setVerticalAlignment(SwingConstants.TOP); + mJList.repaint(); + } + + // When Last was not set yet, make last same as current + mLastHoverIndex = mCurrentHoverIndex; + + } else if (mCurrentHoverIndex != mLastHoverIndex) { + // Get the item in the JList that was hovered over but isn't now + mHoverObject = mJList.getModel().getElementAt(mLastHoverIndex); + if (mHoverObject instanceof JLabel) { + // Change the background to the current Look and Feel non selection color + ((JLabel)mHoverObject).setVerticalAlignment(SwingConstants.CENTER); + } + + // Get the item in the JList that is being hovered over + mHoverObject = mJList.getModel().getElementAt(mCurrentHoverIndex); + if (mHoverObject instanceof JLabel) { + // Change the background to the current Look and Feel selection color + ((JLabel)mHoverObject).setVerticalAlignment(SwingConstants.TOP); + mJList.repaint(); + } + + // Make last same as current + mLastHoverIndex = mCurrentHoverIndex; + } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |