-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
412 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
JavaFXApplication/src/main/java/javafxapplication/Controller/User/AddUserController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package javafxapplication.Controller.User; | ||
|
||
|
||
import javafx.event.ActionEvent; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.Initializable; | ||
import javafx.scene.Scene; | ||
import javafx.scene.control.*; | ||
import javafx.scene.layout.StackPane; | ||
import javafxapplication.Proxy.UserProxy; | ||
import javafxapplication.Model.RequestDto.AddUserRequest; | ||
//import javafxapplication.Model.Shop; | ||
//import main.java.javafxapplication.Proxy.UserProxy; | ||
//import javafxapplication.Proxy.ShopProxy; | ||
import javafx.stage.Stage; | ||
|
||
import java.net.URL; | ||
import java.util.ResourceBundle; | ||
|
||
|
||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: admin | ||
* Date: 26.12.13 | ||
* Time: 14:04 | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class AddUserController implements Initializable{ | ||
|
||
@FXML | ||
private TextField text1; | ||
@FXML | ||
private TextField text2; | ||
@FXML | ||
private TextField text3; | ||
|
||
|
||
UserProxy userProxy = new UserProxy(); | ||
|
||
@FXML | ||
private void handleButtonAction(ActionEvent actionEvent) { | ||
|
||
String userName, email, password; | ||
userName = text1.getText(); | ||
email=text2.getText(); | ||
password=text3.getText(); | ||
|
||
|
||
AddUserRequest request = new AddUserRequest( userName, email,password); | ||
|
||
userProxy.addUser(request); | ||
text1.setText(""); | ||
text2.setText(""); | ||
text3.setText(""); | ||
} | ||
@FXML | ||
private void textTazala(ActionEvent event){ | ||
text1.setText(""); | ||
text2.setText(""); | ||
text3.setText(""); | ||
} | ||
|
||
@Override | ||
public void initialize(URL url, ResourceBundle resourceBundle) { | ||
//To change body of implemented methods use File | Settings | File Templates. | ||
} | ||
} |
35 changes: 28 additions & 7 deletions
35
JavaFXApplication/src/main/java/javafxapplication/Controller/User/ListUserController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,39 @@ | ||
package javafxapplication.Controller.User; | ||
|
||
import javafx.fxml.Initializable; | ||
|
||
import javafx.scene.control.TableColumn; | ||
import javafx.scene.control.TableView; | ||
import javafx.event.ActionEvent; | ||
import javafx.scene.control.cell.PropertyValueFactory; | ||
import javafxapplication.Model.User; | ||
import javafxapplication.Proxy.UserProxy; | ||
import java.net.URL; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.ResourceBundle; | ||
|
||
/** | ||
* | ||
* @author Akim | ||
*/ | ||
public class ListUserController implements Initializable { | ||
|
||
|
||
public TableColumn<User, String> userName; | ||
public TableColumn<User, String> email; | ||
|
||
public TableView<User> UserListTableView; | ||
|
||
UserProxy userProxy = new UserProxy(); | ||
|
||
@Override | ||
public void initialize(URL url, ResourceBundle resourceBundle) { | ||
public void initialize(URL url, ResourceBundle rb) { | ||
|
||
userName.setCellValueFactory(new PropertyValueFactory<User, String>("userName")); | ||
email.setCellValueFactory(new PropertyValueFactory<User, String>("email")); | ||
} | ||
|
||
public void textTolukta(ActionEvent actionEvent) { | ||
List<User> users = Arrays.asList(userProxy.getUsers()); | ||
|
||
|
||
UserListTableView.getItems().setAll(users); | ||
} | ||
|
||
|
||
} |
60 changes: 60 additions & 0 deletions
60
JavaFXApplication/src/main/java/javafxapplication/Model/RequestDto/AddUserRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package javafxapplication.Model.RequestDto; | ||
|
||
import java.io.Serializable; | ||
/** | ||
* Created with IntelliJ IDEA. | ||
* User: admin | ||
* Date: 26.12.13 | ||
* Time: 14:10 | ||
* To change this template use File | Settings | File Templates. | ||
*/ | ||
public class AddUserRequest implements Serializable{ | ||
|
||
private long id; | ||
private String userName; | ||
private String email; | ||
private String password; | ||
|
||
public AddUserRequest() | ||
{ | ||
|
||
} | ||
public AddUserRequest(String userName, String email, String password) | ||
{ | ||
this.userName = userName; | ||
this.email = email; | ||
this.password = password; | ||
} | ||
|
||
public String getName() { | ||
return userName; | ||
} | ||
|
||
public void setName(String name) { | ||
this.userName = name; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public long getId() { | ||
return id; | ||
} | ||
|
||
public void setId(long id) { | ||
this.id = id; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
JavaFXApplication/src/main/resources/View/AddUserControl.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.lang.*?> | ||
<?import javafx.collections.*?> | ||
<?import javafx.scene.control.*?> | ||
<?import javafx.scene.layout.*?> | ||
<?import javafx.scene.text.*?> | ||
|
||
<AnchorPane prefHeight="500.0" prefWidth="392.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="javafxapplication.Controller.User.AddUserController"> | ||
<children> | ||
<Label layoutX="112.0" layoutY="14.0" minHeight="16.0" minWidth="69.0" text="Жаңы колдонуучу кошуу" textFill="#00ff5b"> | ||
<font> | ||
<Font size="20.0" /> | ||
</font> | ||
</Label> | ||
<Label layoutX="22.0" layoutY="99.0" text="Колдонуучунун аты:" textFill="RED"> | ||
<font> | ||
<Font size="14.0" fx:id="x1" /> | ||
</font> | ||
</Label> | ||
<Label font="$x1" layoutX="22.0" layoutY="131.0" text="Электронндук дареги:" textFill="RED" /> | ||
<Label font="$x1" layoutX="22.0" layoutY="171.0" text="Сыр соз:" textFill="RED" /> | ||
<TextField fx:id="text1" layoutX="161.0" layoutY="94.0" prefHeight="27.0" prefWidth="200.0" /> | ||
<TextField fx:id="text2" layoutX="161.0" layoutY="131.0" prefHeight="27.0" prefWidth="200.0" /> | ||
<PasswordField fx:id="text3" layoutX="161.0" layoutY="171.0" prefHeight="27.0" prefWidth="200.0" promptText="Пароль" /> | ||
<Button layoutX="161.0" layoutY="217.0" mnemonicParsing="false" onAction="#textTazala" prefHeight="27.0" prefWidth="88.0" text="Тазала" /> | ||
<Button layoutX="273.0" layoutY="217.0" onAction="#handleButtonAction" prefHeight="27.0" prefWidth="88.0" text="OK" /> | ||
</children> | ||
</AnchorPane> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 20 additions & 19 deletions
39
JavaFXApplication/src/main/resources/View/MainWindow.fxml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import java.lang.*?> | ||
<?import javafx.geometry.*?> | ||
<?import javafx.geometry.Insets?> | ||
<?import javafx.scene.control.*?> | ||
<?import javafx.scene.layout.*?> | ||
|
||
<?import javafx.geometry.Insets?> | ||
<VBox id="AnchorPane" prefHeight="500.0" prefWidth="392.0" xmlns="http://javafx.com/javafx/8" | ||
xmlns:fx="http://javafx.com/fxml/1" fx:controller="javafxapplication.Controller.MainController"> | ||
<children> | ||
<MenuBar> | ||
<menus> | ||
<Menu text="Колдонуучулар"> | ||
<items> | ||
<MenuItem mnemonicParsing="false" text="Колдонуучулардын тизмеси" onAction="#listSeller"/> | ||
</items> | ||
</Menu> | ||
</menus> | ||
</MenuBar> | ||
<VBox fx:id="vbox"> | ||
<VBox.margin> | ||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0"/> | ||
</VBox.margin> | ||
</VBox> | ||
</children> | ||
<VBox id="AnchorPane" prefHeight="500.0" prefWidth="392.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="javafxapplication.Controller.MainController"> | ||
<children> | ||
<MenuBar> | ||
<menus> | ||
<Menu text="Колдонуучулар"> | ||
<items> | ||
<MenuItem mnemonicParsing="false" onAction="#listUser" text="Колдонуучулардын тизмеси" /> | ||
<MenuItem mnemonicParsing="false" onAction="#addUser" text="Колдонуучу кошуууу-уу" /> | ||
</items> | ||
</Menu> | ||
</menus> | ||
</MenuBar> | ||
<VBox fx:id="vbox" prefWidth="363.0001220703125"> | ||
<VBox.margin> | ||
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" /> | ||
</VBox.margin> | ||
</VBox> | ||
</children> | ||
</VBox> |
Oops, something went wrong.