Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fc8a622ab | ||
|
|
3543f8acd3 | ||
|
|
96a58bcda5 | ||
|
|
34ddd6f26e | ||
|
|
38dc53b484 | ||
|
|
547c036cdb | ||
|
|
a69651447c |
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,4 @@
|
||||
.idea
|
||||
.idea
|
||||
*.iml
|
||||
**/*.log
|
||||
**/target
|
||||
|
||||
@@ -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地址
|
||||
|
||||
BIN
javafx-plus-demo/logs/debug/javafxplus.log
Normal file
BIN
javafx-plus-demo/logs/debug/javafxplus.log
Normal file
Binary file not shown.
23
javafx-plus-demo/pom.xml
Normal file
23
javafx-plus-demo/pom.xml
Normal 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>
|
||||
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
68
javafx-plus/pom.xml
Normal file
68
javafx-plus/pom.xml
Normal 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>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user