Skip to content

Commit

Permalink
尝试使用 GraalVM 构建可执行程序失败 oracle/graal#3084
Browse files Browse the repository at this point in the history
  • Loading branch information
icuxika committed Jan 14, 2021
1 parent f471804 commit 2200d3a
Show file tree
Hide file tree
Showing 11 changed files with 191 additions and 118 deletions.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.9'
id 'org.beryx.jlink' version '2.22.3'
id 'com.gluonhq.client-gradle-plugin' version '0.1.35'
}

group 'com.icuxika'
Expand All @@ -26,6 +27,19 @@ javafx {
modules = ['javafx.controls', 'javafx.fxml', 'javafx.swing']
}

gluonClient {
bundlesList.addAll(
"com.icuxika.i18n.LanguageResource",
"com.icuxika.i18n.LanguageResource_en",
"com.icuxika.i18n.LanguageResource_zh_CN"
)
reflectionList.addAll(
"org.apache.logging.log4j.message.DefaultFlowMessageFactory",
"org.apache.logging.log4j.message.ParameterizedMessageFactory",
"com.icuxika.controller.LoginController"
)
}

repositories {
mavenCentral()
}
Expand Down
9 changes: 9 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
pluginManagement {
repositories {
maven {
url "https://nexus.gluonhq.com/nexus/content/repositories/releases"
}

gradlePluginPortal()
}
}
rootProject.name = 'IMFrameworkFX'

23 changes: 16 additions & 7 deletions src/main/java/com/icuxika/callback/MessageListViewCallback.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,20 @@ protected void updateItem(MessageModel item, boolean empty) {
MessageType messageType = item.getType();
ConversationProperty conversationProperty = item.getConversationProperty();
switch (messageType) {
case TEXT -> {
case TEXT: {
TextMessageNode textMessageNode = null;
if (item.getSenderId() == 0) {
textMessageNode = new TextMessageNode();
} else {
switch (conversationProperty) {
case SINGLE -> textMessageNode = TextMessageNode.left(false);
case GROUP -> {
case SINGLE: {
textMessageNode = TextMessageNode.left(false);
break;
}
case GROUP: {
textMessageNode = TextMessageNode.left(true);
textMessageNode.setName(item.getNameProperty());
break;
}
}

Expand Down Expand Up @@ -70,14 +74,19 @@ protected void updateItem(MessageModel item, boolean empty) {

messageNode = textMessageNode;
}
break;
}
case FILE -> {
case FILE: {
break;
}
case IMAGE -> {
case IMAGE: {
break;
}
case EMOJI -> {
case EMOJI: {
break;
}
default -> {
default: {

}
}

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/com/icuxika/control/SelectableLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public SelectableLabel(StringBinding text, ObjectBinding<Node> graphics) {
}

public void initialize() {
// setSelectedTextFill(Paint.valueOf("#FFFFFF"));
// setSelectedBackgroundFill(Paint.valueOf("#308DFC"));
setStyle("""
-ifx-selected-text-fill: #FFFFFF;
-ifx-selected-background-fill: #308DFC;
""");
setSelectedTextFill(Paint.valueOf("#FFFFFF"));
setSelectedBackgroundFill(Paint.valueOf("#308DFC"));
// setStyle("""
// -ifx-selected-text-fill: #FFFFFF;
// -ifx-selected-background-fill: #308DFC;
// """);
}

/**
Expand Down
21 changes: 14 additions & 7 deletions src/main/java/com/icuxika/controller/HomeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,30 @@ public void initialize() {
UserData.userStatusProperty().addListener((observable, oldValue, newValue) -> {
SVGPath userStatusIcon = new SVGPath();
switch (newValue) {
case ONLINE -> {
case ONLINE: {
userStatusIcon.setContent("M511.999488 61.745273c-248.678712 0-450.273176 201.585181-450.273176 450.254727s201.594464 450.254727 450.273176 450.254727c248.678712 0 450.273176-201.585181 450.273176-450.254727S760.6782 61.745273 511.999488 61.745273zM480.664569 672.184259l-64.396228 64.370053-64.431021-64.370053L223.009047 543.351032l64.397251-64.393589L416.244804 607.744621l320.325361-320.298933 64.419765 64.393589L480.664569 672.184259z");
userStatusTextFlow.setBackground(new Background(new BackgroundFill(Paint.valueOf("#73d74d"), null, null)));
break;
}
case OFFLINE -> {
case OFFLINE: {
userStatusIcon.setContent("M511.999488 61.745273c-248.678712 0-450.273176 201.585181-450.273176 450.254727s201.594464 450.254727 450.273176 450.254727c248.678712 0 450.273176-201.585181 450.273176-450.254727S760.6782 61.745273 511.999488 61.745273zM705.974102 640.246873l-65.770584 65.73105L512.022002 577.75561 383.770898 705.978946l-65.746024-65.73105 128.20403-128.246873L318.024874 383.776663l65.746024-65.75561 128.22859 128.223337 128.20403-128.223337 65.770584 65.75561L577.745512 512 705.974102 640.246873z");
userStatusTextFlow.setBackground(new Background(new BackgroundFill(Paint.valueOf("#b4b8ba"), null, null)));
break;
}
case HIDE -> {
case HIDE: {
userStatusIcon.setContent("M511.999488 61.745273c-248.678712 0-450.273176 201.585181-450.273176 450.254727s201.594464 450.254727 450.273176 450.254727 450.273176-201.585181 450.273176-450.254727S760.6782 61.745273 511.999488 61.745273zM266.371377 306.294988l491.256222 0 0 33.772174L266.371377 340.067162 266.371377 306.294988zM757.627599 717.706035 266.371377 717.706035l0-33.773198 491.256222 0L757.627599 717.706035zM140.487278 528.886599l0-33.771151 743.024421 0 0 33.771151L140.487278 528.886599z");
userStatusTextFlow.setBackground(new Background(new BackgroundFill(Paint.valueOf("#e8c35e"), null, null)));
break;
}
case BUSY -> {
case BUSY: {
userStatusIcon.setContent("M511.999488 61.745273c-248.678712 0-450.273176 201.585181-450.273176 450.254727s201.594464 450.254727 450.273176 450.254727c248.678712 0 450.273176-201.585181 450.273176-450.254727S760.6782 61.745273 511.999488 61.745273zM739.818272 558.50415l-181.308634-0.033769-93.020298 0.024559-181.325008-0.017396-0.00921-92.983741 181.342405 0 92.986528 0.008186 181.360825 0.017396L739.818272 558.50415z");
userStatusTextFlow.setBackground(new Background(new BackgroundFill(Paint.valueOf("#ed695e"), null, null)));
break;
}
case LEAVE -> {
case LEAVE: {
userStatusIcon.setContent("M511.999488 61.745273c-248.681782 0-450.273176 201.543226-450.273176 450.214818 0 248.711502 201.591394 450.294636 450.273176 450.294636s450.273176-201.583135 450.273176-450.294636C962.272664 263.288498 760.68127 61.745273 511.999488 61.745273zM511.999488 877.79308c-202.051901 0-365.867422-163.810856-365.867422-365.832989 0-202.023156 163.814498-365.8115 365.867422-365.8115 202.049854 0 365.867422 163.789367 365.867422 365.8115C877.865887 713.982224 714.049343 877.79308 511.999488 877.79308zM547.17708 476.78394 547.17708 171.950234 476.821896 171.950234 476.821896 547.176151 521.393824 547.176151 547.17708 547.176151 830.976076 547.176151 830.976076 476.78394Z");
userStatusTextFlow.setBackground(new Background(new BackgroundFill(Paint.valueOf("#b4b8ba"), null, null)));
break;
}
}
UserData.setUserStatusIconShape(userStatusIcon);
Expand Down Expand Up @@ -215,11 +220,13 @@ public enum HomePageType {
*/
public void switchPage(HomePageType pageType) {
switch (pageType) {
case CONVERSATION -> {
case CONVERSATION: {
conversation.toFront();
break;
}
case ADDRESS_BOOK -> {
case ADDRESS_BOOK: {
addressBook.toFront();
break;
}
}
}
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/com/icuxika/controller/LoginController.java
Original file line number Diff line number Diff line change
Expand Up @@ -377,15 +377,20 @@ public void initialize() {

loginTypeProperty().addListener((observable, oldValue, newValue) -> {
switch (newValue) {
case PASSWORD -> {
case PASSWORD: {
generalLoginBox.toFront();
passwordContainer.toFront();
break;
}
case SMS -> {
case SMS: {
generalLoginBox.toFront();
verificationCodeContainer.toFront();
break;
}
case QR: {
qrLoginBox.toFront();
break;
}
case QR -> qrLoginBox.toFront();
}
});
passwordIcon.setOnMouseReleased(event -> setLoginType(LoginType.PASSWORD));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,24 @@ public void changed(ObservableValue<? extends ConversationModel> observable, Con
chatNode = chatViewMap.get(id).getRootNode();
} else {
switch (conversationProperty) {
case SINGLE -> {
case SINGLE: {
AppView<SingleChatController> singleChatView = new AppView<>(SingleChatController.class);
singleChatView.getController().setName(newValue.getNameProperty());
singleChatView.getController().setConversationId(id);
chatNode = singleChatView.getRootNode();
chatViewMap.put(id, singleChatView);
break;
}
case GROUP -> {
case GROUP: {
AppView<GroupChatController> groupChatView = new AppView<>(GroupChatController.class);
groupChatView.getController().setName(newValue.getNameProperty());
groupChatView.getController().setConversationId(id);
chatNode = groupChatView.getRootNode();
chatViewMap.put(id, groupChatView);
break;
}
default -> throw new IllegalStateException("未定义该会话属性: " + conversationProperty);
default:
throw new IllegalStateException("未定义该会话属性: " + conversationProperty);
}
}

Expand Down
Loading

0 comments on commit 2200d3a

Please sign in to comment.