Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package is.hi.torg.vidmot;
- import is.hi.torg.vinnsla.Root;
- import java.net.URL;
- import java.util.Optional;
- import java.util.ResourceBundle;
- import javafx.fxml.FXML;
- import javafx.fxml.Initializable;
- import javafx.scene.Node;
- import javafx.scene.control.ButtonBar;
- import javafx.scene.control.ButtonType;
- import javafx.scene.control.Dialog;
- import javafx.scene.control.DialogPane;
- import javafx.scene.control.Label;
- import javafx.scene.image.Image;
- import javafx.scene.image.ImageView;
- import javafx.scene.layout.AnchorPane;
- import javafx.util.Callback;
- /**
- * FXML Controller class fyrir Dialog controller til
- * að sýna námskeið
- *
- * @author Ebba Þóra Hvannberg ebba@hi.is
- */
- public class DagskraDialogController implements Initializable {
- @FXML
- private static Label jTitill;
- @FXML
- private static Label jLysing;
- @FXML
- private static Label jUpphaf;
- @FXML
- private static Label jTimi;
- @FXML
- private static Label jSeriaOgThattur;
- @FXML
- private static Label jBeinni;
- @FXML
- private static AnchorPane dagskraDialog;
- /**
- * Initializes the controller class.
- */
- @Override
- public void initialize(URL url, ResourceBundle rb) {
- }
- /***
- * Birtir dialog með námskeiði í
- * @param namskeid fullt heiti námskeiðs
- */
- public void dagskraDialogBirta(Root.Results svar) {
- // Innihald dialogs búið til
- DialogPane p = new DialogPane();
- dagskraDialog.setVisible(true);
- // Búa námskeið niður og setja í label hluti
- setjaGogn(svar);
- // Innihald sett sem Pane sem fengið er úr Scene builder
- p.setContent(dagskraDialog);
- // Umgjörðin búin til - Dialog sem gefur niðurstöðu í Leikmenn klasann
- Dialog<ButtonType> d = new Dialog();
- // og innihaldið sett í umgjörðina
- d.setDialogPane(p);
- // Haus, titill og mynd ef vill
- d.setTitle("Skoða námskeið");
- // Hnapparnir Í lagi og hætta við búnir til og bætt við
- ButtonType iLagi = new ButtonType("Í lagi",
- ButtonBar.ButtonData.OK_DONE);
- d.getDialogPane().getButtonTypes().add(iLagi);
- ButtonType haettaVid = new ButtonType("Hætta við",
- ButtonBar.ButtonData.CANCEL_CLOSE);
- d.getDialogPane().getButtonTypes().add(haettaVid);
- // Dialog birtur - svarið ekki notað
- d.showAndWait();
- }
- /**
- * Setja gögn í samtalsgluggann. Kóði og nafn á námskeiði
- * @param s strengur sem gögnin eru geymd í
- */
- public static void setjaGogn(Root.Results svar) {
- jTitill.setText(svar.getTitle());
- jLysing.setText(svar.getDescription());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement