diff --git a/src/main/java/com/luoboduner/moo/tool/ui/Init.java b/src/main/java/com/luoboduner/moo/tool/ui/Init.java index ebff61db..7f3d042f 100644 --- a/src/main/java/com/luoboduner/moo/tool/ui/Init.java +++ b/src/main/java/com/luoboduner/moo/tool/ui/Init.java @@ -16,11 +16,11 @@ import com.luoboduner.moo.tool.ui.component.JPopupMenuMouseAdapter; import com.luoboduner.moo.tool.ui.dialog.FontSizeAdjustDialog; import com.luoboduner.moo.tool.ui.dialog.SettingDialog; import com.luoboduner.moo.tool.ui.dialog.TranslationDialog; +import com.luoboduner.moo.tool.ui.form.AboutForm; import com.luoboduner.moo.tool.ui.form.func.*; import com.luoboduner.moo.tool.ui.frame.ColorPickerFrame; import com.luoboduner.moo.tool.ui.listener.FrameListener; import com.luoboduner.moo.tool.util.SystemUtil; -import com.luoboduner.moo.tool.util.UIUtil; import com.luoboduner.moo.tool.util.UpgradeUtil; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; @@ -196,6 +196,7 @@ public class Init { * 初始化所有tab */ public static void initAllTab() { + ThreadUtil.execute(AboutForm::init); ThreadUtil.execute(QuickNoteForm::init); ThreadUtil.execute(JsonBeautyForm::init); ThreadUtil.execute(TimeConvertForm::init); diff --git a/src/main/java/com/luoboduner/moo/tool/ui/form/AboutForm.form b/src/main/java/com/luoboduner/moo/tool/ui/form/AboutForm.form new file mode 100644 index 00000000..f0ced4d8 --- /dev/null +++ b/src/main/java/com/luoboduner/moo/tool/ui/form/AboutForm.form @@ -0,0 +1,311 @@ + +
diff --git a/src/main/java/com/luoboduner/moo/tool/ui/form/AboutForm.java b/src/main/java/com/luoboduner/moo/tool/ui/form/AboutForm.java new file mode 100644 index 00000000..ce81cf9e --- /dev/null +++ b/src/main/java/com/luoboduner/moo/tool/ui/form/AboutForm.java @@ -0,0 +1,224 @@ +package com.luoboduner.moo.tool.ui.form; + +import com.intellij.uiDesigner.core.GridConstraints; +import com.intellij.uiDesigner.core.GridLayoutManager; +import com.intellij.uiDesigner.core.Spacer; +import com.luoboduner.moo.tool.ui.UiConsts; +import com.luoboduner.moo.tool.ui.listener.AboutListener; +import lombok.Getter; + +import javax.swing.*; +import javax.swing.border.TitledBorder; +import javax.swing.plaf.FontUIResource; +import javax.swing.text.StyleContext; +import java.awt.*; +import java.util.Locale; + +/** + *+ * About + *+ * + * @author RememBerBer + * @since 2019/8/13. + */ +@Getter +public class AboutForm { + + private JPanel aboutPanel; + private JScrollPane scrollPane; + private JLabel codeGitHubLabel; + private JLabel versionLabel; + private JLabel codeGiteeLabel; + private JLabel issueLabel; + private JLabel daculaLabel; + private JLabel hutoolLabel; + private JLabel wePushLinkLabel; + private JPanel wePushPanel; + private JLabel beautyEyeLabel; + private JLabel vsCodeIconsLabel; + + private static AboutForm aboutForm; + + private AboutForm() { + } + + public static AboutForm getInstance() { + if (aboutForm == null) { + aboutForm = new AboutForm(); + } + return aboutForm; + } + + public static void init() { + aboutForm = getInstance(); + aboutForm.versionLabel.setText(UiConsts.APP_VERSION); + + aboutForm.getScrollPane().getVerticalScrollBar().setUnitIncrement(16); + aboutForm.getScrollPane().getVerticalScrollBar().setDoubleBuffered(true); + aboutForm.getAboutPanel().updateUI(); + + AboutListener.addListeners(); + } + + { +// 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$$$() { + aboutPanel = new JPanel(); + aboutPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); + aboutPanel.setPreferredSize(new Dimension(400, 300)); + scrollPane = new JScrollPane(); + aboutPanel.add(scrollPane, new GridConstraints(0, 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)); + final JPanel panel1 = new JPanel(); + panel1.setLayout(new GridLayoutManager(9, 2, new Insets(40, 80, 0, 0), -1, -1)); + scrollPane.setViewportView(panel1); + panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null)); + final JLabel label1 = new JLabel(); + label1.setIcon(new ImageIcon(getClass().getResource("/icon/logo-128.png"))); + label1.setText(""); + panel1.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final Spacer spacer1 = new Spacer(); + panel1.add(spacer1, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); + final Spacer spacer2 = new Spacer(); + panel1.add(spacer2, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); + final JPanel panel2 = new JPanel(); + panel2.setLayout(new GridLayoutManager(3, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel2, new GridConstraints(1, 0, 1, 2, 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)); + panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "MooTool", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, 20, panel2.getFont()), new Color(-7883))); + final JLabel label2 = new JLabel(); + label2.setText("A handy desktop toolset for developers"); + panel2.add(label2, new GridConstraints(0, 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("Proudly by RememBerBer 周波"); + panel2.add(label3, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + versionLabel = new JLabel(); + Font versionLabelFont = this.$$$getFont$$$(null, Font.BOLD, -1, versionLabel.getFont()); + if (versionLabelFont != null) versionLabel.setFont(versionLabelFont); + versionLabel.setText("v0.0.0"); + versionLabel.setToolTipText("Check for updates"); + panel2.add(versionLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel3 = new JPanel(); + panel3.setLayout(new GridLayoutManager(5, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel3, new GridConstraints(2, 0, 1, 2, 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)); + panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "About", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel3.getFont()), null)); + final JLabel label4 = new JLabel(); + label4.setText("Hi. Thanks to use MooTool. \"Moo\" named from my daughter."); + panel3.add(label4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label5 = new JLabel(); + label5.setText("Less Java developer use Swing building projects, but I still love to develop by it."); + panel3.add(label5, 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 label6 = new JLabel(); + label6.setText("So every little free time, I had went towards the development."); + panel3.add(label6, 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 label7 = new JLabel(); + label7.setText("I did some works finaly, although there are so many same on web page."); + panel3.add(label7, new GridConstraints(3, 0, 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("Hope you enjoy using it as much as I did building it."); + panel3.add(label8, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel4 = new JPanel(); + panel4.setLayout(new GridLayoutManager(2, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel4, new GridConstraints(3, 0, 1, 2, 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)); + panel4.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "CODE", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel4.getFont()), null)); + codeGitHubLabel = new JLabel(); + codeGitHubLabel.setText("GitHub:https://github.com/rememberber/MooTool"); + panel4.add(codeGitHubLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + codeGiteeLabel = new JLabel(); + codeGiteeLabel.setText("Gitee:https://gitee.com/zhoubochina/MooTool"); + panel4.add(codeGiteeLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel5 = new JPanel(); + panel5.setLayout(new GridLayoutManager(1, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel5, new GridConstraints(4, 0, 1, 2, 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)); + panel5.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "HELP TO DO BETTER", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel5.getFont()), null)); + issueLabel = new JLabel(); + issueLabel.setText("https://github.com/rememberber/MooTool/issues"); + panel5.add(issueLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel6 = new JPanel(); + panel6.setLayout(new GridLayoutManager(4, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel6, new GridConstraints(5, 0, 1, 2, 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)); + panel6.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "THANKS TO", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel6.getFont()), null)); + daculaLabel = new JLabel(); + daculaLabel.setText("Darcula"); + panel6.add(daculaLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + beautyEyeLabel = new JLabel(); + beautyEyeLabel.setText("BeautyEye"); + panel6.add(beautyEyeLabel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + hutoolLabel = new JLabel(); + hutoolLabel.setText("Hutool"); + panel6.add(hutoolLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + vsCodeIconsLabel = new JLabel(); + vsCodeIconsLabel.setText("vscode-icons"); + panel6.add(vsCodeIconsLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel7 = new JPanel(); + panel7.setLayout(new GridLayoutManager(1, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel7, new GridConstraints(6, 0, 1, 2, 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)); + panel7.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "SPONSOR", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel7.getFont()), null)); + final JLabel label9 = new JLabel(); + label9.setIcon(new ImageIcon(getClass().getResource("/icon/wx-zanshang.jpg"))); + label9.setText(""); + label9.setToolTipText("感谢您的鼓励和支持"); + panel7.add(label9, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JPanel panel8 = new JPanel(); + panel8.setLayout(new GridLayoutManager(1, 1, new Insets(5, 3, 20, 0), -1, -1)); + panel1.add(panel8, new GridConstraints(7, 0, 1, 2, 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)); + panel8.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "OTHER WORKS", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel8.getFont()), null)); + wePushPanel = new JPanel(); + wePushPanel.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1)); + panel8.add(wePushPanel, 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)); + wePushLinkLabel = new JLabel(); + wePushLinkLabel.setText("https://github.com/rememberber/WePush"); + wePushPanel.add(wePushLinkLabel, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label10 = new JLabel(); + label10.setIcon(new ImageIcon(getClass().getResource("/icon/WePush-logo-64.png"))); + label10.setText(""); + wePushPanel.add(label10, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + final JLabel label11 = new JLabel(); + label11.setText("WePush"); + wePushPanel.add(label11, 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 label12 = new JLabel(); + label12.setText("专注批量推送的小而美的工具"); + wePushPanel.add(label12, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); + } + + /** + * @noinspection ALL + */ + private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { + if (currentFont == null) return null; + String resultName; + if (fontName == null) { + resultName = currentFont.getName(); + } else { + Font testFont = new Font(fontName, Font.PLAIN, 10); + if (testFont.canDisplay('a') && testFont.canDisplay('1')) { + resultName = fontName; + } else { + resultName = currentFont.getName(); + } + } + Font font = new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); + boolean isMac = System.getProperty("os.name", "").toLowerCase(Locale.ENGLISH).startsWith("mac"); + Font fontWithFallback = isMac ? new Font(font.getFamily(), font.getStyle(), font.getSize()) : new StyleContext().getFont(font.getFamily(), font.getStyle(), font.getSize()); + return fontWithFallback instanceof FontUIResource ? fontWithFallback : new FontUIResource(fontWithFallback); + } + + /** + * @noinspection ALL + */ + public JComponent $$$getRootComponent$$$() { + return aboutPanel; + } + +} diff --git a/src/main/java/com/luoboduner/moo/tool/ui/form/MainWindow.form b/src/main/java/com/luoboduner/moo/tool/ui/form/MainWindow.form index 1e3d2c33..30a9ca0a 100644 --- a/src/main/java/com/luoboduner/moo/tool/ui/form/MainWindow.form +++ b/src/main/java/com/luoboduner/moo/tool/ui/form/MainWindow.form @@ -19,6 +19,15 @@
+ * AboutListener + *+ * + * @author RememBerBer + * @since 2019/10/15. + */ +public class AboutListener { + + public static void addListeners() { + AboutForm aboutForm = AboutForm.getInstance(); + + aboutForm.getCodeGitHubLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/rememberber/MooTool")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getCodeGiteeLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://gitee.com/zhoubochina/MooTool")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getIssueLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/rememberber/MooTool/issues")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getDaculaLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/bulenkov/Darcula")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getBeautyEyeLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://gitee.com/jackjiang/beautyeye")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getHutoolLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://hutool.cn/")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getWePushPanel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/rememberber/WePush")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + aboutForm.getVsCodeIconsLabel().addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + super.mouseClicked(e); + Desktop desktop = Desktop.getDesktop(); + try { + desktop.browse(new URI("https://github.com/microsoft/vscode-icons")); + } catch (IOException | URISyntaxException e1) { + e1.printStackTrace(); + } + } + + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + // 检查更新 + aboutForm.getVersionLabel().addMouseListener(new MouseAdapter() { + @Override + public void mousePressed(MouseEvent e) { + super.mousePressed(e); + ThreadUtil.execute(() -> UpgradeUtil.checkUpdate(false)); + } + + @Override + public void mouseEntered(MouseEvent e) { + super.mouseEntered(e); + e.getComponent().setCursor(new Cursor(Cursor.HAND_CURSOR)); + } + }); + + } +}