Reworks default tools, moves some files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.parameters.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.parameters.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.setup.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.setup.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.subtitles.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.subtitles.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.work.impl.spi;
|
||||
|
||||
import java.util.spi.ResourceBundleProvider;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
package com.github.gtache.autosubtitle.gui.work.impl.spi;
|
||||
|
||||
import java.util.spi.AbstractResourceBundleProvider;
|
||||
|
||||
@@ -20,32 +20,31 @@ public final class GuiCoreModule {
|
||||
@Provides
|
||||
static ResourceBundle providesBundle() {
|
||||
return new CombinedResourceBundle(ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.MainBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.SetupBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.WorkBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.ParametersBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.SubtitlesBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.impl.MediaBundle"));
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.setup.impl.SetupBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.work.impl.WorkBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.parameters.impl.ParametersBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.subtitles.impl.SubtitlesBundle"),
|
||||
ResourceBundle.getBundle("com.github.gtache.autosubtitle.gui.media.impl.MediaBundle"));
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Play
|
||||
static byte[] providesPlayImage() {
|
||||
try (final var in = GuiCoreModule.class.getResourceAsStream("/com/github/gtache/autosubtitle/gui/impl/play_64.png")) {
|
||||
if (in == null) {
|
||||
throw new UncheckedIOException(new IOException("Resource not found : /com/github/gtache/autosubtitle/gui/impl/play_64.png"));
|
||||
}
|
||||
return in.readAllBytes();
|
||||
} catch (final IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
final var path = "/com/github/gtache/autosubtitle/gui/media/impl/play_64.png";
|
||||
return readResource(path);
|
||||
}
|
||||
|
||||
@Provides
|
||||
@Pause
|
||||
static byte[] providesPauseImage() {
|
||||
try (final var in = GuiCoreModule.class.getResourceAsStream("/com/github/gtache/autosubtitle/gui/impl/pause_64.png")) {
|
||||
final var path = "/com/github/gtache/autosubtitle/gui/media/impl/pause_64.png";
|
||||
return readResource(path);
|
||||
}
|
||||
|
||||
private static byte[] readResource(final String path) {
|
||||
try (final var in = GuiCoreModule.class.getResourceAsStream(path)) {
|
||||
if (in == null) {
|
||||
throw new UncheckedIOException(new IOException("Resource not found : /com/github/gtache/autosubtitle/gui/impl/pause_64.png"));
|
||||
throw new UncheckedIOException(new IOException("Resource not found : " + path));
|
||||
}
|
||||
return in.readAllBytes();
|
||||
} catch (final IOException e) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
|
||||
@@ -1,12 +1,3 @@
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.MainBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.MainBundleProviderImpl;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.ParametersBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.ParametersBundleProviderImpl;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.SetupBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.SetupBundleProviderImpl;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.WorkBundleProvider;
|
||||
import com.github.gtache.autosubtitle.gui.impl.spi.WorkBundleProviderImpl;
|
||||
|
||||
/**
|
||||
* Core gui module for autosubtitle
|
||||
*/
|
||||
@@ -14,12 +5,13 @@ module com.github.gtache.autosubtitle.gui.core {
|
||||
requires transitive com.github.gtache.autosubtitle.gui.api;
|
||||
requires transitive com.github.gtache.autosubtitle.core;
|
||||
requires org.apache.logging.log4j;
|
||||
|
||||
exports com.github.gtache.autosubtitle.gui.impl;
|
||||
exports com.github.gtache.autosubtitle.gui.impl.spi;
|
||||
exports com.github.gtache.autosubtitle.gui.parameters.impl.spi;
|
||||
exports com.github.gtache.autosubtitle.gui.setup.impl.spi;
|
||||
exports com.github.gtache.autosubtitle.gui.subtitles.impl.spi;
|
||||
exports com.github.gtache.autosubtitle.gui.work.impl.spi;
|
||||
|
||||
exports com.github.gtache.autosubtitle.modules.gui.impl;
|
||||
|
||||
provides MainBundleProvider with MainBundleProviderImpl;
|
||||
provides ParametersBundleProvider with ParametersBundleProviderImpl;
|
||||
provides SetupBundleProvider with SetupBundleProviderImpl;
|
||||
provides WorkBundleProvider with WorkBundleProviderImpl;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Reference in New Issue
Block a user