joonsrenderer 1.1.3-java → 1.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.mvn/extensions.xml +1 -1
- data/.mvn/wrapper/maven-wrapper.properties +1 -0
- data/CHANGELOG.md +3 -1
- data/Rakefile +1 -1
- data/docs/Gemfile +2 -0
- data/docs/_config.yml +3 -0
- data/docs/_includes/header.html +1 -1
- data/docs/_includes/top.html +11 -0
- data/docs/_layouts/default.html +6 -15
- data/docs/about.md +2 -2
- data/joonsrenderer.gemspec +2 -2
- data/lib/joonsrenderer/version.rb +1 -1
- data/pom.rb +4 -4
- data/pom.xml +7 -7
- data/src/{test/java/a_maintest.java → a_maintest.java} +1 -1
- data/src/main/java/SunflowGUI.java +294 -352
- data/src/main/java/org/sunflow/AsciiFileSunflowAPI.java +1 -1
- data/src/main/java/org/sunflow/BinaryFileSunflowAPI.java +1 -1
- data/src/main/java/org/sunflow/SunflowAPI.java +2 -2
- data/src/main/java/org/sunflow/core/GIEngine.java +3 -1
- data/src/main/java/org/sunflow/core/ImageSampler.java +3 -0
- data/src/main/java/org/sunflow/core/InstanceList.java +1 -1
- data/src/main/java/org/sunflow/core/IntersectionState.java +7 -6
- data/src/main/java/org/sunflow/core/ParameterList.java +3 -2
- data/src/main/java/org/sunflow/core/PhotonStore.java +1 -0
- data/src/main/java/org/sunflow/core/Ray.java +4 -3
- data/src/main/java/org/sunflow/core/TextureCache.java +1 -1
- data/src/main/java/org/sunflow/core/accel/BoundingIntervalHierarchy.java +1 -1
- data/src/main/java/org/sunflow/core/photonmap/CausticPhotonMap.java +1 -1
- data/src/main/java/org/sunflow/core/renderer/BucketRenderer.java +3 -1
- data/src/main/java/org/sunflow/image/writers/EXRBitmapWriter.java +28 -19
- data/src/main/java/org/sunflow/image/writers/PNGBitmapWriter.java +5 -0
- data/src/main/java/org/sunflow/image/writers/TGABitmapWriter.java +20 -14
- data/src/main/java/org/sunflow/system/BenchmarkFramework.java +2 -2
- data/src/main/java/org/sunflow/system/RenderGlobalsPanel.java +5 -4
- metadata +9 -8
- data/docs/_includes/head.html +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1fa93288f40b9e667b896153787865cb7c0a0ab0356faa569e908be45da6b9a3
|
4
|
+
data.tar.gz: c73a86087de0ff6aa767225ef9298add60cd978e4a41316ba71716decd9569c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c9bf9c4250a95ccc8c1b98a6705040c09e4c7978195b28c5e0f8693cd0f75784c2f48b28eacbf18c33bb05488c59aba0ddfeb81e89304545c4ef4313ec7abb1
|
7
|
+
data.tar.gz: 41d514fd0c33a784b04001240a93726b4503b595774141bf8822c54889a95f0514de594509b81142263c3bac974523a766f554a1911a76daab11110f6b99dd07
|
data/.mvn/extensions.xml
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.6.0/apache-maven-3.6.0-bin.zip
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
**v1.
|
1
|
+
**v1.2.0** Bump for janino-3.0.12, plus some refactoring
|
2
|
+
|
3
|
+
**v1.1.3** Bump for processing-3.3.4
|
2
4
|
|
3
5
|
**v1.1.2** Use sunflow.util.FloatList and IntList, netbeans profiling suggest it is worth doing (there is a vanilla processing alternative, with a different interface)
|
4
6
|
|
data/Rakefile
CHANGED
data/docs/Gemfile
ADDED
data/docs/_config.yml
CHANGED
data/docs/_includes/header.html
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html lang="en-US">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<meta name="generator" content="Jekyll v{{ jekyll.version }}">
|
7
|
+
{% feed_meta %}
|
8
|
+
<link rel="stylesheet" href="/css/main.css">
|
9
|
+
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
10
|
+
{% seo %}
|
11
|
+
</head>
|
data/docs/_layouts/default.html
CHANGED
@@ -1,20 +1,11 @@
|
|
1
|
-
|
2
|
-
<html>
|
1
|
+
{% include top.html %}
|
3
2
|
|
4
|
-
|
3
|
+
<body class="wrap">
|
4
|
+
{% include header.html %}
|
5
5
|
|
6
|
-
|
6
|
+
{{ content }}
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
<div class="page-content">
|
11
|
-
<div class="wrapper">
|
12
|
-
{{ content }}
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
|
16
|
-
{% include footer.html %}
|
17
|
-
|
18
|
-
</body>
|
8
|
+
{% include footer.html %}
|
19
9
|
|
10
|
+
</body>
|
20
11
|
</html>
|
data/docs/about.md
CHANGED
@@ -3,9 +3,9 @@ layout: page
|
|
3
3
|
title: About
|
4
4
|
permalink: /about/
|
5
5
|
---
|
6
|
-
JoonsRenderer is a library for Processing by [Joon Hyub Lee][joonhyublee]. It includes the sunflow java raytracer by [Christopher Kulla][fpsunflower], and the necessary janino compiler by [Arno Unkrig][Arno]. In this gem the JoonsLibrary and sunflower libraries are re-compiled (by Martin Prout) for java-8 and to use janino-3.0.
|
6
|
+
JoonsRenderer is a library for Processing by [Joon Hyub Lee][joonhyublee]. It includes the sunflow java raytracer by [Christopher Kulla][fpsunflower], and the necessary janino compiler by [Arno Unkrig][Arno]. In this gem the JoonsLibrary and sunflower libraries are re-compiled (by Martin Prout) for java-8 and to use janino-3.0.12 The gem is designed to be used with [JRubyArt][jruby_art] or [propane][propane], all you need to do is `require 'joonsrenderer'` and `include_package 'joons'` to use the library.
|
7
7
|
|
8
|
-
[joonhyublee]:https://joonhyublee/joons-renderer/wiki
|
8
|
+
[joonhyublee]:https://github.com/joonhyublee/joons-renderer/wiki
|
9
9
|
[fpsunflower]:https://github.com/fpsunflower/sunflow
|
10
10
|
[Arno]:http://janino-compiler.github.io/janino/
|
11
11
|
[propane]:https://ruby-processing.github.io/propane/
|
data/joonsrenderer.gemspec
CHANGED
@@ -14,8 +14,8 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.homepage = 'https://ruby-processing.github.io/joonsrenderer/'
|
15
15
|
gem.files = `git ls-files`.split($/)
|
16
16
|
gem.files << 'lib/joonsrenderer.jar'
|
17
|
-
gem.files << 'lib/janino-3.0.
|
18
|
-
gem.files << 'lib/commons-compiler-3.0.
|
17
|
+
gem.files << 'lib/janino-3.0.12.jar'
|
18
|
+
gem.files << 'lib/commons-compiler-3.0.12.jar'
|
19
19
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
20
20
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
21
21
|
gem.require_paths = ['lib']
|
data/pom.rb
CHANGED
@@ -2,7 +2,7 @@ require 'fileutils'
|
|
2
2
|
project 'joonsrenderer' do
|
3
3
|
|
4
4
|
model_version '4.0.0'
|
5
|
-
id 'joons:joonsrenderer:1.
|
5
|
+
id 'joons:joonsrenderer:1.2.0'
|
6
6
|
packaging 'jar'
|
7
7
|
description 'joonsrenderer for propane and JRubyArt'
|
8
8
|
organization 'ruby-processing', 'https://ruby-processing.github.io'
|
@@ -21,9 +21,9 @@ project 'joonsrenderer' do
|
|
21
21
|
'maven.compiler.source' => '1.8',
|
22
22
|
'project.build.sourceEncoding' => 'utf-8',
|
23
23
|
'maven.compiler.target' => '1.8',
|
24
|
-
'janino.version' => '3.0.
|
24
|
+
'janino.version' => '3.0.12',
|
25
25
|
'jogl.version' => '2.3.2',
|
26
|
-
'processing.version' => '3.3.
|
26
|
+
'processing.version' => '3.3.7'
|
27
27
|
)
|
28
28
|
|
29
29
|
jar 'org.processing:core:${processing.version}'
|
@@ -53,7 +53,7 @@ project 'joonsrenderer' do
|
|
53
53
|
)
|
54
54
|
end
|
55
55
|
|
56
|
-
plugin( :compiler, '3.
|
56
|
+
plugin( :compiler, '3.8.0',
|
57
57
|
source: '${maven.compiler.source}',
|
58
58
|
target: '${maven.compiler.target}'
|
59
59
|
)
|
data/pom.xml
CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
11
11
|
<modelVersion>4.0.0</modelVersion>
|
12
12
|
<groupId>joons</groupId>
|
13
13
|
<artifactId>joonsrenderer</artifactId>
|
14
|
-
<version>1.
|
14
|
+
<version>1.2.0</version>
|
15
15
|
<name>joonsrenderer</name>
|
16
16
|
<description>joonsrenderer for propane and JRubyArt</description>
|
17
17
|
<organization>
|
@@ -59,15 +59,15 @@ DO NOT MODIFIY - GENERATED CODE
|
|
59
59
|
<url>https://github.com/monkstone/joonsrenderer/issues</url>
|
60
60
|
</issueManagement>
|
61
61
|
<properties>
|
62
|
+
<janino.version>3.0.12</janino.version>
|
62
63
|
<jogl.version>2.3.2</jogl.version>
|
63
|
-
<source.directory>src</source.directory>
|
64
64
|
<joonsrenderer.basedir>${project.basedir}</joonsrenderer.basedir>
|
65
|
+
<maven.compiler.source>1.8</maven.compiler.source>
|
65
66
|
<maven.compiler.target>1.8</maven.compiler.target>
|
66
|
-
<processing.version>3.3.4</processing.version>
|
67
|
-
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
68
|
-
<janino.version>3.0.6</janino.version>
|
69
67
|
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
|
70
|
-
<
|
68
|
+
<processing.version>3.3.7</processing.version>
|
69
|
+
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
|
70
|
+
<source.directory>src</source.directory>
|
71
71
|
</properties>
|
72
72
|
<dependencies>
|
73
73
|
<dependency>
|
@@ -135,7 +135,7 @@ DO NOT MODIFIY - GENERATED CODE
|
|
135
135
|
</plugin>
|
136
136
|
<plugin>
|
137
137
|
<artifactId>maven-compiler-plugin</artifactId>
|
138
|
-
<version>3.
|
138
|
+
<version>3.8.0</version>
|
139
139
|
<configuration>
|
140
140
|
<source>${maven.compiler.source}</source>
|
141
141
|
<target>${maven.compiler.target}</target>
|
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
1
|
import java.awt.BorderLayout;
|
3
2
|
import java.awt.Dimension;
|
4
3
|
import java.awt.FlowLayout;
|
5
4
|
import java.awt.Toolkit;
|
6
5
|
import java.awt.datatransfer.DataFlavor;
|
7
6
|
import java.awt.datatransfer.Transferable;
|
7
|
+
import java.awt.datatransfer.UnsupportedFlavorException;
|
8
8
|
import java.awt.event.ActionEvent;
|
9
|
-
import java.awt.event.ActionListener;
|
10
9
|
import java.beans.PropertyVetoException;
|
11
10
|
import java.io.BufferedReader;
|
12
11
|
import java.io.File;
|
@@ -40,6 +39,7 @@ import javax.swing.SwingUtilities;
|
|
40
39
|
import javax.swing.TransferHandler;
|
41
40
|
import javax.swing.UIManager;
|
42
41
|
import javax.swing.UIManager.LookAndFeelInfo;
|
42
|
+
import javax.swing.UnsupportedLookAndFeelException;
|
43
43
|
import javax.swing.filechooser.FileFilter;
|
44
44
|
import javax.swing.plaf.metal.DefaultMetalTheme;
|
45
45
|
import javax.swing.plaf.metal.MetalLookAndFeel;
|
@@ -198,196 +198,216 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
198
198
|
String translateFilename = null;
|
199
199
|
int frameStart = 1, frameStop = 1;
|
200
200
|
while (i < args.length) {
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
} else if (args[i].equals("-frame")) {
|
359
|
-
if (i > args.length - 2) {
|
360
|
-
usage(false);
|
361
|
-
}
|
362
|
-
frameStart = frameStop = Integer.parseInt(args[i + 1]);
|
363
|
-
i += 2;
|
364
|
-
} else if (args[i].equals("-anim")) {
|
365
|
-
if (i > args.length - 3) {
|
366
|
-
usage(false);
|
367
|
-
}
|
368
|
-
frameStart = Integer.parseInt(args[i + 1]);
|
369
|
-
frameStop = Integer.parseInt(args[i + 2]);
|
370
|
-
i += 3;
|
371
|
-
} else if (args[i].equals("-v")) {
|
372
|
-
if (i > args.length - 2) {
|
373
|
-
usage(false);
|
374
|
-
}
|
375
|
-
UI.verbosity(Integer.parseInt(args[i + 1]));
|
376
|
-
i += 2;
|
377
|
-
} else if (args[i].equals("-translate")) {
|
378
|
-
if (i > args.length - 2) {
|
379
|
-
usage(false);
|
380
|
-
}
|
381
|
-
translateFilename = args[i + 1];
|
382
|
-
i += 2;
|
383
|
-
} else if (args[i].equals("-h") || args[i].equals("-help")) {
|
384
|
-
usage(true);
|
385
|
-
} else {
|
386
|
-
if (input != null) {
|
387
|
-
usage(false);
|
201
|
+
switch (args[i]) {
|
202
|
+
case "-o":
|
203
|
+
if (i > args.length - 2) {
|
204
|
+
usage(false);
|
205
|
+
} filename = args[i + 1];
|
206
|
+
i += 2;
|
207
|
+
break;
|
208
|
+
case "-nogui":
|
209
|
+
showFrame = false;
|
210
|
+
i++;
|
211
|
+
break;
|
212
|
+
case "-ipr":
|
213
|
+
sampler = "ipr";
|
214
|
+
i++;
|
215
|
+
break;
|
216
|
+
case "-threads":
|
217
|
+
if (i > args.length - 2) {
|
218
|
+
usage(false);
|
219
|
+
} threads = Integer.parseInt(args[i + 1]);
|
220
|
+
i += 2;
|
221
|
+
break;
|
222
|
+
case "-lopri":
|
223
|
+
lowPriority = true;
|
224
|
+
i++;
|
225
|
+
break;
|
226
|
+
case "-hipri":
|
227
|
+
lowPriority = false;
|
228
|
+
i++;
|
229
|
+
break;
|
230
|
+
case "-sampler":
|
231
|
+
if (i > args.length - 2) {
|
232
|
+
usage(false);
|
233
|
+
} sampler = args[i + 1];
|
234
|
+
i += 2;
|
235
|
+
break;
|
236
|
+
case "-smallmesh":
|
237
|
+
TriangleMesh.setSmallTriangles(true);
|
238
|
+
i++;
|
239
|
+
break;
|
240
|
+
case "-dumpkd":
|
241
|
+
KDTree.setDumpMode(true, "kdtree");
|
242
|
+
i++;
|
243
|
+
break;
|
244
|
+
case "-buildonly":
|
245
|
+
noRender = true;
|
246
|
+
i++;
|
247
|
+
break;
|
248
|
+
case "-showaa":
|
249
|
+
showAA = true;
|
250
|
+
i++;
|
251
|
+
break;
|
252
|
+
case "-nogi":
|
253
|
+
noGI = true;
|
254
|
+
i++;
|
255
|
+
break;
|
256
|
+
case "-nocaustics":
|
257
|
+
noCaustics = true;
|
258
|
+
i++;
|
259
|
+
break;
|
260
|
+
case "-pathgi":
|
261
|
+
if (i > args.length - 2) {
|
262
|
+
usage(false);
|
263
|
+
} pathGI = Integer.parseInt(args[i + 1]);
|
264
|
+
i += 2;
|
265
|
+
break;
|
266
|
+
case "-quick_ambocc":
|
267
|
+
if (i > args.length - 2) {
|
268
|
+
usage(false);
|
269
|
+
} maxDist = Float.parseFloat(args[i + 1]);
|
270
|
+
shaderOverride = "ambient_occlusion"; // new
|
271
|
+
// AmbientOcclusionShader(Color.WHITE,
|
272
|
+
// d);
|
273
|
+
i += 2;
|
274
|
+
break;
|
275
|
+
case "-quick_uvs":
|
276
|
+
if (i > args.length - 1) {
|
277
|
+
usage(false);
|
278
|
+
} shaderOverride = "show_uvs";
|
279
|
+
i++;
|
280
|
+
break;
|
281
|
+
case "-quick_normals":
|
282
|
+
if (i > args.length - 1) {
|
283
|
+
usage(false);
|
284
|
+
} shaderOverride = "show_normals";
|
285
|
+
i++;
|
286
|
+
break;
|
287
|
+
case "-quick_id":
|
288
|
+
if (i > args.length - 1) {
|
289
|
+
usage(false);
|
290
|
+
} shaderOverride = "show_instance_id";
|
291
|
+
i++;
|
292
|
+
break;
|
293
|
+
case "-quick_prims":
|
294
|
+
if (i > args.length - 1) {
|
295
|
+
usage(false);
|
296
|
+
} shaderOverride = "show_primitive_id";
|
297
|
+
i++;
|
298
|
+
break;
|
299
|
+
case "-quick_gray":
|
300
|
+
if (i > args.length - 1) {
|
301
|
+
usage(false);
|
302
|
+
} shaderOverride = "quick_gray";
|
303
|
+
i++;
|
304
|
+
break;
|
305
|
+
case "-quick_wire":
|
306
|
+
if (i > args.length - 1) {
|
307
|
+
usage(false);
|
308
|
+
} shaderOverride = "wireframe";
|
309
|
+
i++;
|
310
|
+
break;
|
311
|
+
case "-resolution":
|
312
|
+
if (i > args.length - 3) {
|
313
|
+
usage(false);
|
314
|
+
} resolutionW = Integer.parseInt(args[i + 1]);
|
315
|
+
resolutionH = Integer.parseInt(args[i + 2]);
|
316
|
+
i += 3;
|
317
|
+
break;
|
318
|
+
case "-aa":
|
319
|
+
if (i > args.length - 3) {
|
320
|
+
usage(false);
|
321
|
+
} aaMin = Integer.parseInt(args[i + 1]);
|
322
|
+
aaMax = Integer.parseInt(args[i + 2]);
|
323
|
+
i += 3;
|
324
|
+
break;
|
325
|
+
case "-samples":
|
326
|
+
if (i > args.length - 2) {
|
327
|
+
usage(false);
|
328
|
+
} samples = Integer.parseInt(args[i + 1]);
|
329
|
+
i += 2;
|
330
|
+
break;
|
331
|
+
case "-bucket":
|
332
|
+
if (i > args.length - 3) {
|
333
|
+
usage(false);
|
334
|
+
} bucketSize = Integer.parseInt(args[i + 1]);
|
335
|
+
bucketOrder = args[i + 2];
|
336
|
+
i += 3;
|
337
|
+
break;
|
338
|
+
case "-bake":
|
339
|
+
if (i > args.length - 2) {
|
340
|
+
usage(false);
|
341
|
+
} bakingName = args[i + 1];
|
342
|
+
i += 2;
|
343
|
+
break;
|
344
|
+
case "-bakedir":
|
345
|
+
if (i > args.length - 2) {
|
346
|
+
usage(false);
|
347
|
+
} String baketype = args[i + 1];
|
348
|
+
switch (baketype) {
|
349
|
+
case "view":
|
350
|
+
bakeViewdep = true;
|
351
|
+
break;
|
352
|
+
case "ortho":
|
353
|
+
bakeViewdep = false;
|
354
|
+
break;
|
355
|
+
default:
|
356
|
+
usage(false);
|
357
|
+
break;
|
388
358
|
}
|
389
|
-
|
390
|
-
|
359
|
+
i += 2;
|
360
|
+
break;
|
361
|
+
|
362
|
+
case "-filter":
|
363
|
+
if (i > args.length - 2) {
|
364
|
+
usage(false);
|
365
|
+
} filterType = args[i + 1];
|
366
|
+
i += 2;
|
367
|
+
break;
|
368
|
+
case "-bench":
|
369
|
+
runBenchmark = true;
|
370
|
+
i++;
|
371
|
+
break;
|
372
|
+
case "-rtbench":
|
373
|
+
runRTBenchmark = true;
|
374
|
+
i++;
|
375
|
+
break;
|
376
|
+
case "-frame":
|
377
|
+
if (i > args.length - 2) {
|
378
|
+
usage(false);
|
379
|
+
} frameStart = frameStop = Integer.parseInt(args[i + 1]);
|
380
|
+
i += 2;
|
381
|
+
break;
|
382
|
+
case "-anim":
|
383
|
+
if (i > args.length - 3) {
|
384
|
+
usage(false);
|
385
|
+
} frameStart = Integer.parseInt(args[i + 1]);
|
386
|
+
frameStop = Integer.parseInt(args[i + 2]);
|
387
|
+
i += 3;
|
388
|
+
break;
|
389
|
+
case "-v":
|
390
|
+
if (i > args.length - 2) {
|
391
|
+
usage(false);
|
392
|
+
} UI.verbosity(Integer.parseInt(args[i + 1]));
|
393
|
+
i += 2;
|
394
|
+
break;
|
395
|
+
case "-translate":
|
396
|
+
if (i > args.length - 2) {
|
397
|
+
usage(false);
|
398
|
+
} translateFilename = args[i + 1];
|
399
|
+
i += 2;
|
400
|
+
break;
|
401
|
+
case "-h":
|
402
|
+
case "-help":
|
403
|
+
usage(true);
|
404
|
+
break;
|
405
|
+
default:
|
406
|
+
if (input != null) {
|
407
|
+
usage(false);
|
408
|
+
} input = args[i];
|
409
|
+
i++;
|
410
|
+
break;
|
391
411
|
}
|
392
412
|
}
|
393
413
|
if (runBenchmark) {
|
@@ -495,7 +515,7 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
495
515
|
break;
|
496
516
|
}
|
497
517
|
}
|
498
|
-
} catch (
|
518
|
+
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException | UnsupportedLookAndFeelException e) {
|
499
519
|
// If Nimbus is not available, you can set the GUI to another look and feel.
|
500
520
|
MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
|
501
521
|
}
|
@@ -548,22 +568,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
548
568
|
renderButton = new JButton();
|
549
569
|
jPanel1.add(renderButton);
|
550
570
|
renderButton.setText("Render");
|
551
|
-
renderButton.addActionListener(
|
552
|
-
|
553
|
-
public void actionPerformed(ActionEvent evt) {
|
554
|
-
renderMenuItemActionPerformed(evt);
|
555
|
-
}
|
571
|
+
renderButton.addActionListener((ActionEvent evt) -> {
|
572
|
+
renderMenuItemActionPerformed(evt);
|
556
573
|
});
|
557
574
|
}
|
558
575
|
{
|
559
576
|
iprButton = new JButton();
|
560
577
|
jPanel1.add(iprButton);
|
561
578
|
iprButton.setText("IPR");
|
562
|
-
iprButton.addActionListener(
|
563
|
-
|
564
|
-
public void actionPerformed(ActionEvent evt) {
|
565
|
-
iprMenuItemActionPerformed(evt);
|
566
|
-
}
|
579
|
+
iprButton.addActionListener((ActionEvent evt) -> {
|
580
|
+
iprMenuItemActionPerformed(evt);
|
567
581
|
});
|
568
582
|
}
|
569
583
|
}
|
@@ -608,11 +622,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
608
622
|
buildButton = new JButton();
|
609
623
|
jPanel3.add(buildButton);
|
610
624
|
buildButton.setText("Build Scene");
|
611
|
-
buildButton.addActionListener(
|
612
|
-
|
613
|
-
public void actionPerformed(ActionEvent evt) {
|
614
|
-
buildMenuItemActionPerformed(evt);
|
615
|
-
}
|
625
|
+
buildButton.addActionListener((ActionEvent evt) -> {
|
626
|
+
buildMenuItemActionPerformed(evt);
|
616
627
|
});
|
617
628
|
}
|
618
629
|
}
|
@@ -669,22 +680,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
669
680
|
jPanel5.add(taskCancelButton);
|
670
681
|
taskCancelButton.setText("Cancel");
|
671
682
|
taskCancelButton.setEnabled(false);
|
672
|
-
taskCancelButton.addActionListener(
|
673
|
-
|
674
|
-
public void actionPerformed(ActionEvent evt) {
|
675
|
-
UI.taskCancel();
|
676
|
-
}
|
683
|
+
taskCancelButton.addActionListener((ActionEvent evt) -> {
|
684
|
+
UI.taskCancel();
|
677
685
|
});
|
678
686
|
}
|
679
687
|
{
|
680
688
|
clearConsoleButton = new JButton();
|
681
689
|
jPanel5.add(clearConsoleButton);
|
682
690
|
clearConsoleButton.setText("Clear");
|
683
|
-
clearConsoleButton.addActionListener(
|
684
|
-
|
685
|
-
public void actionPerformed(ActionEvent evt) {
|
686
|
-
clearConsole();
|
687
|
-
}
|
691
|
+
clearConsoleButton.addActionListener((ActionEvent evt) -> {
|
692
|
+
clearConsole();
|
688
693
|
});
|
689
694
|
}
|
690
695
|
}
|
@@ -705,11 +710,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
705
710
|
fileMenu.add(newFileMenuItem);
|
706
711
|
newFileMenuItem.setText("New");
|
707
712
|
newFileMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl N"));
|
708
|
-
newFileMenuItem.addActionListener(
|
709
|
-
|
710
|
-
public void actionPerformed(ActionEvent evt) {
|
711
|
-
newFileMenuItemActionPerformed(evt);
|
712
|
-
}
|
713
|
+
newFileMenuItem.addActionListener((ActionEvent evt) -> {
|
714
|
+
newFileMenuItemActionPerformed(evt);
|
713
715
|
});
|
714
716
|
}
|
715
717
|
{
|
@@ -717,11 +719,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
717
719
|
fileMenu.add(openFileMenuItem);
|
718
720
|
openFileMenuItem.setText("Open ...");
|
719
721
|
openFileMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl O"));
|
720
|
-
openFileMenuItem.addActionListener(
|
721
|
-
|
722
|
-
public void actionPerformed(ActionEvent evt) {
|
723
|
-
openFileMenuItemActionPerformed(evt);
|
724
|
-
}
|
722
|
+
openFileMenuItem.addActionListener((ActionEvent evt) -> {
|
723
|
+
openFileMenuItemActionPerformed(evt);
|
725
724
|
});
|
726
725
|
}
|
727
726
|
{
|
@@ -729,22 +728,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
729
728
|
fileMenu.add(saveMenuItem);
|
730
729
|
saveMenuItem.setText("Save");
|
731
730
|
saveMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl S"));
|
732
|
-
saveMenuItem.addActionListener(
|
733
|
-
|
734
|
-
public void actionPerformed(ActionEvent evt) {
|
735
|
-
saveCurrentFile(currentFile);
|
736
|
-
}
|
731
|
+
saveMenuItem.addActionListener((ActionEvent evt) -> {
|
732
|
+
saveCurrentFile(currentFile);
|
737
733
|
});
|
738
734
|
}
|
739
735
|
{
|
740
736
|
saveAsMenuItem = new JMenuItem();
|
741
737
|
fileMenu.add(saveAsMenuItem);
|
742
738
|
saveAsMenuItem.setText("Save As ...");
|
743
|
-
saveAsMenuItem.addActionListener(
|
744
|
-
|
745
|
-
public void actionPerformed(ActionEvent evt) {
|
746
|
-
saveAsMenuItemActionPerformed(evt);
|
747
|
-
}
|
739
|
+
saveAsMenuItem.addActionListener((ActionEvent evt) -> {
|
740
|
+
saveAsMenuItemActionPerformed(evt);
|
748
741
|
});
|
749
742
|
}
|
750
743
|
{
|
@@ -755,11 +748,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
755
748
|
exitMenuItem = new JMenuItem();
|
756
749
|
fileMenu.add(exitMenuItem);
|
757
750
|
exitMenuItem.setText("Exit");
|
758
|
-
exitMenuItem.addActionListener(
|
759
|
-
|
760
|
-
public void actionPerformed(ActionEvent evt) {
|
761
|
-
System.exit(0);
|
762
|
-
}
|
751
|
+
exitMenuItem.addActionListener((ActionEvent evt) -> {
|
752
|
+
System.exit(0);
|
763
753
|
});
|
764
754
|
}
|
765
755
|
}
|
@@ -772,12 +762,9 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
772
762
|
sceneMenu.add(buildMenuItem);
|
773
763
|
buildMenuItem.setText("Build");
|
774
764
|
buildMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl B"));
|
775
|
-
buildMenuItem.addActionListener(
|
776
|
-
|
777
|
-
|
778
|
-
if (sceneMenu.isEnabled()) {
|
779
|
-
buildMenuItemActionPerformed(evt);
|
780
|
-
}
|
765
|
+
buildMenuItem.addActionListener((ActionEvent evt) -> {
|
766
|
+
if (sceneMenu.isEnabled()) {
|
767
|
+
buildMenuItemActionPerformed(evt);
|
781
768
|
}
|
782
769
|
});
|
783
770
|
}
|
@@ -795,22 +782,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
795
782
|
renderMenuItem = new JMenuItem();
|
796
783
|
sceneMenu.add(renderMenuItem);
|
797
784
|
renderMenuItem.setText("Render");
|
798
|
-
renderMenuItem.addActionListener(
|
799
|
-
|
800
|
-
public void actionPerformed(ActionEvent evt) {
|
801
|
-
renderMenuItemActionPerformed(evt);
|
802
|
-
}
|
785
|
+
renderMenuItem.addActionListener((ActionEvent evt) -> {
|
786
|
+
renderMenuItemActionPerformed(evt);
|
803
787
|
});
|
804
788
|
}
|
805
789
|
{
|
806
790
|
iprMenuItem = new JMenuItem();
|
807
791
|
sceneMenu.add(iprMenuItem);
|
808
792
|
iprMenuItem.setText("IPR");
|
809
|
-
iprMenuItem.addActionListener(
|
810
|
-
|
811
|
-
public void actionPerformed(ActionEvent evt) {
|
812
|
-
iprMenuItemActionPerformed(evt);
|
813
|
-
}
|
793
|
+
iprMenuItem.addActionListener((ActionEvent evt) -> {
|
794
|
+
iprMenuItemActionPerformed(evt);
|
814
795
|
});
|
815
796
|
}
|
816
797
|
{
|
@@ -828,11 +809,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
828
809
|
textureCacheClearMenuItem = new JMenuItem();
|
829
810
|
sceneMenu.add(textureCacheClearMenuItem);
|
830
811
|
textureCacheClearMenuItem.setText("Clear Texture Cache");
|
831
|
-
textureCacheClearMenuItem.addActionListener(
|
832
|
-
|
833
|
-
public void actionPerformed(ActionEvent evt) {
|
834
|
-
textureCacheClearMenuItemActionPerformed(evt);
|
835
|
-
}
|
812
|
+
textureCacheClearMenuItem.addActionListener((ActionEvent evt) -> {
|
813
|
+
textureCacheClearMenuItemActionPerformed(evt);
|
836
814
|
});
|
837
815
|
}
|
838
816
|
{
|
@@ -840,11 +818,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
840
818
|
sceneMenu.add(smallTrianglesMenuItem);
|
841
819
|
smallTrianglesMenuItem.setText("Low Mem Triangles");
|
842
820
|
smallTrianglesMenuItem.setToolTipText("Load future meshes using a low memory footprint triangle representation");
|
843
|
-
smallTrianglesMenuItem.addActionListener(
|
844
|
-
|
845
|
-
public void actionPerformed(ActionEvent evt) {
|
846
|
-
smallTrianglesMenuItemActionPerformed(evt);
|
847
|
-
}
|
821
|
+
smallTrianglesMenuItem.addActionListener((ActionEvent evt) -> {
|
822
|
+
smallTrianglesMenuItemActionPerformed(evt);
|
848
823
|
});
|
849
824
|
}
|
850
825
|
}
|
@@ -856,22 +831,16 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
856
831
|
resetZoomMenuItem = new JMenuItem();
|
857
832
|
imageMenu.add(resetZoomMenuItem);
|
858
833
|
resetZoomMenuItem.setText("Reset Zoom");
|
859
|
-
resetZoomMenuItem.addActionListener(
|
860
|
-
|
861
|
-
public void actionPerformed(ActionEvent evt) {
|
862
|
-
imagePanel.reset();
|
863
|
-
}
|
834
|
+
resetZoomMenuItem.addActionListener((ActionEvent evt) -> {
|
835
|
+
imagePanel.reset();
|
864
836
|
});
|
865
837
|
}
|
866
838
|
{
|
867
839
|
fitWindowMenuItem = new JMenuItem();
|
868
840
|
imageMenu.add(fitWindowMenuItem);
|
869
841
|
fitWindowMenuItem.setText("Fit to Window");
|
870
|
-
fitWindowMenuItem.addActionListener(
|
871
|
-
|
872
|
-
public void actionPerformed(ActionEvent evt) {
|
873
|
-
imagePanel.fit();
|
874
|
-
}
|
842
|
+
fitWindowMenuItem.addActionListener((ActionEvent evt) -> {
|
843
|
+
imagePanel.fit();
|
875
844
|
});
|
876
845
|
}
|
877
846
|
{
|
@@ -882,26 +851,23 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
882
851
|
jMenuItem4 = new JMenuItem();
|
883
852
|
imageMenu.add(jMenuItem4);
|
884
853
|
jMenuItem4.setText("Save Image ...");
|
885
|
-
jMenuItem4.addActionListener(
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
public String getDescription() {
|
893
|
-
return "Image File";
|
894
|
-
}
|
895
|
-
|
896
|
-
@Override
|
897
|
-
public boolean accept(File f) {
|
898
|
-
return (f.isDirectory() || f.getName().endsWith(".png") || f.getName().endsWith(".tga"));
|
899
|
-
}
|
900
|
-
});
|
901
|
-
if (fc.showSaveDialog(SunflowGUI.this) == JFileChooser.APPROVE_OPTION) {
|
902
|
-
String filename = fc.getSelectedFile().getAbsolutePath();
|
903
|
-
imagePanel.save(filename);
|
854
|
+
jMenuItem4.addActionListener((ActionEvent evt) -> {
|
855
|
+
// imagePanel.image;
|
856
|
+
JFileChooser fc = new JFileChooser(".");
|
857
|
+
fc.setFileFilter(new FileFilter() {
|
858
|
+
@Override
|
859
|
+
public String getDescription() {
|
860
|
+
return "Image File";
|
904
861
|
}
|
862
|
+
|
863
|
+
@Override
|
864
|
+
public boolean accept(File f) {
|
865
|
+
return (f.isDirectory() || f.getName().endsWith(".png") || f.getName().endsWith(".tga"));
|
866
|
+
}
|
867
|
+
});
|
868
|
+
if (fc.showSaveDialog(SunflowGUI.this) == JFileChooser.APPROVE_OPTION) {
|
869
|
+
String filename = fc.getSelectedFile().getAbsolutePath();
|
870
|
+
imagePanel.save(filename);
|
905
871
|
}
|
906
872
|
});
|
907
873
|
}
|
@@ -916,11 +882,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
916
882
|
windowMenu.add(imageWindowMenuItem);
|
917
883
|
imageWindowMenuItem.setText("Image");
|
918
884
|
imageWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl 1"));
|
919
|
-
imageWindowMenuItem.addActionListener(
|
920
|
-
|
921
|
-
public void actionPerformed(ActionEvent evt) {
|
922
|
-
selectFrame(imagePanelFrame);
|
923
|
-
}
|
885
|
+
imageWindowMenuItem.addActionListener((ActionEvent evt) -> {
|
886
|
+
selectFrame(imagePanelFrame);
|
924
887
|
});
|
925
888
|
}
|
926
889
|
{
|
@@ -928,11 +891,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
928
891
|
windowMenu.add(editorWindowMenuItem);
|
929
892
|
editorWindowMenuItem.setText("Script Editor");
|
930
893
|
editorWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl 2"));
|
931
|
-
editorWindowMenuItem.addActionListener(
|
932
|
-
|
933
|
-
public void actionPerformed(ActionEvent evt) {
|
934
|
-
selectFrame(editorFrame);
|
935
|
-
}
|
894
|
+
editorWindowMenuItem.addActionListener((ActionEvent evt) -> {
|
895
|
+
selectFrame(editorFrame);
|
936
896
|
});
|
937
897
|
}
|
938
898
|
{
|
@@ -940,11 +900,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
940
900
|
windowMenu.add(consoleWindowMenuItem);
|
941
901
|
consoleWindowMenuItem.setText("Console");
|
942
902
|
consoleWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl 3"));
|
943
|
-
consoleWindowMenuItem.addActionListener(
|
944
|
-
|
945
|
-
public void actionPerformed(ActionEvent evt) {
|
946
|
-
selectFrame(consoleFrame);
|
947
|
-
}
|
903
|
+
consoleWindowMenuItem.addActionListener((ActionEvent evt) -> {
|
904
|
+
selectFrame(consoleFrame);
|
948
905
|
});
|
949
906
|
}
|
950
907
|
{
|
@@ -956,11 +913,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
956
913
|
windowMenu.add(tileWindowMenuItem);
|
957
914
|
tileWindowMenuItem.setText("Tile");
|
958
915
|
tileWindowMenuItem.setAccelerator(KeyStroke.getKeyStroke("ctrl T"));
|
959
|
-
tileWindowMenuItem.addActionListener(
|
960
|
-
|
961
|
-
public void actionPerformed(ActionEvent evt) {
|
962
|
-
tileWindowMenuItemActionPerformed(evt);
|
963
|
-
}
|
916
|
+
tileWindowMenuItem.addActionListener((ActionEvent evt) -> {
|
917
|
+
tileWindowMenuItemActionPerformed(evt);
|
964
918
|
});
|
965
919
|
}
|
966
920
|
}
|
@@ -1045,11 +999,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
1045
999
|
}
|
1046
1000
|
|
1047
1001
|
private void println(final String s) {
|
1048
|
-
SwingUtilities.invokeLater(
|
1049
|
-
|
1050
|
-
public void run() {
|
1051
|
-
consoleTextArea.append(s + "\n");
|
1052
|
-
}
|
1002
|
+
SwingUtilities.invokeLater(() -> {
|
1003
|
+
consoleTextArea.append(s + "\n");
|
1053
1004
|
});
|
1054
1005
|
}
|
1055
1006
|
|
@@ -1079,16 +1030,13 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
1079
1030
|
currentTaskLastP = -1;
|
1080
1031
|
final int taskMin = min;
|
1081
1032
|
final int taskMax = max;
|
1082
|
-
SwingUtilities.invokeLater(
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
taskProgressBar.setValue(taskMin);
|
1090
|
-
taskProgressBar.setString(currentTask);
|
1091
|
-
}
|
1033
|
+
SwingUtilities.invokeLater(() -> {
|
1034
|
+
taskProgressBar.setEnabled(true);
|
1035
|
+
taskCancelButton.setEnabled(true);
|
1036
|
+
taskProgressBar.setMinimum(taskMin);
|
1037
|
+
taskProgressBar.setMaximum(taskMax);
|
1038
|
+
taskProgressBar.setValue(taskMin);
|
1039
|
+
taskProgressBar.setString(currentTask);
|
1092
1040
|
});
|
1093
1041
|
}
|
1094
1042
|
|
@@ -1096,29 +1044,23 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
1096
1044
|
public void taskUpdate(int current) {
|
1097
1045
|
final int taskCurrent = current;
|
1098
1046
|
final String taskString = currentTask;
|
1099
|
-
SwingUtilities.invokeLater(
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
taskProgressBar.setString(taskString + " [" + p + "%]");
|
1106
|
-
currentTaskLastP = p;
|
1107
|
-
}
|
1047
|
+
SwingUtilities.invokeLater(() -> {
|
1048
|
+
taskProgressBar.setValue(taskCurrent);
|
1049
|
+
int p = (int) (100.0 * taskProgressBar.getPercentComplete());
|
1050
|
+
if (p > currentTaskLastP) {
|
1051
|
+
taskProgressBar.setString(taskString + " [" + p + "%]");
|
1052
|
+
currentTaskLastP = p;
|
1108
1053
|
}
|
1109
1054
|
});
|
1110
1055
|
}
|
1111
1056
|
|
1112
1057
|
@Override
|
1113
1058
|
public void taskStop() {
|
1114
|
-
SwingUtilities.invokeLater(
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
taskProgressBar.setEnabled(false);
|
1120
|
-
taskCancelButton.setEnabled(false);
|
1121
|
-
}
|
1059
|
+
SwingUtilities.invokeLater(() -> {
|
1060
|
+
taskProgressBar.setValue(taskProgressBar.getMinimum());
|
1061
|
+
taskProgressBar.setString("");
|
1062
|
+
taskProgressBar.setEnabled(false);
|
1063
|
+
taskCancelButton.setEnabled(false);
|
1122
1064
|
});
|
1123
1065
|
}
|
1124
1066
|
|
@@ -1330,7 +1272,7 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
1330
1272
|
break;
|
1331
1273
|
}
|
1332
1274
|
}
|
1333
|
-
} catch (
|
1275
|
+
} catch (UnsupportedFlavorException | IOException exp) {
|
1334
1276
|
Logger.getLogger(SunflowGUI.class.getName()).log(Level.SEVERE, null, exp);
|
1335
1277
|
}
|
1336
1278
|
|
@@ -1341,8 +1283,8 @@ public class SunflowGUI extends javax.swing.JFrame implements UserInterface {
|
|
1341
1283
|
public boolean canImport(JComponent c, DataFlavor[] flavors) {
|
1342
1284
|
// Just a quick check to see if a file can be accepted at this time
|
1343
1285
|
// Are there any files around?
|
1344
|
-
for (
|
1345
|
-
if (
|
1286
|
+
for (DataFlavor flavor : flavors) {
|
1287
|
+
if (flavor.isFlavorJavaFileListType()) {
|
1346
1288
|
return true;
|
1347
1289
|
}
|
1348
1290
|
}
|