Skip to content

Commit bab9e9f

Browse files
Merge pull request rage#213 from BenAttenborough/13.5-typos
13.5 typos
2 parents a9583b0 + 654f3c2 commit bab9e9f

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

data/part-13/5-multiple-views.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import javafx.stage.Stage;
4040
public class BackAndForthApplication extends Application {
4141

4242
@Override
43-
public void start(Stage windows) {
43+
public void start(Stage window) {
4444

4545
Button back = new Button("Back ..");
4646
Button forth = new Button(".. forth.");
@@ -104,7 +104,7 @@ When first started, the program should display the first view.
104104

105105
<!-- Tutustutaan seuraavaksi kaksi erillistä näkymää sisältävään esimerkkiin. Ensimmäisessä näkymässä käyttäjää pyydetään syöttämään salasana. Jos käyttäjä kirjoittaa väärän salasanan, väärästä salasanasta ilmoitetaan. Jos käyttäjä kirjoittaa oikean salasanan, ohjelma vaihtaa seuraavaan näkymään. Ohjelman toiminta on seuraavanlainen. -->
106106

107-
Let's get familiar with an example containing two different views. In the first view user is asked to input a password. If the user types a wrong password, the application informs the user about the mistakee. If the user types the correct passwod, the application switches to the next view. The program functions as follows:
107+
Let's get familiar with an example containing two different views. In the first view user is asked to input a password. If the user types a wrong password, the application informs the user about the mistake. If the user types the correct password, the application switches to the next view. The program functions as follows:
108108

109109

110110
<img src="../img/material/gui-salasana.gif" />
@@ -194,7 +194,7 @@ public class PasswordProtectedApplication extends Application {
194194

195195
<!-- Esimerkissä on hyödynnetty sekä GridPanen että StackPanen asettelussa niiden tarjoamia setPrefSize ja setAlignment-metodeja. Metodilla setPrefSize annetaan asettelulle toivottu koko, ja metodilla setAlignment kerrotaan miten asettelun sisältö tulee ryhmittää. Parametrilla Pos.CENTER toivotaan asettelua näkymän keskelle. -->
196196

197-
The example takes advantage of GridPane's and StackPane's built in setPrefSize and setAlignMents -methods for layout. Method setPrefSize takes the preferred size of the layout as and arguments and the setAlignMent-method is used to define how the content of the layout should be aligned. The parameter Pos.CENTER is used for asking the content to be placed to the center of the application
197+
The example takes advantage of GridPane's and StackPane's built in setPrefSize and setAlignment methods for layout. Method setPrefSize takes the preferred size of the layout as an argument and the setAlignment method is used to define how the content of the layout should be aligned. The parameter Pos.CENTER is used to place the content in the center of the application
198198

199199

200200
<!-- <programming-exercise name='Tervehtijä' tmcname='osa13-Osa13_10.Tervehtija'> -->
@@ -340,20 +340,20 @@ public class ExampleApplication extends Application {
340340

341341

342342
// 2. Add subviews and add them to the menu buttons
343-
// 2.1. Create subview layout
343+
// 2.1. Create subview layout
344344
StackPane firstLayout = createView("First view");
345345
StackPane secondLayout = createView("Second view");
346346

347347
// 2.2. Add subviews to button. Pressing the buttons will change the view
348348
first.setOnAction((event) -> layout.setCenter(firstLayout));
349-
second.setOnAction((event) -> asettelu.setCenter(secondLayout));
349+
second.setOnAction((event) -> layout.setCenter(secondLayout));
350350

351351
// 2.3. Set initial view
352352
layout.setCenter(firstLayout);
353353

354354

355-
// 3. Create main scene with layout
356-
Scene scene = new Scene(asettelu);
355+
// 3. Create main scene with layout
356+
Scene scene = new Scene(layout);
357357

358358

359359
// 4. Show the main scene
@@ -433,7 +433,7 @@ public interface PersonWarehouse {
433433

434434
<!-- Käyttöliittymää toteutettaessa hyvä aloitustapa on ensin käyttöliittymän piirtäminen, jota seuraa sopivien käyttöliittymäkomponenttien lisääminen käyttöliittymään. Henkilöiden tallennuksessa tarvitsemme kentät nimelle ja henkilötunnukselle sekä napin jolla henkilö voidaan lisätä. Käytetään luokkaa TextField nimen ja henkilötunnuksen syöttämiseen ja luokkaa Button napin toteuttamiseen. Luodaan käyttöliittymään lisäksi käyttöliittymän toiminnallisuutta selventävät Label-tyyppiset selitystekstit. -->
435435

436-
When implementing a user interface a good starting point is drawing the interface followed bt adding appropriate user interface components to the user interface. When saving persons to a database we need a field for name, a field for social security number and a button for adding the person. In addition we'll also create
436+
When implementing a user interface a good starting point is drawing the interface followed by adding appropriate user interface components to the user interface. When saving persons to a database we need a field for name, a field for social security number and a button for adding the person. In addition we'll also create
437437

438438
<!--
439439
Käytetään käyttöliittymän asetteluun `GridPane`-asettelijaa. Rivejä käyttöliittymässä on 3, sarakkeita 2. Lisätään tapahtumien käsittelytoiminnallisuus myöhemmin. Käyttöliittymän alustusmetodi näyttää seuraavalta.
@@ -534,7 +534,7 @@ public void start(Stage window) {
534534
// ...
535535

536536
addButton.setOnAction((event) -> {
537-
warehouse.talleta(new Person(nameText.getText(), secText.getText());
537+
warehouse.save(new Person(nameText.getText(), secText.getText());
538538
});
539539
// ...
540540
}
@@ -626,7 +626,7 @@ public class PersonApp extends Application {
626626
Button addButton = new Button("Add person!");
627627

628628
addButton.setOnAction((event) -> {
629-
warehouse.talleta(new Person(nameText.getText(), secText.getText());
629+
warehouse.save(new Person(nameText.getText(), secText.getText());
630630
});
631631

632632
GridPane components = new GridPane();
@@ -739,7 +739,7 @@ public class Dictionary {
739739
this.words.add(word);
740740
}
741741

742-
this.translations.put(word, translations);
742+
this.translations.put(word, translation);
743743
}
744744

745745
public String getRandomWord() {
@@ -1169,7 +1169,7 @@ Follow the previous example and create an application for practising translation
11691169

11701170
<!-- Käyttöliittymästä tarkemmin. Sanojen syöttämisnäkymän näyttävän napin tekstin tulee olla "Lisää sanoja". Sanojen harjoittelunäkymän näyttävän napin tekstin tulee olla "Harjoittele". Sanoja syötettäessä ensimmäisen tekstikentän tulee olla sana alkuperäiskielellä, ja toisen tekstikentän tulee olla sana käännettynä. Syöttämiseen käytetyn napin tekstin tulee olla "Lisää sanapari". Harjoittelutilassa käyttäjältä kysytään aina sanoja alkuperäiskielellä ja hänen tulee kirjoittaa sanojen käännöksiä. Vastauksen tarkistamiseen käytetyn napin tekstin tulee olla "Tarkista". Jos vastaus on oikein, käyttöliittymässä näytetään teksti "Oikein!". Jos taas vastaus on väärin, käyttöliittymässä näytetään teksti "Väärin!" sekä tieto oikeasta vastausksesta. -->
11711171

1172-
Let's discuss the user interface in more detail. The button that shows the input view should contain the text "Enter new words". The button that shows the practice view should contain the text "Practice". In the input view, the first text field should have the word in the original language, and the second text field should contain the translation of that word. The button that adds this word and the translation should read "Add the word pair". In the practice view the user is represented with a word in the original language, and their task is to write down the translation. If the answer is correct, the user interface displays the text "Correct!". If the answer is incorrect, the text that is displayed is "Incorrec!". In this case the correct translation is also shown.
1172+
Let's discuss the user interface in more detail. The button that shows the input view should contain the text "Enter new words". The button that shows the practice view should contain the text "Practice". In the input view, the first text field should have the word in the original language, and the second text field should contain the translation of that word. The button that adds this word and the translation should read "Add the word pair". In the practice view the user is presented with a word in the original language, and their task is to write down the translation. If the answer is correct, the user interface displays the text "Correct!". If the answer is incorrect, the text that is displayed is "Incorrect!". In this case the correct translation is also shown.
11731173

11741174

11751175
<img src="../img/material/gui-vocabulary-practice.gif"/>
@@ -1215,7 +1215,7 @@ btn.setFont(Font.font("Monospaced", 40));
12151215
12161216
<!-- Muokkaa luokkaa RistinollaSovellus siten, että se käynnistää graafisen käyttöliittymän. Käytä käyttöliittymäkomponenttien asetteluun ensin BorderPane-luokkaa. Aseta BorderPanen ylälaitaan tekstikomponentti, joka sisältää tiedon vuorosta sekä pelin loppuessa tiedon pelin loppumisesta. Aseta BorderPanen keskelle GridPane, joka sisältää 9 nappia. GridPanessa tulee olla 3 riviä ja 3 saraketta, jolloin napit muodostavat 3x3-ruudukon. -->
12171217
1218-
Modify the TicTacToeApplication class so that it starts the graphical user interface. First, use the BorderPane class to create the layout of the UI components. The top of the BorderPane should continue a text component that includes the information about the turn, and at the end of the game the message that the game has ended. Set to the middle of the BorderPane a GridPane that contains 9 buttons. The GridPane should have 3 rows and 3 columns, so that the buttons form a 3x3 grid.
1218+
Modify the TicTacToeApplication class so that it starts the graphical user interface. First, use the BorderPane class to create the layout of the UI components. The top of the BorderPane should contain a text component that includes information about the turn, and at the end of the game a message to show that the game has ended. In the middle of the BorderPane create a GridPane that contains 9 buttons. The GridPane should have 3 rows and 3 columns, so that the buttons form a 3x3 grid.
12191219
12201220
<!-- <h2>Vuorojen vaihtaminen ja reilu peli</h2> -->
12211221
@@ -1227,7 +1227,7 @@ The players of the game are X and O. X always takes the first turn. Add the foll
12271227

12281228
<!-- Pelin ylälaidassa olevan tekstikentän tulee kertoa aina vuorossa oleva pelaaja. Teksti on aluksi "Vuoro: X". Kun X pelaa vuoronsa, eli painaa jotain nappia, tekstiksi asetetaan "Vuoro: O". Tämän jälkeen kun O pelaa vuoronsa, tekstiksi asetetaan taas "Vuoro: X". -->
12291229

1230-
The text component at the top of the game must always show whose turn it is. The text begins as "Turn: X". Once X playes their turn, i.e. presses a button, the text should change to "Turn: O". After the player O has played their turn, the text turns once again into "Turn: X".
1230+
The text component at the top of the game must always show whose turn it is. The text begins as "Turn: X". Once X finishes their turn by pressing a button, the text should change to "Turn: O". After player O has finished their turn, the text should turn into "Turn: X" again.
12311231

12321232
<!-- Huom! Jos pelaaja on jo pelannut tietyn ruudun, ei toinen pelaaja saa enää pelata sitä. Varmista, ettei vuoro muutu tilanteessa, jossa pelaaja yrittää pelata jo pelatun ruudun. -->
12331233

@@ -1243,7 +1243,7 @@ NB!! You might encounter the following error: "local variables referenced from a
12431243
12441244
<!-- Lisää peliin toiminnallisuus, jossa pelin voi pelata loppuun. Peli loppuu jos toinen pelaajista saa kolme samaa merkkiä riviin (pysty, vaaka, vino). Pelin loppuminen tulee ilmaista siten, että ylälaidassa on teksti "Loppu!". Tämän jälkeen pelin jatkaminen ei enää onnistu. -->
12451245
1246-
Add the possibility to finish the game to the program. The game ends if one player positions three of their symbols in a line (horizontally, vertically, or diagonally). The end of the game should be indicated by the text "The end!" at the top of the program. It is no longer possible to continue the game after this.
1246+
Add the possibility to finish the game to the program. The game ends if one player positions three of their symbols in a line (horizontally, vertically, or diagonally). The end of the game should be indicated by the text "The end!" at the top of the program. It should be no longer possible to continue the game after this.
12471247
12481248
<!-- Tehtävän testit eivät ole kattavimmat. Pyri tekemään ohjelma ilman suurta testeihin tukeutumista. -->
12491249

0 commit comments

Comments
 (0)