Moves some classes

This commit is contained in:
Guillaume Tâche
2024-09-16 20:01:12 +02:00
parent 233b4bdb77
commit 17086a87ef
57 changed files with 242 additions and 180 deletions

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.main;
/**
* Controller for the main view

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.main;
/**
* Model for the main view

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.media;
/**
* Controller for the media view

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.media;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.subtitle.EditableSubtitle;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.parameters;
/**
* Controller for the parameters view

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.parameters;
import com.github.gtache.autosubtitle.subtitle.OutputFormat;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.setup;
/**
* Controller for the setup view

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.setup;
import com.github.gtache.autosubtitle.setup.SetupStatus;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.subtitles;
import com.github.gtache.autosubtitle.Language;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.subtitles;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.VideoInfo;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.work;
import java.nio.file.Path;
@@ -18,7 +18,7 @@ public interface WorkController {
* @param file The path to the video
*/
void loadVideo(final Path file);
/**
* @return The model
*/

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.work;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui;
package com.github.gtache.autosubtitle.gui.work;
/**
* Possible statuses for the work controller

View File

@@ -4,4 +4,10 @@
module com.github.gtache.autosubtitle.gui.api {
requires transitive com.github.gtache.autosubtitle.api;
exports com.github.gtache.autosubtitle.gui;
exports com.github.gtache.autosubtitle.gui.main;
exports com.github.gtache.autosubtitle.gui.media;
exports com.github.gtache.autosubtitle.gui.parameters;
exports com.github.gtache.autosubtitle.gui.setup;
exports com.github.gtache.autosubtitle.gui.subtitles;
exports com.github.gtache.autosubtitle.gui.work;
}

View File

@@ -1,6 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.main.fx;
import com.github.gtache.autosubtitle.gui.MainController;
import com.github.gtache.autosubtitle.gui.fx.AbstractFXController;
import com.github.gtache.autosubtitle.gui.main.MainController;
import javafx.fxml.FXML;
import javafx.scene.control.TabPane;
import javafx.stage.Window;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.main.fx;
import com.github.gtache.autosubtitle.gui.MainModel;
import com.github.gtache.autosubtitle.gui.main.MainModel;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;

View File

@@ -1,5 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.media.fx;
import com.github.gtache.autosubtitle.gui.fx.FXBinder;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkModel;
import javafx.beans.binding.Bindings;
import javax.inject.Inject;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.media.fx;
import com.github.gtache.autosubtitle.File;
import com.github.gtache.autosubtitle.gui.MediaController;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import com.github.gtache.autosubtitle.gui.media.MediaController;
import com.github.gtache.autosubtitle.modules.gui.impl.Pause;
import com.github.gtache.autosubtitle.modules.gui.impl.Play;
import com.github.gtache.autosubtitle.subtitle.Subtitle;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.media.fx;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.gui.MediaModel;
import com.github.gtache.autosubtitle.gui.media.MediaModel;
import com.github.gtache.autosubtitle.subtitle.EditableSubtitle;
import javafx.beans.binding.Bindings;
import javafx.beans.property.*;
@@ -12,7 +12,7 @@ import javax.inject.Inject;
import javax.inject.Singleton;
/**
* FX implementation of {@link com.github.gtache.autosubtitle.gui.MediaModel}
* FX implementation of {@link MediaModel}
*/
@Singleton
public class FXMediaModel implements MediaModel {

View File

@@ -1,6 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.parameters.fx;
import com.github.gtache.autosubtitle.gui.ParametersController;
import com.github.gtache.autosubtitle.gui.fx.AbstractFXController;
import com.github.gtache.autosubtitle.gui.parameters.ParametersController;
import com.github.gtache.autosubtitle.subtitle.OutputFormat;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModelProvider;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.parameters.fx;
import com.github.gtache.autosubtitle.gui.ParametersModel;
import com.github.gtache.autosubtitle.gui.parameters.ParametersModel;
import com.github.gtache.autosubtitle.modules.impl.FontName;
import com.github.gtache.autosubtitle.modules.impl.FontSize;
import com.github.gtache.autosubtitle.modules.impl.MaxLineLength;
@@ -65,7 +65,7 @@ public class FXParametersModel implements ParametersModel {
extractionModel.set(model);
}
ObjectProperty<ExtractionModel> extractionModelProperty() {
public ObjectProperty<ExtractionModel> extractionModelProperty() {
return extractionModel;
}

View File

@@ -1,6 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.setup.fx;
import com.github.gtache.autosubtitle.gui.SetupController;
import com.github.gtache.autosubtitle.gui.fx.AbstractFXController;
import com.github.gtache.autosubtitle.gui.setup.SetupController;
import com.github.gtache.autosubtitle.modules.setup.impl.SubtitleExtractorSetup;
import com.github.gtache.autosubtitle.modules.setup.impl.TranslatorSetup;
import com.github.gtache.autosubtitle.modules.setup.impl.VideoConverterSetup;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.setup.fx;
import com.github.gtache.autosubtitle.gui.SetupModel;
import com.github.gtache.autosubtitle.gui.setup.SetupModel;
import com.github.gtache.autosubtitle.setup.SetupStatus;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;

View File

@@ -1,8 +1,10 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.gui.WorkStatus;
import com.github.gtache.autosubtitle.gui.fx.FXBinder;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkModel;
import com.github.gtache.autosubtitle.gui.work.WorkStatus;
import com.github.gtache.autosubtitle.subtitle.gui.fx.ObservableSubtitleCollectionImpl;
import javafx.beans.binding.Bindings;

View File

@@ -1,8 +1,9 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.gui.SubtitlesController;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import com.github.gtache.autosubtitle.gui.fx.AbstractFXController;
import com.github.gtache.autosubtitle.gui.subtitles.SubtitlesController;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.SubtitleImporterExporter;
import com.github.gtache.autosubtitle.subtitle.converter.ParseException;

View File

@@ -1,8 +1,8 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.VideoInfo;
import com.github.gtache.autosubtitle.gui.SubtitlesModel;
import com.github.gtache.autosubtitle.gui.subtitles.SubtitlesModel;
import com.github.gtache.autosubtitle.subtitle.gui.fx.ObservableSubtitleCollectionImpl;
import com.github.gtache.autosubtitle.subtitle.gui.fx.ObservableSubtitleImpl;
import javafx.beans.binding.Bindings;
@@ -124,7 +124,7 @@ public class FXSubtitlesModel implements SubtitlesModel<ObservableSubtitleImpl,
ObjectProperty<VideoInfo> videoInfoProperty() {
return videoInfo;
}
@Override
public ObservableList<Language> availableTranslationsLanguage() {
return FXCollections.unmodifiableObservableList(availableTranslationLanguages);

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.Language;
import javafx.util.StringConverter;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import javafx.util.StringConverter;

View File

@@ -1,4 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.work.fx;
import com.github.gtache.autosubtitle.gui.fx.FXBinder;
import com.github.gtache.autosubtitle.gui.parameters.fx.FXParametersModel;
import javax.inject.Inject;
import javax.inject.Singleton;

View File

@@ -1,9 +1,11 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.work.fx;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.VideoLoader;
import com.github.gtache.autosubtitle.gui.WorkController;
import com.github.gtache.autosubtitle.gui.WorkStatus;
import com.github.gtache.autosubtitle.gui.fx.AbstractFXController;
import com.github.gtache.autosubtitle.gui.media.fx.FXMediaController;
import com.github.gtache.autosubtitle.gui.work.WorkController;
import com.github.gtache.autosubtitle.gui.work.WorkStatus;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractEvent;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractException;

View File

@@ -1,9 +1,9 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.work.fx;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.gui.WorkModel;
import com.github.gtache.autosubtitle.gui.WorkStatus;
import com.github.gtache.autosubtitle.gui.work.WorkModel;
import com.github.gtache.autosubtitle.gui.work.WorkStatus;
import com.github.gtache.autosubtitle.subtitle.EditableSubtitle;
import com.github.gtache.autosubtitle.subtitle.SubtitleCollection;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;
@@ -72,7 +72,7 @@ public class FXWorkModel implements WorkModel {
this.video.set(video);
}
ObjectProperty<Video> videoProperty() {
public ObjectProperty<Video> videoProperty() {
return video;
}
@@ -100,7 +100,7 @@ public class FXWorkModel implements WorkModel {
workStatus.set(status);
}
ObjectProperty<WorkStatus> statusProperty() {
public ObjectProperty<WorkStatus> statusProperty() {
return workStatus;
}
@@ -137,7 +137,7 @@ public class FXWorkModel implements WorkModel {
this.canExport.set(canExport);
}
BooleanProperty canExportProperty() {
public BooleanProperty canExportProperty() {
return canExport;
}
@@ -149,7 +149,7 @@ public class FXWorkModel implements WorkModel {
ReadOnlyBooleanProperty isProgressVisibleProperty() {
return isProgressVisible.getReadOnlyProperty();
}
@Override
public SubtitleCollection<?> extractedCollection() {
return extractedCollection.get();
@@ -160,23 +160,23 @@ public class FXWorkModel implements WorkModel {
extractedCollection.set(collection);
}
ObjectProperty<SubtitleCollection<?>> extractedCollectionProperty() {
public ObjectProperty<SubtitleCollection<?>> extractedCollectionProperty() {
return extractedCollection;
}
ObjectProperty<EditableSubtitle> selectedSubtitleProperty() {
public ObjectProperty<EditableSubtitle> selectedSubtitleProperty() {
return selectedSubtitle;
}
ObservableList<ObservableSubtitleImpl> subtitles() {
public ObservableList<ObservableSubtitleImpl> subtitles() {
return subtitles;
}
ObservableMap<Language, ObservableSubtitleCollectionImpl> collections() {
public ObservableMap<Language, ObservableSubtitleCollectionImpl> collections() {
return collections;
}
ObjectProperty<Language> videoLanguageProperty() {
public ObjectProperty<Language> videoLanguageProperty() {
return videoLanguage;
}
}

View File

@@ -2,12 +2,12 @@ package com.github.gtache.autosubtitle.modules.gui.fx;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import com.github.gtache.autosubtitle.gui.fx.ColonTimeFormatter;
import com.github.gtache.autosubtitle.gui.fx.FXMainController;
import com.github.gtache.autosubtitle.gui.fx.FXMediaController;
import com.github.gtache.autosubtitle.gui.fx.FXParametersController;
import com.github.gtache.autosubtitle.gui.fx.FXSetupController;
import com.github.gtache.autosubtitle.gui.fx.FXSubtitlesController;
import com.github.gtache.autosubtitle.gui.fx.FXWorkController;
import com.github.gtache.autosubtitle.gui.main.fx.FXMainController;
import com.github.gtache.autosubtitle.gui.media.fx.FXMediaController;
import com.github.gtache.autosubtitle.gui.parameters.fx.FXParametersController;
import com.github.gtache.autosubtitle.gui.setup.fx.FXSetupController;
import com.github.gtache.autosubtitle.gui.subtitles.fx.FXSubtitlesController;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkController;
import com.github.gtache.autosubtitle.modules.gui.impl.Pause;
import com.github.gtache.autosubtitle.modules.gui.impl.Play;
import com.github.gtache.autosubtitle.modules.setup.gui.fx.FXSetupModule;

View File

@@ -1,6 +1,6 @@
package com.github.gtache.autosubtitle.setup.gui.fx;
import com.github.gtache.autosubtitle.gui.fx.FXMainController;
import com.github.gtache.autosubtitle.gui.main.fx.FXMainController;
import com.github.gtache.autosubtitle.setup.SetupUserBridge;
import javafx.application.Platform;
import javafx.scene.control.Alert;

View File

@@ -17,4 +17,16 @@ module com.github.gtache.autosubtitle.gui.fx {
exports com.github.gtache.autosubtitle.subtitle.gui.fx;
exports com.github.gtache.autosubtitle.modules.gui.fx;
opens com.github.gtache.autosubtitle.gui.fx to javafx.fxml;
exports com.github.gtache.autosubtitle.gui.main.fx;
opens com.github.gtache.autosubtitle.gui.main.fx to javafx.fxml;
exports com.github.gtache.autosubtitle.gui.media.fx;
opens com.github.gtache.autosubtitle.gui.media.fx to javafx.fxml;
exports com.github.gtache.autosubtitle.gui.parameters.fx;
opens com.github.gtache.autosubtitle.gui.parameters.fx to javafx.fxml;
exports com.github.gtache.autosubtitle.gui.setup.fx;
opens com.github.gtache.autosubtitle.gui.setup.fx to javafx.fxml;
exports com.github.gtache.autosubtitle.gui.subtitles.fx;
opens com.github.gtache.autosubtitle.gui.subtitles.fx to javafx.fxml;
exports com.github.gtache.autosubtitle.gui.work.fx;
opens com.github.gtache.autosubtitle.gui.work.fx to javafx.fxml;
}

View File

@@ -3,7 +3,7 @@
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<TabPane fx:id="tabPane" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.autosubtitle.gui.fx.FXMainController">
fx:controller="com.github.gtache.autosubtitle.gui.main.fx.FXMainController">
<tabs>
<Tab closable="false" text="%main.tab.work.label">
<content>

View File

@@ -11,7 +11,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.media.MediaView?>
<BorderPane xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.autosubtitle.gui.fx.FXMediaController">
fx:controller="com.github.gtache.autosubtitle.gui.media.fx.FXMediaController">
<bottom>
<VBox BorderPane.alignment="CENTER">
<children>

View File

@@ -9,37 +9,41 @@
<?import javafx.scene.layout.RowConstraints?>
<?import org.controlsfx.control.PrefixSelectionComboBox?>
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" vgap="10.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.gtache.autosubtitle.gui.fx.FXParametersController">
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" vgap="10.0"
xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.autosubtitle.gui.parameters.fx.FXParametersController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<Label text="%parameters.extraction.model.label" />
<PrefixSelectionComboBox fx:id="extractionModelCombobox" GridPane.columnIndex="1" />
<PrefixSelectionComboBox fx:id="extractionOutputFormat" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label text="%parameters.subtitles.output.format" GridPane.rowIndex="1" />
<Label text="%parameters.subtitles.font.size" GridPane.rowIndex="3" />
<Label text="%parameters.subtitles.font.family" GridPane.rowIndex="2" />
<PrefixSelectionComboBox fx:id="fontFamilyCombobox" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<TextField fx:id="fontSizeField" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button mnemonicParsing="false" onAction="#savePressed" text="%parameters.button.save.label" GridPane.columnIndex="1" GridPane.rowIndex="6" />
<Button mnemonicParsing="false" onAction="#resetPressed" text="%parameters.button.reset.label" GridPane.rowIndex="6" />
<Label text="%parameters.subtitles.max.length.label" GridPane.rowIndex="4" />
<Label text="%parameters.subtitles.max.lines.label" GridPane.rowIndex="5" />
<TextField fx:id="maxLengthField" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<TextField fx:id="maxLinesField" GridPane.columnIndex="1" GridPane.rowIndex="5" />
<Label text="%parameters.extraction.model.label"/>
<PrefixSelectionComboBox fx:id="extractionModelCombobox" GridPane.columnIndex="1"/>
<PrefixSelectionComboBox fx:id="extractionOutputFormat" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<Label text="%parameters.subtitles.output.format" GridPane.rowIndex="1"/>
<Label text="%parameters.subtitles.font.size" GridPane.rowIndex="3"/>
<Label text="%parameters.subtitles.font.family" GridPane.rowIndex="2"/>
<PrefixSelectionComboBox fx:id="fontFamilyCombobox" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
<TextField fx:id="fontSizeField" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
<Button mnemonicParsing="false" onAction="#savePressed" text="%parameters.button.save.label"
GridPane.columnIndex="1" GridPane.rowIndex="6"/>
<Button mnemonicParsing="false" onAction="#resetPressed" text="%parameters.button.reset.label"
GridPane.rowIndex="6"/>
<Label text="%parameters.subtitles.max.length.label" GridPane.rowIndex="4"/>
<Label text="%parameters.subtitles.max.lines.label" GridPane.rowIndex="5"/>
<TextField fx:id="maxLengthField" GridPane.columnIndex="1" GridPane.rowIndex="4"/>
<TextField fx:id="maxLinesField" GridPane.columnIndex="1" GridPane.rowIndex="5"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</GridPane>

View File

@@ -8,40 +8,47 @@
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<GridPane hgap="10.0" vgap="10.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.gtache.autosubtitle.gui.fx.FXSetupController">
<GridPane hgap="10.0" vgap="10.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.autosubtitle.gui.setup.fx.FXSetupController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="ALWAYS" />
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="ALWAYS"/>
<ColumnConstraints hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS"/>
</rowConstraints>
<children>
<Label fx:id="converterNameLabel" text="Label" GridPane.rowIndex="1" />
<Label fx:id="converterStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" />
<Label fx:id="extractorNameLabel" text="Label" GridPane.rowIndex="2" />
<Label fx:id="extractorStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Label fx:id="translatorNameLabel" text="Label" GridPane.rowIndex="3" />
<Label fx:id="translatorStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<MenuButton fx:id="converterButton" mnemonicParsing="false" text="%setup.menu.label" GridPane.columnIndex="2" GridPane.rowIndex="1" />
<MenuButton fx:id="extractorButton" mnemonicParsing="false" text="%setup.menu.label" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<MenuButton fx:id="translatorButton" mnemonicParsing="false" text="%setup.menu.label" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label text="%setup.description.label" GridPane.columnSpan="2147483647" />
<ProgressBar fx:id="converterProgress" prefWidth="200.0" progress="0.0" GridPane.columnIndex="3" GridPane.rowIndex="1" />
<ProgressBar fx:id="extractorProgress" prefWidth="200.0" progress="0.0" GridPane.columnIndex="3" GridPane.rowIndex="2" />
<ProgressBar fx:id="translatorProgress" prefWidth="200.0" progress="0.0" GridPane.columnIndex="3" GridPane.rowIndex="3" />
<Label fx:id="converterProgressLabel" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="1" />
<Label fx:id="extractorProgressLabel" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="2" />
<Label fx:id="translatorProgressLabel" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="3" />
<Label fx:id="converterNameLabel" text="Label" GridPane.rowIndex="1"/>
<Label fx:id="converterStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1"/>
<Label fx:id="extractorNameLabel" text="Label" GridPane.rowIndex="2"/>
<Label fx:id="extractorStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="2"/>
<Label fx:id="translatorNameLabel" text="Label" GridPane.rowIndex="3"/>
<Label fx:id="translatorStatusLabel" text="Label" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
<MenuButton fx:id="converterButton" mnemonicParsing="false" text="%setup.menu.label" GridPane.columnIndex="2"
GridPane.rowIndex="1"/>
<MenuButton fx:id="extractorButton" mnemonicParsing="false" text="%setup.menu.label" GridPane.columnIndex="2"
GridPane.rowIndex="2"/>
<MenuButton fx:id="translatorButton" mnemonicParsing="false" text="%setup.menu.label" GridPane.columnIndex="2"
GridPane.rowIndex="3"/>
<Label text="%setup.description.label" GridPane.columnSpan="2147483647"/>
<ProgressBar fx:id="converterProgress" prefWidth="200.0" progress="0.0" GridPane.columnIndex="3"
GridPane.rowIndex="1"/>
<ProgressBar fx:id="extractorProgress" prefWidth="200.0" progress="0.0" GridPane.columnIndex="3"
GridPane.rowIndex="2"/>
<ProgressBar fx:id="translatorProgress" prefWidth="200.0" progress="0.0" GridPane.columnIndex="3"
GridPane.rowIndex="3"/>
<Label fx:id="converterProgressLabel" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="1"/>
<Label fx:id="extractorProgressLabel" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="2"/>
<Label fx:id="translatorProgressLabel" text="Label" GridPane.columnIndex="4" GridPane.rowIndex="3"/>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</GridPane>

View File

@@ -11,14 +11,15 @@
<?import javafx.scene.layout.VBox?>
<?import org.controlsfx.control.PrefixSelectionComboBox?>
<VBox spacing="10" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.gtache.autosubtitle.gui.fx.FXSubtitlesController">
<VBox spacing="10" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.autosubtitle.gui.subtitles.fx.FXSubtitlesController">
<children>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<Label text="%subtitles.language.label" />
<PrefixSelectionComboBox fx:id="languageCombobox" />
<Label text="%subtitles.translate.label" />
<ComboBox fx:id="translationsCombobox" />
<Label text="%subtitles.language.label"/>
<PrefixSelectionComboBox fx:id="languageCombobox"/>
<Label text="%subtitles.translate.label"/>
<ComboBox fx:id="translationsCombobox"/>
</children>
</HBox>
<TabPane fx:id="tabPane" VBox.vgrow="ALWAYS">
@@ -27,12 +28,15 @@
<content>
<TableView fx:id="subtitlesTable" editable="true">
<columns>
<TableColumn fx:id="startColumn" prefWidth="50.0" sortable="false" text="%subtitles.table.column.from.label" />
<TableColumn fx:id="endColumn" prefWidth="50.0" sortable="false" text="%subtitles.table.column.to.label" />
<TableColumn fx:id="textColumn" prefWidth="75.0" sortable="false" text="%subtitles.table.column.text.label" />
<TableColumn fx:id="startColumn" prefWidth="50.0" sortable="false"
text="%subtitles.table.column.from.label"/>
<TableColumn fx:id="endColumn" prefWidth="50.0" sortable="false"
text="%subtitles.table.column.to.label"/>
<TableColumn fx:id="textColumn" prefWidth="75.0" sortable="false"
text="%subtitles.table.column.text.label"/>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY"/>
</columnResizePolicy>
</TableView>
</content>
@@ -41,10 +45,13 @@
</TabPane>
<HBox spacing="10.0">
<children>
<Button fx:id="loadButton" mnemonicParsing="false" onAction="#loadPressed" text="%subtitles.button.load.label" />
<Button fx:id="saveButton" mnemonicParsing="false" onAction="#savePressed" text="%subtitles.button.subtitles.save.label" />
<Button fx:id="resetButton" mnemonicParsing="false" onAction="#resetButtonPressed" text="%subtitles.button.reset.label" />
<Button fx:id="addButton" mnemonicParsing="false" onAction="#addPressed" text="+" />
<Button fx:id="loadButton" mnemonicParsing="false" onAction="#loadPressed"
text="%subtitles.button.load.label"/>
<Button fx:id="saveButton" mnemonicParsing="false" onAction="#savePressed"
text="%subtitles.button.subtitles.save.label"/>
<Button fx:id="resetButton" mnemonicParsing="false" onAction="#resetButtonPressed"
text="%subtitles.button.reset.label"/>
<Button fx:id="addButton" mnemonicParsing="false" onAction="#addPressed" text="+"/>
</children>
</HBox>
</children>

View File

@@ -11,51 +11,59 @@
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<GridPane hgap="10.0" vgap="10.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.gtache.autosubtitle.gui.fx.FXWorkController">
<GridPane hgap="10.0" vgap="10.0" xmlns="http://javafx.com/javafx/22" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="com.github.gtache.autosubtitle.gui.work.fx.FXWorkController">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="ALWAYS" />
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="ALWAYS"/>
<ColumnConstraints hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="NEVER" />
<RowConstraints vgrow="ALWAYS" />
<RowConstraints vgrow="NEVER" />
<RowConstraints vgrow="NEVER" />
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="ALWAYS"/>
<RowConstraints vgrow="NEVER"/>
<RowConstraints vgrow="NEVER"/>
</rowConstraints>
<children>
<TextField fx:id="fileField" editable="false" GridPane.columnIndex="1" />
<Button mnemonicParsing="false" onAction="#fileButtonPressed" text="%work.button.file.label" GridPane.columnIndex="2" />
<TextField fx:id="fileField" editable="false" GridPane.columnIndex="1"/>
<Button mnemonicParsing="false" onAction="#fileButtonPressed" text="%work.button.file.label"
GridPane.columnIndex="2"/>
<HBox spacing="10.0" GridPane.columnIndex="1" GridPane.rowIndex="2">
<children>
<Button fx:id="extractButton" mnemonicParsing="false" onAction="#extractPressed" text="%work.button.extract.label" />
<Button fx:id="extractButton" mnemonicParsing="false" onAction="#extractPressed"
text="%work.button.extract.label"/>
</children>
</HBox>
<HBox alignment="CENTER_RIGHT" spacing="10.0" GridPane.columnIndex="2" GridPane.rowIndex="2">
<children>
<Button fx:id="exportSoftButton" mnemonicParsing="false" onAction="#exportSoftPressed" text="%work.button.export.soft.label">
<Button fx:id="exportSoftButton" mnemonicParsing="false" onAction="#exportSoftPressed"
text="%work.button.export.soft.label">
<tooltip>
<Tooltip text="%work.button.export.soft.tooltip" />
<Tooltip text="%work.button.export.soft.tooltip"/>
</tooltip>
</Button>
<Button fx:id="exportHardButton" mnemonicParsing="false" onAction="#exportHardPressed" text="%work.button.export.hard.label">
<Button fx:id="exportHardButton" mnemonicParsing="false" onAction="#exportHardPressed"
text="%work.button.export.hard.label">
<tooltip>
<Tooltip text="%work.button.export.hard.tooltip" />
<Tooltip text="%work.button.export.hard.tooltip"/>
</tooltip>
</Button>
</children>
</HBox>
<fx:include fx:id="subtitles" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" source="subtitlesView.fxml" GridPane.columnIndex="0" GridPane.columnSpan="1" GridPane.rowIndex="0" GridPane.rowSpan="3" GridPane.vgrow="ALWAYS" />
<fx:include fx:id="media" source="mediaView.fxml" GridPane.columnIndex="1" GridPane.columnSpan="2147483647" GridPane.rowIndex="1" />
<Label fx:id="progressLabel" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<fx:include fx:id="subtitles" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
source="subtitlesView.fxml" GridPane.columnIndex="0" GridPane.columnSpan="1" GridPane.rowIndex="0"
GridPane.rowSpan="3" GridPane.vgrow="ALWAYS"/>
<fx:include fx:id="media" source="mediaView.fxml" GridPane.columnIndex="1" GridPane.columnSpan="2147483647"
GridPane.rowIndex="1"/>
<Label fx:id="progressLabel" GridPane.columnIndex="1" GridPane.rowIndex="3"/>
<HBox spacing="10.0" GridPane.columnIndex="2" GridPane.rowIndex="3">
<children>
<Label fx:id="progressDetailLabel" />
<ProgressBar fx:id="progressBar" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" />
<Label fx:id="progressDetailLabel"/>
<ProgressBar fx:id="progressBar" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS"/>
</children>
</HBox>
</children>
<padding>
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0"/>
</padding>
</GridPane>

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.main.fx;
import com.github.gtache.autosubtitle.modules.gui.fx.DaggerResourceComponent;
import javafx.fxml.FXMLLoader;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.main.fx;
import org.junit.jupiter.api.Test;

View File

@@ -1,6 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.media.fx;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkModel;
import com.github.gtache.autosubtitle.subtitle.gui.fx.ObservableSubtitleImpl;
import org.junit.jupiter.api.Test;
@@ -9,12 +10,13 @@ import java.util.List;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
class TestFXMediaBinder {
@Test
void testCreateBindings() {
final var workModel = new FXWorkModel();
final var workModel = spy(FXWorkModel.class);
final var mediaModel = new FXMediaModel();
final var binder = new FXMediaBinder(workModel, mediaModel);
binder.createBindings();

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.media.fx;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.gui.TimeFormatter;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.media.fx;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.VideoInfo;

View File

@@ -1,8 +1,9 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.parameters.fx;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.VideoLoader;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkBinder;
import com.github.gtache.autosubtitle.modules.gui.fx.DaggerResourceComponent;
import com.github.gtache.autosubtitle.subtitle.converter.SubtitleConverter;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModelProvider;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.parameters.fx;
import com.github.gtache.autosubtitle.subtitle.OutputFormat;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;

View File

@@ -1,8 +1,9 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.setup.fx;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.VideoLoader;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkBinder;
import com.github.gtache.autosubtitle.modules.gui.fx.DaggerResourceComponent;
import com.github.gtache.autosubtitle.subtitle.converter.SubtitleConverter;
import com.github.gtache.autosubtitle.subtitle.extractor.SubtitleExtractor;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.setup.fx;
import com.github.gtache.autosubtitle.setup.SetupStatus;
import org.junit.jupiter.api.Test;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.VideoLoader;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.Language;
import com.github.gtache.autosubtitle.subtitle.gui.fx.ObservableSubtitleImpl;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.Language;
import org.junit.jupiter.api.Test;

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.subtitles.fx;
import com.github.gtache.autosubtitle.gui.TimeFormatter;
import org.junit.jupiter.api.Test;

View File

@@ -1,18 +1,19 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.work.fx;
import com.github.gtache.autosubtitle.gui.parameters.fx.FXParametersModel;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModelProvider;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.*;
class TestFXWorkBinder {
@Test
void testBindings() {
final var workModel = new FXWorkModel();
final var parametersModel = new FXParametersModel(mock(ExtractionModelProvider.class), "Arial", 12, 40, 1);
final var parametersModel = mock(FXParametersModel.class, withSettings().defaultAnswer(CALLS_REAL_METHODS).useConstructor(mock(ExtractionModelProvider.class), "Arial", 12, 40, 1));
final var binder = new FXWorkBinder(workModel, parametersModel);
binder.createBindings();
assertNull(workModel.extractionModel());

View File

@@ -1,4 +1,4 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.work.fx;
import com.github.gtache.autosubtitle.VideoConverter;
import com.github.gtache.autosubtitle.VideoLoader;

View File

@@ -1,7 +1,7 @@
package com.github.gtache.autosubtitle.gui.fx;
package com.github.gtache.autosubtitle.gui.work.fx;
import com.github.gtache.autosubtitle.Video;
import com.github.gtache.autosubtitle.gui.WorkStatus;
import com.github.gtache.autosubtitle.gui.work.WorkStatus;
import com.github.gtache.autosubtitle.subtitle.extractor.ExtractionModel;
import org.junit.jupiter.api.Test;

View File

@@ -1,11 +1,11 @@
package com.github.gtache.autosubtitle.modules.gui.fx;
import com.github.gtache.autosubtitle.gui.fx.FXMainController;
import com.github.gtache.autosubtitle.gui.fx.FXMediaController;
import com.github.gtache.autosubtitle.gui.fx.FXParametersController;
import com.github.gtache.autosubtitle.gui.fx.FXSetupController;
import com.github.gtache.autosubtitle.gui.fx.FXSubtitlesController;
import com.github.gtache.autosubtitle.gui.fx.FXWorkController;
import com.github.gtache.autosubtitle.gui.main.fx.FXMainController;
import com.github.gtache.autosubtitle.gui.media.fx.FXMediaController;
import com.github.gtache.autosubtitle.gui.parameters.fx.FXParametersController;
import com.github.gtache.autosubtitle.gui.setup.fx.FXSetupController;
import com.github.gtache.autosubtitle.gui.subtitles.fx.FXSubtitlesController;
import com.github.gtache.autosubtitle.gui.work.fx.FXWorkController;
import javafx.fxml.FXMLLoader;
import javafx.scene.image.Image;
import org.junit.jupiter.api.Test;