Skip to content

Commit

Permalink
feat(qe): dali config添加 (#742)
Browse files Browse the repository at this point in the history
* feat(qe): dali config添加

Signed-off-by: IfGuestInDream <ifGuestInDream@163.com>

* feat(qe): dali config添加

Signed-off-by: IfGuestInDream <ifGuestInDream@163.com>

* feat(qe): dali config添加

Signed-off-by: IfGuestInDream <ifGuestInDream@163.com>

* feat(qe): dali config添加

Signed-off-by: IfGuestInDream <ifGuestInDream@163.com>

* feat(qe): 完善demo

* build: 工作流更新

* build: 格式化

* build: 格式化

---------

Signed-off-by: IfGuestInDream <ifGuestInDream@163.com>
Co-authored-by: unknowIfGuestInDream <liang.tang.cx@gmail.com>
  • Loading branch information
DreamAwakenFateBroke and unknowIfGuestInDream committed Sep 18, 2023
1 parent 495a344 commit bb89e04
Show file tree
Hide file tree
Showing 5 changed files with 483 additions and 10 deletions.
11 changes: 6 additions & 5 deletions .github/linters/sun_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,19 @@
<!-- Checks for Javadoc comments. -->
<!-- See https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod"/>
<module name="JavadocMethod">
<property name="accessModifiers" value="public"/>
<property name="allowMissingParamTags" value="true"/>
</module>
<module name="JavadocType"/>
<module name="JavadocType">
<property name="allowMissingParamTags" value="true"/>
<property name="allowUnknownTags" value="true"/>
</module>
<module name="MissingJavadocMethod">
<property name="scope" value="private"/>
<property name="allowMissingPropertyJavadoc" value="true"/>
<property name="allowedAnnotations" value="Override,Deprecated"/>
<property name="ignoreMethodNamesRegex" value="^main$"/>
</module>
<module name="MissingJavadocType"/>
<module name="RequireEmptyLineBeforeBlockTagGroup"/>
Expand Down Expand Up @@ -181,7 +184,7 @@
<property name="max" value="60"/>
</module>
<module name="LambdaBodyLength">
<property name="max" value="5"/>
<property name="max" value="30"/>
</module>

<!-- Checks for whitespace -->
Expand Down Expand Up @@ -222,7 +225,6 @@
<module name="HiddenField"/>
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<module name="MagicNumber"/>
<module name="MissingSwitchDefault"/>
<module name="MultipleVariableDeclarations"/>
<module name="SimplifyBooleanExpression"/>
Expand All @@ -249,7 +251,6 @@
<module name="DesignForExtension">
<property name="ignoredAnnotations" value="Override"/>
</module>
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static Action create(String text, Consumer<ActionEvent> eventHandler, Str
}

/**
* create action
* create action.
*/
public static Action create(String text, Consumer<ActionEvent> eventHandler, Node graphic) {
Action action = new Action(text, actionEvent -> {
Expand Down Expand Up @@ -233,10 +233,6 @@ public static Action openDir(String text, Consumer<ActionEvent> eventHandler) {
return create(text, eventHandler, "/com/tlcsdm/core/static/menubar/folder.png");
}

public static Action openSysConfig(Consumer<ActionEvent> eventHandler) {
return openSysConfig(I18nUtils.get("core.menubar.help.openSysConfigDir"), eventHandler);
}

public static Action api() {
return create("JavaFX", actionEvent -> {
CoreUtil.openWeb(CoreConstant.JAVAFX_API_URL);
Expand All @@ -255,6 +251,10 @@ public static Action fxmlApi() {
}, "/com/tlcsdm/core/static/menubar/fxml.png");
}

public static Action openSysConfig(Consumer<ActionEvent> eventHandler) {
return openSysConfig(I18nUtils.get("core.menubar.help.openSysConfigDir"), eventHandler);
}

public static Action openSysConfig() {
return openSysConfig(actionEvent -> {
VBox vbox = new VBox();
Expand Down Expand Up @@ -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<XmlEditorArea> pane = new VirtualizedScrollPane<>(area);
vbox.getChildren().addAll(button, pane);
VBox.setVgrow(pane, Priority.ALWAYS);
Expand Down
100 changes: 100 additions & 0 deletions qe/src/main/java/com/tlcsdm/qe/tools/DaliDemo.java
Original file line number Diff line number Diff line change
@@ -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) {

}
}

0 comments on commit bb89e04

Please sign in to comment.