Merge branch 'develop' into main
This commit is contained in:
@@ -22,8 +22,6 @@
|
||||
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fx</groupId>
|
||||
<artifactId>falsework-sever</artifactId>
|
||||
@@ -36,11 +34,9 @@
|
||||
<version>11.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jfoenix</groupId>
|
||||
<groupId>com.jfoenix</groupId>
|
||||
<artifactId>jfoenix</artifactId>
|
||||
<version>${jfoenix.version}</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${pom.basedir}/libs/jfoenix-8.0.10.jar</systemPath>
|
||||
<version>8.0.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>tilesfx</groupId>
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.fx.client.AppStartup
|
||||
Class-Path: . libs/annotations-2.0.0.jar libs/feign-slf4j-10.9.jar libs/se
|
||||
rvo-core-0.10.1.jar libs/jackson-databind-2.10.0.pr3.jar libs/netflix-c
|
||||
ommons-util-0.1.1.jar libs/ribbon-loadbalancer-2.3.0.jar libs/pagehelpe
|
||||
r-5.1.4.jar libs/spring-boot-starter-websocket-2.4.1.jar libs/fontaweso
|
||||
mefx-8.9.jar libs/httpcore-4.2.1.jar libs/HikariCP-3.4.5.jar libs/log4j
|
||||
-to-slf4j-2.13.3.jar libs/javafx-graphics-11.0.2-mac.jar libs/log4j-api
|
||||
-2.13.3.jar libs/spring-boot-starter-jdbc-2.4.0.jar libs/feign-okhttp-1
|
||||
0.9.jar libs/druid-spring-boot-starter-1.1.14.jar libs/spring-web-5.3.2
|
||||
.jar libs/spring-security-config-5.4.2.jar libs/spring-boot-starter-2.4
|
||||
.1.jar libs/ribbon-core-2.3.0.jar libs/jackson-datatype-jsr310-2.11.3.j
|
||||
ar libs/spring-aop-5.3.2.jar libs/junit-4.12.jar libs/spring-boot-start
|
||||
er-quartz-2.4.1.jar libs/logback-core-1.1.7.jar libs/hamcrest-core-1.3.
|
||||
jar libs/feign-core-10.9.jar libs/spring-security-core-5.4.2.jar libs/j
|
||||
ersey-core-1.19.1.jar libs/spring-boot-2.4.1.jar libs/mybatis-spring-bo
|
||||
ot-autoconfigure-2.1.4.jar libs/feign-jackson-10.9.jar libs/okio-1.17.2
|
||||
.jar libs/mybatis-spring-2.0.6.jar libs/jakarta.annotation-api-1.3.5.ja
|
||||
r libs/tomcat-embed-websocket-9.0.41.jar libs/feign-ribbon-10.9.jar lib
|
||||
s/datafx-flow-8.0.2-SNAPSHOT.jar libs/snakeyaml-1.27.jar libs/javassist
|
||||
-3.18.1-GA.jar libs/joda-time-2.10.1.jar libs/spring-boot-starter-secur
|
||||
ity-2.4.1.jar libs/okhttp-3.14.6.jar libs/DmJdbcDriver-1.0.0.jar libs/d
|
||||
ruid-1.1.14.jar libs/jackson-annotations-2.10.0.pr3.jar libs/ikonli-jav
|
||||
afx-2.4.0.jar libs/Java-WebSocket-1.5.1.jar libs/jsr305-3.0.1.jar libs/
|
||||
mybatis-spring-boot-starter-2.1.4.jar libs/commons-lang-2.6.jar libs/sp
|
||||
ring-context-support-5.3.2.jar libs/spring-context-5.3.2.jar libs/jacks
|
||||
on-module-parameter-names-2.11.3.jar libs/spring-boot-autoconfigure-1.5
|
||||
.12.RELEASE.jar libs/javafx-base-11.0.2.jar libs/ikonli-core-2.4.0.jar
|
||||
libs/feign-hystrix-10.9.jar libs/spring-security-web-5.4.2.jar libs/spr
|
||||
ing-expression-5.2.11.RELEASE.jar libs/rxjava-1.2.0.jar libs/slf4j-api-
|
||||
1.7.21.jar libs/spring-boot-starter-json-2.4.1.jar libs/lombok-1.18.16.
|
||||
jar libs/javafx-media-11.0.2.jar libs/c3p0-0.9.5.4.jar libs/datafx-inje
|
||||
ction-8.0.2-SNAPSHOT.jar libs/jul-to-slf4j-1.7.30.jar libs/jersey-apach
|
||||
e-client4-1.19.1.jar libs/jfoenix-8.0.10.jar libs/jjwt-0.7.0.jar libs/c
|
||||
ommons-lang3-3.4.jar libs/tomcat-embed-core-9.0.41.jar libs/netflix-sta
|
||||
tistics-0.1.1.jar libs/controlsfx-11.0.3.jar libs/spring-messaging-5.3.
|
||||
2.jar libs/spring-tx-5.3.2.jar libs/spring-boot-starter-web-2.4.1.jar l
|
||||
ibs/spring-boot-starter-tomcat-2.4.1.jar libs/spring-jcl-5.3.2.jar libs
|
||||
/HikariCP-java7-2.4.13.jar libs/spring-beans-5.3.2.jar libs/HdrHistogra
|
||||
m-2.1.9.jar libs/guava-16.0.1.jar libs/pinyin4j-2.5.0.jar libs/spring-w
|
||||
ebsocket-5.3.2.jar libs/commons-collections-3.2.1.jar libs/datafx-event
|
||||
system-8.0.2-SNAPSHOT.jar libs/httpclient-4.2.1.jar libs/mchange-common
|
||||
s-java-0.2.15.jar libs/jakarta.el-3.0.3.jar libs/pagehelper-spring-boot
|
||||
-autoconfigure-1.2.5.jar libs/javafx-base-11.0.2-mac.jar libs/jackson-c
|
||||
ore-2.10.0.pr3.jar libs/ribbon-httpclient-2.2.0.jar libs/spring-boot-st
|
||||
arter-cache-2.4.1.jar libs/commons-logging-1.1.1.jar libs/javafx-media-
|
||||
11.0.2-mac.jar libs/jsqlparser-1.0.jar libs/javafx-controls-11.0.2-mac.
|
||||
jar libs/archaius-core-0.7.6.jar libs/spring-boot-starter-logging-2.4.1
|
||||
.jar libs/mysql-connector-java-8.0.20.jar libs/javafx-graphics-11.0.2.j
|
||||
ar libs/javafx-controls-11.0.2.jar libs/javax.inject-1.jar libs/datafx-
|
||||
core-8.0.2-SNAPSHOT.jar libs/quartz-2.3.2.jar libs/logback-classic-1.1.
|
||||
7.jar libs/spring-jdbc-5.3.1.jar libs/ikonli-fontawesome5-pack-2.4.0.ja
|
||||
r libs/hystrix-core-1.5.18.jar libs/jersey-client-1.19.1.jar libs/commo
|
||||
ns-configuration-1.8.jar libs/jsr311-api-1.1.1.jar libs/mybatis-3.5.6.j
|
||||
ar libs/spring-webmvc-5.3.2.jar libs/servo-internal-0.10.1.jar libs/spr
|
||||
ing-core-5.3.2.jar libs/jackson-datatype-jdk8-2.11.3.jar libs/pagehelpe
|
||||
r-spring-boot-starter-1.2.5.jar libs/commons-codec-1.6.jar
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.fx.client;
|
||||
|
||||
import com.fx.client.gui.uicomponents.control.LFXDecorator;
|
||||
import com.fx.client.gui.uicomponents.login.LoginController;
|
||||
import com.fx.client.store.ApplicatonStore;
|
||||
import com.fx.client.websocket.WSClient;
|
||||
import com.jfoenix.assets.JFoenixResources;
|
||||
import com.jfoenix.controls.JFXDecorator;
|
||||
import com.jfoenix.svg.SVGGlyph;
|
||||
import com.jfoenix.svg.SVGGlyphLoader;
|
||||
import com.netflix.config.ConfigurationManager;
|
||||
@@ -45,7 +45,7 @@ public class AppStartup extends Application {
|
||||
InputStream in = AppStartup.class.getClassLoader().getResourceAsStream("fonts/msyh.ttf");
|
||||
Font font1 = Font.loadFont(in, 12);
|
||||
|
||||
System.err.println(font1.getName() + "\t" + font1.getFamily());
|
||||
// System.err.println(font1.getName() + "\t" + font1.getFamily());
|
||||
ConfigurationManager.loadPropertiesFromResources("sample-client.properties");
|
||||
//
|
||||
|
||||
@@ -74,7 +74,7 @@ public class AppStartup extends Application {
|
||||
applicationContext.register("ContentFlowHandler", contentFlowHandler);
|
||||
contentFlowHandler.start(container);
|
||||
|
||||
LFXDecorator wfxDecorator = new LFXDecorator(stage, container.getView(), false, true, true);
|
||||
JFXDecorator wfxDecorator = new JFXDecorator(stage, container.getView());
|
||||
wfxDecorator.setCustomMaximize(true);
|
||||
wfxDecorator.setGraphic(new SVGGlyph(""));
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.fx.client.gui.uicomponents.basicInfo;
|
||||
|
||||
import com.fx.client.gui.uicomponents.basicInfo.skin.IconSwitchSkin;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.scene.control.ContentDisplay;
|
||||
import javafx.scene.control.Control;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Skin;
|
||||
|
||||
/**
|
||||
* @version: 0.0.1
|
||||
* @description:
|
||||
* @className: IconSwitch
|
||||
* @author: liwen
|
||||
* @date: 2021/2/22 10:21
|
||||
*/
|
||||
public class IconSwitch extends Control {
|
||||
|
||||
// CSS pseudo classes
|
||||
private BooleanProperty selected;
|
||||
|
||||
private final Label symbol;
|
||||
|
||||
// ******************** Constructors **************************************
|
||||
public IconSwitch() {
|
||||
getStyleClass().addAll("icon-switch");
|
||||
symbol = new Label();
|
||||
symbol.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
|
||||
}
|
||||
|
||||
// ******************** Methods *******************************************
|
||||
public final boolean isSelected() {
|
||||
return null == selected ? false : selected.get();
|
||||
}
|
||||
|
||||
public final void setSelected(final boolean ON) {
|
||||
selectedProperty().set(ON);
|
||||
}
|
||||
|
||||
public final BooleanProperty selectedProperty() {
|
||||
if (null == selected) {
|
||||
selected = new SimpleBooleanProperty();
|
||||
}
|
||||
return selected;
|
||||
}
|
||||
|
||||
// ******************** Style related *************************************
|
||||
@Override
|
||||
protected Skin createDefaultSkin() {
|
||||
return new IconSwitchSkin(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUserAgentStylesheet() {
|
||||
return getClass().getResource("/css/iconswitch.css").toExternalForm();
|
||||
}
|
||||
|
||||
|
||||
public Label getSymbol() {
|
||||
return symbol;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.fx.client.gui.uicomponents.basicInfo.skin;
|
||||
|
||||
import com.fx.client.gui.uicomponents.basicInfo.IconSwitch;
|
||||
import com.jfoenix.svg.SVGGlyph;
|
||||
import javafx.animation.TranslateTransition;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.control.ContentDisplay;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.SkinBase;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.shape.Rectangle;
|
||||
import javafx.util.Duration;
|
||||
|
||||
/**
|
||||
* @version: 0.0.1
|
||||
* @description:
|
||||
* @className: IconSwitch
|
||||
* @author: liwen
|
||||
* @date: 2021/2/22 10:21
|
||||
*/
|
||||
public class IconSwitchSkin extends SkinBase<IconSwitch> {
|
||||
private static final double PREFERRED_WIDTH = 80;
|
||||
private static final double PREFERRED_HEIGHT = 32;
|
||||
private static final double MINIMUM_WIDTH = 20;
|
||||
private static final double MINIMUM_HEIGHT = 8;
|
||||
private static final double MAXIMUM_WIDTH = 1024;
|
||||
private static final double MAXIMUM_HEIGHT = 1024;
|
||||
private double size;
|
||||
|
||||
private double aspectRatio;
|
||||
private double width;
|
||||
private double height;
|
||||
private Pane pane;
|
||||
private Rectangle background;
|
||||
private SVGGlyph symbol;
|
||||
private Label thumb;
|
||||
private TranslateTransition moveToDeselected;
|
||||
private TranslateTransition moveToSelected;
|
||||
|
||||
// ******************** Constructors **************************************
|
||||
public IconSwitchSkin(final IconSwitch CONTROL) {
|
||||
super(CONTROL);
|
||||
init();
|
||||
initGraphics();
|
||||
registerListeners();
|
||||
resize();
|
||||
}
|
||||
|
||||
// ******************** Initialization ************************************
|
||||
private void init() {
|
||||
if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 ||
|
||||
Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) {
|
||||
if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) {
|
||||
getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight());
|
||||
} else {
|
||||
getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
if (Double.compare(getSkinnable().getMinWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getMinHeight(), 0.0) <= 0) {
|
||||
getSkinnable().setMinSize(MINIMUM_WIDTH, MINIMUM_HEIGHT);
|
||||
}
|
||||
|
||||
if (Double.compare(getSkinnable().getMaxWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getMaxHeight(), 0.0) <= 0) {
|
||||
getSkinnable().setMaxSize(MAXIMUM_WIDTH, MAXIMUM_HEIGHT);
|
||||
}
|
||||
|
||||
if (getSkinnable().getPrefWidth() != PREFERRED_WIDTH || getSkinnable().getPrefHeight() != PREFERRED_HEIGHT) {
|
||||
aspectRatio = getSkinnable().getPrefHeight() / getSkinnable().getPrefWidth();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void initGraphics() {
|
||||
|
||||
background = new Rectangle();
|
||||
background.getStyleClass().setAll("background");
|
||||
|
||||
|
||||
symbol = new SVGGlyph("");
|
||||
symbol.setSize(20, 20);
|
||||
symbol.setId("symbol-a");
|
||||
|
||||
thumb = new Label("");
|
||||
thumb.setGraphic(symbol);
|
||||
thumb.setAlignment(Pos.CENTER);
|
||||
thumb.setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
|
||||
thumb.getStyleClass().setAll("thumb-a");
|
||||
thumb.setMouseTransparent(true);
|
||||
|
||||
|
||||
pane = new Pane(background, thumb);
|
||||
pane.getStyleClass().setAll("icon-switch");
|
||||
|
||||
moveToDeselected = new TranslateTransition(Duration.millis(180), thumb);
|
||||
moveToSelected = new TranslateTransition(Duration.millis(180), thumb);
|
||||
|
||||
// Add all nodes
|
||||
getChildren().setAll(pane);
|
||||
}
|
||||
|
||||
private void registerListeners() {
|
||||
getSkinnable().widthProperty().addListener(observable -> handleControlPropertyChanged("RESIZE"));
|
||||
getSkinnable().heightProperty().addListener(observable -> handleControlPropertyChanged("RESIZE"));
|
||||
getSkinnable().selectedProperty().addListener(observable -> handleControlPropertyChanged("SELECTED"));
|
||||
pane.setOnMouseClicked(mouseEvent -> {
|
||||
getSkinnable().setSelected(!getSkinnable().isSelected());
|
||||
});
|
||||
}
|
||||
|
||||
// ******************** Methods *******************************************
|
||||
protected void handleControlPropertyChanged(final String PROPERTY) {
|
||||
if ("RESIZE".equals(PROPERTY)) {
|
||||
resize();
|
||||
} else if ("SELECTED".equals(PROPERTY)) {
|
||||
|
||||
thumb.getStyleClass().removeAll("thumb-a-selected" , "thumb-a");
|
||||
thumb.getStyleClass().setAll(getSkinnable().isSelected() ? "thumb-a-selected" : "thumb-a");
|
||||
symbol.setId(getSkinnable().isSelected() ? "symbol-a-selected" : "symbol-a");
|
||||
// symbol.setStyle(getSkinnable().isSelected() ? "-fx-background-color: #191e1e;" : " -fx-background-color: #ffffff;");
|
||||
if (getSkinnable().isSelected()) {
|
||||
moveToSelected.play();
|
||||
} else {
|
||||
moveToDeselected.play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected double computeMinWidth(final double HEIGHT, double TOP_INSET, double RIGHT_INSET, double BOTTOM_INSET, double LEFT_INSET) {
|
||||
return super.computeMinWidth(Math.max(MINIMUM_HEIGHT, HEIGHT - TOP_INSET - BOTTOM_INSET), TOP_INSET, RIGHT_INSET, BOTTOM_INSET, LEFT_INSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double computeMinHeight(final double WIDTH, double TOP_INSET, double RIGHT_INSET, double BOTTOM_INSET, double LEFT_INSET) {
|
||||
return super.computeMinHeight(Math.max(MINIMUM_WIDTH, WIDTH - LEFT_INSET - RIGHT_INSET), TOP_INSET, RIGHT_INSET, BOTTOM_INSET, LEFT_INSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double computeMaxWidth(final double HEIGHT, double TOP_INSET, double RIGHT_INSET, double BOTTOM_INSET, double LEFT_INSET) {
|
||||
return super.computeMaxWidth(Math.min(MAXIMUM_HEIGHT, HEIGHT - TOP_INSET - BOTTOM_INSET), TOP_INSET, RIGHT_INSET, BOTTOM_INSET, LEFT_INSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double computeMaxHeight(final double WIDTH, double TOP_INSET, double RIGHT_INSET, double BOTTOM_INSET, double LEFT_INSET) {
|
||||
return super.computeMaxHeight(Math.min(MAXIMUM_WIDTH, WIDTH - LEFT_INSET - RIGHT_INSET), TOP_INSET, RIGHT_INSET, BOTTOM_INSET, LEFT_INSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double computePrefWidth(final double HEIGHT, double TOP_INSET, double RIGHT_INSET, double BOTTOM_INSET, double LEFT_INSET) {
|
||||
double prefHeight = PREFERRED_HEIGHT;
|
||||
if (HEIGHT != -1) {
|
||||
prefHeight = Math.max(0, HEIGHT - TOP_INSET - BOTTOM_INSET);
|
||||
}
|
||||
return super.computePrefWidth(prefHeight, TOP_INSET, RIGHT_INSET, BOTTOM_INSET, LEFT_INSET);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double computePrefHeight(final double WIDTH, double TOP_INSET, double RIGHT_INSET, double BOTTOM_INSET, double LEFT_INSET) {
|
||||
double prefWidth = PREFERRED_WIDTH;
|
||||
if (WIDTH != -1) {
|
||||
prefWidth = Math.max(0, WIDTH - LEFT_INSET - RIGHT_INSET);
|
||||
}
|
||||
return super.computePrefHeight(prefWidth, TOP_INSET, RIGHT_INSET, BOTTOM_INSET, LEFT_INSET);
|
||||
}
|
||||
|
||||
|
||||
// ******************** Private Methods ***********************************
|
||||
private void resize() {
|
||||
width = getSkinnable().getWidth();
|
||||
height = getSkinnable().getHeight();
|
||||
size = (width < height ? width : height)*.65;
|
||||
|
||||
if (width > 0 && height > 0) {
|
||||
|
||||
background.heightProperty().set(height * 0.35);
|
||||
background.widthProperty().set(width);
|
||||
background.arcHeightProperty().setValue(background.getHeight());
|
||||
background.arcWidthProperty().setValue(background.getHeight());
|
||||
background.setTranslateY((height - background.getHeight()) / 2.0);
|
||||
|
||||
thumb.setPrefSize(size, size);
|
||||
thumb.setTranslateX(getSkinnable().isSelected() ? width - size : 0);
|
||||
thumb.setTranslateY((height - size) / 2.0);
|
||||
|
||||
symbol.setSize((size * 0.65), (size * 0.65));
|
||||
|
||||
moveToDeselected.setFromX(width -size);
|
||||
moveToDeselected.setToX(0);
|
||||
|
||||
moveToSelected.setFromX(0);
|
||||
moveToSelected.setToX(width - size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,18 +2,9 @@ package com.fx.client.gui.uicomponents.control;
|
||||
|
||||
import com.jfoenix.controls.JFXButton;
|
||||
import com.jfoenix.svg.SVGGlyph;
|
||||
import javafx.animation.Animation;
|
||||
import javafx.animation.Interpolator;
|
||||
import javafx.animation.KeyFrame;
|
||||
import javafx.animation.KeyValue;
|
||||
import javafx.animation.Timeline;
|
||||
import javafx.animation.*;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.ObjectProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
import javafx.beans.property.*;
|
||||
import javafx.geometry.BoundingBox;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.geometry.Pos;
|
||||
@@ -21,21 +12,10 @@ import javafx.geometry.Rectangle2D;
|
||||
import javafx.scene.Cursor;
|
||||
import javafx.scene.Node;
|
||||
import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.effect.BlendMode;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.Background;
|
||||
import javafx.scene.layout.BackgroundFill;
|
||||
import javafx.scene.layout.Border;
|
||||
import javafx.scene.layout.BorderStroke;
|
||||
import javafx.scene.layout.BorderStrokeStyle;
|
||||
import javafx.scene.layout.BorderWidths;
|
||||
import javafx.scene.layout.CornerRadii;
|
||||
import javafx.scene.layout.HBox;
|
||||
import javafx.scene.layout.Priority;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.layout.*;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.shape.Rectangle;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
@@ -351,7 +331,6 @@ public class LFXDecorator extends StackPane {
|
||||
}
|
||||
});
|
||||
buttonsContainer.setMinWidth(180);
|
||||
contentPlaceHolder.getStyleClass().add("lfx-decorator-content-container");
|
||||
contentPlaceHolder.setMinSize(0, 0);
|
||||
StackPane clippedContainer = new StackPane(node);
|
||||
contentPlaceHolder.getChildren().add(clippedContainer);
|
||||
@@ -361,15 +340,9 @@ public class LFXDecorator extends StackPane {
|
||||
|
||||
// BINDING
|
||||
|
||||
Rectangle clip = new Rectangle();
|
||||
clip.setArcWidth(20);
|
||||
clip.setArcHeight(20);
|
||||
clip.widthProperty().bind(contentPane.widthProperty());
|
||||
clip.heightProperty().bind(contentPane.heightProperty());
|
||||
|
||||
VBox.setVgrow(contentPlaceHolder, Priority.ALWAYS);
|
||||
contentPane.getChildren().addAll(buttonsContainer, contentPlaceHolder);
|
||||
contentPane.setClip(clip);
|
||||
contentPane.getChildren().addAll(buttonsContainer,contentPlaceHolder);
|
||||
contentPane.setBlendMode(BlendMode.SRC_ATOP);
|
||||
|
||||
this.setPadding(new Insets(3,3,3,3));
|
||||
this.getChildren().addAll(contentPane);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.fx.client.gui.uicomponents.main;
|
||||
import com.fx.client.AppStartup;
|
||||
import com.fx.client.bean.MenuVoCell;
|
||||
import com.fx.client.gui.feature.FeatureResourceConsumer;
|
||||
import com.fx.client.gui.uicomponents.basicInfo.IconSwitch;
|
||||
import com.fx.client.gui.uicomponents.home.HomeController;
|
||||
import com.fx.client.gui.uicomponents.login.LoginController;
|
||||
import com.fx.client.gui.uicomponents.main.components.UserInfoController;
|
||||
@@ -82,9 +83,8 @@ public class MainController {
|
||||
@FXML
|
||||
@ActionTrigger("goHome")
|
||||
private JFXButton homeButton;
|
||||
@FXML
|
||||
@ActionTrigger("showSkinPane")
|
||||
private JFXToggleNode styleNode;
|
||||
private IconSwitch styleNode;
|
||||
//刷新按钮
|
||||
@FXML
|
||||
@EventTrigger("refresh")
|
||||
@@ -127,7 +127,9 @@ public class MainController {
|
||||
|
||||
@PostConstruct
|
||||
public void init() throws FlowException {
|
||||
|
||||
styleNode=new IconSwitch();
|
||||
styleNode.setPrefSize(50,32);
|
||||
rightHbox.getChildren().add(0,styleNode);
|
||||
navigationList=new JFXListView<>();
|
||||
navigationList.getStyleClass().add("navigation-list");
|
||||
leftDrawer = new JFXDrawer();
|
||||
@@ -147,7 +149,6 @@ public class MainController {
|
||||
refreshButton.setGraphic(SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".shuaxin1"));
|
||||
bellButton.setGraphic(SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".cc-bell-o"));
|
||||
userButton.setGraphic(SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".ChevronDownCircle"));
|
||||
styleNode.setGraphic(SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".moon-fill"));
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -205,8 +206,16 @@ public class MainController {
|
||||
});
|
||||
drawersStack.toggle(leftDrawer);
|
||||
drawersStack.setEffect(null);
|
||||
|
||||
styleNode.selectedProperty().bindBidirectional(ApplicatonStore.styleProperty());
|
||||
ApplicatonStore.styleProperty().bindBidirectional( styleNode.selectedProperty());
|
||||
styleNode.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
try {
|
||||
showSkinPane();
|
||||
} catch (VetoException e) {
|
||||
e.printStackTrace();
|
||||
} catch (FlowException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
featureResourceConsumer.consumeResource(this);
|
||||
|
||||
navigationList.setCellFactory(listView -> new JFXListCell<Object>() {
|
||||
@@ -412,19 +421,10 @@ public class MainController {
|
||||
String style2 = AppStartup.class.getResource("/css/app-dark.css").toExternalForm();
|
||||
if (styleNode.isSelected()) {
|
||||
|
||||
try {
|
||||
styleNode.setGraphic(SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".taiyang"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
styleNode.getScene().getStylesheets().removeAll(style1);
|
||||
styleNode.getScene().getStylesheets().addAll(style2);
|
||||
} else {
|
||||
try {
|
||||
styleNode.setGraphic(SVGGlyphLoader.getIcoMoonGlyph(ApplicatonStore.ICON_FONT_KEY + ".moon-fill"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
styleNode.getScene().getStylesheets().removeAll(style2);
|
||||
styleNode.getScene().getStylesheets().addAll(style1);
|
||||
|
||||
@@ -115,8 +115,10 @@ public class Request {
|
||||
|
||||
@Override
|
||||
public LBClient create(String clientName) {
|
||||
System.err.println("--------------------"+clientName+"--------------------");
|
||||
IClientConfig config = ClientFactory.getNamedConfig(clientName);
|
||||
ILoadBalancer lb = ClientFactory.getNamedLoadBalancer(clientName);
|
||||
|
||||
ZoneAwareLoadBalancer zb = (ZoneAwareLoadBalancer) lb;
|
||||
zb.setRule(new BestAvailableRule());
|
||||
LBClient lbClient = LBClient.create(lb, config);
|
||||
|
||||
59
falsework-client/src/main/resources/META-INF/MANIFEST.MF
Normal file
59
falsework-client/src/main/resources/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,59 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.fx.client.AppStartup
|
||||
Class-Path: . libs/kotlin-compiler-1.0.6.jar libs/datafx-flow-8.0.2-SNAP
|
||||
SHOT.jar libs/jersey-apache-client4-1.19.1.jar libs/HikariCP-java7-2.4.
|
||||
13.jar libs/hystrix-core-1.5.18.jar libs/spring-boot-starter-web-2.4.1.
|
||||
jar libs/HikariCP-3.4.5.jar libs/netflix-statistics-0.1.1.jar libs/comm
|
||||
ons-lang3-3.4.jar libs/datafx-core-8.0.2-SNAPSHOT.jar libs/spring-boot-
|
||||
starter-websocket-2.4.1.jar libs/jersey-core-1.19.1.jar libs/tilesfx-1.
|
||||
6.8.jar libs/spring-beans-5.3.2.jar libs/javax.inject-1.jar libs/spring
|
||||
-boot-starter-security-2.4.1.jar libs/spring-expression-5.2.11.RELEASE.
|
||||
jar libs/spring-websocket-5.3.2.jar libs/c3p0-0.9.5.4.jar libs/spring-w
|
||||
ebmvc-5.3.2.jar libs/logback-classic-1.1.7.jar libs/spring-boot-autocon
|
||||
figure-1.5.12.RELEASE.jar libs/jackson-databind-2.10.0.pr3.jar libs/rib
|
||||
bon-httpclient-2.2.0.jar libs/spring-boot-starter-tomcat-2.4.1.jar libs
|
||||
/spring-web-5.3.2.jar libs/feign-jackson-10.9.jar libs/httpclient-4.2.1
|
||||
.jar libs/junit-4.12.jar libs/mybatis-3.5.6.jar libs/spring-tx-5.3.2.ja
|
||||
r libs/spring-messaging-5.3.2.jar libs/javafx-graphics-11.0.2.jar libs/
|
||||
javafx-base-11.0.2-mac.jar libs/spring-context-support-5.3.2.jar libs/d
|
||||
atafx-eventsystem-8.0.2-SNAPSHOT.jar libs/javafx-base-11.0.2.jar libs/p
|
||||
agehelper-spring-boot-autoconfigure-1.2.5.jar libs/slf4j-api-1.7.21.jar
|
||||
libs/javassist-3.18.1-GA.jar libs/commons-logging-1.1.1.jar libs/mysql
|
||||
-connector-java-8.0.20.jar libs/jakarta.el-3.0.3.jar libs/jackson-modul
|
||||
e-parameter-names-2.11.3.jar libs/spring-boot-starter-cache-2.4.1.jar l
|
||||
ibs/spring-security-web-5.4.2.jar libs/jul-to-slf4j-1.7.30.jar libs/spr
|
||||
ing-security-config-5.4.2.jar libs/spring-boot-2.4.1.jar libs/pagehelpe
|
||||
r-5.1.4.jar libs/ikonli-javafx-2.4.0.jar libs/spring-boot-starter-loggi
|
||||
ng-2.4.1.jar libs/spring-jcl-5.3.2.jar libs/servo-core-0.10.1.jar libs/
|
||||
jackson-core-2.10.0.pr3.jar libs/log4j-to-slf4j-2.13.3.jar libs/hamcres
|
||||
t-core-1.3.jar libs/spring-jdbc-5.3.1.jar libs/log4j-api-2.13.3.jar lib
|
||||
s/jakarta.annotation-api-1.3.5.jar libs/mchange-commons-java-0.2.15.jar
|
||||
libs/javafx-controls-11.0.2-mac.jar libs/jackson-datatype-jdk8-2.11.3.
|
||||
jar libs/archaius-core-0.7.6.jar libs/pinyin4j-2.5.0.jar libs/mybatis-s
|
||||
pring-boot-autoconfigure-2.1.4.jar libs/commons-configuration-1.8.jar l
|
||||
ibs/tomcat-embed-core-9.0.41.jar libs/jsr305-3.0.1.jar libs/snakeyaml-1
|
||||
.27.jar libs/commons-codec-1.6.jar libs/druid-1.1.14.jar libs/feign-rib
|
||||
bon-10.9.jar libs/spring-boot-starter-2.4.1.jar libs/spring-core-5.3.2.
|
||||
jar libs/okio-1.17.2.jar libs/ikonli-core-2.4.0.jar libs/jjwt-0.7.0.jar
|
||||
libs/rxjava-1.2.0.jar libs/DmJdbcDriver-1.0.0.jar libs/guava-16.0.1.ja
|
||||
r libs/okhttp-3.14.6.jar libs/druid-spring-boot-starter-1.1.14.jar libs
|
||||
/datafx-injection-8.0.2-SNAPSHOT.jar libs/mybatis-spring-boot-starter-2
|
||||
.1.4.jar libs/spring-boot-starter-jdbc-2.4.0.jar libs/ribbon-core-2.3.0
|
||||
.jar libs/logback-core-1.1.7.jar libs/feign-okhttp-10.9.jar libs/pagehe
|
||||
lper-spring-boot-starter-1.2.5.jar libs/ikonli-fontawesome5-pack-2.4.0.
|
||||
jar libs/feign-slf4j-10.9.jar libs/netflix-commons-util-0.1.1.jar libs/
|
||||
fontawesomefx-8.9.jar libs/Java-WebSocket-1.5.1.jar libs/HdrHistogram-2
|
||||
.1.9.jar libs/javafx-controls-11.0.2.jar libs/jersey-client-1.19.1.jar
|
||||
libs/spring-aop-5.3.2.jar libs/tomcat-embed-websocket-9.0.41.jar libs/c
|
||||
ontrolsfx-11.0.3.jar libs/spring-context-5.3.2.jar libs/javafx-media-11
|
||||
.0.2-mac.jar libs/jsr311-api-1.1.1.jar libs/jfoenix-9.0.10.jar libs/jsq
|
||||
lparser-1.0.jar libs/spring-boot-starter-quartz-2.4.1.jar libs/annotati
|
||||
ons-2.0.0.jar libs/ribbon-loadbalancer-2.3.0.jar libs/mybatis-spring-2.
|
||||
0.6.jar libs/spring-security-core-5.4.2.jar libs/commons-lang-2.6.jar l
|
||||
ibs/commons-collections-3.2.1.jar libs/servo-internal-0.10.1.jar libs/f
|
||||
eign-core-10.9.jar libs/feign-hystrix-10.9.jar libs/httpcore-4.2.1.jar
|
||||
libs/javafx-graphics-11.0.2-mac.jar libs/joda-time-2.10.1.jar libs/lomb
|
||||
ok-1.18.16.jar libs/quartz-2.3.2.jar libs/jackson-annotations-2.10.0.pr
|
||||
3.jar libs/jackson-datatype-jsr310-2.11.3.jar libs/javafx-media-11.0.2.
|
||||
jar libs/spring-boot-starter-json-2.4.1.jar
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
52
falsework-client/src/main/resources/css/iconswitch.css
Normal file
52
falsework-client/src/main/resources/css/iconswitch.css
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (c) 2013 by Gerrit Grunwald
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/************************************************************
|
||||
* ICON-SWITCH class *
|
||||
************************************************************/
|
||||
.icon-switch {
|
||||
-fx-skin: "com.fx.client.gui.uicomponents.basicInfo.skin.IconSwitchSkin";
|
||||
-switch-color: white;
|
||||
-thumb-color: white;
|
||||
}
|
||||
|
||||
.icon-switch > .background {
|
||||
-fx-fill: #41464b;
|
||||
}
|
||||
|
||||
.icon-switch > .thumb-a {
|
||||
-fx-background-color: #909191;
|
||||
-fx-background-radius: 1024;
|
||||
}
|
||||
|
||||
.icon-switch > .thumb-a-selected {
|
||||
-fx-background-color: #9b9b9b;
|
||||
-fx-background-radius: 1024;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.icon-switch .thumb-a .jfx-svg-glyph {
|
||||
-fx-shape: "M511.951 74.082c16.284 0 29.529-13.001 29.904-29.18l0.008-0.706v-81.31c0-16.506-13.392-29.886-29.912-29.886-16.283 0-29.528 13-29.903 29.18l-0.008 0.706v81.31c0 16.505 13.392 29.886 29.911 29.886z m-219.283 93.56c11.514-11.505 11.679-30.056 0.493-41.761l-0.493-0.505-57.545-57.495c-11.68-11.67-30.62-11.67-42.301 0-11.515 11.505-11.68 30.055-0.494 41.76l0.494 0.505 57.544 57.495c11.681 11.671 30.62 11.671 42.302 0z m484.965 0.492l0.505-0.493 57.545-57.495c11.681-11.67 11.681-30.593 0-42.265-11.515-11.504-30.08-11.669-41.797-0.493l-0.505 0.493-57.544 57.495c-11.682 11.671-11.682 30.594 0 42.265 11.514 11.505 30.08 11.669 41.796 0.493zM511.951 645.787c143.596 0 260.003-116.306 260.003-259.778 0-143.471-116.407-259.778-260.003-259.778-143.595 0-260.003 116.307-260.003 259.778 0 143.472 116.408 259.778 260.003 259.778z m0-59.772c-110.556 0-200.179-89.545-200.179-200.006 0-110.46 89.623-200.006 200.18-200.006 110.555 0 200.179 89.546 200.179 200.006s-89.624 200.006-200.18 200.006z m-336.694-167.07c16.505 0 29.886-13.391 29.886-29.911 0-16.284-13.001-29.529-29.18-29.904l-0.706-0.008h-81.31c-16.506 0-29.886 13.392-29.886 29.912 0 16.284 13 29.528 29.18 29.904l0.706 0.008h81.31z m747.796 0c16.506 0 29.886-13.391 29.886-29.911 0-16.284-13-29.529-29.18-29.904l-0.706-0.008h-81.31c-16.505 0-29.886 13.392-29.886 29.912 0 16.284 13.001 29.528 29.18 29.904l0.706 0.008h81.31zM234.618 708.382l0.505-0.493 57.545-57.495c11.681-11.671 11.681-30.594 0-42.265-11.515-11.505-30.08-11.67-41.797-0.493l-0.505 0.493-57.544 57.494c-11.682 11.672-11.682 30.594 0 42.265 11.514 11.505 30.08 11.67 41.796 0.494z m596.463-0.493c11.515-11.505 11.679-30.055 0.494-41.76l-0.494-0.506-57.544-57.494c-11.682-11.671-30.62-11.671-42.302 0-11.515 11.504-11.679 30.055-0.494 41.76l0.494 0.505 57.544 57.495c11.682 11.67 30.62 11.67 42.302 0zM511.951 832c16.284 0 29.529-13 29.904-29.18l0.008-0.706v-81.31c0-16.505-13.392-29.886-29.912-29.886-16.283 0-29.528 13.001-29.903 29.18l-0.008 0.706v81.31C482.04 818.62 495.432 832 511.95 832z";
|
||||
}
|
||||
|
||||
.icon-switch .thumb-a-selected .jfx-svg-glyph {
|
||||
-fx-shape: "M485.546667 809.856a320 320 0 1 1 452.266666-452.266667C924.245333 134.229333 738.816-42.666667 512.042667-42.666667 276.352-42.666667 85.333333 148.352 85.333333 384c0 226.773333 176.896 412.202667 400.213334 425.856z";
|
||||
}
|
||||
|
||||
.icon-switch:disabled {
|
||||
-fx-opacity: 0.4;
|
||||
}
|
||||
@@ -22,70 +22,83 @@
|
||||
|
||||
<Pane fx:id="backgroundPicturePane" prefHeight="200.0" prefWidth="200.0" styleClass="backgroundPicturePane">
|
||||
<StackPane.margin>
|
||||
<Insets />
|
||||
<Insets/>
|
||||
</StackPane.margin>
|
||||
</Pane>
|
||||
<Pane fx:id="backgroundPane" prefHeight="200.0" prefWidth="200.0" styleClass="backgroundPane">
|
||||
<StackPane.margin>
|
||||
<Insets />
|
||||
<Insets/>
|
||||
</StackPane.margin>
|
||||
</Pane>
|
||||
|
||||
<VBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="400.0" prefWidth="600.0">
|
||||
<children>
|
||||
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="1.7976931348623157E308" minHeight="-Infinity" prefHeight="50.0" spacing="5.0" styleClass="tool-pane" VBox.vgrow="ALWAYS">
|
||||
<HBox alignment="CENTER_LEFT" maxHeight="-Infinity" maxWidth="1.7976931348623157E308"
|
||||
minHeight="-Infinity" prefHeight="50.0" spacing="5.0" styleClass="tool-pane" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<JFXHamburger fx:id="navigationButton" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="40.0" prefWidth="40.0">
|
||||
<JFXHamburger fx:id="navigationButton" maxHeight="-Infinity" maxWidth="-Infinity"
|
||||
prefHeight="40.0" prefWidth="40.0">
|
||||
<animation>
|
||||
<HamburgerSlideCloseTransition />
|
||||
<HamburgerSlideCloseTransition/>
|
||||
</animation>
|
||||
<padding>
|
||||
<Insets left="5.0" />
|
||||
<Insets left="5.0"/>
|
||||
</padding>
|
||||
</JFXHamburger>
|
||||
<JFXButton fx:id="homeButton" contentDisplay="GRAPHIC_ONLY" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="40.0" prefWidth="40.0" styleClass="tool-bar-button" />
|
||||
<JFXButton fx:id="refreshButton" contentDisplay="GRAPHIC_ONLY" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="40.0" prefWidth="40.0" styleClass="tool-bar-button" />
|
||||
<JFXButton fx:id="homeButton" contentDisplay="GRAPHIC_ONLY" maxHeight="-Infinity"
|
||||
maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="40.0"
|
||||
prefWidth="40.0" styleClass="tool-bar-button"/>
|
||||
<JFXButton fx:id="refreshButton" contentDisplay="GRAPHIC_ONLY" maxHeight="-Infinity"
|
||||
maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="40.0"
|
||||
prefWidth="40.0" styleClass="tool-bar-button"/>
|
||||
<JFXDatePicker fx:id="datePicker" editable="false" maxWidth="150">
|
||||
<HBox.margin>
|
||||
<Insets />
|
||||
<Insets/>
|
||||
</HBox.margin>
|
||||
<padding>
|
||||
<Insets bottom="7.0" />
|
||||
<Insets bottom="7.0"/>
|
||||
</padding>
|
||||
</JFXDatePicker>
|
||||
|
||||
|
||||
<HBox alignment="CENTER_RIGHT" HBox.hgrow="ALWAYS">
|
||||
<JFXToggleNode fx:id="styleNode" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="40.0" prefWidth="40.0" styleClass="tool-bar-toggle" />
|
||||
<JFXBadge maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="40.0" prefWidth="45.0" styleClass="icons-badge" text="8">
|
||||
<HBox fx:id="rightHbox" alignment="CENTER_RIGHT" HBox.hgrow="ALWAYS">
|
||||
|
||||
<JFXBadge maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="40.0" prefWidth="45.0"
|
||||
styleClass="icons-badge" text="8">
|
||||
<control>
|
||||
<StackPane style="-fx-padding: 5;">
|
||||
<JFXButton fx:id="bellButton" contentDisplay="GRAPHIC_ONLY" maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="40.0" prefWidth="40.0" styleClass="tool-bar-button" text="1">
|
||||
<JFXButton fx:id="bellButton" contentDisplay="GRAPHIC_ONLY"
|
||||
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="40.0"
|
||||
prefWidth="40.0" styleClass="tool-bar-button" text="1">
|
||||
<StackPane.margin>
|
||||
<Insets />
|
||||
<Insets/>
|
||||
</StackPane.margin>
|
||||
</JFXButton>
|
||||
</StackPane>
|
||||
</control>
|
||||
</JFXBadge>
|
||||
<VBox alignment="CENTER">
|
||||
<Label fx:id="userLabel" maxWidth="1.7976931348623157E308" style="-fx-font-size: 16;-fx-font-weight: bold" text="李稳" VBox.vgrow="ALWAYS" />
|
||||
<Label fx:id="roleLabel" maxWidth="1.7976931348623157E308" style="-fx-font-size: 10;" text="管理员" VBox.vgrow="ALWAYS" />
|
||||
<Label fx:id="userLabel" maxWidth="1.7976931348623157E308"
|
||||
style="-fx-font-size: 16;-fx-font-weight: bold" text="李稳" VBox.vgrow="ALWAYS"/>
|
||||
<Label fx:id="roleLabel" maxWidth="1.7976931348623157E308" style="-fx-font-size: 10;"
|
||||
text="管理员" VBox.vgrow="ALWAYS"/>
|
||||
<padding>
|
||||
<Insets left="7.0" />
|
||||
<Insets left="7.0"/>
|
||||
</padding>
|
||||
</VBox>
|
||||
<JFXButton fx:id="userButton" contentDisplay="GRAPHIC_ONLY" maxHeight="20.0" maxWidth="20.0" minHeight="20.0" minWidth="20.0" prefHeight="20.0" prefWidth="20.0" styleClass="tool-bar-button" text="user" textFill="WHITE" />
|
||||
<JFXButton fx:id="userButton" contentDisplay="GRAPHIC_ONLY" maxHeight="20.0" maxWidth="20.0"
|
||||
minHeight="20.0" minWidth="20.0" prefHeight="20.0" prefWidth="20.0"
|
||||
styleClass="tool-bar-button" text="user" textFill="WHITE"/>
|
||||
<padding>
|
||||
<Insets right="5.0" />
|
||||
<Insets right="5.0"/>
|
||||
</padding>
|
||||
</HBox>
|
||||
</children>
|
||||
</HBox>
|
||||
|
||||
<JFXDrawersStack fx:id="drawersStack" VBox.vgrow="ALWAYS" >
|
||||
<JFXDrawersStack fx:id="drawersStack" VBox.vgrow="ALWAYS">
|
||||
<content>
|
||||
<JFXTabPane fx:id="tabPane" />
|
||||
<JFXTabPane fx:id="tabPane"/>
|
||||
</content>
|
||||
</JFXDrawersStack>
|
||||
</children>
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
import sun.reflect.ConstructorAccessor;
|
||||
import sun.reflect.FieldAccessor;
|
||||
import sun.reflect.ReflectionFactory;
|
||||
|
||||
import java.lang.reflect.AccessibleObject;
|
||||
import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class DynamicEnumUtil {
|
||||
|
||||
private static ReflectionFactory reflectionFactory = ReflectionFactory.getReflectionFactory();
|
||||
|
||||
private static void setFailsafeFieldValue(Field field, Object target, Object value) throws NoSuchFieldException,
|
||||
IllegalAccessException {
|
||||
|
||||
// let's make the field accessible
|
||||
field.setAccessible(true);
|
||||
|
||||
// next we change the modifier in the Field instance to
|
||||
// not be final anymore, thus tricking reflection into
|
||||
// letting us modify the static final field
|
||||
Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
modifiersField.setAccessible(true);
|
||||
int modifiers = modifiersField.getInt(field);
|
||||
|
||||
// blank out the final bit in the modifiers int
|
||||
modifiers &= ~Modifier.FINAL;
|
||||
modifiersField.setInt(field, modifiers);
|
||||
|
||||
FieldAccessor fa = reflectionFactory.newFieldAccessor(field, false);
|
||||
fa.set(target, value);
|
||||
}
|
||||
|
||||
private static void blankField(Class<?> enumClass, String fieldName) throws NoSuchFieldException,
|
||||
IllegalAccessException {
|
||||
for (Field field : Class.class.getDeclaredFields()) {
|
||||
if (field.getName().contains(fieldName)) {
|
||||
AccessibleObject.setAccessible(new Field[] { field }, true);
|
||||
setFailsafeFieldValue(field, enumClass, null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void cleanEnumCache(Class<?> enumClass) throws NoSuchFieldException, IllegalAccessException {
|
||||
blankField(enumClass, "enumConstantDirectory"); // Sun (Oracle?!?) JDK 1.5/6
|
||||
blankField(enumClass, "enumConstants"); // IBM JDK
|
||||
}
|
||||
|
||||
private static ConstructorAccessor getConstructorAccessor(Class<?> enumClass, Class<?>[] additionalParameterTypes)
|
||||
throws NoSuchMethodException {
|
||||
Class<?>[] parameterTypes = new Class[additionalParameterTypes.length + 2];
|
||||
parameterTypes[0] = String.class;
|
||||
parameterTypes[1] = int.class;
|
||||
System.arraycopy(additionalParameterTypes, 0, parameterTypes, 2, additionalParameterTypes.length);
|
||||
return reflectionFactory.newConstructorAccessor(enumClass.getDeclaredConstructor(parameterTypes));
|
||||
}
|
||||
|
||||
private static Object makeEnum(Class<?> enumClass, String value, int ordinal, Class<?>[] additionalTypes,
|
||||
Object[] additionalValues) throws Exception {
|
||||
Object[] parms = new Object[additionalValues.length + 2];
|
||||
parms[0] = value;
|
||||
parms[1] = Integer.valueOf(ordinal);
|
||||
System.arraycopy(additionalValues, 0, parms, 2, additionalValues.length);
|
||||
// parms[1] = parms[parms.length-1];
|
||||
return enumClass.cast(getConstructorAccessor(enumClass, additionalTypes).newInstance(parms));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an enum instance to the enum class given as argument
|
||||
*
|
||||
* @param <T> the type of the enum (implicit)
|
||||
* @param enumType the class of the enum to be modified
|
||||
* @param enumName the name of the new enum instance to be added to the class.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <T extends Enum<?>> T addEnum(Class<T> enumType, String enumName, Class<?>[] additionalTypes, Object[] additionalValues) {
|
||||
|
||||
// 0. Sanity checks
|
||||
if (!Enum.class.isAssignableFrom(enumType)) {
|
||||
throw new RuntimeException("class " + enumType + " is not an instance of Enum");
|
||||
}
|
||||
|
||||
// 1. Lookup "$VALUES" holder in enum class and get previous enum instances
|
||||
Field valuesField = null;
|
||||
Field[] fields = enumType.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if (field.getName().contains("$VALUES")) {
|
||||
valuesField = field;
|
||||
break;
|
||||
}
|
||||
}
|
||||
AccessibleObject.setAccessible(new Field[] { valuesField }, true);
|
||||
|
||||
try {
|
||||
|
||||
// 2. Copy it
|
||||
T[] previousValues = (T[]) valuesField.get(enumType);
|
||||
List<T> values = new ArrayList<T>(Arrays.asList(previousValues));
|
||||
|
||||
// 3. build new enum
|
||||
T newValue = (T) makeEnum(enumType, enumName, values.size(), additionalTypes, additionalValues);
|
||||
|
||||
// 4. add new value
|
||||
values.add(newValue);
|
||||
|
||||
// 5. Set new values field
|
||||
setFailsafeFieldValue(valuesField, null, values.toArray((T[]) Array.newInstance(enumType, 0)));
|
||||
|
||||
// 6. Clean enum cache
|
||||
cleanEnumCache(enumType);
|
||||
return newValue;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
9
falsework-client/src/test/java/JavaFxTest.java
Normal file
9
falsework-client/src/test/java/JavaFxTest.java
Normal file
@@ -0,0 +1,9 @@
|
||||
package PACKAGE_NAME;/**
|
||||
* @version: 0.0.1
|
||||
* @description:
|
||||
*
|
||||
* @className: JavaFxTest
|
||||
* @author: liwen
|
||||
* @date: 2021/4/13 15:16
|
||||
*/public class JavaFxTest {
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum YesNoEnum {
|
||||
YES(1, "yes"),
|
||||
NO(0, "no");
|
||||
|
||||
private Integer value;
|
||||
private String name;
|
||||
private static Map<Integer, YesNoEnum> enumMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
// 可以在这里加载枚举的配置文件 比如从 properties 数据库中加载
|
||||
// 加载完后 使用DynamicEnumUtil.addEnum 动态增加枚举值
|
||||
// 然后正常使用枚举即可
|
||||
EnumSet<YesNoEnum> set = EnumSet.allOf(YesNoEnum.class);
|
||||
for (YesNoEnum each : set) {
|
||||
// 增加一个缓存 减少对枚举的修改
|
||||
enumMap.put(each.value, each);
|
||||
}
|
||||
}
|
||||
|
||||
YesNoEnum(Integer value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
// 根据关键字段获取枚举值 可以在这里做一些修改 来达到动态添加的效果
|
||||
public YesNoEnum getEnum(Integer value) {
|
||||
// 这里可以做一些修改 比如若从 enumMap 中没有取得 则加载配置动态添加
|
||||
return enumMap.get(value);
|
||||
}
|
||||
|
||||
// 动态添加方法 添加完后加入缓存 减少对枚举的修改
|
||||
public YesNoEnum addEnum(String enumName, Integer value, String name) {
|
||||
YesNoEnum yesNoEnum = DynamicEnumUtil.addEnum(YesNoEnum.class, enumName, new Class[]{Integer.class, String.class}, new Object[]{value, name});
|
||||
enumMap.put(value, yesNoEnum);
|
||||
return yesNoEnum;
|
||||
}
|
||||
}
|
||||
50
falsework-sever/src/main/resources/META-INF/MANIFEST.MF
Normal file
50
falsework-sever/src/main/resources/META-INF/MANIFEST.MF
Normal file
@@ -0,0 +1,50 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: com.fx.client.AppStartup
|
||||
Class-Path: tomcat-embed-core-9.0.41.jar Java-WebSocket-1.5.1.jar hystri
|
||||
x-core-1.5.18.jar druid-spring-boot-starter-1.1.14.jar commons-lang-2.6
|
||||
.jar jersey-core-1.19.1.jar pagehelper-5.1.4.jar spring-security-web-5.
|
||||
4.2.jar spring-boot-starter-security-2.4.1.jar okhttp-3.14.6.jar datafx
|
||||
-eventsystem-8.0.2-SNAPSHOT.jar spring-context-support-5.3.2.jar okio-1
|
||||
.17.2.jar ribbon-core-2.3.0.jar druid-1.1.14.jar junit-4.12.jar spring-
|
||||
boot-starter-quartz-2.4.1.jar jackson-datatype-jsr310-2.11.3.jar spring
|
||||
-jcl-5.3.2.jar tilesfx-1.6.8.jar spring-boot-2.4.1.jar datafx-flow-8.0.
|
||||
2-SNAPSHOT.jar HdrHistogram-2.1.9.jar slf4j-api-1.7.21.jar fontawesomef
|
||||
x-8.9.jar netflix-statistics-0.1.1.jar spring-tx-5.3.2.jar feign-core-1
|
||||
0.9.jar commons-codec-1.6.jar spring-context-5.3.2.jar jsr305-3.0.1.jar
|
||||
archaius-core-0.7.6.jar DmJdbcDriver-1.0.0.jar spring-beans-5.3.2.jar
|
||||
ribbon-loadbalancer-2.3.0.jar httpclient-4.2.1.jar spring-boot-starter-
|
||||
logging-2.4.1.jar jjwt-0.7.0.jar jfoenix-8.0.10.jar spring-boot-starter
|
||||
-tomcat-2.4.1.jar pagehelper-spring-boot-autoconfigure-1.2.5.jar httpco
|
||||
re-4.2.1.jar c3p0-0.9.5.4.jar feign-hystrix-10.9.jar guava-16.0.1.jar j
|
||||
avafx-base-11.0.2-mac.jar ikonli-javafx-2.4.0.jar spring-security-core-
|
||||
5.4.2.jar snakeyaml-1.27.jar jackson-datatype-jdk8-2.11.3.jar jakarta.a
|
||||
nnotation-api-1.3.5.jar commons-logging-1.1.1.jar mchange-commons-java-
|
||||
0.2.15.jar javafx-media-11.0.2-mac.jar ribbon-httpclient-2.2.0.jar quar
|
||||
tz-2.3.2.jar javafx-media-11.0.2.jar log4j-api-2.13.3.jar annotations-2
|
||||
.0.0.jar jackson-module-parameter-names-2.11.3.jar jakarta.el-3.0.3.jar
|
||||
spring-boot-autoconfigure-1.5.12.RELEASE.jar jackson-databind-2.10.0.p
|
||||
r3.jar tomcat-embed-websocket-9.0.41.jar logback-core-1.1.7.jar pagehel
|
||||
per-spring-boot-starter-1.2.5.jar commons-configuration-1.8.jar mybatis
|
||||
-3.5.6.jar commons-lang3-3.4.jar javafx-graphics-11.0.2-mac.jar ikonli-
|
||||
fontawesome5-pack-2.4.0.jar feign-okhttp-10.9.jar jul-to-slf4j-1.7.30.j
|
||||
ar spring-websocket-5.3.2.jar spring-messaging-5.3.2.jar spring-aop-5.3
|
||||
.2.jar spring-boot-starter-2.4.1.jar pinyin4j-2.5.0.jar jackson-annotat
|
||||
ions-2.10.0.pr3.jar spring-web-5.3.2.jar spring-jdbc-5.3.1.jar spring-c
|
||||
ore-5.3.2.jar javafx-controls-11.0.2.jar spring-expression-5.2.11.RELEA
|
||||
SE.jar feign-slf4j-10.9.jar mybatis-spring-2.0.6.jar servo-core-0.10.1.
|
||||
jar controlsfx-11.0.3.jar lombok-1.18.16.jar spring-boot-starter-websoc
|
||||
ket-2.4.1.jar jersey-apache-client4-1.19.1.jar HikariCP-java7-2.4.13.ja
|
||||
r javafx-graphics-11.0.2.jar servo-internal-0.10.1.jar log4j-to-slf4j-2
|
||||
.13.3.jar kotlin-compiler-1.0.6.jar datafx-injection-8.0.2-SNAPSHOT.jar
|
||||
spring-security-config-5.4.2.jar jsqlparser-1.0.jar commons-collection
|
||||
s-3.2.1.jar jsr311-api-1.1.1.jar jackson-core-2.10.0.pr3.jar spring-boo
|
||||
t-starter-jdbc-2.4.0.jar logback-classic-1.1.7.jar spring-webmvc-5.3.2.
|
||||
jar spring-boot-starter-json-2.4.1.jar javax.inject-1.jar joda-time-2.1
|
||||
0.1.jar rxjava-1.2.0.jar netflix-commons-util-0.1.1.jar datafx-core-8.0
|
||||
.2-SNAPSHOT.jar spring-boot-starter-web-2.4.1.jar mybatis-spring-boot-s
|
||||
tarter-2.1.4.jar hamcrest-core-1.3.jar mysql-connector-java-8.0.20.jar
|
||||
HikariCP-3.4.5.jar ikonli-core-2.4.0.jar javafx-controls-11.0.2-mac.jar
|
||||
javafx-base-11.0.2.jar feign-jackson-10.9.jar feign-ribbon-10.9.jar sp
|
||||
ring-boot-starter-cache-2.4.1.jar javassist-3.18.1-GA.jar jersey-client
|
||||
-1.19.1.jar mybatis-spring-boot-autoconfigure-2.1.4.jar
|
||||
|
||||
Reference in New Issue
Block a user