parent
96133965c6
commit
5abb23415c
@ -0,0 +1,119 @@
|
||||
package gui;
|
||||
|
||||
import alg.XML_processing;
|
||||
import data.*;
|
||||
import javafx.application.HostServices;
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.binding.StringBinding;
|
||||
import javafx.beans.property.ReadOnlyDoubleWrapper;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.concurrent.Task;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.controlsfx.control.CheckComboBox;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static gui.GUIController.showAlert;
|
||||
|
||||
@SuppressWarnings("Duplicates")
|
||||
public class AboutTab {
|
||||
public final static Logger logger = LogManager.getLogger(AboutTab.class);
|
||||
|
||||
private HostServices hostService;
|
||||
|
||||
@FXML
|
||||
public AnchorPane aboutTabPane;
|
||||
|
||||
@FXML
|
||||
public Pane paneSlo;
|
||||
|
||||
@FXML
|
||||
public Pane paneEng;
|
||||
|
||||
@FXML
|
||||
public Label aboutL;
|
||||
|
||||
@FXML
|
||||
private Hyperlink cjvtSH;
|
||||
|
||||
@FXML
|
||||
private Hyperlink githubSH;
|
||||
|
||||
@FXML
|
||||
private Hyperlink cjvtEH;
|
||||
|
||||
@FXML
|
||||
private Hyperlink githubEH;
|
||||
|
||||
@FXML
|
||||
private Button changeLanguageB;
|
||||
|
||||
@FXML
|
||||
public ImageView stringLengthI;
|
||||
|
||||
// TODO: pass observables for taxonomy based on header scan
|
||||
// after header scan
|
||||
|
||||
public void initialize() {
|
||||
aboutTabPane.getStylesheets().add("style.css");
|
||||
aboutTabPane.getStyleClass().add("root");
|
||||
|
||||
Messages.setPane(paneSlo, paneEng);
|
||||
|
||||
manageTranslations();
|
||||
|
||||
changeLanguageB.setOnAction(e -> {
|
||||
if (I18N.getLocale() == new Locale.Builder().setLanguage("sl").setRegion("SI").build()){
|
||||
I18N.setLocale(Locale.ENGLISH);
|
||||
} else {
|
||||
I18N.setLocale(new Locale.Builder().setLanguage("sl").setRegion("SI").build());
|
||||
}
|
||||
Messages.reload();
|
||||
Messages.updateChooseCorpusL();
|
||||
logger.info("change language");
|
||||
});
|
||||
|
||||
cjvtSH.setOnAction(e -> openCjvtWebsite());
|
||||
|
||||
githubSH.setOnAction(e -> openGithubWebsite());
|
||||
|
||||
cjvtEH.setOnAction(e -> openCjvtWebsite());
|
||||
|
||||
githubEH.setOnAction(e -> openGithubWebsite());
|
||||
}
|
||||
|
||||
private void manageTranslations(){
|
||||
changeLanguageB.textProperty().bind(I18N.createStringBinding("button.language"));
|
||||
aboutL.textProperty().bind(I18N.createStringBinding("about.text"));
|
||||
// calculateForL.textProperty().bind(I18N.createStringBinding("label.calculateFor"));
|
||||
// displayTaxonomyL.textProperty().bind(I18N.createStringBinding("label.displayTaxonomy"));
|
||||
//
|
||||
// addTooltipToImage(stringLengthI, I18N.createStringBinding("label.letter.stringLengthH"));
|
||||
}
|
||||
|
||||
private void openCjvtWebsite(){
|
||||
hostService.showDocument(Messages.CJVT_URL);
|
||||
}
|
||||
|
||||
private void openGithubWebsite(){
|
||||
hostService.showDocument(Messages.GITHUB_URL);
|
||||
}
|
||||
|
||||
public void setHostServices(HostServices hostServices){
|
||||
this.hostService = hostServices;
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 20 KiB |
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.image.ImageView?>
|
||||
<?import javafx.scene.image.Image?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Hyperlink?>
|
||||
<AnchorPane fx:id="aboutTabPane" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gui.AboutTab">
|
||||
<children>
|
||||
<Pane>
|
||||
<Label fx:id="aboutL" layoutX="10.0" layoutY="20.0" prefWidth="800" text="?" />
|
||||
<!--<ImageView fx:id="stringLengthI" layoutX="370.0" layoutY="27.5" pickOnBounds="true" preserveRatio="true">-->
|
||||
<!--<Image url="questionmark.png" backgroundLoading="true"/>-->
|
||||
<!--</ImageView>-->
|
||||
|
||||
|
||||
|
||||
<!--<Label fx:id="calculateForL" layoutX="10.0" layoutY="60.0" prefHeight="25.0" text="Izračunaj za"/>-->
|
||||
<Pane fx:id="paneSlo">
|
||||
<Label fx:id="linksSL" layoutX="114.0" layoutY="360.0" prefWidth="800" text="in ." />
|
||||
|
||||
<ImageView fx:id="logoSloI" layoutX="10.0" layoutY="360.0" pickOnBounds="true" preserveRatio="true" fitWidth="600">
|
||||
<Image url="CJVT_CGP_Osnovni_znak+Pripis_naziva_SLO.png" backgroundLoading="true"/>
|
||||
</ImageView>
|
||||
|
||||
<Hyperlink fx:id="cjvtSH" layoutX="25.0" layoutY="356.0" text="CLARIN.SI" />
|
||||
<Hyperlink fx:id="githubSH" layoutX="129.0" layoutY="356.0" text="GitHub" />
|
||||
</Pane>
|
||||
|
||||
<Pane fx:id="paneEng" visible="false">
|
||||
<Label fx:id="linksEL" layoutX="114.0" layoutY="360.0" prefWidth="800" text="and ." />
|
||||
|
||||
<ImageView fx:id="logoEngI" layoutX="10.0" layoutY="360.0" pickOnBounds="true" preserveRatio="true" fitWidth="740">
|
||||
<Image url="CJVT_CGP_Osnovni_znak+Pripis_naziva_ENG.png" backgroundLoading="true"/>
|
||||
</ImageView>
|
||||
|
||||
<Hyperlink fx:id="cjvtEH" layoutX="25.0" layoutY="356.0" text="CLARIN.SI" />
|
||||
<Hyperlink fx:id="githubEH" layoutX="144.0" layoutY="356.0" text="GitHub" />
|
||||
</Pane>
|
||||
</Pane>
|
||||
</children>
|
||||
<Button fx:id="changeLanguageB" layoutX="710.0" layoutY="40.0" mnemonicParsing="false" prefWidth="50.0"/>
|
||||
</AnchorPane>
|
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 20 KiB |
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<AnchorPane prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
|
||||
<children>
|
||||
<Label layoutX="371.0" layoutY="26.0" text="Izbrani filtri:"/>
|
||||
<Label fx:id="selectedFiltersLabel" alignment="TOP_LEFT" layoutX="371.0" layoutY="43.0" prefHeight="188.0"
|
||||
prefWidth="215.0"
|
||||
text=" "/>
|
||||
</children>
|
||||
</AnchorPane>
|
Loading…
Reference in new issue