Skip to content

Commit

Permalink
Merge pull request #108 from rememberber/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rememberber authored Jun 1, 2024
2 parents 4147132 + f417d8c commit 1b03e8e
Show file tree
Hide file tree
Showing 20 changed files with 641 additions and 57 deletions.
6 changes: 3 additions & 3 deletions download_links.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"windows": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.0/MooTool-1.6.0-windows.exe",
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.0/MooTool_1.6.0.dmg",
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.0/MooTool_1.6.0.deb"
"windows": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.1/MooTool-1.6.1-windows.exe",
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.1/MooTool_1.6.1.dmg",
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.6.1/MooTool_1.6.1.deb"
}
84 changes: 49 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.luoboduner.moo.tool</groupId>
<artifactId>MooTool</artifactId>
<version>1.6.0</version>
<version>1.6.1</version>
<packaging>jar</packaging>

<name>MooTool</name>
Expand All @@ -32,23 +32,25 @@
<guava.version>32.1.2-jre</guava.version>
<okhttp.version>4.11.0</okhttp.version>
<google.zxing.core.version>3.5.1</google.zxing.core.version>
<flatlaf.version>3.4-SNAPSHOT</flatlaf.version>
<flatlaf-extras.version>3.4-SNAPSHOT</flatlaf-extras.version>
<flatlaf-intellij-themes.version>3.4-SNAPSHOT</flatlaf-intellij-themes.version>
<flatlaf-fonts-jetbrains-mono.version>2.242</flatlaf-fonts-jetbrains-mono.version>
<rsyntaxtextarea.version>3.3.4</rsyntaxtextarea.version>
<flatlaf.version>3.4.1</flatlaf.version>
<flatlaf-extras.version>3.4.1</flatlaf-extras.version>
<flatlaf-intellij-themes.version>3.4.1</flatlaf-intellij-themes.version>
<flatlaf-fonts-jetbrains-mono.version>2.304</flatlaf-fonts-jetbrains-mono.version>
<flatlaf-fonts-inter.version>4.0</flatlaf-fonts-inter.version>
<rsyntaxtextarea.version>3.4.0</rsyntaxtextarea.version>
<sql-formatter.version>2.0.4</sql-formatter.version>
<google-java-format.version>1.18.1</google-java-format.version>
<!-- <jSystemThemeDetector.version>3.8</jSystemThemeDetector.version>-->
<!-- <jSystemThemeDetector.version>3.8</jSystemThemeDetector.version>-->
<cron-utils.version>9.2.1</cron-utils.version>
<jna.version>5.13.0</jna.version>
<oshi-core.version>6.4.6</oshi-core.version>
<jfa.version>1.2.0</jfa.version>
<versioncompare.version>1.5.0</versioncompare.version>
<groovy.version>4.0.15</groovy.version>
<jsoup.version>1.16.2</jsoup.version>
<jalopy.version>1.5rc3</jalopy.version>
<groovy.version>4.0.15</groovy.version>
<jsoup.version>1.16.2</jsoup.version>
<jalopy.version>1.5rc3</jalopy.version>
<itextpdf.version>5.5.1</itextpdf.version>
<snakeyaml.version>1.23</snakeyaml.version>
</properties>

<repositories>
Expand Down Expand Up @@ -182,12 +184,12 @@
<groupId>com.formdev</groupId>
<artifactId>flatlaf-fonts-jetbrains-mono</artifactId>
<version>${flatlaf-fonts-jetbrains-mono.version}</version>
<exclusions>
<exclusion>
<artifactId>flatlaf</artifactId>
<groupId>com.formdev</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf-fonts-inter</artifactId>
<version>${flatlaf-fonts-inter.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.fifesoft/rsyntaxtextarea -->
Expand All @@ -203,17 +205,17 @@
<version>${sql-formatter.version}</version>
</dependency>

<!-- <dependency>-->
<!-- <groupId>com.google.googlejavaformat</groupId>-->
<!-- <artifactId>google-java-format</artifactId>-->
<!-- <version>${google-java-format.version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <artifactId>guava</artifactId>-->
<!-- <groupId>com.google.guava</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.google.googlejavaformat</groupId>-->
<!-- <artifactId>google-java-format</artifactId>-->
<!-- <version>${google-java-format.version}</version>-->
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <artifactId>guava</artifactId>-->
<!-- <groupId>com.google.guava</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
<!-- </dependency>-->

<dependency>
<groupId>com.jayway.jsonpath</groupId>
Expand All @@ -227,11 +229,11 @@
</exclusions>
</dependency>

<!-- <dependency>-->
<!-- <groupId>com.github.Dansoftowner</groupId>-->
<!-- <artifactId>jSystemThemeDetector</artifactId>-->
<!-- <version>${jSystemThemeDetector.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.github.Dansoftowner</groupId>-->
<!-- <artifactId>jSystemThemeDetector</artifactId>-->
<!-- <version>${jSystemThemeDetector.version}</version>-->
<!-- </dependency>-->

<dependency>
<groupId>net.java.dev.jna</groupId>
Expand Down Expand Up @@ -268,8 +270,8 @@
<artifactId>versioncompare</artifactId>
<version>${versioncompare.version}</version>
</dependency>
<dependency>

<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
Expand All @@ -294,6 +296,18 @@
<type>jar</type>
</dependency>

<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>

<!--<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>5.1.0</version>
</dependency>-->

</dependencies>

<build>
Expand All @@ -311,7 +325,7 @@
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.7.4</version>
<version>1.7.5</version>
<configuration>
<bundleJre>true</bundleJre>
<mainClass>com.luoboduner.moo.tool.App</mainClass>
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/luoboduner/moo/tool/ui/Init.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ public static void initAllTab() {
ThreadUtil.execute(RegexForm::init);
ThreadUtil.execute(ImageForm::init);
ThreadUtil.execute(VariablesForm::init);
ThreadUtil.execute(YmlPropertiesForm::init);

// 检查新版版
if (App.config.isAutoCheckUpdate()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/luoboduner/moo/tool/ui/UiConsts.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class UiConsts {
* 软件名称,版本
*/
public static final String APP_NAME = "MooTool";
public static final String APP_VERSION = "v1.6.0";
public static final String APP_VERSION = "v1.6.1";

public static final int TABLE_ROW_HEIGHT = 30;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.luoboduner.moo.tool.ui.component.textviewer;

import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.fonts.inter.FlatInterFont;
import com.formdev.flatlaf.fonts.jetbrains_mono.FlatJetBrainsMonoFont;
import com.formdev.flatlaf.util.FontUtils;
import com.formdev.flatlaf.util.StringUtils;
Expand Down Expand Up @@ -66,7 +67,8 @@ public void keyReleased(KeyEvent arg0) {
public void keyPressed(KeyEvent evt) {
if ((evt.isControlDown() || evt.isMetaDown()) && evt.getKeyCode() == KeyEvent.VK_S) {
QuickNoteListener.quickSave(true, true);
} else if ((evt.isControlDown() || evt.isMetaDown()) && evt.isShiftDown() && evt.getKeyCode() == KeyEvent.VK_F) {
} else if (((evt.isControlDown() || evt.isMetaDown()) && evt.isShiftDown() && evt.getKeyCode() == KeyEvent.VK_F)
|| evt.isMetaDown() && evt.isAltDown() && evt.getKeyCode() == KeyEvent.VK_L) {
QuickNoteListener.format();
} else if ((evt.isControlDown() || evt.isMetaDown()) && evt.getKeyCode() == KeyEvent.VK_F) {
QuickNoteListener.showFindPanel();
Expand Down Expand Up @@ -155,6 +157,8 @@ public void updateTheme() {
Font font;
if (FlatJetBrainsMonoFont.FAMILY.equals(fontName)) {
font = FontUtils.getCompositeFont(FlatJetBrainsMonoFont.FAMILY, Font.PLAIN, fontSize);
} else if (FlatInterFont.FAMILY.equals(fontName)) {
font = FontUtils.getCompositeFont(FlatInterFont.FAMILY, Font.PLAIN, fontSize);
} else {
font = new Font(fontName, Font.PLAIN, fontSize);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.luoboduner.moo.tool.ui.component.textviewer;

import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.fonts.inter.FlatInterFont;
import com.formdev.flatlaf.fonts.jetbrains_mono.FlatJetBrainsMonoFont;
import com.formdev.flatlaf.util.FontUtils;
import com.luoboduner.moo.tool.App;
Expand Down Expand Up @@ -46,6 +47,8 @@ public RTextScrollPane getRTextScrollPane(String name) {
Font font;
if (FlatJetBrainsMonoFont.FAMILY.equals(tQuickNote.getFontName())) {
font = FontUtils.getCompositeFont(FlatJetBrainsMonoFont.FAMILY, Font.PLAIN, Integer.parseInt(tQuickNote.getFontSize()));
} else if (FlatInterFont.FAMILY.equals(tQuickNote.getFontName())) {
font = FontUtils.getCompositeFont(FlatInterFont.FAMILY, Font.PLAIN, Integer.parseInt(tQuickNote.getFontSize()));
} else {
font = new Font(tQuickNote.getFontName(), Font.PLAIN, Integer.parseInt(tQuickNote.getFontSize()));
}
Expand All @@ -66,7 +69,7 @@ public RTextScrollPane getRTextScrollPane(String name) {
return rTextScrollPane;
}

public void updateFont(String name){
public void updateFont(String name) {
RTextScrollPane rTextScrollPane = viewMap.get(name);
if (rTextScrollPane != null) {
QuickNoteRSyntaxTextViewer plainTextViewer = (QuickNoteRSyntaxTextViewer) rTextScrollPane.getTextArea();
Expand All @@ -75,6 +78,8 @@ public void updateFont(String name){
Font font;
if (FlatJetBrainsMonoFont.FAMILY.equals(tQuickNote.getFontName())) {
font = FontUtils.getCompositeFont(FlatJetBrainsMonoFont.FAMILY, Font.PLAIN, Integer.parseInt(tQuickNote.getFontSize()));
} else if (FlatInterFont.FAMILY.equals(tQuickNote.getFontName())) {
font = FontUtils.getCompositeFont(FlatInterFont.FAMILY, Font.PLAIN, Integer.parseInt(tQuickNote.getFontSize()));
} else {
font = new Font(tQuickNote.getFontName(), Font.PLAIN, Integer.parseInt(tQuickNote.getFontSize()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Json格式化"/>
<text value="格式化"/>
</properties>
</component>
<component id="5922d" class="javax.swing.JLabel">
Expand Down Expand Up @@ -71,7 +71,7 @@
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Ctrl+Shift+F"/>
<text value="Ctrl+Shift+F或option+command+L"/>
</properties>
</component>
<component id="6ce1f" class="javax.swing.JLabel">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void onOK() {
label2.setText("查找");
panel1.add(label2, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label3 = new JLabel();
label3.setText("Json格式化");
label3.setText("格式化");
panel1.add(label3, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label4 = new JLabel();
label4.setText("删除选择的行");
Expand All @@ -92,7 +92,7 @@ private void onOK() {
label6.setText("Ctrl+F");
panel1.add(label6, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label7 = new JLabel();
label7.setText("Ctrl+Shift+F");
label7.setText("Ctrl+Shift+F或option+command+L");
panel1.add(label7, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label8 = new JLabel();
label8.setText("Ctrl+D");
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/com/luoboduner/moo/tool/ui/form/MainWindow.form
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,15 @@
<border type="none"/>
<children/>
</grid>
<grid id="c3fe5" binding="ymlProperties" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<tabbedpane title="配置文件转换"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ public class MainWindow {
private JPanel reformattingPanel;
private JPanel pdfPanel;
private JPanel variablesPanel;
private JPanel ymlProperties;

private static MainWindow mainWindow;

private static final String[] ICON_PATH = {"icon/edit.svg", "icon/time.svg", "icon/json.svg", "icon/check.svg", "icon/global.svg", "icon/exchange.svg", "icon/QRcode.svg", "icon/method.svg", "icon/calculate.svg", "icon/network.svg", "icon/color.svg", "icon/image.svg", "icon/translate.svg", "icon/schedule.svg", "icon/reg.svg", "icon/java.svg", "icon/nuclear.svg", "icon/pdf.svg", "icon/fx.svg"};
private static final String[] ICON_PATH = {"icon/edit.svg", "icon/time.svg", "icon/json.svg", "icon/check.svg", "icon/global.svg", "icon/exchange.svg", "icon/QRcode.svg", "icon/method.svg", "icon/calculate.svg", "icon/network.svg", "icon/color.svg", "icon/image.svg", "icon/translate.svg", "icon/schedule.svg", "icon/reg.svg", "icon/java.svg", "icon/nuclear.svg", "icon/pdf.svg", "icon/fx.svg", "icon/suffix-yml.svg"};

private MainWindow() {
}
Expand Down Expand Up @@ -92,6 +93,7 @@ public void init() {
mainWindow.getReformattingPanel().add(FileReformattingForm.getInstance().getReformattingPanel(), gridConstraints);
mainWindow.getPdfPanel().add(PdfForm.getInstance().getPdfPanel(), gridConstraints);
mainWindow.getVariablesPanel().add(VariablesForm.getInstance().getVariablesPanel(), gridConstraints);
mainWindow.getYmlProperties().add(YmlPropertiesForm.getInstance().getYmlPropertiesPanel(), gridConstraints);
mainWindow.getMainPanel().updateUI();

TabListener.addListeners();
Expand Down Expand Up @@ -275,6 +277,9 @@ public void initTabPlacement() {
variablesPanel = new JPanel();
variablesPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
tabbedPane.addTab("环境变量", variablesPanel);
ymlProperties = new JPanel();
ymlProperties.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
tabbedPane.addTab("配置文件转换", ymlProperties);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.formdev.flatlaf.FlatClientProperties;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.FlatSVGIcon;
import com.formdev.flatlaf.fonts.inter.FlatInterFont;
import com.formdev.flatlaf.fonts.jetbrains_mono.FlatJetBrainsMonoFont;
import com.formdev.flatlaf.icons.FlatAbstractIcon;
import com.formdev.flatlaf.icons.FlatSearchIcon;
Expand Down Expand Up @@ -424,6 +425,7 @@ private static void getSysFontList() {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
String[] fonts = ge.getAvailableFontFamilyNames();
quickNoteForm.getFontNameComboBox().addItem(FlatJetBrainsMonoFont.FAMILY);
quickNoteForm.getFontNameComboBox().addItem(FlatInterFont.FAMILY);
for (String font : fonts) {
if (StringUtils.isNotBlank(font)) {
quickNoteForm.getFontNameComboBox().addItem(font);
Expand Down
Loading

0 comments on commit 1b03e8e

Please sign in to comment.