commit f1eb3e57eca876698abb213ae7139650554e814f
Author: billkiller <747441355@qq.com>
Date: Sat Jun 29 01:34:10 2019 +0800
JavaFX-Plus v1.beta
diff --git a/.idea/artifacts/JavaFx_Plus_jar.xml b/.idea/artifacts/JavaFx_Plus_jar.xml
new file mode 100644
index 0000000..4f13ba8
--- /dev/null
+++ b/.idea/artifacts/JavaFx_Plus_jar.xml
@@ -0,0 +1,12 @@
+
+
+ $PROJECT_DIR$/out/artifacts/JavaFx_Plus_jar
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..0980d0e
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__cglib_cglib_3_1.xml b/.idea/libraries/Maven__cglib_cglib_3_1.xml
new file mode 100644
index 0000000..bd3cddd
--- /dev/null
+++ b/.idea/libraries/Maven__cglib_cglib_3_1.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__junit_junit_4_11.xml b/.idea/libraries/Maven__junit_junit_4_11.xml
new file mode 100644
index 0000000..f33320d
--- /dev/null
+++ b/.idea/libraries/Maven__junit_junit_4_11.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
new file mode 100644
index 0000000..f58bbc1
--- /dev/null
+++ b/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/libraries/Maven__org_ow2_asm_asm_4_2.xml b/.idea/libraries/Maven__org_ow2_asm_asm_4_2.xml
new file mode 100644
index 0000000..b5e3748
--- /dev/null
+++ b/.idea/libraries/Maven__org_ow2_asm_asm_4_2.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..5755a99
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..3bb9433
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..138dd71
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,1247 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaFx-Plus:jar
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ JavaFx-Plus
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/JavaFx-Plus.iml b/JavaFx-Plus.iml
new file mode 100644
index 0000000..0234078
--- /dev/null
+++ b/JavaFx-Plus.iml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/out/artifacts/JavaFx_Plus_jar/JavaFx-Plus.jar b/out/artifacts/JavaFx_Plus_jar/JavaFx-Plus.jar
new file mode 100644
index 0000000..d9749e8
Binary files /dev/null and b/out/artifacts/JavaFx_Plus_jar/JavaFx-Plus.jar differ
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..17d629e
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,42 @@
+
+
+ 4.0.0
+
+ groupId
+ JavaFx-Plus
+ 1.0-SNAPSHOT
+
+
+
+
+ cglib
+ cglib
+ 3.1
+
+
+
+ junit
+ junit
+ 4.11
+ test
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.6.1
+
+ 1.8
+ 1.8
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXController.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXController.java
new file mode 100644
index 0000000..3551334
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXController.java
@@ -0,0 +1,17 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * This is use for marking A controller as FX-Plus Controller
+ * @Author jack
+ * @Date:2019/6/25 1:34
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface FXController {
+ String path();
+ double preWidth() default 0.0;
+ double preHeight() default 0.0;
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXEntity.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXEntity.java
new file mode 100644
index 0000000..a780452
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXEntity.java
@@ -0,0 +1,15 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Author jack
+ * @Date:2019/6/25 1:35
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface FXEntity {
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXField.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXField.java
new file mode 100644
index 0000000..ecb3570
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXField.java
@@ -0,0 +1,20 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Author jack
+ * @Date:2019/6/27 20:10
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface FXField {
+ boolean readOnly() default false;
+ String setter() default "";
+ String add() default "";
+ String delete() default "";
+ String edit() default "";
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXReceiver.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXReceiver.java
new file mode 100644
index 0000000..4b1f539
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXReceiver.java
@@ -0,0 +1,14 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @Author jack
+ * @Date:2019/6/25 13:06
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+@Target(ElementType.METHOD)
+public @interface FXReceiver {
+ String name();
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXScan.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXScan.java
new file mode 100644
index 0000000..f9e19a0
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXScan.java
@@ -0,0 +1,16 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @Author jack
+ * @Date:2019/6/25 2:55
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface FXScan {
+ String[] base() default ".";
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXSender.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXSender.java
new file mode 100644
index 0000000..e8c39b4
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXSender.java
@@ -0,0 +1,38 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This cn.edu.scau.biubiusuisui.annotation is used for a method which can send a signal to all consumer
+ * And FXSender has a name which is used for identifying different method
+ * It is legal to use same method which has same name because JavaFX-Plus will identify a method with its full class name
+ * In addition ,name is optional , default name will be the class name and method name
+ * you can use this cn.edu.scau.biubiusuisui.annotation as the following cn.edu.scau.biubiusuisui.example
+ * @FXSernder
+ * public class A{
+ * public void test(){
+ *
+ * }
+ * }
+ * name will be A.name(It will only contain base class name and this name)
+ * or you can use
+ * @FXSernder("testDemo")
+ * public class A{
+ * public void test(){
+ *
+ * }
+ * }
+ * name will be A.testDemo
+ *
+ * @Author jack
+ * @Date:2019/6/25 13:02
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.METHOD)
+public @interface FXSender {
+ String name()default "";
+}
+
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXView.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXView.java
new file mode 100644
index 0000000..38f6b02
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXView.java
@@ -0,0 +1,9 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+/**
+ * @Author jack
+ * @Date:2019/6/25 1:36
+ */
+public @interface FXView {
+
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXWindow.java b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXWindow.java
new file mode 100644
index 0000000..5989812
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/annotation/FXWindow.java
@@ -0,0 +1,16 @@
+package cn.edu.scau.biubiusuisui.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * @Author jack
+ * @Date:2019/6/25 1:36
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+@Inherited
+public @interface FXWindow {
+ double preWidth() default 0.0;
+ double preHeight()default 0.0;
+ String title () ;
+}
diff --git a/src/main/java/cn/edu/scau/biubiusuisui/config/FXMLLoaderPlus.java b/src/main/java/cn/edu/scau/biubiusuisui/config/FXMLLoaderPlus.java
new file mode 100644
index 0000000..798bec3
--- /dev/null
+++ b/src/main/java/cn/edu/scau/biubiusuisui/config/FXMLLoaderPlus.java
@@ -0,0 +1,3533 @@
+package cn.edu.scau.biubiusuisui.config;
+
+import javafx.fxml.*;
+
+/*
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+ * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ */
+
+
+
+import com.sun.javafx.util.Logging;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.security.AllPermission;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Set;
+import java.util.regex.Pattern;
+
+import javafx.beans.DefaultProperty;
+import javafx.beans.InvalidationListener;
+import javafx.beans.property.Property;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.*;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.util.Builder;
+import javafx.util.BuilderFactory;
+import javafx.util.Callback;
+
+import javax.script.Bindings;
+import javax.script.ScriptContext;
+import javax.script.ScriptEngine;
+import javax.script.ScriptEngineManager;
+import javax.script.ScriptException;
+import javax.script.SimpleBindings;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.util.StreamReaderDelegate;
+
+import com.sun.javafx.beans.IDProperty;
+import com.sun.javafx.fxml.BeanAdapter;
+import com.sun.javafx.fxml.LoadListener;
+import com.sun.javafx.fxml.ParseTraceElement;
+import com.sun.javafx.fxml.PropertyNotFoundException;
+import com.sun.javafx.fxml.expression.Expression;
+import com.sun.javafx.fxml.expression.ExpressionValue;
+import com.sun.javafx.fxml.expression.KeyPath;
+import java.net.MalformedURLException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.EnumMap;
+import java.util.Locale;
+import java.util.StringTokenizer;
+import sun.reflect.CallerSensitive;
+import sun.reflect.Reflection;
+import sun.reflect.misc.ConstructorUtil;
+import sun.reflect.misc.MethodUtil;
+import sun.reflect.misc.ReflectUtil;
+
+/**
+ * Loads an object hierarchy from an XML document.
+ * @since JavaFX 2.0
+ */
+public class FXMLLoaderPlus {
+
+ // Indicates permission to get the ClassLoader
+ private static final RuntimePermission GET_CLASSLOADER_PERMISSION =
+ new RuntimePermission("getClassLoader");
+
+ // Abstract base class for elements
+ private abstract class Element {
+ public final cn.edu.scau.biubiusuisui.config.FXMLLoaderPlus.Element parent;
+
+ public Object value = null;
+ private BeanAdapter valueAdapter = null;
+
+ public final LinkedList eventHandlerAttributes = new LinkedList();
+ public final LinkedList instancePropertyAttributes = new LinkedList();
+ public final LinkedList staticPropertyAttributes = new LinkedList();
+ public final LinkedList staticPropertyElements = new LinkedList();
+
+ public Element() {
+ parent = current;
+ }
+
+ public boolean isCollection() {
+ // Return true if value is a list, or if the value's type defines
+ // a default property that is a list
+ boolean collection;
+ if (value instanceof List>) {
+ collection = true;
+ } else {
+ Class> type = value.getClass();
+ DefaultProperty defaultProperty = type.getAnnotation(DefaultProperty.class);
+
+ if (defaultProperty != null) {
+ collection = getProperties().get(defaultProperty.value()) instanceof List>;
+ } else {
+ collection = false;
+ }
+ }
+
+ return collection;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void add(Object element) throws LoadException {
+ // If value is a list, add element to it; otherwise, get the value
+ // of the default property, which is assumed to be a list and add
+ // to that (coerce to the appropriate type)
+ List