Skip to content

Commit 7b377e7

Browse files
Merge pull request #280 from scenerygraphics/ui-updates
UI updates: * usage of flatlaf if run as standalone (https://www.formdev.com/flatlaf/) * nicer inspector panel, which is collapsible to the sidebar * nicer REPL panel, which is also collapsible to the sidebar Also adds a new command to load Cremi datasets and segmentations, which is the first Kotlin-powered command 🥳
2 parents 68e35df + 21a4427 commit 7b377e7

File tree

211 files changed

+40306
-73
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+40306
-73
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,11 @@ In case you use sciview or scenery in a scientific publication, please cite this
4747
**Triggering uploads to the update site:**
4848

4949
Add either `[SV_IJ_DEPLOY_UNSTABLE]` or `[SV_IJ_DEPLOY_PRIMARY]` to a commit message
50+
51+
## Acknowledgements
52+
53+
This software contains the following 3rd party libraries:
54+
55+
* IntelliJ UI code, by JetBrains (licensed under the Apache Software License 2.0), see `src/main/java/com/intellij`
56+
* trove4j, by the Trove4j team (licensed under the Lesser GNU Public License 3.0), see `src/main/java/gnu`
57+

pom.xml

Lines changed: 107 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@
108108
<!-- NB: Deploy releases to the SciJava Maven repository. -->
109109
<releaseProfiles>deploy-to-scijava</releaseProfiles>
110110

111-
<scenery.version>5778367</scenery.version>
111+
<scenery.version>0797d5d2</scenery.version>
112112

113-
<kotlin.version>1.4-M3</kotlin.version>
114-
<kotlinx-coroutines-core.version>1.3.7-1.4-M3</kotlinx-coroutines-core.version>
113+
<kotlin.version>1.4.0</kotlin.version>
114+
<kotlinx-coroutines-core.version>1.3.9</kotlinx-coroutines-core.version>
115+
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
115116

116117
</properties>
117118

@@ -146,6 +147,12 @@
146147
<version>${jogl.version}</version>
147148
</dependency>
148149

150+
<dependency>
151+
<groupId>com.formdev</groupId>
152+
<artifactId>flatlaf</artifactId>
153+
<version>0.38</version>
154+
</dependency>
155+
149156
<!-- SciJava dependencies -->
150157
<dependency>
151158
<groupId>org.scijava</groupId>
@@ -301,6 +308,10 @@
301308
<groupId>org.janelia.saalfeldlab</groupId>
302309
<artifactId>n5</artifactId>
303310
</dependency>
311+
<dependency>
312+
<groupId>org.janelia.saalfeldlab</groupId>
313+
<artifactId>n5-hdf5</artifactId>
314+
</dependency>
304315
<dependency>
305316
<groupId>org.janelia.saalfeldlab</groupId>
306317
<artifactId>n5-imglib2</artifactId>
@@ -309,11 +320,22 @@
309320
<groupId>sc.fiji</groupId>
310321
<artifactId>spim_data</artifactId>
311322
</dependency>
323+
<dependency>
324+
<groupId>org.jetbrains.kotlin</groupId>
325+
<artifactId>kotlin-stdlib-jdk8</artifactId>
326+
<version>${kotlin.version}</version>
327+
</dependency>
328+
<dependency>
329+
<groupId>org.jetbrains.kotlin</groupId>
330+
<artifactId>kotlin-test-junit</artifactId>
331+
<version>${kotlin.version}</version>
332+
<scope>test</scope>
333+
</dependency>
334+
312335
</dependencies>
313336

314337
<build>
315-
<sourceDirectory>src/main/java</sourceDirectory>
316-
<testSourceDirectory>src/test/tests</testSourceDirectory>
338+
<testSourceDirectory>src/test/tests</testSourceDirectory>
317339
<plugins>
318340
<plugin>
319341
<groupId>org.apache.maven.plugins</groupId>
@@ -324,6 +346,86 @@
324346
<reuseForks>true</reuseForks>
325347
</configuration>
326348
</plugin>
349+
<plugin>
350+
<groupId>org.jetbrains.kotlin</groupId>
351+
<artifactId>kotlin-maven-plugin</artifactId>
352+
<version>${kotlin.version}</version>
353+
<executions>
354+
<execution>
355+
<id>compile</id>
356+
<phase>compile</phase>
357+
<goals> <goal>compile</goal> </goals>
358+
<configuration>
359+
<sourceDirs>
360+
<source>src/main/java</source>
361+
<source>target/generated-sources/kapt</source>
362+
<source>target/generated-sources/kaptKotlin</source>
363+
</sourceDirs>
364+
<jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
365+
<args>
366+
<arg>-Werror</arg>
367+
<arg>-Xopt-in=kotlin.RequiresOptIn</arg>
368+
</args>
369+
</configuration>
370+
</execution>
371+
<execution>
372+
<id>test-compile</id>
373+
<phase>test-compile</phase>
374+
<goals> <goal>test-compile</goal> </goals>
375+
<configuration>
376+
<sourceDirs>
377+
<sourceDir>${project.basedir}/src/test/tests</sourceDir>
378+
</sourceDirs>
379+
</configuration>
380+
</execution>
381+
<execution>
382+
<id>kapt</id>
383+
<goals>
384+
<goal>kapt</goal>
385+
</goals>
386+
<configuration>
387+
<sourceDirs>
388+
<sourceDir>src/main/kotlin</sourceDir>
389+
<sourceDir>src/main/java</sourceDir>
390+
</sourceDirs>
391+
<annotationProcessorPaths>
392+
<annotationProcessorPath>
393+
<groupId>org.scijava</groupId>
394+
<artifactId>scijava-common</artifactId>
395+
<version>${scijava-common.version}}</version>
396+
</annotationProcessorPath>
397+
</annotationProcessorPaths>
398+
</configuration>
399+
</execution>
400+
</executions>
401+
<configuration>
402+
<jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
403+
<args>
404+
<arg>-Werror</arg>
405+
<arg>-Xopt-in=kotlin.RequiresOptIn</arg>
406+
</args>
407+
</configuration>
408+
</plugin>
409+
<plugin>
410+
<groupId>org.apache.maven.plugins</groupId>
411+
<artifactId>maven-compiler-plugin</artifactId>
412+
<executions>
413+
<execution>
414+
<id>compile</id>
415+
<phase>compile</phase>
416+
<goals>
417+
<goal>compile</goal>
418+
</goals>
419+
</execution>
420+
<execution>
421+
<id>testCompile</id>
422+
<phase>test-compile</phase>
423+
<goals>
424+
<goal>testCompile</goal>
425+
</goals>
426+
</execution>
427+
</executions>
428+
</plugin>
327429
</plugins>
328430
</build>
329431

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright 2000-2009 JetBrains s.r.o.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.intellij.openapi;
17+
18+
/**
19+
* This class marks classes, which require some work done for cleaning up.
20+
* As a general policy you shouldn't call the {@link #dispose} method directly,
21+
* but register your object to be chained with a parent disposable via {@link com.intellij.openapi.util.Disposer#register(Disposable, Disposable)}.
22+
* If you're 100% sure that you should control disposion of your object manually,
23+
* do not call the {@link #dispose} method either. Use {@link com.intellij.openapi.util.Disposer#dispose(Disposable)} instead, since
24+
* there might be any object registered in chain.
25+
*/
26+
public interface Disposable {
27+
void dispose();
28+
29+
interface Parent extends Disposable {
30+
void beforeTreeDispose();
31+
}
32+
33+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2000-2009 JetBrains s.r.o.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.intellij.openapi.diagnostic;
17+
18+
public interface ApplicationInfoProvider {
19+
20+
String getInfo();
21+
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright 2000-2015 JetBrains s.r.o.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.intellij.openapi.diagnostic;
17+
18+
/**
19+
* A marker interface for exceptions that should never be logged.
20+
*/
21+
@SuppressWarnings("NonExceptionNameEndsWithException")
22+
public interface ControlFlowException { }
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* Copyright 2000-2015 JetBrains s.r.o.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.intellij.openapi.diagnostic;
17+
18+
import com.intellij.openapi.util.text.StringUtil;
19+
import com.intellij.util.ExceptionUtil;
20+
import org.apache.log4j.Level;
21+
import org.jetbrains.annotations.NonNls;
22+
import org.jetbrains.annotations.NotNull;
23+
import org.jetbrains.annotations.Nullable;
24+
25+
public class DefaultLogger extends Logger {
26+
@SuppressWarnings("UnusedParameters")
27+
public DefaultLogger(String category) { }
28+
29+
@Override
30+
public boolean isDebugEnabled() {
31+
return false;
32+
}
33+
34+
@Override
35+
public void debug(String message) { }
36+
37+
@Override
38+
public void debug(Throwable t) { }
39+
40+
@Override
41+
public void debug(@NonNls String message, Throwable t) { }
42+
43+
@Override
44+
public void info(String message) { }
45+
46+
@Override
47+
public void info(String message, Throwable t) { }
48+
49+
@Override
50+
@SuppressWarnings("UseOfSystemOutOrSystemErr")
51+
public void warn(@NonNls String message, @Nullable Throwable t) {
52+
t = checkException(t);
53+
System.err.println("WARN: " + message);
54+
if (t != null) t.printStackTrace(System.err);
55+
}
56+
57+
@Override
58+
@SuppressWarnings("UseOfSystemOutOrSystemErr")
59+
public void error(String message, @Nullable Throwable t, @NotNull String... details) {
60+
t = checkException(t);
61+
message += attachmentsToString(t);
62+
System.err.println("ERROR: " + message);
63+
if (t != null) t.printStackTrace(System.err);
64+
if (details.length > 0) {
65+
System.out.println("details: ");
66+
for (String detail : details) {
67+
System.out.println(detail);
68+
}
69+
}
70+
71+
AssertionError error = new AssertionError(message);
72+
error.initCause(t);
73+
throw error;
74+
}
75+
76+
@Override
77+
public void setLevel(Level level) { }
78+
79+
public static String attachmentsToString(@Nullable Throwable t) {
80+
//noinspection ThrowableResultOfMethodCallIgnored
81+
Throwable rootCause = t == null ? null : ExceptionUtil.getRootCause(t);
82+
return "";
83+
}
84+
}

0 commit comments

Comments
 (0)