OmegaT の背景に画像を表示します。
デバッグ用のコードを削除
| @@ -101,9 +101,7 @@ | ||
| 101 | 101 | if ( file.isFile() ) { |
| 102 | 102 | String text = FileUtil.readTextFile(file); |
| 103 | 103 | String[] lines = RE_LINEBREAK.split(text); |
| 104 | - Log.log("---- Config lines start ----"); | |
| 105 | 104 | for (String line: lines) { |
| 106 | - Log.log("[" + line + "]"); | |
| 107 | 105 | if ( ! line.isEmpty() ) { |
| 108 | 106 | if (setOpacity(data, line) == true) { |
| 109 | 107 | // probably opacity value is changed from default |
| @@ -118,9 +116,7 @@ | ||
| 118 | 116 | } |
| 119 | 117 | } |
| 120 | 118 | } |
| 121 | - Log.log("---- Config lines end ----"); | |
| 122 | 119 | } else { |
| 123 | - Log.log("Config file '" + CONFIG_FILE_NAME + "' is not found."); | |
| 124 | 120 | } |
| 125 | 121 | } catch (Exception ex) { |
| 126 | 122 | Log.log(ex); |
| @@ -147,18 +143,14 @@ | ||
| 147 | 143 | Matcher matcher = RE_OPACITY.matcher(line); |
| 148 | 144 | if ( matcher.matches() ) { |
| 149 | 145 | String num = matcher.group(1); |
| 150 | - Log.log("new Opacity (String) = " + num + "%"); | |
| 151 | 146 | int i = Integer.parseInt(num); // in percent |
| 152 | 147 | if (i > MAX_OPACITY_IN_PERCENTAGE) { |
| 153 | - Log.log("value '" + line + "' is out of range for opacity."); | |
| 154 | 148 | data.opacity = MAX_OPACITY_IN_PERCENTAGE; |
| 155 | 149 | } else if (i < MIN_OPACITY_IN_PERCENTAGE) { |
| 156 | - Log.log("value '" + line + "' is out of range for opacity."); | |
| 157 | 150 | data.opacity = MIN_OPACITY_IN_PERCENTAGE; |
| 158 | 151 | } else { |
| 159 | 152 | float f = ((float) i / MAX_OPACITY_IN_PERCENTAGE); |
| 160 | 153 | data.opacity = f; |
| 161 | - Log.log("new Opacity (float) = " + f); | |
| 162 | 154 | } |
| 163 | 155 | return true; |
| 164 | 156 | } |
| @@ -176,7 +168,6 @@ | ||
| 176 | 168 | if ( matcher.matches() ) { |
| 177 | 169 | String num = matcher.group(1); |
| 178 | 170 | String unit = matcher.group(2).toLowerCase(); // s | m | h |
| 179 | - Log.log("new Interval (String) = " + num + unit); | |
| 180 | 171 | |
| 181 | 172 | long i = Long.parseLong(num); |
| 182 | 173 | if (unit.equals("s")) { |
| @@ -189,14 +180,11 @@ | ||
| 189 | 180 | |
| 190 | 181 | // validate range |
| 191 | 182 | if (i > MAX_INTERVAL) { |
| 192 | - Log.log("value '" + line + "' is out of range for interval."); | |
| 193 | 183 | data.interval = MAX_INTERVAL; |
| 194 | 184 | } else if (i < MIN_INTERVAL) { |
| 195 | - Log.log("value '" + line + "' is out of range for interval."); | |
| 196 | 185 | data.interval = MIN_INTERVAL; |
| 197 | 186 | } else { |
| 198 | 187 | data.interval = i; |
| 199 | - Log.log("new Interval (int) = " + i); | |
| 200 | 188 | } |
| 201 | 189 | return true; |
| 202 | 190 | } |
| @@ -213,7 +201,6 @@ | ||
| 213 | 201 | Matcher matcher = RE_SCRIPT.matcher(line); |
| 214 | 202 | if ( matcher.matches() ) { |
| 215 | 203 | data.script = line; |
| 216 | - Log.log("new script = " + line); | |
| 217 | 204 | return true; |
| 218 | 205 | } |
| 219 | 206 | return false; |
| @@ -256,7 +243,6 @@ | ||
| 256 | 243 | public boolean accept(File f) { |
| 257 | 244 | if (f.isFile()) { |
| 258 | 245 | String fileName = f.getName().toLowerCase(); |
| 259 | - Log.log("fileName is " + fileName); | |
| 260 | 246 | if (RE_HAS_IMAGE_EXTENSION.matcher(fileName).matches() || |
| 261 | 247 | RE_HAS_INTERNET_SHORTCUT_EXTENSION.matcher(fileName).matches()) { |
| 262 | 248 | return true; |
| @@ -306,7 +292,6 @@ | ||
| 306 | 292 | public boolean accept(File f) { |
| 307 | 293 | if (f.isFile()) { |
| 308 | 294 | String fileName = f.getName().toLowerCase(); |
| 309 | - Log.log("fileName is " + fileName); | |
| 310 | 295 | if (RE_SOURCE_IN_PLUGIN_DIR.matcher(fileName).matches()) { |
| 311 | 296 | return true; |
| 312 | 297 | } |
| @@ -316,7 +301,6 @@ | ||
| 316 | 301 | }); |
| 317 | 302 | for (File f: listFiles) { |
| 318 | 303 | String fileName = f.getName().toLowerCase(); |
| 319 | - Log.log("LowerCaseFileName:" + fileName); | |
| 320 | 304 | // image file |
| 321 | 305 | if (RE_HAS_IMAGE_EXTENSION.matcher(fileName).matches()) { |
| 322 | 306 | newSource.add(f); |
| @@ -323,7 +307,6 @@ | ||
| 323 | 307 | // internet shortcut |
| 324 | 308 | } else if (RE_HAS_INTERNET_SHORTCUT_EXTENSION.matcher(fileName).matches()) { |
| 325 | 309 | URL url = MoeUtil.getURL(f); |
| 326 | - Log.log(url == null ? "URL is NULL!!" : "URL is not null: " + url.toExternalForm()); | |
| 327 | 310 | if (url != null) { |
| 328 | 311 | newSource.add(url); |
| 329 | 312 | } |
| @@ -73,20 +73,6 @@ | ||
| 73 | 73 | } catch(Exception e) { |
| 74 | 74 | Log.log("Error raised at " + this.getClass().getCanonicalName() + ".onApplicationStartup()\n" + e); |
| 75 | 75 | } |
| 76 | - | |
| 77 | - | |
| 78 | - try { | |
| 79 | - // ちょっとテストしますよ。 | |
| 80 | - Log.log("NTP: " + StaticUtils.downloadFileToString("http://ntp-a1.nict.go.jp/cgi-bin/time")); | |
| 81 | - // Sun Jul 14 02:24:16 2013 JST | |
| 82 | - } catch (IOException ex) { | |
| 83 | - Logger.getLogger(Moenizer.class.getName()).log(Level.SEVERE, null, ex); | |
| 84 | - } | |
| 85 | - | |
| 86 | - | |
| 87 | - | |
| 88 | - | |
| 89 | - | |
| 90 | 76 | } |
| 91 | 77 | |
| 92 | 78 | @Override |
| @@ -35,7 +35,6 @@ | ||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | // default |
| 38 | - Log.log("DefaultImageLoader will use."); | |
| 39 | 38 | return new DefaultImageLoader(); |
| 40 | 39 | } |
| 41 | 40 |
| @@ -93,7 +93,6 @@ | ||
| 93 | 93 | */ |
| 94 | 94 | @Override |
| 95 | 95 | public BufferedImage getNextImage() { |
| 96 | - Log.log("getNextImage() called."); | |
| 97 | 96 | return image; |
| 98 | 97 | } |
| 99 | 98 |
| @@ -103,19 +102,15 @@ | ||
| 103 | 102 | */ |
| 104 | 103 | @Override |
| 105 | 104 | public void readyForNextImage() { |
| 106 | - Log.log("readyForNextImage() called."); | |
| 107 | 105 | //TODO use cache |
| 108 | 106 | image = null; |
| 109 | 107 | try { |
| 110 | 108 | if (currentSource != null) { |
| 111 | 109 | if (currentSource instanceof File) { |
| 112 | - Log.log("File = " + ((File) currentSource).getCanonicalPath()); | |
| 113 | 110 | image = ImageIO.read((File) currentSource); |
| 114 | 111 | } else if (currentSource instanceof URL) { |
| 115 | - Log.log("File = " + ((URL) currentSource).toExternalForm()); | |
| 116 | 112 | image = ImageIO.read((URL) currentSource); |
| 117 | 113 | } else { |
| 118 | - Log.log("Unknown source type:" + currentSource.getClass().getCanonicalName()); | |
| 119 | 114 | removeCurrentSource(); |
| 120 | 115 | } |
| 121 | 116 | } |
| @@ -140,7 +135,6 @@ | ||
| 140 | 135 | if (sourceIndex >= sources.length) { |
| 141 | 136 | sourceIndex = 0; |
| 142 | 137 | } |
| 143 | - Log.log("getCircularNextSource(): " + sources[sourceIndex].getClass().getCanonicalName()); | |
| 144 | 138 | return sources[sourceIndex]; |
| 145 | 139 | } |
| 146 | 140 |