22 Commits
v1.1 ... 1.3.0

Author SHA1 Message Date
suisui
2fc8a622ab update:调整项目结构,将example独立抽离module 2021-09-16 00:40:18 +08:00
suisui
3543f8acd3 1.3.0-SNAPSHOT 2021-09-16 00:02:53 +08:00
suisui
96a58bcda5 update:更新sonatype配置 2021-09-15 23:58:58 +08:00
suisui
34ddd6f26e update:补充部分注释 2021-09-06 09:02:24 +08:00
suisui
38dc53b484 fix #I1HKWY 2021-09-05 23:21:15 +08:00
suisui
547c036cdb 1.2.1-SNAPSHOT 2021-09-05 23:07:24 +08:00
suisui
a69651447c fix:修复读取中文路径文件异常 2021-09-05 22:58:16 +08:00
yangsuiyu
f6189b1bf9 支持动态修改窗口标题setWindowTitle、窗口图标setIcon、窗口可拖拽拖放setDragAndResize的接口 2020-08-29 17:50:33 +08:00
yangsuiyu
d139cbe3c5 1.修复IDEA中无法加载resources文件夹的Bug;2.修改多语言Demo 2020-08-28 23:20:34 +08:00
yangsuiyu
5b7131febf 更新READNE文档 2020-05-08 00:16:38 +08:00
yangsuiyu
a82844cf35 v1.2.0更新
1. 设计代码模块文件,导入IDE后可快速生成符合JavaFX-Plus编程规范的FXPlusController、FXPlusWindow、FXPlusApplication、FXPlusFXML文件
2. 完善多窗口切换功能,可携带数据跳转
3. 新增注解@FXWindow中的icon属性,传入String类型的图标URL,可为窗口标题栏增设图标
4. 完善JavaFX-Plus生命周期
5. 新增日志log模块
6. 新增语言国际化操作
7. 新增测试生命周期LifeDemo示例和测试国际化的LanguageDemo示例代码
8. 规范化代码和更新README
2020-05-04 23:05:02 +08:00
yangsuiyu
b48325cd63 v1.2.0更新
1. 设计代码模块文件,导入IDE后可快速生成符合JavaFX-Plus编程规范的FXPlusController、FXPlusWindow、FXPlusApplication、FXPlusFXML文件
2. 完善多窗口切换功能,可携带数据跳转
3. 新增注解@FXWindow中的icon属性,传入String类型的图标URL,可为窗口标题栏增设图标
4. 完善JavaFX-Plus生命周期
5. 新增日志log模块
6. 新增语言国际化操作
7. 新增测试生命周期LifeDemo示例和测试国际化的LanguageDemo示例代码
8. 规范化代码和更新README
2020-05-04 15:13:58 +08:00
yangsuiyu
7c807d4b39 可携带数据跳转
1. 新增可携带数据跳转的功能
2. 完善README
3. 修改示例
2020-04-07 21:53:25 +08:00
yangsuiyu
119436dc3b 修正resizable的bug 2020-04-05 22:43:29 +08:00
yangsuiyu
5e60991bda 修改README
1. 修改README
2. 测试分支
2020-04-01 13:35:34 +08:00
suisui
5f9150b0f6 修改README 2020-01-22 10:21:48 +08:00
suisui
9a04efd84f 修改gitee的markdown解析器不支持[TOC]标签所导致目录索引无法显示的bug 2020-01-22 02:44:20 +08:00
suisui
d23cda4f47 新增英文README,修正部分文件结构 2020-01-22 02:18:46 +08:00
Biubiu
54dc098123 修改README 2020-01-15 10:37:23 +08:00
Biubiu
3147d9f9b7 解决了jar包无法扫描问题 2020-01-15 10:29:57 +08:00
Biubiu
4e968bcd08 添加具体应用 2020-01-09 22:57:17 +08:00
suisui
9a542c6caa 修正部分api名称不一致的问题,新增firstDemo示例代码,展现精细化操作时该如何编写代码 2020-01-01 23:45:25 +08:00
227 changed files with 6075 additions and 1238 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
.idea
*.iml
**/*.log
**/target

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: cglib:cglib:3.1" level="project" />
<orderEntry type="library" name="Maven: org.ow2.asm:asm:4.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
</component>
</module>

View File

File diff suppressed because it is too large Load Diff

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

Before

Width:  |  Height:  |  Size: 451 KiB

After

Width:  |  Height:  |  Size: 451 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

BIN
README.en/Resizable_en.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

View File

Before

Width:  |  Height:  |  Size: 14 MiB

After

Width:  |  Height:  |  Size: 14 MiB

BIN
README.en/bindhow.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
README.en/demo1.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
README.en/draggable_en.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

BIN
README.en/expression.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
README.en/expressionV2V.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

BIN
README.en/language_demo.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
README.en/log_demo_en.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
README.en/modulesAction.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

BIN
README.en/moveable.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB

View File

Before

Width:  |  Height:  |  Size: 15 MiB

After

Width:  |  Height:  |  Size: 15 MiB

View File

Before

Width:  |  Height:  |  Size: 5.9 MiB

After

Width:  |  Height:  |  Size: 5.9 MiB

View File

Before

Width:  |  Height:  |  Size: 6.5 MiB

After

Width:  |  Height:  |  Size: 6.5 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 MiB

BIN
README.en/resizeAble.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

BIN
README.en/template_en.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

BIN
README.en/wrap_JavaBean.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

771
README.md
View File

File diff suppressed because it is too large Load Diff

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 MiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
README/JavaFX-Plus.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 KiB

BIN
README/JavaFX-Plus_en.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 531 KiB

BIN
README/Resizable.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

View File

Before

Width:  |  Height:  |  Size: 14 MiB

After

Width:  |  Height:  |  Size: 14 MiB

BIN
README/bindhow.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 KiB

BIN
README/controllerConfig.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
README/demo1.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
README/draggable.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

BIN
README/expression.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
README/expressionV2V.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

BIN
README/helloWorldDemo.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
README/language_demo.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

BIN
README/log_demo.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
README/modulesAction.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 512 KiB

BIN
README/moveable.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 MiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 MiB

BIN
README/resizeAble.gif Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

BIN
README/template.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 KiB

BIN
README/template_incude.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

BIN
README/wrap_JavaBean.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

View File

Binary file not shown.

View File

23
javafx-plus-demo/pom.xml Normal file
View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.gitee.Biubiuyuyu</groupId>
<artifactId>javafx-plus-demo</artifactId>
<version>1.3.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<javafx-plus.version>1.3.0-SNAPSHOT</javafx-plus.version>
</properties>
<dependencies>
<dependency>
<groupId>com.gitee.Biubiuyuyu</groupId>
<artifactId>javafx-plus</artifactId>
<version>${javafx-plus.version}</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,21 @@
package cn.edu.scau.biubiusuisui.example.bindDemo;
import cn.edu.scau.biubiusuisui.annotation.FXScan;
import cn.edu.scau.biubiusuisui.config.FXPlusApplication;
import javafx.application.Application;
import javafx.stage.Stage;
/**
* @author jack
* @author suisui
* @version 1.2
* @date 2020/5/1 1:43
* @since JavaFX2.0 JDK1.8
*/
@FXScan(base = "cn.edu.scau.biubiusuisui.example.bindDemo")
public class BindDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FXPlusApplication.start(BindDemo.class);
}
}

View File

@@ -0,0 +1,130 @@
package cn.edu.scau.biubiusuisui.example.bindDemo;
import cn.edu.scau.biubiusuisui.annotation.FXBind;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.*;
import java.net.URL;
import java.util.ResourceBundle;
/**
* @author jack
* @author suisui
* @version 1.2
* @date 2020/5/1 1:43
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "fxml/bindDemo/bindDemo.fxml")
@FXWindow(title = "bindDemo", mainStage = true)
// TODO 待完善
public class MainController extends FXBaseController implements Initializable {
// View bind to View
@FXML
@FXBind("text=${inputTF.text}")
private Label inputLabel;
@FXML
private TextField inputTF;
// View bind to a Java Bean
@FXML
private Label usernameLabel;
@FXML
private Label userPswLabel;
@FXML
private Label ageLabel;
@FXML
private Label enableLabel;
@FXML
private TextField usernameTF;
@FXML
private PasswordField pswPF;
@FXML
private TextField ageTF;
@FXML
private ToggleGroup enableButtons;
//
// @FXData
// @FXBind({
// "name=${usernameTF.text}",
// "password=${pswPF.text}",
// "age=${ageTF.text}",
// "isEnable=${enableButtons.getSelectedToggle().getUserData()}"
// })
// private User user = new User();
private UserPropertyEntity user = new UserPropertyEntity();
// View bind to Expression
@FXML
private TextField money;
@FXML
@FXBind("text=${@toUs(money.text)}")
private Label us;
@FXML
@FXBind("text=${@toJp(money.text)}")
private Label jp;
@FXML
@FXBind("text=${@toUk(money.text)}")
private Label uk;
@Override
public void initialize(URL location, ResourceBundle resources) {
money.setText("0");
money.textProperty().addListener(new ChangeListener<String>() {
@Override
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
if (null == newValue || "".equals(newValue)) {
money.setText("0");
} else if (!newValue.matches("^[0-9]*$")) {
money.setText(oldValue);
}
}
});
}
@FXML
public void clickToShowInfo() {
RadioButton button = (RadioButton) enableButtons.getSelectedToggle();
System.out.println(button.getText());
usernameLabel.setText(user.getName());
userPswLabel.setText(user.getPassword());
ageLabel.setText(Integer.toString(user.getAge()));
enableLabel.setText(Boolean.toString(user.getEnable()));
}
public String toUs(String value) {
double money = Double.valueOf(value);
double percent = 0.1454;
return String.valueOf(money * percent);
}
public String toJp(String value) {
double money = Double.valueOf(value);
double percent = 15.797;
return String.valueOf(money * percent);
}
public String toUk(String value) {
double money = Double.valueOf(value);
double percent = 0.1174;
return String.valueOf(money * percent);
}
}

View File

@@ -0,0 +1,38 @@
package cn.edu.scau.biubiusuisui.example.bindDemo;
/**
* @author suisui
* @version 1.2
* @description 详细信息
* @date 2020/4/6 00:29
* @since JavaFX2.0 JDK1.8
*/
public class Profile {
private String birthday;
private String address;
private String avatar;
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getAvatar() {
return avatar;
}
public void setAvatar(String avatar) {
this.avatar = avatar;
}
}

View File

@@ -0,0 +1,88 @@
package cn.edu.scau.biubiusuisui.example.bindDemo;
import cn.edu.scau.biubiusuisui.annotation.FXEntity;
import cn.edu.scau.biubiusuisui.annotation.FXField;
import java.util.List;
/**
* @author suisui
* @version 1.2
* @date 2020/4/5 12:19
* @since JavaFX2.0 JDK1.8
*/
@FXEntity
public class User {
@FXField
private String name;
@FXField
private String password;
@FXField
private Integer age;
@FXField
private List<Double> scores;
@FXField
private Double gpa;//平均分
@FXField
private Profile profile;
@FXField
private boolean isEnable;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Integer getAge() {
return age;
}
public void setAge(Integer age) {
this.age = age;
}
public List<Double> getScores() {
return scores;
}
public void addScore(double score) {
this.scores.add(score);
}
public Profile getProfile() {
return profile;
}
public void setProfile(Profile profile) {
this.profile = profile;
}
public boolean isEnable() {
return isEnable;
}
public void setEnable(boolean enable) {
isEnable = enable;
}
public double getGpa() {
double sum = 0;
for (double score : scores) {
sum += score;
}
gpa = sum / scores.size();
return gpa;
}
}

View File

@@ -0,0 +1,105 @@
package cn.edu.scau.biubiusuisui.example.bindDemo;
import javafx.beans.property.*;
import javafx.collections.ObservableList;
/**
* @author suisui
* @version 1.2
* @description User的JavaFXBean
* @date 2020/4/6 14:30
* @since JavaFX2.0 JDK1.8
*/
public class UserPropertyEntity {
private SimpleStringProperty name;
private SimpleStringProperty password;
private SimpleIntegerProperty age;
private SimpleListProperty<Double> scores;
private SimpleDoubleProperty gpa;//平均分
private SimpleObjectProperty<Profile> profile;
private SimpleBooleanProperty enable;
public String getName() {
return name.get();
}
public SimpleStringProperty nameProperty() {
return name;
}
public void setName(String name) {
this.name.set(name);
}
public String getPassword() {
return password.get();
}
public SimpleStringProperty passwordProperty() {
return password;
}
public void setPassword(String password) {
this.password.set(password);
}
public int getAge() {
return age.get();
}
public SimpleIntegerProperty ageProperty() {
return age;
}
public void setAge(int age) {
this.age.set(age);
}
public ObservableList<Double> getScores() {
return scores.get();
}
public SimpleListProperty<Double> scoresProperty() {
return scores;
}
public void setScores(ObservableList<Double> scores) {
this.scores.set(scores);
}
public double getGpa() {
return gpa.get();
}
public SimpleDoubleProperty gpaProperty() {
return gpa;
}
public void setGpa(double gpa) {
this.gpa.set(gpa);
}
public Profile getProfile() {
return profile.get();
}
public SimpleObjectProperty<Profile> profileProperty() {
return profile;
}
public void setProfile(Profile profile) {
this.profile.set(profile);
}
public boolean getEnable() {
return enable.get();
}
public SimpleBooleanProperty enableProperty() {
return enable;
}
public void setEnable(boolean enable) {
this.enable.set(enable);
}
}

View File

@@ -0,0 +1,22 @@
package cn.edu.scau.biubiusuisui.example.firstDemo;
import cn.edu.scau.biubiusuisui.annotation.FXScan;
import cn.edu.scau.biubiusuisui.config.FXPlusApplication;
import javafx.application.Application;
import javafx.stage.Stage;
/**
* @author jack
* @author suisui
* @version 1.0
* @description 第一个示例
* @date 2020/1/1 23:06
* @since JavaFX2.0 JDK1.8
*/
@FXScan(base = {"cn.edu.scau.biubiusuisui.example.firstDemo"}) //会扫描带FXController和FXEntity的类进行初始化
public class FirstDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FXPlusApplication.start(FirstDemo.class); //其他配置和JavaFX相同这里要调用FXPlusAppcalition的start方法开始FX-plus加强
}
}

View File

@@ -0,0 +1,57 @@
package cn.edu.scau.biubiusuisui.example.firstDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusContext;
import cn.edu.scau.biubiusuisui.factory.FXEntityFactory;
import javafx.beans.property.Property;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.ListView;
import java.net.URL;
import java.util.ResourceBundle;
/**
* @author jack
* @author suisui
* @version 1.0
* @description 示例的主窗口
* @date 2020/1/1 23:06
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "fxml/firstDemo/firstDemo.fxml")
@FXWindow(title = "firstDemo", mainStage = true)
public class MainController extends FXBaseController implements Initializable {
@FXML
private Button addHelloButton;
@FXML
private Button deleteHelloButton;
@FXML
private ListView<String> list;
private Student student;
@FXML
void addWord(ActionEvent event) {
student.addList("hello");
}
@FXML
void delWord(ActionEvent event) {
student.delList("hello");
}
@Override
public void initialize(URL location, ResourceBundle resources) {
student = (Student) FXEntityFactory.wrapFXBean(Student.class); // 从工厂中拿到将JavaBean转换得到的JavaFXBean
Property listProperty = FXPlusContext.getEntityPropertyByName(student, "list");
list.itemsProperty().bind(listProperty);
}
}

View File

@@ -0,0 +1,34 @@
package cn.edu.scau.biubiusuisui.example.firstDemo;
import cn.edu.scau.biubiusuisui.annotation.FXEntity;
import cn.edu.scau.biubiusuisui.annotation.FXField;
import java.util.ArrayList;
import java.util.List;
/**
* @author suisui
* @version 1.0
* @description
* @date 2020/1/1 23:07
* @since JavaFX2.0 JDK1.8
*/
@FXEntity
public class Student {
@FXField //标记该属性是否被生成对应的Property
private int age = 0;
@FXField
private List<String> list = new ArrayList<>();
public void addList(String word) {
list.add(word);
}
public void delList(String word) {
list.remove(word);
}
}

View File

@@ -0,0 +1,52 @@
package cn.edu.scau.biubiusuisui.example.langDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXRedirect;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusLocale;
import javafx.fxml.FXML;
/**
* @author suisui
* @description 中文界面
* @date 2020/5/3 16:23
* @since JDK1.8
*/
@FXWindow(mainStage = true, title = "languageDemo")
@FXController(path = "fxml/langDemo/langDemo.fxml", locale = FXPlusLocale.SIMPLIFIED_CHINESE)
public class ChineseController extends FXBaseController {
private String title = "languageDemo";
private int count = 0;
@FXML
public void clickToChinese() {
redirect("ChineseController");
}
@FXML
public void clickToEnglish() {
redirect("EnglishController");
}
@FXML
public void clickToKorean() {
redirect("KoreanController");
}
/**
* 测试是否setWindowTitle接口
*/
@FXML
public void changeTitleClick() {
this.setWindowTitle(this.title + count);
count++;
}
@FXRedirect
public String redirect(String name) {
return name;
}
}

View File

@@ -0,0 +1,50 @@
package cn.edu.scau.biubiusuisui.example.langDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXRedirect;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusLocale;
import javafx.fxml.FXML;
/**
* @author suisui
* @description 英文界面
* @date 2020/5/3 19:54
* @since JDK1.8
*/
@FXWindow(mainStage = false, title = "languageDemo")
@FXController(path = "fxml/langDemo/langDemo.fxml", locale = FXPlusLocale.ENGLISH)
public class EnglishController extends FXBaseController {
private String title = "languageDemo";
private int count = 0;
@FXML
public void clickToChinese() {
redirect("ChineseController");
}
@FXML
public void clickToEnglish() {
redirect("EnglishController");
}
@FXML
public void clickToKorean() {
redirect("KoreanController");
}
/**
* 测试是否setWindowTitle接口
*/
@FXML
public void changeTitleClick() {
this.setWindowTitle(this.title + count);
count++;
}
@FXRedirect
public String redirect(String name) {
return name;
}
}

View File

@@ -0,0 +1,51 @@
package cn.edu.scau.biubiusuisui.example.langDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXRedirect;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusLocale;
import javafx.fxml.FXML;
/**
* @author suisui
* @description 法语界面
* @date 2020/5/4 14:01
* @since JDK1.8
*/
@FXWindow(mainStage = false, title = "languageDemo")
@FXController(path = "fxml/langDemo/langDemo.fxml", locale = FXPlusLocale.KOREAN)
public class KoreanController extends FXBaseController {
private String title = "languageDemo";
private int count = 0;
@FXML
public void clickToChinese() {
redirect("ChineseController");
}
@FXML
public void clickToEnglish() {
redirect("EnglishController");
}
@FXML
public void clickToKorean() {
redirect("KoreanController");
}
/**
* 测试是否setWindowTitle接口
*/
@FXML
public void changeTitleClick() {
this.setWindowTitle(this.title + count);
count++;
}
@FXRedirect
public String redirect(String name) {
return name;
}
}

View File

@@ -0,0 +1,21 @@
package cn.edu.scau.biubiusuisui.example.langDemo;
import cn.edu.scau.biubiusuisui.annotation.FXScan;
import cn.edu.scau.biubiusuisui.config.FXPlusApplication;
import javafx.application.Application;
import javafx.stage.Stage;
/**
* @author suisui
* @description 测试语言国际化的Demo
* @date 2020/5/3 09:57
* @since JDK1.8
*/
@FXScan(base = "cn.edu.scau.biubiusuisui.example.langDemo")
public class LanguageDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FXPlusApplication.start(getClass());
}
}

View File

@@ -0,0 +1,48 @@
package cn.edu.scau.biubiusuisui.example.lifeDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusLocale;
import cn.edu.scau.biubiusuisui.log.FXPlusLogger;
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
/**
* @author suisui
* @version 1.2
* @description 弹窗
* @date 2020/5/1 13:49
* @since JavaFX2.0 JDK1.8
*/
@FXWindow(title = "Dialog")
@FXController(path = "fxml/lifeDemo/dialog.fxml", locale = FXPlusLocale.SIMPLIFIED_CHINESE)
public class DialogController extends FXBaseController {
private static IFXPlusLogger logger = FXPlusLoggerFactory.getLogger(DialogController.class);
@Override
public void initialize() throws Exception {
logger.info("DialogController----initialize");
}
@Override
public void onLoad() throws Exception {
logger.info("DialogController----onLoad");
}
@Override
public void onShow() throws Exception {
logger.info("DialogController----onShow");
}
@Override
public void onClose() throws Exception {
logger.info("DialogController----onClose");
}
@Override
public void onHide() throws Exception {
logger.info("DialogController----onHide");
}
}

View File

@@ -0,0 +1,42 @@
package cn.edu.scau.biubiusuisui.example.lifeDemo;
import cn.edu.scau.biubiusuisui.annotation.FXScan;
import cn.edu.scau.biubiusuisui.config.FXPlusApplication;
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
import cn.edu.scau.biubiusuisui.utils.LogUtil;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.stage.Stage;
/**
* @author suisui
* @version 1.2
* @description 测试生命周期的Demo
* @date 2020/5/1 11:50
* @since JavaFX2.0 JDK1.8
*/
@FXScan(base = "cn.edu.scau.biubiusuisui.example.lifeDemo")
public class LifeDemo extends Application {
private static IFXPlusLogger logger = FXPlusLoggerFactory.getLogger(LifeDemo.class);
@Override
public void start(Stage primaryStage) throws Exception {
logger.info("LifeDemo---start");
// Platform.setImplicitExit(false); //设置当关闭最后一个Stage时JavaFX应用程序不会自动退出
FXPlusApplication.start(getClass());
}
@Override
public void init() throws Exception {
logger.info("LifeDemo---init");
}
@Override
public void stop() throws Exception {
logger.info("LifeDemo---stop");
}
}

View File

@@ -0,0 +1,74 @@
package cn.edu.scau.biubiusuisui.example.lifeDemo;
import cn.edu.scau.biubiusuisui.annotation.FXRedirect;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusLocale;
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
import javafx.fxml.FXML;
/**
* @author suisui
* @version 1.2
* @description 主窗口
* @date 2020/5/1 11:53
* @since JavaFX2.0 JDK1.8
*/
@FXWindow(mainStage = true, title = "lifeDemo", icon = "image/icon.png")
@FXController(path = "fxml/lifeDemo/lifeMain.fxml", locale = FXPlusLocale.SIMPLIFIED_CHINESE)
public class MainController extends FXBaseController {
private static IFXPlusLogger logger = FXPlusLoggerFactory.getLogger(FXBaseController.class);
@Override
public void initialize() throws Exception {
logger.info("MainController----initialize");
}
@Override
public void onShow() throws Exception {
logger.info("MainController----onShow");
}
@Override
public void onLoad() throws Exception {
logger.info("MainController----onLoad");
}
@Override
public void onClose() throws Exception {
logger.info("MainController----onClose");
}
@Override
public void onHide() throws Exception {
logger.info("MainController----onHide");
}
@FXML
public void go() {
redirectToDialog();
}
@FXML
public void goAndClose() {
redirectToDialogAndClose();
}
/**
* 弹窗不关闭窗口
*/
@FXRedirect(close = false)
public String redirectToDialog() {
return "DialogController";
}
/**
* 弹窗并关闭本窗口
*/
@FXRedirect()
public String redirectToDialogAndClose() {
return "DialogController";
}
}

View File

@@ -0,0 +1,44 @@
package cn.edu.scau.biubiusuisui.example.lifeDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXPlusLocale;
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
/**
* @author suisui
* @version 1.2
* @description 子组件
* @date 2020/5/1 13:48
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "fxml/lifeDemo/subBar.fxml", locale = FXPlusLocale.SIMPLIFIED_CHINESE)
public class SubController extends FXBaseController {
private static IFXPlusLogger logger = FXPlusLoggerFactory.getLogger(SubController.class);
@Override
public void initialize() throws Exception {
logger.info("SubController----initialize");
}
@Override
public void onShow() throws Exception {
logger.info("SubController----onShow");
}
@Override
public void onLoad() throws Exception {
logger.info("SubController----onLoad");
}
@Override
public void onClose() throws Exception {
logger.info("SubController----onClose");
}
@Override
public void onHide() throws Exception {
logger.info("SubController----onHide");
}
}

View File

@@ -6,13 +6,15 @@ import javafx.application.Application;
import javafx.stage.Stage;
/**
* @Author jack
* @Date:2019/7/27 1:43
* @author jack
* @version 1.0
* @date 2019/7/27 1:43
* @since JavaFX2.0 JDK1.8
*/
@FXScan(base = "cn.edu.scau.biubiusuisui.example.listDemo")
public class Demo extends Application {
public class ListDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FXPlusApplication.start(Demo.class);
FXPlusApplication.start(getClass());
}
}

View File

@@ -10,13 +10,15 @@ import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.ListView;
import java.util.ArrayList;
import java.util.List;
/**
* @Author jack
* @Date:2019/7/27 1:43
* @author jack
* @version 1.0
* @date 2019/7/27 1:43
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "listDemo/listDemo.fxml")
@FXController(path = "fxml/listDemo/listDemo.fxml")
@FXWindow(title = "listDemo", mainStage = true)
public class MainController extends FXBaseController {
@@ -35,7 +37,7 @@ public class MainController extends FXBaseController {
user.addNames("Jack\t" + (count++));
}
public ObservableList toList(ArrayList list) {
public ObservableList toList(List list) {
if (list == null) {
return null;
}

View File

@@ -4,10 +4,13 @@ import cn.edu.scau.biubiusuisui.annotation.FXEntity;
import cn.edu.scau.biubiusuisui.annotation.FXField;
import java.util.ArrayList;
import java.util.List;
/**
* @Author jack
* @Date:2019/7/27 12:19
* @author jack
* @version 1.0
* @date 2019/7/27 12:19
* @since JavaFX2.0 JDK1.8
*/
@FXEntity
public class User {
@@ -18,7 +21,7 @@ public class User {
private String password;
@FXField
private ArrayList<String> names = new ArrayList<>();
private List<String> names = new ArrayList<>();
public User() {
@@ -47,7 +50,7 @@ public class User {
this.password = password;
}
public ArrayList<String> getNames() {
public List<String> getNames() {
return names;
}

View File

@@ -0,0 +1,36 @@
package cn.edu.scau.biubiusuisui.example.logDemo;
import cn.edu.scau.biubiusuisui.example.lifeDemo.LifeDemo;
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
import cn.edu.scau.biubiusuisui.utils.LogUtil;
/**
* @author suisui
* @description 测试日志的Demo
* @date 2020/5/2 19:58
* @since JDK1.8
*/
public class LogDemo {
private static IFXPlusLogger logger = FXPlusLoggerFactory.getLogger(LogDemo.class);
public void testLogger() {
logger.info("info");
logger.error("error");
logger.debug("debug");
logger.warn("warn");
}
public void testLogUtil() {
LogUtil.info("info");
LogUtil.error("error");
LogUtil.debug("debug");
LogUtil.warn("warn");
}
public static void main(String[] args) {
LogDemo demo = new LogDemo();
demo.testLogger();
demo.testLogUtil();
}
}

View File

@@ -6,15 +6,28 @@ import javafx.application.Application;
import javafx.stage.Stage;
/**
* @author suiyu_yang
* @author suisui
* @version 1.1
* @description
* @date 2019/12/8 13:17
* @email suiyu_yang@163.com
* @since JavaFX2.0 JDK1.8
*/
@FXScan(base = "cn.edu.scau.biubiusuisui.example.mqDemo")
public class MQDemo extends Application {
@Override
public void init() throws Exception {
System.out.println("application init");
}
@Override
public void start(Stage primaryStage) throws Exception {
System.out.println("application start");
FXPlusApplication.start(MQDemo.class);
}
@Override
public void stop() throws Exception {
System.out.println("application stop");
}
}

View File

@@ -8,12 +8,13 @@ import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
/**
* @author suiyu_yang
* @author suisui
* @version 1.2
* @description 主界面
* @date 2019/12/8 13:17
* @email suiyu_yang@163.com
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "mqDemo/main.fxml")
@FXController(path = "fxml/mqDemo/main.fxml")
@FXWindow(mainStage = true, title = "MQDemo")
public class MainController extends FXBaseController {
@@ -28,9 +29,7 @@ public class MainController extends FXBaseController {
*/
@FXReceiver(name = "TopBarController:sendToMain")
public void handleTopBar(String msg) {
// TODO: 2019/12/8
// 处理导航栏的点击事件
outTA.appendText(msg + "\n");
}
}

View File

@@ -6,12 +6,13 @@ import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import javafx.fxml.FXML;
/**
* @author suiyu_yang
* @author suisui
* @version 1.1
* @description 导航栏示例
* @date 2019/12/8 13:17
* @email suiyu_yang@163.com
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "mqDemo/topBar.fxml")
@FXController(path = "fxml/mqDemo/topBar.fxml")
public class TopBarController extends FXBaseController {
@FXML

View File

@@ -5,12 +5,14 @@ import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
/**
* @author suiyu_yang
* @author suisui
* @version 1.1
* @description
* @date 2019/12/4 21:00
* @email suiyu_yang@163.com
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "redirectDemo/dialog.fxml")
@FXController(path = "fxml/redirectDemo/dialog.fxml")
@FXWindow(title = "弹窗")
public class DialogController extends FXBaseController {
}

View File

@@ -0,0 +1,74 @@
package cn.edu.scau.biubiusuisui.example.redirectDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXRedirect;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXRedirectParam;
import javafx.fxml.FXML;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
import java.util.Date;
/**
* @author suisui
* @version 1.1
* @description
* @date 2019/12/3 11:53
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "fxml/redirectDemo/login.fxml")
@FXWindow(title = "redirectDemo", mainStage = true)
public class LoginController extends FXBaseController {
@FXML
private TextField usernameTF;
@FXML
private PasswordField passwordPF;
@FXML
public void registerClick() {
redirectToRegister();
}
@FXRedirect
public String redirectToRegister() {
return "RegisterController";
}
@FXML
@FXRedirect(close = false) //弹窗
public String redirectToDialog() {
return "DialogController";
}
@FXML
@FXRedirect //登录成功 Query方式
public String redirectToSuccessWithQuery() {
return "SuccessController?showType=0&username=" + usernameTF.getText() + "&password=" + passwordPF.getText();
}
@FXML
@FXRedirect //登录成功 Param方式
public FXRedirectParam redirectToSuccessWithParam() {
FXRedirectParam params = new FXRedirectParam("SuccessController");
params.addParam("username", usernameTF.getText());
params.addParam("password", passwordPF.getText());
params.addQuery("showType", "0");
return params;
}
@FXML
@FXRedirect
public FXRedirectParam redirectToSuccessWithAll() {
FXRedirectParam params = new FXRedirectParam("SuccessController");
params.addParam("username", usernameTF.getText());
params.addParam("password", passwordPF.getText());
params.addQuery("token", new Date().toString());
params.addQuery("showType", "0");
return params;
}
}

View File

@@ -6,13 +6,15 @@ import javafx.application.Application;
import javafx.stage.Stage;
/**
* @author suiyu_yang
* @author suisui
* @version 1.1
* @description 测试重定向功能的Application
* @date 2019/12/3 11:52
* @email suiyu_yang@163.com
* @since JavaFX2.0 JDK1.8
*/
@FXScan(base = "cn.edu.scau.biubiusuisui.example.redirectDemo")
public class RedirectDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
FXPlusApplication.start(RedirectDemo.class);

View File

@@ -0,0 +1,91 @@
package cn.edu.scau.biubiusuisui.example.redirectDemo;
import cn.edu.scau.biubiusuisui.annotation.FXController;
import cn.edu.scau.biubiusuisui.annotation.FXRedirect;
import cn.edu.scau.biubiusuisui.annotation.FXWindow;
import cn.edu.scau.biubiusuisui.entity.FXBaseController;
import cn.edu.scau.biubiusuisui.entity.FXRedirectParam;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.PasswordField;
import javafx.scene.control.TextField;
/**
* @author suisui
* @version 1.1
* @description
* @date 2019/12/4 00:07
* @since JavaFX2.0 JDK1.8
*/
@FXController(path = "fxml/redirectDemo/register.fxml")
@FXWindow(title = "register")
public class RegisterController extends FXBaseController {
@FXML
private TextField usernameTF;
@FXML
private TextField emailTF;
@FXML
private PasswordField passwordPF;
@FXML
private PasswordField confirmPasswordPF;
@FXML
public void registerClick() {
if (validate()) {
UserEntity userEntity = new UserEntity();
userEntity.setUsername(usernameTF.getText());
userEntity.setPassword(passwordPF.getText());
userEntity.setEmail(emailTF.getText());
redirectToRegisterSuccess(userEntity);
}
}
@FXML
public void loginClick() {
redirectToLogin();
}
@FXRedirect
public String redirectToLogin() {
return "LoginController";
}
@FXRedirect
public FXRedirectParam redirectToRegisterSuccess(UserEntity userEntity) {
FXRedirectParam fxRedirectParam = new FXRedirectParam("SuccessController");
fxRedirectParam.addQuery("showType", "1");
fxRedirectParam.addParam("user", userEntity);
return fxRedirectParam;
}
// 校验
private boolean validate() {
boolean retCode = false;
if (null != passwordPF.getText() && null != confirmPasswordPF.getText()) {
if (!passwordPF.getText().equals(confirmPasswordPF.getText())) {
retCode = false;
new Alert(Alert.AlertType.ERROR, "两次密码不一致");
} else {
retCode = true;
}
} else if (null == usernameTF.getText()) {
retCode = false;
new Alert(Alert.AlertType.ERROR, "用户名不能为空");
} else if (null == emailTF.getText()) {
retCode = false;
new Alert(Alert.AlertType.ERROR, "邮箱不能为空");
}
return retCode;
}
private void clearAllInput() {
usernameTF.setText("");
emailTF.setText("");
passwordPF.setText("");
confirmPasswordPF.setText("");
}
}

Some files were not shown because too many files have changed in this diff Show More