Skip to content

Commit

Permalink
Merge pull request #103 from rememberber/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
rememberber authored Jan 22, 2024
2 parents 9f13735 + ac6e52f commit 4147132
Show file tree
Hide file tree
Showing 13 changed files with 610 additions and 43 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.5.8/MooTool-1.5.8-windows.exe",
"mac": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.5.8/MooTool_1.5.8.dmg",
"linux": "https://gitee.com/zhoubochina/MooTool/releases/download/v1.5.8/MooTool_1.5.8.deb"
"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"
}
8 changes: 4 additions & 4 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.5.9</version>
<version>1.6.0</version>
<packaging>jar</packaging>

<name>MooTool</name>
Expand All @@ -32,9 +32,9 @@
<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.3-SNAPSHOT</flatlaf.version>
<flatlaf-extras.version>3.3-SNAPSHOT</flatlaf-extras.version>
<flatlaf-intellij-themes.version>3.3-SNAPSHOT</flatlaf-intellij-themes.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>
<sql-formatter.version>2.0.4</sql-formatter.version>
Expand Down
Binary file modified screen_shoot/json_mac_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.5.9";
public static final String APP_VERSION = "v1.6.0";

public static final int TABLE_ROW_HEIGHT = 30;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.tool.ui.dialog.JsonResultDialog">
<grid id="cbd77" binding="contentPane" layout-manager="GridLayoutManager" row-count="2" 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>
<xy x="48" y="54" width="436" height="297"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="10" bottom="10" right="10"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<hspacer id="98af6">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<grid id="9538f" 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>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="e7465" class="javax.swing.JButton" binding="buttonOK">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="OK"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="e3588" binding="mainPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</form>
123 changes: 123 additions & 0 deletions src/main/java/com/luoboduner/moo/tool/ui/dialog/JsonResultDialog.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
package com.luoboduner.moo.tool.ui.dialog;

import com.formdev.flatlaf.util.SystemInfo;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.tool.App;
import com.luoboduner.moo.tool.ui.component.textviewer.RegexRSyntaxTextViewer;
import com.luoboduner.moo.tool.ui.component.textviewer.RegexRTextScrollPane;
import com.luoboduner.moo.tool.util.ComponentUtil;
import com.luoboduner.moo.tool.util.ScrollUtil;
import com.luoboduner.moo.tool.util.SystemUtil;
import com.luoboduner.moo.tool.util.UndoUtil;
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;

import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class JsonResultDialog extends JDialog {
private JPanel contentPane;
private JButton buttonOK;
private JPanel mainPanel;

private RegexRSyntaxTextViewer textArea;
private RegexRTextScrollPane rTextScrollPane;

public JsonResultDialog(String contentType) {

super(App.mainFrame, "Result");
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.6, 0.8);
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);

textArea = new RegexRSyntaxTextViewer();
if ("XML".equals(contentType)) {
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
} else if ("JSON".equals(contentType)) {
textArea.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVASCRIPT);
}
rTextScrollPane = new RegexRTextScrollPane(textArea);

mainPanel.add(rTextScrollPane, BorderLayout.CENTER);

UndoUtil.register(textArea);
ScrollUtil.smoothPane(rTextScrollPane);

if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
}

buttonOK.addActionListener(e -> onOK());

setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
onOK();
}
});

// call onCancel() on ESCAPE
contentPane.registerKeyboardAction(e -> onOK(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

}

private void onOK() {
dispose();
}

public void setToTextArea(String str) {
textArea.setText(str);
}

{
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
$$$setupUI$$$();
}

/**
* Method generated by IntelliJ IDEA GUI Designer
* >>> IMPORTANT!! <<<
* DO NOT edit this method OR call it in your code!
*
* @noinspection ALL
*/
private void $$$setupUI$$$() {
contentPane = new JPanel();
contentPane.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 10, 10, 10), -1, -1));
contentPane.add(panel1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, 1, null, null, null, 0, false));
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final JPanel panel2 = new JPanel();
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
buttonOK = new JButton();
buttonOK.setText("OK");
panel2.add(buttonOK, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
mainPanel = new JPanel();
mainPanel.setLayout(new BorderLayout(0, 0));
contentPane.add(mainPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
}

/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}

}
Loading

0 comments on commit 4147132

Please sign in to comment.