Skip to content

Commit

Permalink
Merge pull request #101 from rememberber/develop
Browse files Browse the repository at this point in the history
MooTool-1.5.9
  • Loading branch information
rememberber authored Jan 6, 2024
2 parents 3c44405 + 8f5310c commit 9f13735
Show file tree
Hide file tree
Showing 57 changed files with 724 additions and 242 deletions.
12 changes: 8 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.8</version>
<version>1.5.9</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.2.5</flatlaf.version>
<flatlaf-extras.version>3.2.5</flatlaf-extras.version>
<flatlaf-intellij-themes.version>3.2.5</flatlaf-intellij-themes.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-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 All @@ -60,6 +60,10 @@
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>oss.sonatype.org</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>

<dependencies>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/luoboduner/moo/tool/dao/THostMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ public interface THostMapper {
THost selectByName(String name);

int updateByName(THost tHost);

List<THost> selectByFilter(String titleFilterKeyWord);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ public interface TJsonBeautyMapper {
TJsonBeauty selectByName(String name);

int updateByName(TJsonBeauty tJsonBeauty);

List<TJsonBeauty> selectByFilter(String titleFilterKeyWord);
}
2 changes: 2 additions & 0 deletions src/main/java/com/luoboduner/moo/tool/dao/TMsgHttpMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ public interface TMsgHttpMapper {
int updateByMsgName(TMsgHttp tMsgHttp);

List<TMsgHttp> selectAll();

List<TMsgHttp> selectByFilter(String titleFilterKeyWord);
}
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 @@ -211,6 +211,7 @@ public static void initAllTab() {
ThreadUtil.execute(CronForm::init);
ThreadUtil.execute(RegexForm::init);
ThreadUtil.execute(ImageForm::init);
ThreadUtil.execute(VariablesForm::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.5.8";
public static final String APP_VERSION = "v1.5.9";

public static final int TABLE_ROW_HEIGHT = 30;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class SystemEnvResultDialog extends JDialog {

public SystemEnvResultDialog() {

super(App.mainFrame, "系统环境变量");
super(App.mainFrame, "环境变量");
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.4, 0.64);
setContentPane(contentPane);
setModal(true);
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 @@ -183,6 +183,15 @@
<border type="none"/>
<children/>
</grid>
<grid id="ec9c3" binding="variablesPanel" 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
36 changes: 34 additions & 2 deletions src/main/java/com/luoboduner/moo/tool/ui/form/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ public class MainWindow {
private JPanel javaConsolePanel;
private JPanel reformattingPanel;
private JPanel pdfPanel;
private JPanel variablesPanel;

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"};
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 MainWindow() {
}
Expand Down Expand Up @@ -90,6 +91,7 @@ public void init() {
mainWindow.getJavaConsolePanel().add(JavaConsoleForm.getInstance().getJavaConsolePanel(), gridConstraints);
mainWindow.getReformattingPanel().add(FileReformattingForm.getInstance().getReformattingPanel(), gridConstraints);
mainWindow.getPdfPanel().add(PdfForm.getInstance().getPdfPanel(), gridConstraints);
mainWindow.getVariablesPanel().add(VariablesForm.getInstance().getVariablesPanel(), gridConstraints);
mainWindow.getMainPanel().updateUI();

TabListener.addListeners();
Expand All @@ -111,8 +113,24 @@ public void initTabPlacement() {
if ("左侧".equals(App.config.getFuncTabPosition())) {
tabbedPane.setTabPlacement(JTabbedPane.LEFT);
tabbedPane.putClientProperty(TABBED_PANE_TAB_ALIGNMENT, TABBED_PANE_ALIGN_LEADING);

if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
GridLayoutManager gridLayoutManager = (GridLayoutManager) mainPanel.getLayout();
gridLayoutManager.setMargin(new Insets(15, 0, 0, 0));
} else {
GridLayoutManager gridLayoutManager = (GridLayoutManager) mainPanel.getLayout();
gridLayoutManager.setMargin(new Insets(-10, 0, 0, 0));
}
} else {
tabbedPane.setTabPlacement(JTabbedPane.TOP);

if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
GridLayoutManager gridLayoutManager = (GridLayoutManager) mainPanel.getLayout();
gridLayoutManager.setMargin(new Insets(25, 0, 0, 0));
} else {
GridLayoutManager gridLayoutManager = (GridLayoutManager) mainPanel.getLayout();
gridLayoutManager.setMargin(new Insets(0, 0, 0, 0));
}
}

// 紧凑型tab标题
Expand All @@ -132,6 +150,8 @@ public void initTabPlacement() {
} else {
for (int i = 0; i < tabbedPane.getTabCount(); i++) {
tabbedPane.setTitleAt(i, tabbedPane.getToolTipTextAt(i));
// 还原所有tab的icon大小
tabbedPane.setIconAt(i, new FlatSVGIcon(ICON_PATH[i], 16, 16));
}
}

Expand All @@ -148,10 +168,19 @@ public void initTabPlacement() {
}

JButton toggleTitleButton = new JButton(new FlatSVGIcon("icon/list.svg"));
JPanel panel = new JPanel();
if ("左侧".equals(App.config.getFuncTabPosition())) {
panel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 0, 0, 0), -1, -1));
} else {
panel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 10, 0, 0), -1, -1));
}
panel.add(toggleTitleButton, 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, new Dimension(-1, -1), null, 0, false));
toggleTitleButton.addActionListener(actionEvent -> {
if (App.config.isTabHideTitle()) {
for (int i = 0; i < tabbedPane.getTabCount(); i++) {
tabbedPane.setTitleAt(i, tabbedPane.getToolTipTextAt(i));
// 还原所有tab的icon大小
tabbedPane.setIconAt(i, new FlatSVGIcon(ICON_PATH[i], 16, 16));
}
App.config.setTabHideTitle(false);
App.config.save();
Expand All @@ -165,7 +194,7 @@ public void initTabPlacement() {
App.config.save();
}
});
tabbedPane.putClientProperty(TABBED_PANE_LEADING_COMPONENT, toggleTitleButton);
tabbedPane.putClientProperty(TABBED_PANE_LEADING_COMPONENT, panel);
}

{
Expand Down Expand Up @@ -243,6 +272,9 @@ public void initTabPlacement() {
pdfPanel = new JPanel();
pdfPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
tabbedPane.addTab("PDF", pdfPanel);
variablesPanel = new JPanel();
variablesPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
tabbedPane.addTab("环境变量", variablesPanel);
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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.form.func.CalculatorForm">
<grid id="27dc6" binding="calculatorPanel" 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"/>
<margin top="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="20" y="20" width="837" height="816"/>
</constraints>
Expand All @@ -22,7 +22,7 @@
<border type="none"/>
<children>
<grid id="f7d67" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="12" left="0" bottom="12" right="12"/>
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<splitpane position="right"/>
</constraints>
Expand Down Expand Up @@ -77,7 +77,7 @@
<border type="empty"/>
<children>
<grid id="52f3c" layout-manager="GridLayoutManager" row-count="10" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="15" left="5" bottom="0" right="5"/>
<margin top="0" left="0" bottom="0" right="5"/>
<constraints/>
<properties/>
<border type="none"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ public static int saveContent() {
*/
private void $$$setupUI$$$() {
calculatorPanel = new JPanel();
calculatorPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
calculatorPanel.setLayout(new GridLayoutManager(1, 1, new Insets(10, 10, 10, 10), -1, -1));
splitPane = new JSplitPane();
splitPane.setContinuousLayout(true);
splitPane.setDividerLocation(380);
splitPane.setDividerSize(10);
calculatorPanel.add(splitPane, 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, new Dimension(200, 200), null, 0, false));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(2, 1, new Insets(12, 0, 12, 12), -1, -1));
panel1.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
splitPane.setRightComponent(panel1);
final JScrollPane scrollPane1 = new JScrollPane();
panel1.add(scrollPane1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
Expand All @@ -178,7 +178,7 @@ public static int saveContent() {
splitPane.setLeftComponent(leftScrollPane);
leftScrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(10, 1, new Insets(15, 5, 0, 5), -1, -1));
panel3.setLayout(new GridLayoutManager(10, 1, new Insets(0, 0, 0, 5), -1, -1));
leftScrollPane.setViewportView(panel3);
final JPanel panel4 = new JPanel();
panel4.setLayout(new GridLayoutManager(1, 2, new Insets(10, 15, 25, 5), -1, -1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<border type="none"/>
<children>
<grid id="b785c" binding="themeColorPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="5" bottom="5" right="5"/>
<margin top="0" left="0" bottom="5" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="1" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
Expand Down Expand Up @@ -70,7 +70,7 @@
</grid>
</children>
</grid>
<grid id="a0607" binding="standardColorPanel" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="0">
<grid id="a0607" binding="standardColorPanel" layout-manager="FlowLayout" hgap="5" vgap="0" flow-align="0">
<constraints>
<grid row="1" 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public static void setSelectedColor(Color color) {
panel2.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, 1, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
themeColorPanel = new JPanel();
themeColorPanel.setLayout(new GridLayoutManager(3, 1, new Insets(5, 5, 5, 5), -1, -1));
themeColorPanel.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 5, 0), -1, -1));
panel2.add(themeColorPanel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, 1, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
themeColorPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "主题颜色", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, themeColorPanel.getFont()), null));
themeComboBox = new JComboBox();
Expand All @@ -250,7 +250,7 @@ public static void setSelectedColor(Color color) {
themeColorSubPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
themeColorPanel.add(themeColorSubPanel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
standardColorPanel = new JPanel();
standardColorPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5));
standardColorPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
panel2.add(standardColorPanel, new GridConstraints(1, 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));
standardColorPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "标准颜色", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, standardColorPanel.getFont()), null));
showColorPanel = new JPanel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2986,7 +2986,7 @@
</children>
</grid>
<grid id="cd43" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="12" left="0" bottom="12" right="12"/>
<margin top="10" left="0" bottom="10" right="10"/>
<constraints>
<splitpane position="right"/>
</constraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,7 @@ public static void resolveToUI() {
yearCycleSpinner2 = new JSpinner();
panel47.add(yearCycleSpinner2, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel48 = new JPanel();
panel48.setLayout(new GridLayoutManager(4, 1, new Insets(12, 0, 12, 12), -1, -1));
panel48.setLayout(new GridLayoutManager(4, 1, new Insets(10, 0, 10, 10), -1, -1));
splitPane.setRightComponent(panel48);
final JPanel panel49 = new JPanel();
panel49.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
Expand Down
Loading

0 comments on commit 9f13735

Please sign in to comment.