Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package notepad.controller;
- import javafx.event.ActionEvent;
- import javafx.event.Event;
- import javafx.fxml.FXML;
- import javafx.scene.Node;
- import javafx.scene.control.Button;
- import javafx.scene.control.ListView;
- import javafx.scene.control.TextArea;
- import javafx.scene.control.TextField;
- import javafx.scene.text.Font;
- import javafx.stage.Stage;
- import notepad.model.Notepad;
- /**
- * Created by Krzysztof on 2016-11-09.
- */
- public class FontController {
- @FXML
- private TextField txtFldSize, txtFldFont, txtFldStyle;
- @FXML
- private ListView lstViewFont, lstViewStyle, lstViewSize;
- @FXML
- private Button btnOK, btnCancel;
- private NotepadController notepadController;
- private Notepad notepad;
- //----------------------setter----------
- public void setTxtFldSizeText(String text){
- txtFldSize.setText(text);
- }
- public void setTxtFldFontText(String text){
- txtFldFont.setText(text);
- }
- public void setTxtFldStyleText(String text){
- txtFldStyle.setText(text);
- }
- public void setNotepadController(NotepadController notepadController) {
- this.notepadController = notepadController;
- }
- public void setLstViewFont(ListView lstViewFont) {
- this.lstViewFont = lstViewFont;
- }
- public void setLstViewStyle(ListView lstViewStyle) {
- this.lstViewStyle = lstViewStyle;
- }
- public void setLstViewSize(ListView lstViewSize) {
- this.lstViewSize = lstViewSize;
- }
- public void setNotepad(Notepad notepad) {
- this.notepad = notepad;
- }
- //---------------------getters----------
- public TextField getTxtFldSize() {
- return txtFldSize;
- }
- public TextField getTxtFldFont() {
- return txtFldFont;
- }
- public TextField getTxtFldStyle() {
- return txtFldStyle;
- }
- public ListView getLstViewFont() {
- return lstViewFont;
- }
- public ListView getLstViewStyle() {
- return lstViewStyle;
- }
- public ListView getLstViewSize() {
- return lstViewSize;
- }
- public void handleOkBtn(ActionEvent event) {
- notepad.setChoosenFontOptions();
- Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
- stage.close();
- }
- public void handleCancelBtn(ActionEvent event) {
- Stage stage = (Stage) ((Node) event.getSource()).getScene().getWindow();
- stage.close();
- }
- public void handleMouseClicked(Event event) {
- notepad.getFile();
- notepad.displayFontData(event);
- }
- }
Add Comment
Please, Sign In to add comment