From bb89e04ca3cadb84faa3cf4b789d5ef488d094f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=A6=E9=86=92=E7=BC=98=E6=96=AD?= Date: Mon, 18 Sep 2023 19:25:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(qe):=20dali=20config=E6=B7=BB=E5=8A=A0=20(?= =?UTF-8?q?#742)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(qe): dali config添加 Signed-off-by: IfGuestInDream * feat(qe): dali config添加 Signed-off-by: IfGuestInDream * feat(qe): dali config添加 Signed-off-by: IfGuestInDream * feat(qe): dali config添加 Signed-off-by: IfGuestInDream * feat(qe): 完善demo * build: 工作流更新 * build: 格式化 * build: 格式化 --------- Signed-off-by: IfGuestInDream Co-authored-by: unknowIfGuestInDream --- .github/linters/sun_checks.xml | 11 +- .../core/javafx/controlsfx/FxAction.java | 11 +- .../java/com/tlcsdm/qe/tools/DaliDemo.java | 100 +++++ .../com/tlcsdm/qe/fxml/daliConfig.fxml | 370 ++++++++++++++++++ .../smc/codeDev/ecm/AbstractEcmScript.java | 1 + 5 files changed, 483 insertions(+), 10 deletions(-) create mode 100644 qe/src/main/java/com/tlcsdm/qe/tools/DaliDemo.java create mode 100644 qe/src/main/resources/com/tlcsdm/qe/fxml/daliConfig.fxml diff --git a/.github/linters/sun_checks.xml b/.github/linters/sun_checks.xml index 19528f33a..ab3aa0b8b 100644 --- a/.github/linters/sun_checks.xml +++ b/.github/linters/sun_checks.xml @@ -125,16 +125,19 @@ - + + + + - + @@ -181,7 +184,7 @@ - + @@ -222,7 +225,6 @@ - @@ -249,7 +251,6 @@ - diff --git a/core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java b/core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java index 3ab4227cd..a2eecfde8 100644 --- a/core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java +++ b/core/src/main/java/com/tlcsdm/core/javafx/controlsfx/FxAction.java @@ -73,7 +73,7 @@ public static Action create(String text, Consumer eventHandler, Str } /** - * create action + * create action. */ public static Action create(String text, Consumer eventHandler, Node graphic) { Action action = new Action(text, actionEvent -> { @@ -233,10 +233,6 @@ public static Action openDir(String text, Consumer eventHandler) { return create(text, eventHandler, "/com/tlcsdm/core/static/menubar/folder.png"); } - public static Action openSysConfig(Consumer eventHandler) { - return openSysConfig(I18nUtils.get("core.menubar.help.openSysConfigDir"), eventHandler); - } - public static Action api() { return create("JavaFX", actionEvent -> { CoreUtil.openWeb(CoreConstant.JAVAFX_API_URL); @@ -255,6 +251,10 @@ public static Action fxmlApi() { }, "/com/tlcsdm/core/static/menubar/fxml.png"); } + public static Action openSysConfig(Consumer eventHandler) { + return openSysConfig(I18nUtils.get("core.menubar.help.openSysConfigDir"), eventHandler); + } + public static Action openSysConfig() { return openSysConfig(actionEvent -> { VBox vbox = new VBox(); @@ -294,6 +294,7 @@ public static Action openUserData() { area.setEditable(false); area.appendText( FileUtil.readUtf8String(FileUtil.file(ConfigureUtil.getConfigurePath(Config.USERDATA_FILE_NAME)))); + area.showParagraphAtTop(0); VirtualizedScrollPane pane = new VirtualizedScrollPane<>(area); vbox.getChildren().addAll(button, pane); VBox.setVgrow(pane, Priority.ALWAYS); diff --git a/qe/src/main/java/com/tlcsdm/qe/tools/DaliDemo.java b/qe/src/main/java/com/tlcsdm/qe/tools/DaliDemo.java new file mode 100644 index 000000000..5fd7a80c6 --- /dev/null +++ b/qe/src/main/java/com/tlcsdm/qe/tools/DaliDemo.java @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2019, 2023 unknowIfGuestInDream + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of unknowIfGuestInDream, any associated website, nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL UNKNOWIFGUESTINDREAM BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package com.tlcsdm.qe.tools; + +import com.tlcsdm.core.javafx.util.Config; +import com.tlcsdm.core.javafx.util.FxmlUtil; +import com.tlcsdm.qe.QeSample; +import com.tlcsdm.qe.util.I18nUtils; +import javafx.fxml.FXMLLoader; +import javafx.fxml.Initializable; +import javafx.scene.Node; +import javafx.stage.Stage; + +import java.net.URL; +import java.util.ResourceBundle; + +/** + * 测试用,DALi Configuration. + * + * @author unknowIfGuestInDream + */ +public class DaliDemo extends QeSample implements Initializable { + + @Override + public boolean isVisible() { + return super.isVisible(); + } + + @Override + public Node getPanel(Stage stage) { + FXMLLoader fxmlLoader = FxmlUtil.loadFxmlFromResource( + DaliDemo.class.getResource("/com/tlcsdm/qe/fxml/daliConfig.fxml"), + ResourceBundle.getBundle(I18nUtils.BASENAME, Config.defaultLocale)); + return fxmlLoader.getRoot(); + } + + public static void main(String[] args) { + launch(args); + } + + @Override + public String getSampleId() { + return "daliConfig"; + } + + @Override + public String getSampleName() { + return "DALI Config"; + } + + @Override + public String getOrderKey() { + return "daliConfig"; + } + + @Override + public String getSampleDescription() { + return "此组件测试用"; + } + + @Override + public String getSampleVersion() { + return "1.0.0-Beta"; + } + + @Override + public boolean hasRightPanel() { + return false; + } + + @Override + public void initialize(URL location, ResourceBundle resources) { + + } +} diff --git a/qe/src/main/resources/com/tlcsdm/qe/fxml/daliConfig.fxml b/qe/src/main/resources/com/tlcsdm/qe/fxml/daliConfig.fxml new file mode 100644 index 000000000..5b1abea54 --- /dev/null +++ b/qe/src/main/resources/com/tlcsdm/qe/fxml/daliConfig.fxml @@ -0,0 +1,370 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +