Skip to content

Commit

Permalink
Merge pull request #280 from scenerygraphics/ui-updates
Browse files Browse the repository at this point in the history
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 🥳
  • Loading branch information
skalarproduktraum committed Aug 27, 2020
2 parents 68e35df + 21a4427 commit 7b377e7
Show file tree
Hide file tree
Showing 211 changed files with 40,306 additions and 73 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ In case you use sciview or scenery in a scientific publication, please cite this
**Triggering uploads to the update site:**

Add either `[SV_IJ_DEPLOY_UNSTABLE]` or `[SV_IJ_DEPLOY_PRIMARY]` to a commit message

## Acknowledgements

This software contains the following 3rd party libraries:

* IntelliJ UI code, by JetBrains (licensed under the Apache Software License 2.0), see `src/main/java/com/intellij`
* trove4j, by the Trove4j team (licensed under the Lesser GNU Public License 3.0), see `src/main/java/gnu`

112 changes: 107 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>deploy-to-scijava</releaseProfiles>

<scenery.version>5778367</scenery.version>
<scenery.version>0797d5d2</scenery.version>

<kotlin.version>1.4-M3</kotlin.version>
<kotlinx-coroutines-core.version>1.3.7-1.4-M3</kotlinx-coroutines-core.version>
<kotlin.version>1.4.0</kotlin.version>
<kotlinx-coroutines-core.version>1.3.9</kotlinx-coroutines-core.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>

</properties>

Expand Down Expand Up @@ -146,6 +147,12 @@
<version>${jogl.version}</version>
</dependency>

<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>0.38</version>
</dependency>

<!-- SciJava dependencies -->
<dependency>
<groupId>org.scijava</groupId>
Expand Down Expand Up @@ -301,6 +308,10 @@
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5</artifactId>
</dependency>
<dependency>
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-hdf5</artifactId>
</dependency>
<dependency>
<groupId>org.janelia.saalfeldlab</groupId>
<artifactId>n5-imglib2</artifactId>
Expand All @@ -309,11 +320,22 @@
<groupId>sc.fiji</groupId>
<artifactId>spim_data</artifactId>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/tests</testSourceDirectory>
<testSourceDirectory>src/test/tests</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -324,6 +346,86 @@
<reuseForks>true</reuseForks>
</configuration>
</plugin>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals> <goal>compile</goal> </goals>
<configuration>
<sourceDirs>
<source>src/main/java</source>
<source>target/generated-sources/kapt</source>
<source>target/generated-sources/kaptKotlin</source>
</sourceDirs>
<jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
<args>
<arg>-Werror</arg>
<arg>-Xopt-in=kotlin.RequiresOptIn</arg>
</args>
</configuration>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals> <goal>test-compile</goal> </goals>
<configuration>
<sourceDirs>
<sourceDir>${project.basedir}/src/test/tests</sourceDir>
</sourceDirs>
</configuration>
</execution>
<execution>
<id>kapt</id>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.scijava</groupId>
<artifactId>scijava-common</artifactId>
<version>${scijava-common.version}}</version>
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</execution>
</executions>
<configuration>
<jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
<args>
<arg>-Werror</arg>
<arg>-Xopt-in=kotlin.RequiresOptIn</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>testCompile</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/intellij/openapi/Disposable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi;

/**
* This class marks classes, which require some work done for cleaning up.
* As a general policy you shouldn't call the {@link #dispose} method directly,
* but register your object to be chained with a parent disposable via {@link com.intellij.openapi.util.Disposer#register(Disposable, Disposable)}.
* If you're 100% sure that you should control disposion of your object manually,
* do not call the {@link #dispose} method either. Use {@link com.intellij.openapi.util.Disposer#dispose(Disposable)} instead, since
* there might be any object registered in chain.
*/
public interface Disposable {
void dispose();

interface Parent extends Disposable {
void beforeTreeDispose();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.diagnostic;

public interface ApplicationInfoProvider {

String getInfo();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.diagnostic;

/**
* A marker interface for exceptions that should never be logged.
*/
@SuppressWarnings("NonExceptionNameEndsWithException")
public interface ControlFlowException { }
84 changes: 84 additions & 0 deletions src/main/java/com/intellij/openapi/diagnostic/DefaultLogger.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.openapi.diagnostic;

import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ExceptionUtil;
import org.apache.log4j.Level;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public class DefaultLogger extends Logger {
@SuppressWarnings("UnusedParameters")
public DefaultLogger(String category) { }

@Override
public boolean isDebugEnabled() {
return false;
}

@Override
public void debug(String message) { }

@Override
public void debug(Throwable t) { }

@Override
public void debug(@NonNls String message, Throwable t) { }

@Override
public void info(String message) { }

@Override
public void info(String message, Throwable t) { }

@Override
@SuppressWarnings("UseOfSystemOutOrSystemErr")
public void warn(@NonNls String message, @Nullable Throwable t) {
t = checkException(t);
System.err.println("WARN: " + message);
if (t != null) t.printStackTrace(System.err);
}

@Override
@SuppressWarnings("UseOfSystemOutOrSystemErr")
public void error(String message, @Nullable Throwable t, @NotNull String... details) {
t = checkException(t);
message += attachmentsToString(t);
System.err.println("ERROR: " + message);
if (t != null) t.printStackTrace(System.err);
if (details.length > 0) {
System.out.println("details: ");
for (String detail : details) {
System.out.println(detail);
}
}

AssertionError error = new AssertionError(message);
error.initCause(t);
throw error;
}

@Override
public void setLevel(Level level) { }

public static String attachmentsToString(@Nullable Throwable t) {
//noinspection ThrowableResultOfMethodCallIgnored
Throwable rootCause = t == null ? null : ExceptionUtil.getRootCause(t);
return "";
}
}
Loading

0 comments on commit 7b377e7

Please sign in to comment.