2023年10月9日14:31:23
parent
c078f31fd5
commit
83e4410b17
13
pom.xml
13
pom.xml
|
|
@ -448,6 +448,19 @@
|
|||
<artifactId>timi-fx</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.imyeyu.timifx.icon</groupId>
|
||||
<artifactId>timi-fx-icon</artifactId>
|
||||
<version>1.2.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>net.imyeyu.timiinject</groupId>
|
||||
<artifactId>timi-inject</artifactId>
|
||||
<version>1.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>eu.mihosoft.monacofx</groupId>
|
||||
<artifactId>MonacoFX</artifactId>
|
||||
|
|
|
|||
|
|
@ -25,8 +25,15 @@
|
|||
|
||||
package com.zhangmeng.tools;
|
||||
|
||||
import com.zhangmeng.tools.utils.Resources;
|
||||
import com.zhangmeng.tools.views.LoadView;
|
||||
import javafx.application.Application;
|
||||
import net.imyeyu.timijava.Lang;
|
||||
import net.imyeyu.timijava.config.Config;
|
||||
import net.imyeyu.timijava.config.ConfigManager;
|
||||
|
||||
import static net.imyeyu.timifx.TimiFX.TIMI_FX_LANG;
|
||||
import static net.imyeyu.timijava.TimiJava.TIMI_JAVA_LANG;
|
||||
|
||||
/**
|
||||
* @author : 芊芊墨客
|
||||
|
|
@ -35,6 +42,20 @@ import javafx.application.Application;
|
|||
*/
|
||||
public class JavaFxToolsApplication {
|
||||
|
||||
static {
|
||||
// 配置加载
|
||||
ConfigManager configManager = ConfigManager.getInstance();
|
||||
configManager.setAutoSave(10);
|
||||
configManager.load(Resources.CONFIG_PATH);
|
||||
|
||||
//多语言系统
|
||||
String local = ConfigManager.getConfig(Resources.CONFIG_PATH).getString(Config.section("Main").key("Lang"));
|
||||
Lang.init(local);
|
||||
Lang.load(TIMI_JAVA_LANG);
|
||||
Lang.load(TIMI_FX_LANG);
|
||||
Lang.load("lang/%s.lang");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Application.launch(LoadView.class);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zhangmeng.tools.controller;
|
|||
import com.zhangmeng.tools.editors.ace.AceEditor;
|
||||
import com.zhangmeng.tools.editors.codemirr.CodeMirrWebView;
|
||||
import com.zhangmeng.tools.editors.monaco.*;
|
||||
import com.zhangmeng.tools.editors.timifx.TimiFxEditor;
|
||||
import com.zhangmeng.tools.utils.AlertUtils;
|
||||
import com.zhangmeng.tools.utils.ClipboardUtils;
|
||||
import com.zhangmeng.tools.utils.ImagePath;
|
||||
|
|
@ -59,6 +60,7 @@ public class EditListController {
|
|||
private AceEditor acJsEditor;
|
||||
private AnchorPane monacoEdit;
|
||||
private AnchorPane codemirror;
|
||||
private AnchorPane timiFx;
|
||||
|
||||
public static final String color_cell = "#f4f4f4";
|
||||
|
||||
|
|
@ -260,6 +262,13 @@ public class EditListController {
|
|||
}
|
||||
codemirror(flag);
|
||||
}
|
||||
|
||||
if (newValue.getIndex() == 3) {
|
||||
if (timiFx != null){
|
||||
flag = true;
|
||||
}
|
||||
timiFx(flag);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -269,6 +278,7 @@ public class EditListController {
|
|||
case Ace_JS -> new Image(ImagePath.path(ImagePath.ImagePathType.MD5));
|
||||
case Monaco_JS -> new Image(ImagePath.path(ImagePath.ImagePathType.MD5));
|
||||
case CodeMirror_JS -> new Image(ImagePath.path(ImagePath.ImagePathType.MD5));
|
||||
case Timi_Fx -> new Image(ImagePath.path(ImagePath.ImagePathType.MD5));
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -372,6 +382,19 @@ public class EditListController {
|
|||
common_method();
|
||||
}
|
||||
|
||||
private void timiFx(boolean flag) {
|
||||
|
||||
//默认选择第一个
|
||||
listView.getSelectionModel().select(3);
|
||||
if (!flag){
|
||||
root = new TimiFxEditor();
|
||||
timiFx = root;
|
||||
}else {
|
||||
root = timiFx;
|
||||
}
|
||||
common_method();
|
||||
}
|
||||
|
||||
|
||||
private void common_method() {
|
||||
splitPane.getItems().remove(1);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,47 @@
|
|||
package com.zhangmeng.tools.editors.timifx;
|
||||
|
||||
import com.zhangmeng.tools.utils.Resources;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import net.imyeyu.timifx.component.TextAreaEditor;
|
||||
import net.imyeyu.timijava.Lang;
|
||||
import net.imyeyu.timijava.Tools;
|
||||
import net.imyeyu.timijava.bean.Language;
|
||||
import net.imyeyu.timijava.config.Config;
|
||||
import net.imyeyu.timijava.config.ConfigManager;
|
||||
|
||||
import static net.imyeyu.timifx.TimiFX.CSS_BORDER_L;
|
||||
import static net.imyeyu.timifx.TimiFX.TIMI_FX_LANG;
|
||||
import static net.imyeyu.timijava.TimiJava.TIMI_JAVA_LANG;
|
||||
|
||||
public class TimiFxEditor extends AnchorPane {
|
||||
|
||||
private TextAreaEditor editor ;
|
||||
|
||||
public TextAreaEditor getEditor() {
|
||||
return editor;
|
||||
}
|
||||
|
||||
public void setEditor(TextAreaEditor editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public TimiFxEditor() {
|
||||
init();
|
||||
}
|
||||
|
||||
public TimiFxEditor(String text) {
|
||||
init();
|
||||
editor.setText(text);
|
||||
}
|
||||
|
||||
public void init(){
|
||||
editor = new TextAreaEditor();
|
||||
editor.getStyleClass().add(CSS_BORDER_L);
|
||||
getChildren().add(editor);
|
||||
AnchorPane.setTopAnchor(editor,0.0);
|
||||
AnchorPane.setBottomAnchor(editor,0.0);
|
||||
AnchorPane.setLeftAnchor(editor,0.0);
|
||||
AnchorPane.setRightAnchor(editor,0.0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.zhangmeng.tools.utils;
|
||||
|
||||
import javafx.scene.image.Image;
|
||||
import net.imyeyu.timifx.TimiFX;
|
||||
import net.imyeyu.timifx.util.TrayFX;
|
||||
import net.imyeyu.timiinject.annotation.IOCReturn;
|
||||
import net.imyeyu.timijava.config.Config;
|
||||
import net.imyeyu.timijava.config.ConfigManager;
|
||||
|
||||
/**
|
||||
* 静态资源
|
||||
*
|
||||
* <p>夜雨 创建于 2022-08-26 15:23
|
||||
*/
|
||||
@net.imyeyu.timiinject.annotation.Resources
|
||||
public class Resources implements TimiFX {
|
||||
|
||||
/** 配置路径 */
|
||||
public static final String CONFIG_PATH = "mystyle-java-fx-tools.ini";
|
||||
|
||||
public static final Image ICON_X64 = new Image(TFX_RESOURCE + "icon.png", 64, 64, true, false);
|
||||
|
||||
/** @return 配置 */
|
||||
@IOCReturn
|
||||
public Config config() {
|
||||
return ConfigManager.getConfig(CONFIG_PATH);
|
||||
}
|
||||
|
||||
/** @return 托盘 */
|
||||
@IOCReturn
|
||||
public TrayFX trayFX() {
|
||||
return TrayFX.getInstance();
|
||||
}
|
||||
}
|
||||
|
|
@ -364,6 +364,7 @@ public class ResourcesUtils {
|
|||
Ace_JS("ace.js 编辑器", 0),
|
||||
Monaco_JS("monaco.js 编辑器", 1),
|
||||
CodeMirror_JS("codemirror.js 编辑器", 2),
|
||||
Timi_Fx("timi-fx 编辑器",3),
|
||||
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# TimiFXExamples 配置文件,不建议手动修改,可能会导致程序异常或崩溃
|
||||
#
|
||||
|
||||
[Main]
|
||||
|
||||
# 语言
|
||||
Lang=zh_CN
|
||||
|
||||
# 窗体宽度,静默配置,双精度浮点型,取值范围 [1, 系统最大限制],默认 1300
|
||||
Width=1300
|
||||
|
||||
# 窗体高度,静默配置,双精度浮点型,取值范围 [1, 系统最大限制],默认 850
|
||||
Height=850
|
||||
|
||||
[Interpolator]
|
||||
|
||||
# 动画插值器持续时间
|
||||
Duration=1000
|
||||
Loading…
Reference in New Issue