7 Commits

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
141 changed files with 214 additions and 55 deletions

5
.gitignore vendored
View File

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

View File

@@ -85,7 +85,7 @@
- [ ] 键盘事件绑定
- [ ] 优化性能
## ~~Maven仓库地址~~
## Maven仓库地址
maven仓库中的JavaFX-Plus版本是较旧版本建议使用最新发行版。
@@ -93,7 +93,7 @@ maven仓库中的JavaFX-Plus版本是较旧版本建议使用最新发行版
<dependency>
<groupId>com.gitee.Biubiuyuyu</groupId>
<artifactId>javafx-plus</artifactId>
<version>1.0.0-RELEASE</version>
<version>1.2.1-SNAPSHOT</version>
</dependency>
```
## Git地址

View File

Binary file not shown.

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

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

68
javafx-plus/pom.xml Normal file
View File

@@ -0,0 +1,68 @@
<?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">
<parent>
<artifactId>javafx-plus-parent</artifactId>
<groupId>com.gitee.Biubiuyuyu</groupId>
<version>1.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>javafx-plus</artifactId>
<packaging>jar</packaging>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<build>
<!--配置Maven 对resource文件 过滤 -->
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
<include>**/*.fxml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArgs>
<!-- 过期的方法的警告-->
<arg>-Xlint:deprecation</arg>
</compilerArgs>
<compilerArguments>
<!-- 是否输出所有的编译信息(包括类的加载等)-->
<!--<verbose />-->
<!-- 解决maven命令编译报错因为rt.jar 和jce.jar在jre的lib下面不在jdk的lib下面
导致maven找不到java7以后会出现这个问题将这2个jar包拷贝到jdk的lib下面估计也好使-->
<bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -12,6 +12,7 @@ import cn.edu.scau.biubiusuisui.utils.ClassUtil;
import cn.edu.scau.biubiusuisui.utils.FileUtil;
import cn.edu.scau.biubiusuisui.utils.LogUtil;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.List;
@@ -25,7 +26,6 @@ import java.util.Set;
*/
public class FXPlusApplication {
private static final IFXPlusLogger logger = FXPlusLoggerFactory.getLogger(FXPlusApplication.class);
// Application
private static FXWindowParser windowAnnotationParser = new FXWindowParser();
@@ -37,7 +37,11 @@ public class FXPlusApplication {
public static void start(Class clazz, BeanBuilder beanBuilder) {
logger.info("starting JavaFX-Plus Application");
logger.info("\n" + FileUtil.readFileFromResources("banner.txt"));
try {
logger.info("\n" + FileUtil.readFileFromResources("banner.txt"));
} catch (UnsupportedEncodingException e) {
logger.error("\n read classpath:banner.txt error, you can ignore it");
}
// 初始化日志路径
LogUtil.initLog4jBase();
@@ -56,15 +60,15 @@ public class FXPlusApplication {
for (String dir : sets) {
logger.info("scanning directory: " + dir);
ClassUtil classUtil = new ClassUtil();
List<String> temps = classUtil.scanAllClassName(dir);
for (String className : temps) {
try {
List<String> temps = null;
try {
temps = classUtil.scanAllClassName(dir);
for (String className : temps) {
logger.info("loading class: " + className);
loadFXPlusClass(className, beanBuilder);
} catch (ClassNotFoundException e) {
logger.error(e.getMessage());
e.printStackTrace();
}
} catch (UnsupportedEncodingException | ClassNotFoundException exception) {
logger.error("{}", exception);
}
}
}

View File

@@ -9,6 +9,7 @@ import cn.edu.scau.biubiusuisui.function.DragWindowHandlerImpl;
import cn.edu.scau.biubiusuisui.log.FXPlusLoggerFactory;
import cn.edu.scau.biubiusuisui.log.IFXPlusLogger;
import cn.edu.scau.biubiusuisui.utils.FileUtil;
import cn.edu.scau.biubiusuisui.utils.IFxPlusConstants;
import cn.edu.scau.biubiusuisui.utils.ResourceBundleUtil;
import cn.edu.scau.biubiusuisui.utils.StringUtil;
import javafx.event.EventHandler;
@@ -18,6 +19,7 @@ import javafx.stage.Stage;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.lang.annotation.Annotation;
import java.net.URL;
import java.util.HashMap;
@@ -249,8 +251,8 @@ public class FXBaseController extends Pane {
} else {
logger.warn("the icon file has not existed");
}
} catch (ProtocolNotSupport protocolNotSupport) {
logger.error(protocolNotSupport.getMessage(), protocolNotSupport);
} catch (ProtocolNotSupport | UnsupportedEncodingException exception) {
logger.error(exception.getMessage(), exception);
}
}
}
@@ -281,7 +283,7 @@ public class FXBaseController extends Pane {
if ("".equals(name) || name == null) { // 原本无name == null判断条件会出错
return StringUtil.getBaseClassName(getClass().getSimpleName());
} else {
return StringUtil.getBaseClassName(getClass().getSimpleName()) + "#" + name;
return StringUtil.getBaseClassName(getClass().getSimpleName()) + IFxPlusConstants.CONTROLLER_NAME_SEPARATOR + name;
}
}

View File

@@ -12,9 +12,13 @@ import java.lang.reflect.Method;
* @since JavaFX2.0 JDK1.8
*/
public class FXMethodEntity {
/**
* 所属Controller
*/
private FXBaseController fxBaseController;
/**
* 实际方法
*/
private Method method;
public FXMethodEntity(FXBaseController fxBaseController, Method method) {

View File

@@ -33,6 +33,8 @@ public class FXPlusContext {
controllers = new LinkedList<>();
}
controllers.add(fxBaseController);
// @since 1.2.1 fix: 没有将controller真正注册到context的异常
controllerContext.put(fxBaseController.getName(), controllers);
}

View File

@@ -11,8 +11,19 @@ import java.util.Map;
* @since JavaFX2.0 JDK1.8
*/
public class FXRedirectParam {
/**
* 跳转的目标Controller
*/
private String toController;
/**
* query方式的参数, like: helloController?name=JavaFx-Plus&msg=helloWorld
* the map will store: { name -> JavaFx-Plus, msg -> helloWorld}
*/
private Map<String, Object> query = new HashMap<>();
/**
* param方式的参数会以map方式传递给目标Controller
*/
private Map<String, Object> params = new HashMap<>();
public FXRedirectParam(String toController) {

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