diff --git a/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java b/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java index 27a919d..d329b8b 100644 --- a/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java +++ b/src/main/java/edu/kit/typicalc/view/content/infocontent/ImageSlide.java @@ -21,29 +21,33 @@ public class ImageSlide extends Slide implements LocaleChangeObserver { private static final String SLIDE_LAYOUT_ID = "slideLayout"; private static final String EXPLANATION_ID = "explanation"; + private final VerticalLayout slideLayout; private final Span explanation; private final String explanationKey; + private final String imageKey; /** - * Create a new ImageSlide with the path of the image and a key for the text. + * Create a new ImageSlide with the key of the image and a key for the text. * - * @param imgPath the path of the image + * @param imgKey the key of the image * @param textKey key for the text */ - public ImageSlide(String imgPath, String textKey) { - VerticalLayout slideLayout = new VerticalLayout(); - Image image = new Image(imgPath, StringUtils.EMPTY); + public ImageSlide(String imgKey, String textKey) { + slideLayout = new VerticalLayout(); + imageKey = imgKey; explanationKey = textKey; explanation = new Span(getTranslation(explanationKey)); explanation.setId(EXPLANATION_ID); - slideLayout.add(image, explanation); + slideLayout.add(new Image(getTranslation(imgKey), StringUtils.EMPTY), explanation); slideLayout.setId(SLIDE_LAYOUT_ID); add(slideLayout); } @Override public void localeChange(LocaleChangeEvent event) { + slideLayout.removeAll(); explanation.setText(getTranslation(explanationKey)); + slideLayout.add(new Image(getTranslation(imageKey), StringUtils.EMPTY), explanation); } } diff --git a/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java b/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java index 0e4b540..d2855f5 100644 --- a/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java +++ b/src/main/java/edu/kit/typicalc/view/content/infocontent/StartPageView.java @@ -93,16 +93,17 @@ public class StartPageView extends VerticalLayout implements ControlPanelView, L } private Carousel createScenarioCarousel() { - Slide slide1 = new ImageSlide(getTranslation("root.image1"), "root.text1"); - Slide slide2 = new ImageSlide(getTranslation("root.image2"), "root.text2"); - Slide slide3 = new ImageSlide(getTranslation("root.image3"), "root.text3"); - Slide slide4 = new ImageSlide(getTranslation("root.image4"), "root.text4"); - Slide slide5 = new ImageSlide(getTranslation("root.image5"), "root.text5"); - Slide slide6 = new ImageSlide(getTranslation("root.image6"), "root.text6"); - Slide slide7 = new ImageSlide(getTranslation("root.image7"), "root.text7"); - Slide slide8 = new ImageSlide(getTranslation("root.image8"), "root.text8"); + Slide slide0 = new ImageSlide("root.image0", "root.text0"); + Slide slide1 = new ImageSlide("root.image1", "root.text1"); + Slide slide2 = new ImageSlide("root.image2", "root.text2"); + Slide slide3 = new ImageSlide("root.image3", "root.text3"); + Slide slide4 = new ImageSlide("root.image4", "root.text4"); + Slide slide5 = new ImageSlide("root.image5", "root.text5"); + Slide slide6 = new ImageSlide("root.image6", "root.text6"); + Slide slide7 = new ImageSlide("root.image7", "root.text7"); + Slide slide8 = new ImageSlide("root.image8", "root.text8"); - return new Carousel(slide1, slide2, slide3, slide4, slide5, slide6, slide7, slide8).withoutNavigation() + return new Carousel(slide0, slide1, slide2, slide3, slide4, slide5, slide6, slide7, slide8).withoutNavigation() .withoutSwipe(); } diff --git a/src/main/resources/META-INF/resources/carousel/ClickShareButton-english.jpg b/src/main/resources/META-INF/resources/carousel/ClickShareButton-english.jpg new file mode 100644 index 0000000..a2241a8 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/ClickShareButton-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/ClickShareButton-german.jpg b/src/main/resources/META-INF/resources/carousel/ClickShareButton-german.jpg new file mode 100644 index 0000000..e28e486 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/ClickShareButton-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/ClickTypeButton-english.jpg b/src/main/resources/META-INF/resources/carousel/ClickTypeButton-english.jpg new file mode 100644 index 0000000..30c0602 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/ClickTypeButton-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/ClickTypeButton-german.jpg b/src/main/resources/META-INF/resources/carousel/ClickTypeButton-german.jpg new file mode 100644 index 0000000..23de421 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/ClickTypeButton-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/ClickTypeButton.png b/src/main/resources/META-INF/resources/carousel/ClickTypeButton.png deleted file mode 100644 index 13257df..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/ClickTypeButton.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/EndOfTree-english.jpg b/src/main/resources/META-INF/resources/carousel/EndOfTree-english.jpg new file mode 100644 index 0000000..2731d77 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/EndOfTree-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/EndOfTree-german.jpg b/src/main/resources/META-INF/resources/carousel/EndOfTree-german.jpg new file mode 100644 index 0000000..1314ea0 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/EndOfTree-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/EndOfTree.png b/src/main/resources/META-INF/resources/carousel/EndOfTree.png deleted file mode 100644 index 293ad75..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/EndOfTree.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/EnterTerm-english.jpg b/src/main/resources/META-INF/resources/carousel/EnterTerm-english.jpg new file mode 100644 index 0000000..50b2278 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/EnterTerm-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/EnterTerm-german.jpg b/src/main/resources/META-INF/resources/carousel/EnterTerm-german.jpg new file mode 100644 index 0000000..d20f798 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/EnterTerm-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/EnterTerm.png b/src/main/resources/META-INF/resources/carousel/EnterTerm.png deleted file mode 100644 index 2a7c0b8..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/EnterTerm.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions-english.jpg b/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions-english.jpg new file mode 100644 index 0000000..22148b7 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions-german.jpg b/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions-german.jpg new file mode 100644 index 0000000..ca000a3 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions.png b/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions.png deleted file mode 100644 index 1871c18..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/EnterTypeAssumptions.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/NavigateTree-english.jpg b/src/main/resources/META-INF/resources/carousel/NavigateTree-english.jpg new file mode 100644 index 0000000..310f5ba Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/NavigateTree-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/NavigateTree-german.jpg b/src/main/resources/META-INF/resources/carousel/NavigateTree-german.jpg new file mode 100644 index 0000000..6201db9 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/NavigateTree-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/NavigateTree.png b/src/main/resources/META-INF/resources/carousel/NavigateTree.png deleted file mode 100644 index 74a92fe..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/NavigateTree.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/OpenExportDialog.png b/src/main/resources/META-INF/resources/carousel/OpenExportDialog.png deleted file mode 100644 index 11b94fc..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/OpenExportDialog.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions-english.jpg b/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions-english.jpg new file mode 100644 index 0000000..5d29325 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions-german.jpg b/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions-german.jpg new file mode 100644 index 0000000..c0407c7 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions.png b/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions.png deleted file mode 100644 index 2e62e2c..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/OpenTypeAssumptions.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/StartPage-english.jpg b/src/main/resources/META-INF/resources/carousel/StartPage-english.jpg new file mode 100644 index 0000000..aafda4f Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/StartPage-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/StartPage-german.jpg b/src/main/resources/META-INF/resources/carousel/StartPage-german.jpg new file mode 100644 index 0000000..b34c0f8 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/StartPage-german.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/UseExportDialog.png b/src/main/resources/META-INF/resources/carousel/UseExportDialog.png deleted file mode 100644 index 265b4eb..0000000 Binary files a/src/main/resources/META-INF/resources/carousel/UseExportDialog.png and /dev/null differ diff --git a/src/main/resources/META-INF/resources/carousel/UseShareDialog-english.jpg b/src/main/resources/META-INF/resources/carousel/UseShareDialog-english.jpg new file mode 100644 index 0000000..bb2ebd6 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/UseShareDialog-english.jpg differ diff --git a/src/main/resources/META-INF/resources/carousel/UseShareDialog-german.jpg b/src/main/resources/META-INF/resources/carousel/UseShareDialog-german.jpg new file mode 100644 index 0000000..62ed796 Binary files /dev/null and b/src/main/resources/META-INF/resources/carousel/UseShareDialog-german.jpg differ diff --git a/src/main/resources/language/translation_de.properties b/src/main/resources/language/translation_de.properties index 50fb40c..bf38df4 100644 --- a/src/main/resources/language/translation_de.properties +++ b/src/main/resources/language/translation_de.properties @@ -124,23 +124,25 @@ navigiert werden. root.linkText=Weitere Informationen zur Typinferenz findest du \u0020 root.link=https://de.wikipedia.org/wiki/Typinferenz_nach_Hindley-Milner root.here=hier -root.image1=/carousel/EnterTerm.png +root.image0=/carousel/StartPage-german.jpg +root.text0=Verwende die Knöpfe am unteren Ende der Seite, um durch die Slideshow zu navigieren. +root.image1=/carousel/EnterTerm-german.jpg root.text1=Der Term \u03BBx.x wird in das Textfeld eingegeben. -root.image2=/carousel/OpenTypeAssumptions.png +root.image2=/carousel/OpenTypeAssumptions-german.jpg root.text2=Der Typannahmen-Knopf wird betätigt, um ein Fenster zur Eingabe von Typannahmen zu öffnen. -root.image3=/carousel/EnterTypeAssumptions.png +root.image3=/carousel/EnterTypeAssumptions-german.jpg root.text3=Eine Typannahme mit Variable "x" und Typ "int" wird hinzugefügt. -root.image4=/carousel/ClickTypeButton.png +root.image4=/carousel/ClickTypeButton-german.jpg root.text4=Der Typisieren-Knopf wird betätigt, um den Typinferenzalgorithmus zu starten. -root.image5=/carousel/NavigateTree.png +root.image5=/carousel/NavigateTree-german.jpg root.text5=Die Knöpfe am unteren Ende der Seite werden verwendet, um zwischen einzelnen Schritten des Algorithmus \ zu wechseln. -root.image6=/carousel/EndOfTree.png +root.image6=/carousel/EndOfTree-german.jpg root.text6=Am Ende des Algorithmus sind der allgemeinste Unifikator, der finale Typ und der finale Herleitungsbaum \ der Eingabe zu sehen. -root.image7=/carousel/OpenExportDialog.png +root.image7=/carousel/ClickShareButton-german.jpg root.text7=Der Teilen-Knopfs wird betätigt, um das entsprechende Dialogfenster zu öffnen. -root.image8=/carousel/UseExportDialog.png +root.image8=/carousel/UseShareDialog-german.jpg root.text8=In dem Dialogfenster sind der Permalink zur aktuellen Seite, der Latex-Code des Baums und die im Code \ verwendeten Pakete aufgelistet. root.correctAssumptions=Korrigiere oder lösche die ungültigen Typannahmen (rot hinterlegt) \ diff --git a/src/main/resources/language/translation_en.properties b/src/main/resources/language/translation_en.properties index 867769e..44949f7 100644 --- a/src/main/resources/language/translation_en.properties +++ b/src/main/resources/language/translation_en.properties @@ -116,22 +116,24 @@ by a red border. The buttons at the bottom of the website can be used to navigat root.linkText=Further information on the type inference algorithm can be found \u0020 root.link=https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system root.here=here -root.image1=/carousel/EnterTerm.png +root.image0=/carousel/StartPage-english.jpg +root.text0=Use the buttons at the bottom of the page to navigate through the slideshow. +root.image1=/carousel/EnterTerm-english.jpg root.text1=The term \u03BBx.x is entered into the input field. -root.image2=/carousel/OpenTypeAssumptions.png +root.image2=/carousel/OpenTypeAssumptions-english.jpg root.text2=The type assumptions button is clicked to open up a dialog to enter type assumptions. -root.image3=/carousel/EnterTypeAssumptions.png +root.image3=/carousel/EnterTypeAssumptions-english.jpg root.text3=A type assumption with variable "x" and type "int" is being entered. -root.image4=/carousel/ClickTypeButton.png +root.image4=/carousel/ClickTypeButton-english.jpg root.text4=The type button is clicked to start the type inference algorithm. -root.image5=/carousel/NavigateTree.png +root.image5=/carousel/NavigateTree-english.jpg root.text5=The buttons at the bottom of the website can be used to navigate through the steps of the algorithm. -root.image6=/carousel/EndOfTree.png +root.image6=/carousel/EndOfTree-english.jpg root.text6=At the end of the algorithm the most general unifier, the final type and the final tree of the \ entered term are being displayed. -root.image7=/carousel/OpenExportDialog.png +root.image7=/carousel/ClickShareButton-english.jpg root.text7=The share button is clicked to open up the corresponding dialog. -root.image8=/carousel/UseExportDialog.png +root.image8=/carousel/UseShareDialog-english.jpg root.text8=The dialog contains a permalink to the current page, the LaTeX-code of the tree and the packages needed \ to compile the code. root.correctAssumptions=Correct or delete the invalid type assumptions (red background) before closing the dialog.