init seed

This commit is contained in:
RememBerBer 2021-11-11 09:09:20 +08:00
parent 8926575a38
commit 48489179e9
47 changed files with 4221 additions and 1 deletions

View File

@ -1 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1636192961316" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2939" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M153.6 153.6m81.92 0l552.96 0q81.92 0 81.92 81.92l0 552.96q0 81.92-81.92 81.92l-552.96 0q-81.92 0-81.92-81.92l0-552.96q0-81.92 81.92-81.92Z" fill="#713A91" p-id="2940"></path><path d="M296.96 358.4a61.44 61.44 0 0 1 61.44-61.44h307.2a61.44 61.44 0 0 1 61.44 61.44v307.2a61.44 61.44 0 0 1-61.44 61.44H358.4a61.44 61.44 0 0 1-61.44-61.44V358.4z" fill="#BC7ABC" p-id="2941"></path><path d="M286.72 30.72a40.96 40.96 0 0 0-40.96 40.96v81.92h81.92V71.68a40.96 40.96 0 0 0-40.96-40.96z m153.6 0a40.96 40.96 0 0 0-40.96 40.96v81.92h81.92V71.68a40.96 40.96 0 0 0-40.96-40.96z m112.64 40.96a40.96 40.96 0 0 1 81.92 0v81.92h-81.92V71.68z m194.56-40.96a40.96 40.96 0 0 0-40.96 40.96v81.92h81.92V71.68a40.96 40.96 0 0 0-40.96-40.96zM30.72 286.72a40.96 40.96 0 0 1 40.96-40.96h81.92v81.92H71.68a40.96 40.96 0 0 1-40.96-40.96z m0 153.6a40.96 40.96 0 0 1 40.96-40.96h81.92v81.92H71.68a40.96 40.96 0 0 1-40.96-40.96z m40.96 112.64a40.96 40.96 0 0 0 0 81.92h81.92v-81.92H71.68zM30.72 747.52a40.96 40.96 0 0 1 40.96-40.96h81.92v81.92H71.68a40.96 40.96 0 0 1-40.96-40.96z m962.56-460.8a40.96 40.96 0 0 0-40.96-40.96h-81.92v81.92h81.92a40.96 40.96 0 0 0 40.96-40.96z m0 153.6a40.96 40.96 0 0 0-40.96-40.96h-81.92v81.92h81.92a40.96 40.96 0 0 0 40.96-40.96z m-40.96 112.64a40.96 40.96 0 0 1 0 81.92h-81.92v-81.92h81.92z m40.96 194.56a40.96 40.96 0 0 0-40.96-40.96h-81.92v81.92h81.92a40.96 40.96 0 0 0 40.96-40.96zM245.76 952.32a40.96 40.96 0 0 0 81.92 0v-81.92h-81.92v81.92z m153.6 0a40.96 40.96 0 0 0 81.92 0v-81.92h-81.92v81.92z m194.56 40.96a40.96 40.96 0 0 1-40.96-40.96v-81.92h81.92v81.92a40.96 40.96 0 0 1-40.96 40.96z m112.64-40.96a40.96 40.96 0 0 0 81.92 0v-81.92h-81.92v81.92z" fill="#A349A4" p-id="2942"></path></svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1636192961316" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2939" xmlns:xlink="http://www.w3.org/1999/xlink" width="1024" height="1024"><defs><style type="text/css"></style></defs><path d="M153.6 153.6m81.92 0l552.96 0q81.92 0 81.92 81.92l0 552.96q0 81.92-81.92 81.92l-552.96 0q-81.92 0-81.92-81.92l0-552.96q0-81.92 81.92-81.92Z" fill="#713A91" p-id="2940"></path><path d="M296.96 358.4a61.44 61.44 0 0 1 61.44-61.44h307.2a61.44 61.44 0 0 1 61.44 61.44v307.2a61.44 61.44 0 0 1-61.44 61.44H358.4a61.44 61.44 0 0 1-61.44-61.44V358.4z" fill="#BC7ABC" p-id="2941"></path><path d="M286.72 30.72a40.96 40.96 0 0 0-40.96 40.96v81.92h81.92V71.68a40.96 40.96 0 0 0-40.96-40.96z m153.6 0a40.96 40.96 0 0 0-40.96 40.96v81.92h81.92V71.68a40.96 40.96 0 0 0-40.96-40.96z m112.64 40.96a40.96 40.96 0 0 1 81.92 0v81.92h-81.92V71.68z m194.56-40.96a40.96 40.96 0 0 0-40.96 40.96v81.92h81.92V71.68a40.96 40.96 0 0 0-40.96-40.96zM30.72 286.72a40.96 40.96 0 0 1 40.96-40.96h81.92v81.92H71.68a40.96 40.96 0 0 1-40.96-40.96z m0 153.6a40.96 40.96 0 0 1 40.96-40.96h81.92v81.92H71.68a40.96 40.96 0 0 1-40.96-40.96z m40.96 112.64a40.96 40.96 0 0 0 0 81.92h81.92v-81.92H71.68zM30.72 747.52a40.96 40.96 0 0 1 40.96-40.96h81.92v81.92H71.68a40.96 40.96 0 0 1-40.96-40.96z m962.56-460.8a40.96 40.96 0 0 0-40.96-40.96h-81.92v81.92h81.92a40.96 40.96 0 0 0 40.96-40.96z m0 153.6a40.96 40.96 0 0 0-40.96-40.96h-81.92v81.92h81.92a40.96 40.96 0 0 0 40.96-40.96z m-40.96 112.64a40.96 40.96 0 0 1 0 81.92h-81.92v-81.92h81.92z m40.96 194.56a40.96 40.96 0 0 0-40.96-40.96h-81.92v81.92h81.92a40.96 40.96 0 0 0 40.96-40.96zM245.76 952.32a40.96 40.96 0 0 0 81.92 0v-81.92h-81.92v81.92z m153.6 0a40.96 40.96 0 0 0 81.92 0v-81.92h-81.92v81.92z m194.56 40.96a40.96 40.96 0 0 1-40.96-40.96v-81.92h81.92v81.92a40.96 40.96 0 0 1-40.96 40.96z m112.64-40.96a40.96 40.96 0 0 0 81.92 0v-81.92h-81.92v81.92z" fill="#A349A4" p-id="2942"></path></svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

13
pom.xml
View File

@ -29,6 +29,8 @@
<okhttp.version>4.9.0</okhttp.version>
<flatlaf.version>1.6.1</flatlaf.version>
<flatlaf-extras.version>1.6.1</flatlaf-extras.version>
<hutool-all.version>5.6.3</hutool-all.version>
<fastjson.version>1.2.74</fastjson.version>
</properties>
<dependencies>
@ -95,6 +97,17 @@
<version>${flatlaf-extras.version}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool-all.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
</dependencies>
<build>

View File

@ -1,5 +1,16 @@
package com.luoboduner.moo.info;
import com.formdev.flatlaf.util.SystemInfo;
import com.luoboduner.moo.info.ui.Init;
import com.luoboduner.moo.info.ui.form.LoadingForm;
import com.luoboduner.moo.info.ui.form.MainWindow;
import com.luoboduner.moo.info.ui.frame.MainFrame;
import com.luoboduner.moo.info.util.ConfigUtil;
import com.luoboduner.moo.info.util.UpgradeUtil;
import javax.swing.*;
import java.awt.*;
/**
* Main Enter!
*
@ -7,4 +18,45 @@ package com.luoboduner.moo.info;
* @since 2021/11/07.
*/
public class App {
public static ConfigUtil config = ConfigUtil.getInstance();
public static MainFrame mainFrame;
public static void main(String[] args) {
if (SystemInfo.isMacOS) {
// java -Xdock:name="MooInfo" -Xdock:icon=MooInfo.jpg ... (whatever else you normally specify here)
// java -Xms64m -Xmx256m -Dapple.awt.application.name="MooInfo" -Dcom.apple.mrj.application.apple.menu.about.name="MooInfo" -cp "./lib/*" com.luoboduner.moo.info.App
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("apple.awt.application.name", "MooInfo");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "MooInfo");
}
Init.initTheme();
mainFrame = new MainFrame();
mainFrame.init();
JPanel loadingPanel = new LoadingForm().getLoadingPanel();
mainFrame.add(loadingPanel);
mainFrame.pack();
mainFrame.setVisible(true);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
if (config.isDefaultMaxWindow() || screenSize.getWidth() <= 1366) {
// The window is automatically maximized at low resolution
mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
}
UpgradeUtil.smoothUpgrade();
mainFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
Init.initGlobalFont();
mainFrame.setContentPane(MainWindow.getInstance().getMainPanel());
MainWindow.getInstance().init();
Init.initAllTab();
Init.initOthers();
mainFrame.addListeners();
mainFrame.remove(loadingPanel);
}
}

View File

@ -0,0 +1,53 @@
package com.luoboduner.moo.info.bean;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* Version summary
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
@Data
public class VersionSummary implements Serializable {
private static final long serialVersionUID = 4637273116136790267L;
/**
* current version
*/
private String currentVersion;
/**
* version index
*/
private String versionIndex;
/**
* list of history versions
*/
private List<Version> versionDetailList;
/**
* Version Class
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
@Data
public static class Version implements Serializable {
private static final long serialVersionUID = 4637273116136790268L;
private String version;
private String title;
private String log;
}
}

View File

@ -0,0 +1,222 @@
package com.luoboduner.moo.info.ui;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.IntelliJTheme;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.ui.component.TopMenuBar;
import com.luoboduner.moo.info.util.SystemUtil;
import com.luoboduner.moo.info.util.UIUtil;
import com.luoboduner.moo.info.util.UpgradeUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import javax.swing.*;
import javax.swing.plaf.FontUIResource;
import java.awt.*;
import java.util.Enumeration;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* The init Class
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/09.
*/
public class Init {
private static final Log logger = LogFactory.get();
/**
* font size inti KEY
*/
private static final String FONT_SIZE_INIT_PROP = "fontSizeInit";
/**
* set font for global
*/
public static void initGlobalFont() {
if (StringUtils.isEmpty(App.config.getProps(FONT_SIZE_INIT_PROP))) {
// Adjust the font size according to the DPI
// Gets the resolution of the screen dpi
// dell 1920*1080/24 inch =96
// Xiaomi air 1920*1080/13.3 inch =144
// Xiaomi air 1366*768/13.3inch =96
int fontSize = 12;
// Initialize high-resolution screen font sizes such as Macs
if (SystemUtil.isMacOs()) {
fontSize = 15;
} else {
fontSize = (int) (UIUtil.getScreenScale() * fontSize);
}
App.config.setFontSize(fontSize);
App.config.setProps(FONT_SIZE_INIT_PROP, "true");
App.config.save();
TopMenuBar.getInstance().initFontSizeMenu();
}
Font font = new Font(App.config.getFont(), Font.PLAIN, App.config.getFontSize());
FontUIResource fontRes = new FontUIResource(font);
for (Enumeration<Object> keys = UIManager.getDefaults().keys(); keys.hasMoreElements(); ) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
UIManager.put(key, fontRes);
}
}
}
/**
* Other initialization
*/
public static void initOthers() {
}
/**
* init look and feel
*/
public static void initTheme() {
if (SystemUtil.isMacM1() || SystemUtil.isLinuxOs()) {
try {
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatDarculaLaf");
logger.warn("FlatDarculaLaf theme set.");
} catch (Exception e) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e2) {
logger.error(ExceptionUtils.getStackTrace(e2));
}
logger.error(ExceptionUtils.getStackTrace(e));
}
return;
}
if (App.config.isUnifiedBackground()) {
UIManager.put("TitlePane.unifiedBackground", true);
}
try {
switch (App.config.getTheme()) {
case "System Default":
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
break;
case "Flat Light":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
FlatLightLaf.install();
break;
case "Flat IntelliJ":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatIntelliJLaf");
break;
case "Flat Dark":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatDarkLaf");
break;
case "Darcula":
case "Darcula(Recommended)":
case "Flat Darcula(Recommended)":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatDarculaLaf");
UIManager.put("PopupMenu.background", UIManager.getColor("Panel.background"));
/**
If you don't like/want it, you can disable it with:
UIManager.put( "TitlePane.useWindowDecorations", false );
It is also possible to disable only the embedded menu bar (and keep the dark title pane) with:
UIManager.put( "TitlePane.menuBarEmbedded", false );
It is also possible to disable this on command line with following VM options:
-Dflatlaf.useWindowDecorations=false
-Dflatlaf.menuBarEmbedded=false
If you have following code in your app, you can remove it (no longer necessary):
// enable window decorations
JFrame.setDefaultLookAndFeelDecorated( true );
JDialog.setDefaultLookAndFeelDecorated( true );
**/
break;
case "Dark purple":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
IntelliJTheme.setup(App.class.getResourceAsStream(
"/theme/DarkPurple.theme.json"));
break;
case "IntelliJ Cyan":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
IntelliJTheme.setup(App.class.getResourceAsStream(
"/theme/Cyan.theme.json"));
break;
case "IntelliJ Light":
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
IntelliJTheme.setup(App.class.getResourceAsStream(
"/theme/Light.theme.json"));
break;
default:
if (SystemUtil.isJBR()) {
JFrame.setDefaultLookAndFeelDecorated(true);
JDialog.setDefaultLookAndFeelDecorated(true);
}
UIManager.setLookAndFeel("com.formdev.flatlaf.FlatDarculaLaf");
}
} catch (Exception e) {
logger.error(e);
}
}
/**
* init all tab
*/
public static void initAllTab() {
// Check the new version
if (App.config.isAutoCheckUpdate()) {
ScheduledThreadPoolExecutor threadPoolExecutor = new ScheduledThreadPoolExecutor(1);
threadPoolExecutor.scheduleAtFixedRate(() -> UpgradeUtil.checkUpdate(true), 0, 24, TimeUnit.HOURS);
}
}
public static void showMainFrame() {
App.mainFrame.setVisible(true);
if (App.mainFrame.getExtendedState() == Frame.ICONIFIED) {
App.mainFrame.setExtendedState(Frame.NORMAL);
} else if (App.mainFrame.getExtendedState() == 7) {
App.mainFrame.setExtendedState(Frame.MAXIMIZED_BOTH);
}
App.mainFrame.requestFocus();
}
public static void shutdown() {
App.mainFrame.dispose();
System.exit(0);
}
}

View File

@ -0,0 +1,78 @@
package com.luoboduner.moo.info.ui;
import java.awt.*;
/**
* constants about UI
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class UiConsts {
public static final String APP_NAME = "MooInfo";
public static final String APP_VERSION = "1.0.0";
public static final int TABLE_ROW_HEIGHT = 36;
/**
* Logo-1024*1024
*/
public static final Image IMAGE_LOGO_1024 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-1024.png"));
/**
* Logo-512*512
*/
public static final Image IMAGE_LOGO_512 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-512.png"));
/**
* Logo-256*256
*/
public static final Image IMAGE_LOGO_256 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-256.png"));
/**
* Logo-128*128
*/
public static final Image IMAGE_LOGO_128 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-128.png"));
/**
* Logo-64*64
*/
public static final Image IMAGE_LOGO_64 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-64.png"));
/**
* Logo-48*48
*/
public static final Image IMAGE_LOGO_48 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-48.png"));
/**
* Logo-32*32
*/
public static final Image IMAGE_LOGO_32 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-32.png"));
/**
* Logo-24*24
*/
public static final Image IMAGE_LOGO_24 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-24.png"));
/**
* Logo-16*16
*/
public static final Image IMAGE_LOGO_16 = Toolkit.getDefaultToolkit()
.getImage(UiConsts.class.getResource("/icons/logo-16.png"));
/**
* update checking url
*/
public static final String CHECK_VERSION_URL = "https://gitee.com/zhoubochina/MooInfo/raw/master/src/main/resources/version_summary.json";
}

View File

@ -0,0 +1,375 @@
package com.luoboduner.moo.info.ui.component;
import com.formdev.flatlaf.FlatLaf;
import com.formdev.flatlaf.extras.FlatAnimatedLafChange;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.ui.Init;
import com.luoboduner.moo.info.ui.dialog.AboutDialog;
import com.luoboduner.moo.info.ui.dialog.SettingDialog;
import com.luoboduner.moo.info.ui.dialog.SystemEnvResultDialog;
import com.luoboduner.moo.info.ui.form.MainWindow;
import com.luoboduner.moo.info.util.SystemUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.util.Map;
import java.util.Properties;
/**
* The top menu bar
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/10.
*/
@Slf4j
public class TopMenuBar extends JMenuBar {
private static TopMenuBar menuBar;
private static JMenu themeMenu;
private static JMenu fontFamilyMenu;
private static JMenu fontSizeMenu;
private static int initialThemeItemCount = -1;
private static int initialFontFamilyItemCount = -1;
private static int initialFontSizeItemCount = -1;
private static String[] themeNames = {
"System Default",
"Flat Light",
"Flat IntelliJ",
"Flat Dark",
"Flat Darcula(Recommended)",
"Dark purple",
"IntelliJ Cyan",
"IntelliJ Light"};
private static String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
private static String[] fontSizes = {
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"25",
"26"};
private TopMenuBar() {
}
public static TopMenuBar getInstance() {
if (menuBar == null) {
menuBar = new TopMenuBar();
}
return menuBar;
}
public void init() {
TopMenuBar topMenuBar = getInstance();
// ---------App
JMenu appMenu = new JMenu();
appMenu.setText("App");
// Setting
JMenuItem settingMenuItem = new JMenuItem();
settingMenuItem.setText("Settings");
settingMenuItem.addActionListener(e -> settingActionPerformed());
appMenu.add(settingMenuItem);
// Exit
JMenuItem exitMenuItem = new JMenuItem();
exitMenuItem.setText("Exit");
exitMenuItem.addActionListener(e -> exitActionPerformed());
appMenu.add(exitMenuItem);
topMenuBar.add(appMenu);
// ---------Appearance
JMenu appearanceMenu = new JMenu();
appearanceMenu.setText("Appearance");
JCheckBoxMenuItem defaultMaxWindowitem = new JCheckBoxMenuItem("Maximize window by Default");
defaultMaxWindowitem.setSelected(App.config.isDefaultMaxWindow());
defaultMaxWindowitem.addActionListener(e -> {
boolean selected = defaultMaxWindowitem.isSelected();
if (selected) {
App.mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
} else {
App.mainFrame.setExtendedState(JFrame.NORMAL);
}
App.config.setDefaultMaxWindow(selected);
App.config.save();
});
appearanceMenu.add(defaultMaxWindowitem);
JCheckBoxMenuItem unifiedBackgrounditem = new JCheckBoxMenuItem("Window color immersive");
unifiedBackgrounditem.setSelected(App.config.isUnifiedBackground());
unifiedBackgrounditem.addActionListener(e -> {
boolean selected = unifiedBackgrounditem.isSelected();
App.config.setUnifiedBackground(selected);
App.config.save();
UIManager.put("TitlePane.unifiedBackground", selected);
FlatLaf.updateUI();
});
appearanceMenu.add(unifiedBackgrounditem);
themeMenu = new JMenu();
themeMenu.setText("Theme");
initThemesMenu();
appearanceMenu.add(themeMenu);
fontFamilyMenu = new JMenu();
fontFamilyMenu.setText("Font Family");
initFontFamilyMenu();
appearanceMenu.add(fontFamilyMenu);
fontSizeMenu = new JMenu();
fontSizeMenu.setText("Font Size");
initFontSizeMenu();
appearanceMenu.add(fontSizeMenu);
topMenuBar.add(appearanceMenu);
// ---------Debug
JMenu debugMenu = new JMenu();
debugMenu.setText("Debug");
// Show logs
JMenuItem logMenuItem = new JMenuItem();
logMenuItem.setText("Show logs");
logMenuItem.addActionListener(e -> logActionPerformed());
debugMenu.add(logMenuItem);
// System environment variables
JMenuItem sysEnvMenuItem = new JMenuItem();
sysEnvMenuItem.setText("System environment variables");
sysEnvMenuItem.addActionListener(e -> sysEnvActionPerformed());
debugMenu.add(sysEnvMenuItem);
topMenuBar.add(debugMenu);
// ---------About
JMenu aboutMenu = new JMenu();
aboutMenu.setText("About");
// About
JMenuItem aboutMenuItem = new JMenuItem();
aboutMenuItem.setText("About");
aboutMenuItem.addActionListener(e -> aboutActionPerformed());
aboutMenu.add(aboutMenuItem);
topMenuBar.add(aboutMenu);
}
public void initFontSizeMenu() {
if (initialFontSizeItemCount < 0)
initialFontSizeItemCount = fontSizeMenu.getItemCount();
else {
// remove old items
for (int i = fontSizeMenu.getItemCount() - 1; i >= initialFontSizeItemCount; i--)
fontSizeMenu.remove(i);
}
for (String fontSize : fontSizes) {
JCheckBoxMenuItem item = new JCheckBoxMenuItem(fontSize);
item.setSelected(fontSize.equals(String.valueOf(App.config.getFontSize())));
item.addActionListener(this::fontSizeChanged);
fontSizeMenu.add(item);
}
}
private void initFontFamilyMenu() {
if (initialFontFamilyItemCount < 0)
initialFontFamilyItemCount = fontFamilyMenu.getItemCount();
else {
// remove old items
for (int i = fontFamilyMenu.getItemCount() - 1; i >= initialFontFamilyItemCount; i--)
fontFamilyMenu.remove(i);
}
for (String font : fontNames) {
JCheckBoxMenuItem item = new JCheckBoxMenuItem(font);
item.setSelected(font.equals(App.config.getFont()));
item.addActionListener(this::fontFamilyChanged);
fontFamilyMenu.add(item);
}
}
private void initThemesMenu() {
if (initialThemeItemCount < 0)
initialThemeItemCount = themeMenu.getItemCount();
else {
// remove old items
for (int i = themeMenu.getItemCount() - 1; i >= initialThemeItemCount; i--)
themeMenu.remove(i);
}
for (String themeName : themeNames) {
JCheckBoxMenuItem item = new JCheckBoxMenuItem(themeName);
item.setSelected(themeName.equals(App.config.getTheme()));
item.addActionListener(this::themeChanged);
themeMenu.add(item);
}
}
private void fontSizeChanged(ActionEvent actionEvent) {
try {
String selectedFontSize = actionEvent.getActionCommand();
FlatAnimatedLafChange.showSnapshot();
App.config.setFontSize(Integer.parseInt(selectedFontSize));
App.config.save();
Init.initGlobalFont();
SwingUtilities.updateComponentTreeUI(App.mainFrame);
SwingUtilities.updateComponentTreeUI(MainWindow.getInstance().getTabbedPane());
// FlatLaf.updateUI();
FlatAnimatedLafChange.hideSnapshotWithAnimation();
initFontSizeMenu();
} catch (Exception e1) {
JOptionPane.showMessageDialog(MainWindow.getInstance().getMainPanel(), "Save failed!\n\n" + e1.getMessage(), "Failed",
JOptionPane.ERROR_MESSAGE);
log.error(ExceptionUtils.getStackTrace(e1));
}
}
private void fontFamilyChanged(ActionEvent actionEvent) {
try {
String selectedFamily = actionEvent.getActionCommand();
FlatAnimatedLafChange.showSnapshot();
App.config.setFont(selectedFamily);
App.config.save();
Init.initGlobalFont();
SwingUtilities.updateComponentTreeUI(App.mainFrame);
SwingUtilities.updateComponentTreeUI(MainWindow.getInstance().getTabbedPane());
// FlatLaf.updateUI();
FlatAnimatedLafChange.hideSnapshotWithAnimation();
initFontFamilyMenu();
} catch (Exception e1) {
JOptionPane.showMessageDialog(MainWindow.getInstance().getMainPanel(), "Save failed!\n\n" + e1.getMessage(), "Failed",
JOptionPane.ERROR_MESSAGE);
log.error(ExceptionUtils.getStackTrace(e1));
}
}
private void themeChanged(ActionEvent actionEvent) {
try {
String selectedThemeName = actionEvent.getActionCommand();
FlatAnimatedLafChange.showSnapshot();
App.config.setTheme(selectedThemeName);
App.config.save();
Init.initTheme();
SwingUtilities.updateComponentTreeUI(App.mainFrame);
SwingUtilities.updateComponentTreeUI(MainWindow.getInstance().getTabbedPane());
// FlatLaf.updateUI();
FlatAnimatedLafChange.hideSnapshotWithAnimation();
initThemesMenu();
} catch (Exception e1) {
JOptionPane.showMessageDialog(MainWindow.getInstance().getMainPanel(), "Save failed!\n\n" + e1.getMessage(), "Failed",
JOptionPane.ERROR_MESSAGE);
log.error(ExceptionUtils.getStackTrace(e1));
}
}
private void aboutActionPerformed() {
try {
AboutDialog dialog = new AboutDialog();
dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error(ExceptionUtils.getStackTrace(e2));
}
}
private void sysEnvActionPerformed() {
try {
SystemEnvResultDialog dialog = new SystemEnvResultDialog();
dialog.appendTextArea("------------System.getenv---------------");
Map<String, String> map = System.getenv();
for (Map.Entry<String, String> envEntry : map.entrySet()) {
dialog.appendTextArea(envEntry.getKey() + "=" + envEntry.getValue());
}
dialog.appendTextArea("------------System.getProperties---------------");
Properties properties = System.getProperties();
for (Map.Entry<Object, Object> objectObjectEntry : properties.entrySet()) {
dialog.appendTextArea(objectObjectEntry.getKey() + "=" + objectObjectEntry.getValue());
}
dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error("Show system environment variables failed", e2);
}
}
private void logActionPerformed() {
try {
Desktop desktop = Desktop.getDesktop();
desktop.open(new File(SystemUtil.LOG_DIR));
} catch (Exception e2) {
log.error("Show log failed", e2);
}
}
private void exitActionPerformed() {
Init.shutdown();
}
private void settingActionPerformed() {
try {
SettingDialog dialog = new SettingDialog();
dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error(ExceptionUtils.getStackTrace(e2));
}
}
}

View File

@ -0,0 +1,344 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.dialog.AboutDialog">
<grid id="cbd77" binding="contentPane" 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>
<xy x="48" y="54" width="911" height="1381"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="1513c" binding="scrollPane">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty"/>
<children>
<grid id="3215c" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="40" left="40" bottom="40" right="0"/>
<constraints/>
<properties/>
<border type="empty"/>
<children>
<component id="5b95d" class="javax.swing.JLabel" binding="logoLabel">
<constraints>
<grid row="0" 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>
<icon value="icons/logo-128.png"/>
<text value=""/>
</properties>
</component>
<hspacer id="f39fa">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<vspacer id="12e0c">
<constraints>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<grid id="f7150" 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="3" bottom="20" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="MooInfo">
<font size="20" style="1"/>
<title-color color="-4425028"/>
</border>
<children>
<component id="67aea" class="javax.swing.JLabel">
<constraints>
<grid row="0" 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="A visual implementation of OSHI, to view information about the system and hardware"/>
</properties>
</component>
<component id="2b99b" class="javax.swing.JLabel" binding="authorLabel">
<constraints>
<grid row="1" 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="Proudly by RememBerBer 周波"/>
</properties>
</component>
<component id="2e035" class="javax.swing.JLabel" binding="versionLabel">
<constraints>
<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>
<font style="1"/>
<text value="v0.0.0"/>
<toolTipText value="Check for updates"/>
</properties>
</component>
</children>
</grid>
<grid id="a0430" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="3" bottom="20" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="About">
<font style="1"/>
</border>
<children>
<component id="28418" class="javax.swing.JLabel">
<constraints>
<grid row="0" 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="Hi. Thanks to use MooInfo. &quot;Moo&quot; named from my daughter."/>
</properties>
</component>
<component id="dc03b" class="javax.swing.JLabel">
<constraints>
<grid row="1" 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="Less Java developer use Swing building projects, but I still love to develop by it."/>
</properties>
</component>
<component id="4c1a1" class="javax.swing.JLabel">
<constraints>
<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="So every little free time, I had went towards the development."/>
</properties>
</component>
<component id="7b3dd" class="javax.swing.JLabel">
<constraints>
<grid row="3" 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="I did some works finaly, although there are so many same on web page."/>
</properties>
</component>
<component id="6a8c4" class="javax.swing.JLabel">
<constraints>
<grid row="4" 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="Hope you enjoy using it as much as I did building it."/>
</properties>
</component>
</children>
</grid>
<grid id="27e0c" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="3" bottom="20" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="CODE">
<font style="1"/>
</border>
<children>
<component id="4ff6b" class="javax.swing.JLabel" binding="codeGitHubLabel">
<constraints>
<grid row="0" 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="&lt;html&gt;GitHub&lt;a href=&quot;https://github.com/rememberber/MooInfo&quot;&gt;https://github.com/rememberber/MooInfo&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
<component id="16411" class="javax.swing.JLabel" binding="codeGiteeLabel">
<constraints>
<grid row="1" 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="&lt;html&gt;Gitee&lt;a href=&quot;https://gitee.com/zhoubochina/MooInfo&quot;&gt;https://gitee.com/zhoubochina/MooInfo&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
</children>
</grid>
<grid id="e98b9" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="3" bottom="20" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="HELP TO DO BETTER">
<font style="1"/>
</border>
<children>
<component id="ac403" class="javax.swing.JLabel" binding="issueLabel">
<constraints>
<grid row="0" 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="&lt;html&gt;&lt;a href=&quot;https://github.com/rememberber/MooInfo/issues&quot;&gt;https://github.com/rememberber/MooInfo/issues&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
</children>
</grid>
<grid id="c28d7" 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="3" bottom="20" right="0"/>
<constraints>
<grid row="5" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="THANKS TO">
<font style="1"/>
</border>
<children>
<component id="982aa" class="javax.swing.JLabel" binding="flatLafLabel">
<constraints>
<grid row="0" 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="&lt;html&gt;&lt;a href=&quot;https://github.com/JFormDesigner/FlatLaf&quot;&gt;FlatLaf&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
<component id="c3231" class="javax.swing.JLabel" binding="hutoolLabel">
<constraints>
<grid row="1" 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="&lt;html&gt;&lt;a href=&quot;https://hutool.cn/&quot;&gt;Hutool&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
<component id="6b692" class="javax.swing.JLabel" binding="vsCodeIconsLabel">
<constraints>
<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="&lt;html&gt;&lt;a href=&quot;https://github.com/microsoft/vscode-icons&quot;&gt;vscode-icons&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
</children>
</grid>
<grid id="7e499" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="3" bottom="20" right="0"/>
<constraints>
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="SPONSOR">
<font style="1"/>
</border>
<children>
<component id="a7175" class="javax.swing.JLabel">
<constraints>
<grid row="0" 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>
<icon value="icons/wx-zanshang.jpg"/>
<text value=""/>
<toolTipText value="感谢您的鼓励和支持"/>
</properties>
</component>
</children>
</grid>
<grid id="74457" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="5" left="3" bottom="20" right="0"/>
<constraints>
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty" title="OTHER WORKS">
<font style="1"/>
</border>
<children>
<grid id="1f14f" binding="wePushPanel" layout-manager="GridLayoutManager" row-count="4" 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="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>
<component id="18ba1" class="javax.swing.JLabel" binding="wePushLinkLabel">
<constraints>
<grid row="3" 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="&lt;html&gt;&lt;a href=&quot;https://github.com/rememberber/WePush&quot;&gt;https://github.com/rememberber/WePush&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
<component id="8306e" class="javax.swing.JLabel">
<constraints>
<grid row="0" 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>
<icon value="icons/WePush-logo-64.png"/>
<text value=""/>
</properties>
</component>
<component id="f6ad2" class="javax.swing.JLabel">
<constraints>
<grid row="1" 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="WePush"/>
</properties>
</component>
<component id="a62e9" class="javax.swing.JLabel">
<constraints>
<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="专注批量推送的小而美的工具"/>
</properties>
</component>
</children>
</grid>
<grid id="c9b44" binding="mooToolPanel" layout-manager="GridLayoutManager" row-count="4" 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="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>
<properties/>
<border type="none"/>
<children>
<component id="d5851" class="javax.swing.JLabel" binding="httpsGithubComRememberberLabel" default-binding="true">
<constraints>
<grid row="3" 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="&lt;html&gt;&lt;a href=&quot;https://github.com/rememberber/MooTool&quot;&gt;https://github.com/rememberber/MooTool&lt;/a&gt;&lt;/html&gt;"/>
</properties>
</component>
<component id="d2a2a" class="javax.swing.JLabel">
<constraints>
<grid row="0" 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>
<icon value="icons/MooTool-logo-64.png"/>
<text value=""/>
</properties>
</component>
<component id="8797c" class="javax.swing.JLabel">
<constraints>
<grid row="1" 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="MooTool"/>
</properties>
</component>
<component id="8b57b" class="javax.swing.JLabel">
<constraints>
<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="A handy tool set for developers."/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</children>
</grid>
</children>
</scrollpane>
</children>
</grid>
</form>

View File

@ -0,0 +1,488 @@
package com.luoboduner.moo.info.ui.dialog;
import cn.hutool.core.thread.ThreadUtil;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.ui.UiConsts;
import com.luoboduner.moo.info.util.ComponentUtil;
import com.luoboduner.moo.info.util.UpgradeUtil;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.plaf.FontUIResource;
import javax.swing.text.StyleContext;
import java.awt.*;
import java.awt.event.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Locale;
public class AboutDialog extends JDialog {
private JPanel contentPane;
private JScrollPane scrollPane;
private JLabel versionLabel;
private JLabel codeGitHubLabel;
private JLabel codeGiteeLabel;
private JLabel issueLabel;
private JLabel hutoolLabel;
private JLabel vsCodeIconsLabel;
private JLabel wePushLinkLabel;
private JPanel wePushPanel;
private JLabel authorLabel;
private JLabel logoLabel;
private JLabel flatLafLabel;
private JPanel mooToolPanel;
private JLabel httpsGithubComRememberberLabel;
public AboutDialog() {
super(App.mainFrame, "About");
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.4, 0.64);
setContentPane(contentPane);
setModal(true);
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);
versionLabel.setText(UiConsts.APP_VERSION);
scrollPane.getVerticalScrollBar().setUnitIncrement(16);
scrollPane.getVerticalScrollBar().setDoubleBuffered(true);
contentPane.updateUI();
logoLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
Desktop desktop = Desktop.getDesktop();
try {
desktop.browse(new URI("https://rememberber.github.io/MooInfo/"));
} 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));
}
});
authorLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
Desktop desktop = Desktop.getDesktop();
try {
desktop.browse(new URI("http://www.luoboduner.com/"));
} 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));
}
});
codeGitHubLabel.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/MooInfo"));
} 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));
}
});
codeGiteeLabel.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/MooInfo"));
} 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));
}
});
issueLabel.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/MooInfo/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));
}
});
flatLafLabel.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
Desktop desktop = Desktop.getDesktop();
try {
desktop.browse(new URI("https://github.com/JFormDesigner/FlatLaf"));
} 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));
}
});
hutoolLabel.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));
}
});
wePushPanel.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));
}
});
mooToolPanel.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));
}
});
vsCodeIconsLabel.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));
}
});
// Check for updates
versionLabel.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));
}
});
}
private void onOK() {
// add your code here
dispose();
}
{
// 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(1, 1, new Insets(0, 0, 0, 0), -1, -1));
scrollPane = new JScrollPane();
contentPane.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));
scrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(9, 2, new Insets(40, 40, 40, 0), -1, -1));
scrollPane.setViewportView(panel1);
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
logoLabel = new JLabel();
logoLabel.setIcon(new ImageIcon(getClass().getResource("/icons/logo-128.png")));
logoLabel.setText("");
panel1.add(logoLabel, 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(), "MooInfo", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, 20, panel2.getFont()), new Color(-4425028)));
final JLabel label1 = new JLabel();
label1.setText("A visual implementation of OSHI, to view information about the system and hardware");
panel2.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));
authorLabel = new JLabel();
authorLabel.setText("Proudly by RememBerBer 周波");
panel2.add(authorLabel, 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 label2 = new JLabel();
label2.setText("Hi. Thanks to use MooInfo. \"Moo\" named from my daughter.");
panel3.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("Less Java developer use Swing building projects, but I still love to develop by it.");
panel3.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));
final JLabel label4 = new JLabel();
label4.setText("So every little free time, I had went towards the development.");
panel3.add(label4, 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 label5 = new JLabel();
label5.setText("I did some works finaly, although there are so many same on web page.");
panel3.add(label5, 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 label6 = new JLabel();
label6.setText("Hope you enjoy using it as much as I did building it.");
panel3.add(label6, 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("<html>GitHub<a href=\"https://github.com/rememberber/MooInfo\">https://github.com/rememberber/MooInfo</a></html>");
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("<html>Gitee<a href=\"https://gitee.com/zhoubochina/MooInfo\">https://gitee.com/zhoubochina/MooInfo</a></html>");
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("<html><a href=\"https://github.com/rememberber/MooInfo/issues\">https://github.com/rememberber/MooInfo/issues</a></html>");
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(3, 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));
flatLafLabel = new JLabel();
flatLafLabel.setText("<html><a href=\"https://github.com/JFormDesigner/FlatLaf\">FlatLaf</a></html>");
panel6.add(flatLafLabel, new GridConstraints(0, 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("<html><a href=\"https://hutool.cn/\">Hutool</a></html>");
panel6.add(hutoolLabel, new GridConstraints(1, 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("<html><a href=\"https://github.com/microsoft/vscode-icons\">vscode-icons</a></html>");
panel6.add(vsCodeIconsLabel, 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 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 label7 = new JLabel();
label7.setIcon(new ImageIcon(getClass().getResource("/icons/wx-zanshang.jpg")));
label7.setText("");
label7.setToolTipText("感谢您的鼓励和支持");
panel7.add(label7, 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(2, 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("<html><a href=\"https://github.com/rememberber/WePush\">https://github.com/rememberber/WePush</a></html>");
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 label8 = new JLabel();
label8.setIcon(new ImageIcon(getClass().getResource("/icons/WePush-logo-64.png")));
label8.setText("");
wePushPanel.add(label8, 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 label9 = new JLabel();
label9.setText("WePush");
wePushPanel.add(label9, 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 label10 = new JLabel();
label10.setText("专注批量推送的小而美的工具");
wePushPanel.add(label10, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
mooToolPanel = new JPanel();
mooToolPanel.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));
panel8.add(mooToolPanel, 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));
httpsGithubComRememberberLabel = new JLabel();
httpsGithubComRememberberLabel.setText("<html><a href=\"https://github.com/rememberber/MooTool\">https://github.com/rememberber/MooTool</a></html>");
mooToolPanel.add(httpsGithubComRememberberLabel, 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 label11 = new JLabel();
label11.setIcon(new ImageIcon(getClass().getResource("/icons/MooTool-logo-64.png")));
label11.setText("");
mooToolPanel.add(label11, 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 label12 = new JLabel();
label12.setText("MooTool");
mooToolPanel.add(label12, 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 label13 = new JLabel();
label13.setText("A handy tool set for developers.");
mooToolPanel.add(label13, 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 contentPane;
}
}

View File

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.dialog.SettingDialog">
<grid id="cbd77" binding="contentPane" 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>
<xy x="48" y="54" width="711" height="722"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="2531c" binding="settingScrollPane">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty"/>
<children>
<grid id="60200" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="20" left="20" bottom="10" right="10"/>
<constraints/>
<properties/>
<border type="none"/>
<children>
<vspacer id="84120">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<grid id="7f4fc" 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="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<preferred-size width="600" height="-1"/>
</grid>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="7c23b" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="15" left="15" bottom="25" right="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="empty" title="Routine">
<font style="1"/>
</border>
<children>
<component id="e1e3b" class="javax.swing.JCheckBox" binding="autoCheckUpdateCheckBox">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Automatically check for updates"/>
</properties>
</component>
<component id="9051a" class="javax.swing.JLabel">
<constraints>
<grid row="1" 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="Language"/>
</properties>
</component>
<component id="dc7fe" class="javax.swing.JComboBox" binding="comboBox1" default-binding="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<enabled value="false"/>
<model>
<item value="English"/>
<item value="简体中文"/>
</model>
</properties>
</component>
<hspacer id="5ff88">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</grid>
<hspacer id="7e07c">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
</children>
</scrollpane>
</children>
</grid>
</form>

View File

@ -0,0 +1,150 @@
package com.luoboduner.moo.info.ui.dialog;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.util.ComponentUtil;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import javax.swing.plaf.FontUIResource;
import javax.swing.text.StyleContext;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Locale;
public class SettingDialog extends JDialog {
private static final Log logger = LogFactory.get();
private JPanel contentPane;
private JScrollPane settingScrollPane;
private JCheckBox autoCheckUpdateCheckBox;
private JComboBox comboBox1;
public SettingDialog() {
super(App.mainFrame, "Settings");
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.5, 0.6);
setContentPane(contentPane);
setModal(true);
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);
// Set the scroll bar speed
settingScrollPane.getVerticalScrollBar().setUnitIncrement(16);
settingScrollPane.getVerticalScrollBar().setDoubleBuffered(true);
// routine
autoCheckUpdateCheckBox.setSelected(App.config.isAutoCheckUpdate());
contentPane.updateUI();
// Settings-routine-Updates are checked automatically at startup
autoCheckUpdateCheckBox.addActionListener(e -> {
App.config.setAutoCheckUpdate(autoCheckUpdateCheckBox.isSelected());
App.config.save();
});
}
private void onOK() {
// add your code here
dispose();
}
{
// 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(1, 1, new Insets(0, 0, 0, 0), -1, -1));
settingScrollPane = new JScrollPane();
contentPane.add(settingScrollPane, 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));
settingScrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(2, 2, new Insets(20, 20, 10, 10), -1, -1));
settingScrollPane.setViewportView(panel1);
final Spacer spacer1 = new Spacer();
panel1.add(spacer1, new GridConstraints(1, 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(1, 1, new Insets(0, 0, 0, 0), -1, -1));
panel1.add(panel2, 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(600, -1), null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(2, 3, new Insets(15, 15, 25, 0), -1, -1));
panel2.add(panel3, 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));
panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), "Routine", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$(null, Font.BOLD, -1, panel3.getFont()), null));
autoCheckUpdateCheckBox = new JCheckBox();
autoCheckUpdateCheckBox.setText("Automatically check for updates");
panel3.add(autoCheckUpdateCheckBox, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JLabel label1 = new JLabel();
label1.setText("Language");
panel3.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
comboBox1 = new JComboBox();
comboBox1.setEnabled(false);
final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel();
defaultComboBoxModel1.addElement("English");
defaultComboBoxModel1.addElement("简体中文");
comboBox1.setModel(defaultComboBoxModel1);
panel3.add(comboBox1, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer2 = new Spacer();
panel3.add(spacer2, new GridConstraints(1, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final Spacer spacer3 = new Spacer();
panel1.add(spacer3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, 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 contentPane;
}
}

View File

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.dialog.SystemEnvResultDialog">
<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="10" left="10" bottom="10" right="10"/>
<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="0" bottom="0" right="0"/>
<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" 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="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>
<scrollpane id="c85e2">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="empty"/>
<children>
<component id="b3671" class="javax.swing.JTextArea" binding="textArea1" default-binding="true">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -0,0 +1,103 @@
package com.luoboduner.moo.info.ui.dialog;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.util.ComponentUtil;
import javax.swing.*;
import javax.swing.border.TitledBorder;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class SystemEnvResultDialog extends JDialog {
private JPanel contentPane;
private JButton buttonOK;
private JTextArea textArea1;
public SystemEnvResultDialog() {
super(App.mainFrame, "System environment variables");
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.4, 0.64);
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);
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() {
// add your code here
dispose();
}
public void setTextArea(String str) {
textArea1.setText(str);
}
public void appendTextArea(String str) {
textArea1.append(str);
textArea1.append("\n");
}
{
// 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(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -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));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, 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));
final JScrollPane scrollPane1 = new JScrollPane();
panel3.add(scrollPane1, 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));
scrollPane1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
textArea1 = new JTextArea();
scrollPane1.setViewportView(textArea1);
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}

View File

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.dialog.UpdateDialog">
<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="10" left="10" bottom="10" right="10"/>
<constraints>
<xy x="48" y="54" width="624" 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="0" bottom="0" right="0"/>
<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="3" 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="立即安装"/>
</properties>
</component>
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
<constraints>
<grid row="0" column="2" 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="取消"/>
</properties>
</component>
<component id="69219" class="javax.swing.JButton" binding="buttonDownloadFromWeb">
<constraints>
<grid row="0" column="1" 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="打开下载页面"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="e3588" layout-manager="GridLayoutManager" row-count="4" 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="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>
<component id="da503" class="javax.swing.JProgressBar" binding="progressBarDownload">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="30bb0" class="javax.swing.JLabel" binding="statusLabel">
<constraints>
<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="就绪"/>
</properties>
</component>
<vspacer id="32ee">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<vspacer id="4b90f">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -0,0 +1,190 @@
package com.luoboduner.moo.info.ui.dialog;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.StreamProgress;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.http.HttpUtil;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.util.ComponentUtil;
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
/**
* Update download dialog
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class UpdateDialog extends JDialog {
private static final long serialVersionUID = -5858063892133811698L;
private JPanel contentPane;
private JButton buttonOK;
private JButton buttonCancel;
private JProgressBar progressBarDownload;
private JButton buttonDownloadFromWeb;
private JLabel statusLabel;
private File downLoadFile;
public UpdateDialog() {
super(App.mainFrame, "Download the new version");
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);
ComponentUtil.setPreferSizeAndLocateToCenter(this, 600, 200);
buttonOK.addActionListener(e -> onOK());
buttonCancel.addActionListener(e -> onCancel());
// call onCancel() when cross is clicked
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
onCancel();
}
});
// call onCancel() on ESCAPE
contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
buttonDownloadFromWeb.addActionListener(e -> {
Desktop desktop = Desktop.getDesktop();
try {
desktop.browse(new URI("https://github.com/rememberber/MooInfo/releases"));
} catch (IOException | URISyntaxException ex) {
ex.printStackTrace();
}
});
}
public void downLoad(String newVersion) {
buttonOK.setEnabled(false);
ThreadUtil.execute(
() -> {
String fileUrl = "http://download.zhoubochina.com/moo/exe/MooInfo-" + newVersion + "-x64-Setup.exe";
String fileName = FileUtil.getName(fileUrl);
URL url;
try {
url = new URL(fileUrl);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
// Get the appropriate file length
int fileLength = urlConnection.getContentLength();
progressBarDownload.setMaximum(fileLength);
} catch (IOException e) {
e.printStackTrace();
}
File tempDir = new File(FileUtil.getTmpDirPath() + "MooInfo");
if (!tempDir.exists()) {
tempDir.mkdirs();
}
FileUtil.clean(tempDir);
downLoadFile = FileUtil.file(tempDir + File.separator + fileName);
HttpUtil.downloadFile(fileUrl, FileUtil.touch(downLoadFile), new StreamProgress() {
@Override
public void start() {
statusLabel.setText("Start downloading...");
}
@Override
public void progress(long progressSize) {
progressBarDownload.setValue((int) progressSize);
statusLabel.setText("Already download" + FileUtil.readableFileSize(progressSize));
}
@Override
public void finish() {
statusLabel.setText("Download finished!");
buttonOK.setEnabled(true);
}
});
}
);
}
private void onOK() {
try {
Desktop.getDesktop().open(downLoadFile);
dispose();
System.exit(0);
} catch (IOException e) {
e.printStackTrace();
}
}
private void onCancel() {
// add your code here if necessary
dispose();
}
{
// 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(10, 10, 10, 10), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -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, 3, 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("立即安装");
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));
buttonCancel = new JButton();
buttonCancel.setText("取消");
panel2.add(buttonCancel, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
buttonDownloadFromWeb = new JButton();
buttonDownloadFromWeb.setText("打开下载页面");
panel2.add(buttonDownloadFromWeb, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(4, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, 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));
progressBarDownload = new JProgressBar();
panel3.add(progressBarDownload, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
statusLabel = new JLabel();
statusLabel.setText("就绪");
panel3.add(statusLabel, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer2 = new Spacer();
panel3.add(spacer2, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
final Spacer spacer3 = new Spacer();
panel3.add(spacer3, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.dialog.UpdateInfoDialog">
<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="10" 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="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<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="3" 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="立即下载"/>
</properties>
</component>
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="取消"/>
</properties>
</component>
</children>
</grid>
<hspacer id="a6e4e">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
<grid id="e3588" 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="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>
<scrollpane id="e2eee">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="29cd0" class="javax.swing.JTextPane" binding="textPane1" default-binding="true">
<constraints/>
<properties>
<editable value="false"/>
<margin top="80" left="28" bottom="3" right="28"/>
<text value=""/>
</properties>
</component>
</children>
</scrollpane>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -0,0 +1,157 @@
package com.luoboduner.moo.info.ui.dialog;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.util.ComponentUtil;
import com.luoboduner.moo.info.util.SystemUtil;
import lombok.Getter;
import javax.swing.*;
import javax.swing.text.html.HTMLEditorKit;
import javax.swing.text.html.StyleSheet;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
/**
* Dialog of update info
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
@Getter
public class UpdateInfoDialog extends JDialog {
private static final long serialVersionUID = -9114988145315865608L;
private JPanel contentPane;
private JButton buttonOK;
private JButton buttonCancel;
private JTextPane textPane1;
private String newVersion;
public void setNewVersion(String newVersion) {
this.newVersion = newVersion;
}
public UpdateInfoDialog() {
super(App.mainFrame, "Surprise the new version");
setContentPane(contentPane);
setModal(true);
getRootPane().setDefaultButton(buttonOK);
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.4, 0.64);
buttonOK.addActionListener(e -> onOK());
buttonCancel.addActionListener(e -> onCancel());
// call onCancel() when cross is clicked
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
onCancel();
}
});
// call onCancel() on ESCAPE
contentPane.registerKeyboardAction(e -> onCancel(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
}
private void onOK() {
if (SystemUtil.isMacOs()) {
Desktop desktop = Desktop.getDesktop();
try {
desktop.browse(new URI("https://github.com/rememberber/MooInfo/releases"));
} catch (IOException | URISyntaxException ex) {
ex.printStackTrace();
}
} else {
UpdateDialog dialog = new UpdateDialog();
dialog.pack();
dialog.downLoad(newVersion);
dialog.setVisible(true);
}
dispose();
}
private void onCancel() {
dispose();
}
public void setPlaneText(String planeText) {
textPane1.setContentType("text/plain; charset=utf-8");
textPane1.setText(planeText);
textPane1.setCaretPosition(0);
}
public void setHtmlText(String htmlText) {
textPane1.setContentType("text/html; charset=utf-8");
HTMLEditorKit kit = new HTMLEditorKit();
textPane1.setEditorKit(kit);
StyleSheet styleSheet = kit.getStyleSheet();
styleSheet.addRule("h2{color:#FBC87A;}");
styleSheet.addRule("body{font-family:" + buttonOK.getFont().getName() + ";font-size:" + buttonOK.getFont().getSize() + ";}");
textPane1.setText(htmlText);
textPane1.setCaretPosition(0);
}
{
// 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, 10, 0), -1, -1));
final JPanel panel1 = new JPanel();
panel1.setLayout(new GridLayoutManager(1, 3, new Insets(0, 0, 0, 0), -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, 3, 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("立即下载");
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));
buttonCancel = new JButton();
buttonCancel.setText("取消");
panel2.add(buttonCancel, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
final Spacer spacer2 = new Spacer();
panel1.add(spacer2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
final JPanel panel3 = new JPanel();
panel3.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
contentPane.add(panel3, 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));
final JScrollPane scrollPane1 = new JScrollPane();
panel3.add(scrollPane1, 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));
textPane1 = new JTextPane();
textPane1.setEditable(false);
textPane1.setMargin(new Insets(80, 28, 3, 28));
textPane1.setText("");
scrollPane1.setViewportView(textPane1);
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return contentPane;
}
}

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.form.LoadingForm">
<grid id="27dc6" binding="loadingPanel" 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>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="bdab4" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font size="26"/>
<horizontalAlignment value="10"/>
<icon value="icons/loading_dark.gif"/>
<text value="Loading……"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@ -0,0 +1,78 @@
package com.luoboduner.moo.info.ui.form;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import lombok.Getter;
import javax.swing.*;
import javax.swing.plaf.FontUIResource;
import javax.swing.text.StyleContext;
import java.awt.*;
import java.util.Locale;
/**
* the loading form
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/10.
*/
@Getter
public class LoadingForm {
private JPanel loadingPanel;
{
// 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$$$() {
loadingPanel = new JPanel();
loadingPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
final JLabel label1 = new JLabel();
Font label1Font = this.$$$getFont$$$(null, -1, 26, label1.getFont());
if (label1Font != null) label1.setFont(label1Font);
label1.setHorizontalAlignment(10);
label1.setIcon(new ImageIcon(getClass().getResource("/icons/loading_dark.gif")));
label1.setText("Loading……");
loadingPanel.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, 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 loadingPanel;
}
}

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.luoboduner.moo.info.ui.form.MainWindow">
<grid id="27dc6" binding="mainPanel" 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>
<xy x="20" y="20" width="1492" height="524"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<tabbedpane id="bfe29" binding="tabbedPane">
<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">
<preferred-size width="200" height="200"/>
</grid>
</constraints>
<properties>
<tabLayoutPolicy value="1"/>
</properties>
<border type="none"/>
<children>
<grid id="f5e21" binding="overViewPanel" 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="Overview"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</tabbedpane>
</children>
</grid>
</form>

View File

@ -0,0 +1,73 @@
package com.luoboduner.moo.info.ui.form;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import lombok.Getter;
import javax.swing.*;
import java.awt.*;
/**
* The main interface
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/10.
*/
@Getter
public class MainWindow {
private JTabbedPane tabbedPane;
private JPanel mainPanel;
private JPanel overViewPanel;
private static MainWindow mainWindow;
private MainWindow() {
}
public static MainWindow getInstance() {
if (mainWindow == null) {
mainWindow = new MainWindow();
}
return mainWindow;
}
private static GridConstraints gridConstraints = 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);
public void init() {
mainWindow = getInstance();
mainWindow.getMainPanel().updateUI();
}
{
// 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$$$() {
mainPanel = new JPanel();
mainPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
tabbedPane = new JTabbedPane();
tabbedPane.setTabLayoutPolicy(1);
mainPanel.add(tabbedPane, 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));
overViewPanel = new JPanel();
overViewPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
tabbedPane.addTab("Overview", overViewPanel);
}
/**
* @noinspection ALL
*/
public JComponent $$$getRootComponent$$$() {
return mainPanel;
}
}

View File

@ -0,0 +1,36 @@
package com.luoboduner.moo.info.ui.frame;
import cn.hutool.core.thread.ThreadUtil;
import com.luoboduner.moo.info.ui.UiConsts;
import com.luoboduner.moo.info.ui.component.TopMenuBar;
import com.luoboduner.moo.info.ui.listener.FrameListener;
import com.luoboduner.moo.info.util.ComponentUtil;
import com.luoboduner.moo.info.util.FrameUtil;
import javax.swing.*;
/**
* Main Frame
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class MainFrame extends JFrame {
public void init() {
this.setName(UiConsts.APP_NAME);
this.setTitle(UiConsts.APP_NAME);
FrameUtil.setFrameIcon(this);
TopMenuBar topMenuBar = TopMenuBar.getInstance();
topMenuBar.init();
setJMenuBar(topMenuBar);
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.8, 0.88);
}
/**
* add event listeners
*/
public void addListeners() {
ThreadUtil.execute(FrameListener::addListeners);
}
}

View File

@ -0,0 +1,68 @@
package com.luoboduner.moo.info.ui.listener;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.ui.Init;
import com.luoboduner.moo.info.util.SystemUtil;
import javax.swing.*;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
/**
* Form event monitoring
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/10.
*/
public class FrameListener {
public static void addListeners() {
App.mainFrame.addWindowListener(new WindowListener() {
@Override
public void windowOpened(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
if (SystemUtil.isWindowsOs()) {
App.mainFrame.setVisible(false);
} else {
App.mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
Init.shutdown();
}
@Override
public void windowClosed(WindowEvent e) {
}
@Override
public void windowActivated(WindowEvent e) {
}
});
}
}

View File

@ -0,0 +1,40 @@
package com.luoboduner.moo.info.util;
import com.luoboduner.moo.info.App;
import java.awt.*;
/**
* util for swing component
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class ComponentUtil {
private static Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
private static Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(App.mainFrame.getGraphicsConfiguration());
private static int screenWidth = screenSize.width - screenInsets.left - screenInsets.right;
private static int screenHeight = screenSize.height - screenInsets.top - screenInsets.bottom;
/**
* Set up the component preferSize and position it in the center of the screen
*/
public static void setPreferSizeAndLocateToCenter(Component component, int preferWidth, int preferHeight) {
component.setBounds((screenWidth - preferWidth) / 2, (screenHeight - preferHeight) / 2,
preferWidth, preferHeight);
Dimension preferSize = new Dimension(preferWidth, preferHeight);
component.setPreferredSize(preferSize);
}
/**
* Set the component preferSize and position it in the center of the screen (based on the percentage of screen width)
*/
public static void setPreferSizeAndLocateToCenter(Component component, double preferWidthPercent, double preferHeightPercent) {
int preferWidth = (int) (screenWidth * preferWidthPercent);
int preferHeight = (int) (screenHeight * preferHeightPercent);
setPreferSizeAndLocateToCenter(component, preferWidth, preferHeight);
}
}

View File

@ -0,0 +1,41 @@
package com.luoboduner.moo.info.util;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.setting.Setting;
import java.io.File;
/**
* Base class of configuration management
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class ConfigBaseUtil {
/**
* path of the setting file
*/
private String settingFilePath = SystemUtil.CONFIG_HOME + File.separator + "config" + File.separator + "config.setting";
Setting setting;
ConfigBaseUtil() {
setting = new Setting(FileUtil.touch(settingFilePath), CharsetUtil.CHARSET_UTF_8, false);
}
public void setProps(String key, String value) {
setting.put(key, value);
}
public String getProps(String key) {
return setting.get(key);
}
/**
* save to disk
*/
public void save() {
setting.store(settingFilePath);
}
}

View File

@ -0,0 +1,99 @@
package com.luoboduner.moo.info.util;
/**
* Configuration management
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class ConfigUtil extends ConfigBaseUtil {
private static final ConfigUtil configUtil = new ConfigUtil();
public static ConfigUtil getInstance() {
return configUtil;
}
private ConfigUtil() {
super();
}
private boolean autoCheckUpdate;
private boolean defaultMaxWindow;
private boolean unifiedBackground;
private String beforeVersion;
private String theme;
private String font;
private int fontSize;
public boolean isAutoCheckUpdate() {
return setting.getBool("autoCheckUpdate", "setting.common", true);
}
public void setAutoCheckUpdate(boolean autoCheckUpdate) {
setting.putByGroup("autoCheckUpdate", "setting.common", String.valueOf(autoCheckUpdate));
}
public boolean isDefaultMaxWindow() {
return setting.getBool("defaultMaxWindow", "setting.normal", false);
}
public void setDefaultMaxWindow(boolean defaultMaxWindow) {
setting.putByGroup("defaultMaxWindow", "setting.normal", String.valueOf(defaultMaxWindow));
}
public boolean isUnifiedBackground() {
return setting.getBool("unifiedBackground", "setting.normal", true);
}
public void setUnifiedBackground(boolean unifiedBackground) {
setting.putByGroup("unifiedBackground", "setting.normal", String.valueOf(unifiedBackground));
}
public String getBeforeVersion() {
return setting.getStr("beforeVersion", "setting.common", "0.0.0");
}
public void setBeforeVersion(String beforeVersion) {
setting.putByGroup("beforeVersion", "setting.common", beforeVersion);
}
public String getTheme() {
if (SystemUtil.isLinuxOs()) {
return setting.getStr("theme", "setting.appearance", "System Default");
} else {
return setting.getStr("theme", "setting.appearance", "Dark purple");
}
}
public void setTheme(String theme) {
setting.putByGroup("theme", "setting.appearance", theme);
}
public String getFont() {
if (SystemUtil.isLinuxOs()) {
return setting.getStr("font", "setting.appearance", "Noto Sans CJK HK");
} else {
return setting.getStr("font", "setting.appearance", "Microsoft YaHei");
}
}
public void setFont(String font) {
setting.putByGroup("font", "setting.appearance", font);
}
public int getFontSize() {
return setting.getInt("fontSize", "setting.appearance", 13);
}
public void setFontSize(int fontSize) {
setting.putByGroup("fontSize", "setting.appearance", String.valueOf(fontSize));
}
}

View File

@ -0,0 +1,33 @@
package com.luoboduner.moo.info.util;
import com.google.common.collect.Lists;
import com.luoboduner.moo.info.ui.UiConsts;
import javax.swing.*;
import java.awt.*;
import java.util.List;
/**
* <pre>
* FrameUtil
* </pre>
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class FrameUtil {
public static void setFrameIcon(JFrame jFrame) {
List<Image> images = Lists.newArrayList();
images.add(UiConsts.IMAGE_LOGO_1024);
images.add(UiConsts.IMAGE_LOGO_512);
images.add(UiConsts.IMAGE_LOGO_256);
images.add(UiConsts.IMAGE_LOGO_128);
images.add(UiConsts.IMAGE_LOGO_64);
images.add(UiConsts.IMAGE_LOGO_48);
images.add(UiConsts.IMAGE_LOGO_32);
images.add(UiConsts.IMAGE_LOGO_24);
images.add(UiConsts.IMAGE_LOGO_16);
jFrame.setIconImages(images);
}
}

View File

@ -0,0 +1,42 @@
package com.luoboduner.moo.info.util;
import java.io.File;
/**
* System util
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
public class SystemUtil {
private static final String OS_NAME = System.getProperty("os.name");
private static final String OS_ARCH = System.getProperty("os.arch");
private static final String VM_VENDOR = System.getProperty("java.vm.vendor");
private static final String USER_HOME = System.getProperty("user.home");
public static final String CONFIG_HOME = USER_HOME + File.separator + ".MooInfo";
/**
* log file dir
*/
public final static String LOG_DIR = USER_HOME + File.separator + ".MooInfo" + File.separator + "logs" + File.separator;
public static boolean isMacOs() {
return OS_NAME.contains("Mac");
}
public static boolean isMacM1() {
return OS_NAME.contains("Mac") && "aarch64".equals(OS_ARCH);
}
public static boolean isWindowsOs() {
return OS_NAME.contains("Windows");
}
public static boolean isLinuxOs() {
return OS_NAME.contains("Linux");
}
public static boolean isJBR() {
return VM_VENDOR.contains("JetBrains");
}
}

View File

@ -0,0 +1,64 @@
package com.luoboduner.moo.info.util;
import com.luoboduner.moo.info.App;
import lombok.extern.slf4j.Slf4j;
import java.awt.*;
/**
* UI custom tools
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/10.
*/
@Slf4j
public class UIUtil {
/**
* Get screen specifications
* <p>
* author by darcula@com.bulenkov
* see https://github.com/bulenkov/Darcula
*
* @return
*/
public static float getScreenScale() {
int dpi = 96;
try {
dpi = Toolkit.getDefaultToolkit().getScreenResolution();
} catch (HeadlessException var2) {
}
float scale = 1.0F;
if (dpi < 120) {
scale = 1.0F;
} else if (dpi < 144) {
scale = 1.25F;
} else if (dpi < 168) {
scale = 1.5F;
} else if (dpi < 192) {
scale = 1.75F;
} else {
scale = 2.0F;
}
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
log.info("screen dpi:{},width:{},height:{}", dpi, screenSize.getWidth(), screenSize.getHeight());
return scale;
}
/**
* the theme is dark or not
*
* @return
*/
public static boolean isDarkLaf() {
return "Darcula".equals(App.config.getTheme())
|| "Darcula(Recommended)".equals(App.config.getTheme())
|| "Flat Dark".equals(App.config.getTheme())
|| "Flat Darcula".equals(App.config.getTheme())
|| "Flat Darcula(Recommended)".equals(App.config.getTheme());
}
}

View File

@ -0,0 +1,136 @@
package com.luoboduner.moo.info.util;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.bean.VersionSummary;
import com.luoboduner.moo.info.ui.UiConsts;
import com.luoboduner.moo.info.ui.dialog.UpdateInfoDialog;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.swing.*;
import java.util.List;
import java.util.Map;
/**
* Upgrade tool class
*
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/08.
*/
@Slf4j
public class UpgradeUtil {
public static void checkUpdate(boolean initCheck) {
// current version
String currentVersion = UiConsts.APP_VERSION;
// Get information about the latest version from github
String versionSummaryJsonContent = HttpUtil.get(UiConsts.CHECK_VERSION_URL);
if (StringUtils.isEmpty(versionSummaryJsonContent) && !initCheck) {
JOptionPane.showMessageDialog(App.mainFrame,
"Check for timeouts, follow GitHub Release!", "Network error",
JOptionPane.INFORMATION_MESSAGE);
return;
} else if (StringUtils.isEmpty(versionSummaryJsonContent) || versionSummaryJsonContent.contains("404: Not Found")) {
return;
}
versionSummaryJsonContent = versionSummaryJsonContent.replace("\n", "");
VersionSummary versionSummary = JSON.parseObject(versionSummaryJsonContent, VersionSummary.class);
// The latest version
String newVersion = versionSummary.getCurrentVersion();
String versionIndexJsonContent = versionSummary.getVersionIndex();
// Version index
Map<String, String> versionIndexMap = JSON.parseObject(versionIndexJsonContent, Map.class);
// list of version details
List<VersionSummary.Version> versionDetailList = versionSummary.getVersionDetailList();
if (newVersion.compareTo(currentVersion) > 0) {
// The current version index
int currentVersionIndex = Integer.parseInt(versionIndexMap.get(currentVersion));
// Version update log:
StringBuilder versionLogBuilder = new StringBuilder("<h1>Surprise the new version! Download it now?</h1>");
VersionSummary.Version version;
for (int i = currentVersionIndex + 1; i < versionDetailList.size(); i++) {
version = versionDetailList.get(i);
versionLogBuilder.append("<h2>").append(version.getVersion()).append("</h2>");
versionLogBuilder.append("<b>").append(version.getTitle()).append("</b><br/>");
versionLogBuilder.append("<p>").append(version.getLog().replaceAll("\\n", "</p><p>")).append("</p>");
}
String versionLog = versionLogBuilder.toString();
UpdateInfoDialog updateInfoDialog = new UpdateInfoDialog();
updateInfoDialog.setHtmlText(versionLog);
updateInfoDialog.setNewVersion(newVersion);
updateInfoDialog.pack();
updateInfoDialog.setVisible(true);
} else {
if (!initCheck) {
JOptionPane.showMessageDialog(App.mainFrame,
"It's the latest version!", "Congratulations",
JOptionPane.INFORMATION_MESSAGE);
}
}
}
/**
* Smooth upgrade
* The version update scripts and sql methods involved are as idempotent as possible to avoid repeated upgrade operations due to unusual interruptions such as power failures and deaths during the upgrade process
*/
public static void smoothUpgrade() {
// Get the current version
String currentVersion = UiConsts.APP_VERSION;
// Get the before upgrade version
String beforeVersion = App.config.getBeforeVersion();
if (currentVersion.compareTo(beforeVersion) <= 0) {
// If both are consistent, no upgrade action is performed
return;
} else {
log.info("Smooth upgrade begins");
// Then take the index for both versions
String versionSummaryJsonContent = FileUtil.readString(UiConsts.class.getResource("/version_summary.json"), CharsetUtil.UTF_8);
versionSummaryJsonContent = versionSummaryJsonContent.replace("\n", "");
VersionSummary versionSummary = JSON.parseObject(versionSummaryJsonContent, VersionSummary.class);
String versionIndex = versionSummary.getVersionIndex();
Map<String, String> versionIndexMap = JSON.parseObject(versionIndex, Map.class);
int currentVersionIndex = Integer.parseInt(versionIndexMap.get(currentVersion));
int beforeVersionIndex = Integer.parseInt(versionIndexMap.get(beforeVersion));
log.info("Older version{}", beforeVersion);
log.info("Current version{}", currentVersion);
// Traverses the index range
beforeVersionIndex++;
for (int i = beforeVersionIndex; i <= currentVersionIndex; i++) {
log.info("Update the version index {} begin", i);
// Perform updates to each version index, from far to nearby time
upgrade(i);
log.info("Update the version index {} finished", i);
}
// If the upgrade is complete and successful, the version number prior to the upgrade is assigned to the current version
App.config.setBeforeVersion(currentVersion);
App.config.save();
log.info("Smooth upgrade ends");
}
}
/**
* Execute the upgrade script
*
* @param versionIndex Version index
*/
private static void upgrade(int versionIndex) {
log.info("Start with the upgrade script, version index:{}", versionIndex);
switch (versionIndex) {
case 21:
break;
default:
}
log.info("The upgrade script ends, the version index:{}", versionIndex);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,293 @@
{
"name": "Cyan light",
"dark": false,
"author": "Olga Berdnikova",
"editorScheme": "/themes/cyanScheme.xml",
"ui": {
"*": {
"background": "#e4e6eb",
"foreground": "#1d1d1d",
"selectionBackground": "#3eb2c2",
"selectionBackgroundInactive": "#d0d5db",
"selectionInactiveBackground": "#d0d5db",
"lightSelectionBackground": "#d3e4eb",
"disabledForeground": "#b1b1b1",
"disabledText": "#b1b1b1",
"inactiveForeground": "#b1b1b1",
"infoForeground": "#787878",
"modifiedItemForeground": "#00a9bf",
"separatorColor": "#bec5cd",
"borderColor": "#bec5cd",
"underlineColor": "#0ab0d1"
},
"ActionButton": {
"hoverBackground": "#d0d3d9",
"hoverBorderColor": "#d0d3d9",
"pressedBackground": "#c3c7cf",
"pressedBorderColor": "#c3c7cf"
},
"Borders": {
"color": "#bec5cd",
"ContrastBorderColor": "#bec5cd"
},
"Button": {
"startBorderColor": "#b0b9c3",
"endBorderColor": "#b0b9c3",
"default": {
"foreground": "#FFFFFF",
"startBackground": "#28a4c3",
"endBackground": "#28a4c3",
"startBorderColor": "#258aa4",
"endBorderColor": "#258aa4",
"focusedBorderColor": "#82d3dd"
}
},
"ComboBox": {
"background": "#eef0f4",
"nonEditableBackground": "#FFFFFF",
"ArrowButton.background": "#FFFFFF"
},
"ComboBoxButton.background": "#FFFFFF",
"ComboPopup.border": "1,1,1,1,b0b9c3",
"CompletionPopup": {
"foreground": "#404040",
"infoForeground": "#8c8c8c",
"selectionBackground": "#bce2e6",
"selectionInactiveBackground": "#d7dbe0",
"matchForeground": "#00a0d1",
"selectionForeground": "#404040",
"selectionInfoForeground": "#8c8c8c",
"matchSelectionForeground": "#00a0d1"
},
"Component": {
"borderColor": "#b0b9c3",
"focusedBorderColor": "#31b1d0",
"focusColor": "#5fc5de"
},
"Counter": {
"background": "#9AA7B0",
"foreground": "#FFFFFF"
},
"DefaultTabs": {
"inactiveUnderlineColor": "#8699a6",
"hoverBackground": "#ced2d9"
},
"DragAndDrop": {
"areaBackground": "#4cb2c733"
},
"Editor": {
"background": "#d0d3d9",
"foreground": "#808080",
"shortcutForeground": "#1b9bb6"
},
"EditorPane.inactiveBackground": "#e4e6eb",
"EditorTabs": {
"selectedBackground": "#f3f3f3",
"inactiveMaskColor": "#4752661A",
"underlineColor": "#29abcb",
"underlinedTabBackground": "#f2f4f5",
"inactiveColoredFileBackground": "#a6a9b350",
"hoverBackground": "#b9bdc999"
},
"DebuggerTabs.selectedBackground": "#e4e6eb",
"FileColor.Yellow": "#f2efda",
"FileColor.Green": "#d8f0e2",
"FileColor.Blue": "#d3f0f4",
"Label.errorForeground": "#C7222D",
"Link": {
"activeForeground": "#009eb3",
"hoverForeground": "#009eb3",
"pressedForeground": "#009eb3",
"visitedForeground": "#009eb3",
"secondaryForeground": "#7ac2cc"
},
"List.background": "#eef0f4",
"Notification": {
"MoreButton.innerBorderColor": "#bec5cd",
"errorBackground": "#f5e1e4",
"errorBorderColor": "#e695a3",
"ToolWindow": {
"informativeBackground": "#ccedcf",
"informativeBorderColor": "#8ebd91",
"warningBackground": "#f0e4c0",
"warningBorderColor": "#d9b857",
"errorBackground": "#fad7dd",
"errorBorderColor": "#e68a99"
}
},
"PasswordField.background": "#FFFFFF",
"Plugins": {
"background": "#f5f7fa",
"SearchField.background": "#FFFFFF",
"SectionHeader.foreground": "#808080",
"SectionHeader.background": "#edeef2",
"Tab.selectedBackground": "#cacccf",
"Tab.hoverBackground": "#cacccf"
},
"Popup": {
"Header": {
"activeBackground": "#d6dae5",
"inactiveBackground": "#d6dae5"
},
"separatorColor": "#bec5cd",
"separatorForeground": "#919699",
"Advertiser": {
"foreground": "#787878",
"background": "#e4e6eb",
"borderColor": "#e4e6eb"
}
},
"ProgressBar": {
"trackColor": "#c4c9d5",
"progressColor": "#2b9cb8",
"indeterminateStartColor": "#b8dde6",
"indeterminateEndColor": "#2b9cb8",
"passedEndColor": "#bcebd5",
"passedColor": "#1eb070",
"failedEndColor": "#e6b8bf",
"failedColor": "#dc445d"
},
"SearchEverywhere": {
"SearchField.background": "#FFFFFF",
"Tab.selectedBackground": "#d1d4d4",
"Advertiser.foreground": "#787878"
},
"SearchMatch": {
"startBackground": "#ffc466",
"endBackground": "#FFC466"
},
"SidePanel.background": "#e4e6eb",
"SpeedSearch": {
"background": "#FFFFFF",
"errorForeground": "#C7222D"
},
"TabbedPane": {
"hoverColor": "#ced2d9",
"focusColor": "#dbebed",
"contentAreaColor": "#bec5cd"
},
"Table": {
"background": "#eef0f4",
"hoverBackground": "#C3D2E366"
},
"TableHeader": {
"cellBorder": "3,0,3,0",
"background": "#e9ecf0",
"bottomSeparatorColor": "#dfe2e6"
},
"TextArea.background": "#FFFFFF",
"TextField.background": "#FFFFFF",
"ToggleButton": {
"onBackground": "#28a4c3",
"offForeground": "#787878",
"buttonColor": "#b0b9c3",
"borderColor": "#b0b9c3"
},
"ToolTip": {
"background": "#f3f6fb",
"Actions.background": "#e4e6eb"
},
"ToolWindow": {
"Header": {
"background": "#d8dee8",
"inactiveBackground": "#e4e6eb"
},
"HeaderTab": {
"selectedBackground": "#b9bec7",
"hoverBackground": "#b9bdc999",
"selectedInactiveBackground": "#CED1D6",
"hoverInactiveBackground": "#b9bdc999"
},
"Button": {
"selectedBackground": "#C3C6C9",
"hoverBackground": "#C3C6C9"
}
},
"Tree.background": "#eef0f4",
"WelcomeScreen": {
"Details.background": "#eef0f4",
"Projects.actions.background": "#E1E4EB"
}
},
"icons": {
"ColorPalette": {
"Actions.Grey": "#696d78",
"Actions.Red": "#e0516b",
"Actions.Blue": "#348def",
"Actions.Green": "#29a66c",
"Actions.Yellow": "#e3b610",
"Objects.Grey": "#858994",
"Objects.RedStatus": "#dc445d",
"Objects.Red": "#de4765",
"Objects.Pink": "#f070a5",
"Objects.Yellow": "#e6ba29",
"Objects.Green": "#1eb070",
"Objects.Blue": "#499df2",
"Objects.Purple": "#bc8af2",
"Objects.YellowDark": "#b79108",
"Objects.BlackText": "#26282b",
"Checkbox.Background.Default": "#f3f3f3",
"Checkbox.Border.Default": "#8a9199",
"Checkbox.Background.Selected": "#28a4c3",
"Checkbox.Border.Selected": "#2896b2",
"Checkbox.Foreground.Selected": "#FFFFFF",
"Checkbox.Focus.Wide": "#5fc5de",
"Checkbox.Focus.Thin.Default": "#98a0aa4c",
"Checkbox.Focus.Thin.Selected": "#82d3dd",
"Checkbox.Background.Disabled": "#e4e6eb",
"Checkbox.Border.Disabled": "#babfc4",
"Checkbox.Foreground.Disabled": "#babfc4"
}
}
}

View File

@ -0,0 +1,421 @@
{
"name": "Dark purple",
"dark": true,
"author": "JetBrains",
"editorScheme": "/themes/darkPurpleScheme.xml",
"ui": {
"*": {
"background": "#2C2C3B",
"foreground": "#D0D0D9",
"infoForeground": "#6d6a80",
"selectionBackground": "#713a91",
"selectionForeground": "#D0D0D9",
"selectionInactiveBackground": "#3d3952",
"selectionBackgroundInactive": "#3d3952",
"lightSelectionBackground": "#3a324a",
"lightSelectionForeground": "#D0D0D9",
"lightSelectionInactiveBackground": "#3d3952",
"lightSelectionInactiveForeground":"#D0D0D9",
"disabledBackground": "#2C2C3B",
"inactiveBackground": "#2C2C3B",
"disabledForeground": "#646078",
"disabledText": "#646078",
"inactiveForeground": "#646078",
"acceleratorForeground": "#D0D0D9",
"acceleratorSelectionForeground": "#D0D0D9",
"errorForeground": "#dd3962",
"borderColor": "#4E4C63",
"disabledBorderColor": "#45405C",
"focusColor": "#693687",
"focusedBorderColor": "#814F9E",
"separatorForeground": "#6d6a80",
"separatorColor": "#4e4b61",
"lineSeparatorColor": "#55506b",
"modifiedItemForeground": "#b279f2"
},
"ActionButton": {
"hoverBackground": "#453e57",
"hoverBorderColor": "#453E57",
"pressedBackground": "#49415c",
"pressedBorderColor": "#49415C",
"focusedBorderColor": "#476fcc"
},
"Button": {
"startBackground": "#45405C",
"endBackground": "#45405C",
"startBorderColor": "#544F70",
"endBorderColor": "#544F70",
"shadowColor": "#27282B",
"default": {
"foreground": "#D0D0D9",
"startBackground": "#6B388F",
"endBackground": "#6B388F",
"startBorderColor": "#7C519C",
"endBorderColor": "#7C519C",
"focusedBorderColor": "#8465a6",
"focusColor": "#784299",
"shadowColor": "#27282B"
}
},
"Borders": {
"color": "#1a1721",
"ContrastBorderColor": "#1a1721"
},
"ComboBox": {
"nonEditableBackground": "#3A384D",
"background": "#343445",
"ArrowButton": {
"iconColor": "#9A97A8",
"disabledIconColor": "#454554",
"nonEditableBackground": "#3A384D"
}
},
"ComboPopup.border": "1,1,1,1,64647A",
"CompletionPopup": {
"matchForeground": "#ED94FF",
"matchSelectionForeground": "#ED94FF",
"selectionInactiveBackground": "#44405c",
"nonFocusedMask": "#00000033",
"selectionBackground": "#623380"
},
"Component": {
"errorFocusColor": "#993750",
"inactiveErrorFocusColor": "#522530",
"warningFocusColor": "#8c812b",
"inactiveWarningFocusColor": "#47441f",
"iconColor": "#77728fCC",
"hoverIconColor": "#8b85a6"
},
"Counter": {
"background": "#FFFFFF80",
"foreground": "#000000"
},
"DebuggerPopup.borderColor": "#524e66",
"DebuggerTabs.selectedBackground": "#332C40",
"DefaultTabs": {
"underlineColor": "#9649cc",
"inactiveUnderlineColor": "#877399",
"hoverBackground": "#dfb3ff1a"
},
"DragAndDrop": {
"areaForeground": "#D0D0D9",
"areaBackground": "#5d476680",
"areaBorderColor": "#343142"
},
"Editor": {
"background": "#1D1D26",
"foreground": "#6d6a80",
"shortcutForeground": "#6E86FF"
},
"EditorPane.inactiveBackground": "#2C2C3B",
"EditorTabs": {
"selectedForeground": "#D0D0D9",
"selectedBackground": "#343445",
"inactiveMaskColor": "#0d0d0d33",
"underlineColor": "#904ac2",
"underlinedTabBackground": "#363647",
"inactiveColoredFileBackground": "#2C2C3B80",
"borderColor": "#1a1721"
},
"FileColor": {
"Yellow": "#45243b",
"Green": "#213d37",
"Blue": "#1f3557",
"Violet": "#2a2754",
"Orange": "#402e23",
"Rose": "#4a2d59"
},
"InplaceRefactoringPopup.borderColor": "#474359",
"Link": {
"activeForeground": "#7094ff",
"hoverForeground": "#7094FF",
"pressedForeground": "#7094FF",
"visitedForeground": "#7094FF"
},
"MenuBar.borderColor": "#1a1721",
"NavBar.borderColor": "#1a1721",
"Notification": {
"background": "#3d394d",
"borderColor": "#57506e",
"errorForeground": "#D0D0D9",
"errorBackground": "#4d232e",
"errorBorderColor": "#802e44",
"MoreButton.innerBorderColor": "#1a1721",
"ToolWindow": {
"informativeForeground": "#D0D0D9",
"informativeBackground": "#2e4280",
"informativeBorderColor": "#17254d",
"warningForeground": "#D0D0D9",
"warningBackground": "#735822",
"warningBorderColor": "#403013",
"errorForeground": "#D0D0D9",
"errorBackground": "#802d43",
"errorBorderColor": "#4d1c2b"
}
},
"MemoryIndicator": {
"allocatedBackground": "#352140",
"usedBackground": "#533473"
},
"ParameterInfo": {
"background": "#463f57",
"foreground": "#ababb3",
"infoForeground": "ababb3",
"currentOverloadBackground": "#6A6173",
"currentParameterForeground": "#D0D0D9"
},
"Plugins": {
"Tab": {
"selectedForeground": "#D0D0D9",
"selectedBackground": "#593f73",
"hoverBackground": "#593F73"
},
"SearchField.borderColor": "#1a1721",
"SearchField.background": "#252533",
"SectionHeader.background": "#3d3952",
"tagBackground": "#4c4766",
"tagForeground": "#D0D0D9",
"Button": {
"installForeground": "#8862b3",
"installBorderColor":"#8862b3",
"installFillForeground": "#D0D0D9",
"installFillBackground": "#713a91",
"updateForeground":"#D0D0D9",
"updateBackground": "#713a91",
"updateBorderColor": "#713a91"
}
},
"Popup": {
"paintBorder": true,
"borderColor": "#4e4b61",
"inactiveBorderColor": "#343142",
"Toolbar.borderColor": "#1a1721",
"Header.activeBackground": "#453A5C",
"Header.inactiveBackground": "#453A5C",
"Advertiser": {
"foreground": "#8785a6",
"borderColor": "#4e4b61",
"borderInsets": "4,8,3,0"
}
},
"PopupMenu": {
"borderWidth": 1,
"borderInsets": "4,1,4,1"
},
"ProgressBar": {
"trackColor": "#1D1D26",
"progressColor": "#a85ed6",
"indeterminateStartColor": "#a85ed6",
"indeterminateEndColor": "#402e4d",
"failedColor": "#bd3c5f",
"failedEndColor": "#472c33",
"passedColor": "#239E62",
"passedEndColor": "#2b4242"
},
"SearchEverywhere": {
"Header.background": "#3a394d",
"Tab": {
"selectedForeground": "#D0D0D9",
"selectedBackground": "#5c3d7a"
},
"SearchField":{
"background": "#252533",
"borderColor": "#1a1721"
},
"Advertiser.foreground": "#8785a6"
},
"SearchMatch": {
"startBackground": "#cca929",
"endBackground": "#cca929"
},
"SearchOption.selectedBackground": "#424885",
"SpeedSearch": {
"foreground": "#D0D0D9",
"borderColor": "#69418c",
"background": "#5c3a7a",
"errorForeground": "#ff80a1"
},
"StatusBar.borderColor": "#1a1721",
"TabbedPane": {
"underlineColor": "#9649cc",
"disabledUnderlineColor": "#5e5b6b",
"contentAreaColor": "#1a1721",
"hoverColor": "#dfb3ff1a",
"focusColor": "#523366"
},
"TableHeader": {
"cellBorder": "3,0,3,0",
"background": "#363445",
"separatorColor": "#1a1721",
"bottomSeparatorColor": "#282430"
},
"Table": {
"stripeColor": "#323242",
"hoverBackground": "#00000028"
},
"TextArea": {
"background": "#3A384D",
"selectionBackground": "#69418c"
},
"TextField": {
"background": "#3A384D",
"selectionBackground": "#69418c"
},
"ToggleButton": {
"onForeground": "#D0D0D9",
"onBackground": "#543073",
"offForeground": "#9f9fa6",
"offBackground": "#2C2C3B",
"buttonColor": "#666380",
"borderColor": "#666380"
},
"ToolTip": {
"background": "#463f57",
"Actions.background": "#323245",
"infoForeground": "#8985a1",
"shortcutForeground": "#8985A1"
},
"ToolWindow": {
"Header": {
"background": "#453A5C",
"inactiveBackground": "#2C2C3B",
"borderColor": "#1a1721"
},
"HeaderTab": {
"selectedBackground": "#0a0a0a66",
"selectedInactiveBackground": "#0a0a0a4D",
"hoverBackground": "#dfb3ff1a",
"hoverInactiveBackground": "#dfb3ff1a"
},
"Button": {
"hoverBackground": "#1e1e24",
"selectedBackground": "#1e1e24",
"selectedForeground": "#D0D0D9"
}
},
"Tree.rowHeight": 20,
"ValidationTooltip": {
"errorBackground": "#802d43",
"errorBorderColor": "#4d1c2b",
"warningBackground": "#735822",
"warningBorderColor": "#403013"
},
"VersionControl": {
"Log.Commit": {
"currentBranchBackground": "#202340",
"unmatchedForeground": "#6d6a80",
"hoveredBackground": "#000000B9"
},
"FileHistory.Commit.selectedBranchBackground": "#202340"
},
"WelcomeScreen": {
"Projects.selectionInactiveBackground": "#713a91",
"separatorColor": "#1a1721",
"Details.background": "#26262E",
"Projects.actions.background": "#343445"
}
},
"icons": {
"ColorPalette": {
"Actions.Grey": "#a4a1b3",
"Actions.Red": "#c63a5d",
"Actions.Yellow": "#caba2d",
"Actions.Green": "#25ad6b",
"Actions.Blue": "#4d85ff",
"Actions.GreyInline.Dark": "#9f99bfb3",
"Objects.Grey": "#9790ad",
"Objects.RedStatus": "#dd3962",
"Objects.Red": "#c63a5d",
"Objects.Pink": "#f98b9e",
"Objects.Yellow": "#caba2d",
"Objects.Green": "#239e62",
"Objects.Blue": "#598bff",
"Objects.Purple": "#af71e0",
"Objects.BlackText": "#000000ff",
"Objects.YellowDark": "#988c26",
"Objects.GreenAndroid": "#78c257",
"Checkbox.Background.Default.Dark": "#343445",
"Checkbox.Border.Default.Dark": "#756b8c",
"Checkbox.Foreground.Selected.Dark": "#a4a1b3",
"Checkbox.Focus.Wide.Dark": "#723b94",
"Checkbox.Focus.Thin.Default.Dark": "#8a64b3",
"Checkbox.Focus.Thin.Selected.Dark": "#8a64b3",
"Checkbox.Background.Disabled.Dark": "#2C2C3B",
"Checkbox.Border.Disabled.Dark": "#4c4766",
"Checkbox.Foreground.Disabled.Dark": "#565073"
}
}
}

View File

@ -0,0 +1,145 @@
{
"name": "IntelliJ Light",
"dark": false,
"author": "JetBrains",
"editorScheme": "/themes/Light.xml",
"colors": {
"foreground": "#000000",
"infoPanelForeground": "#808080",
"infoInputForeground": "#999999",
"disabledForeground": "#8C8C8C",
"selectionForeground": "#FFFFFF",
"linkForeground": "#2470B3",
"border": "#D1D1D1",
"componentBorder": "#C4C4C4",
"lightBorder": "#d9d9d9",
"windowsPopupBorder": "#adadad",
"panel": "#F2F2F2"
},
"ui": {
"*": {
"foreground": "foreground",
"acceleratorForeground": "foreground",
"caretForeground": "foreground",
"selectedForeground": "foreground",
"selectionInactiveForeground": "foreground",
"selectionBackground": "#2675BF",
"selectionBackgroundInactive": "#D5D5D5",
"selectionInactiveBackground": "#D5D5D5",
"disabledForeground": "disabledForeground",
"disabledText": "disabledForeground",
"inactiveForeground": "disabledForeground",
"modifiedItemForeground": "#005ad9",
"acceleratorSelectionForeground": "selectionForeground",
"separatorColor": "border",
"separatorForeground": "infoInputForeground"
},
"Borders": {
"color": "border",
"ContrastBorderColor": "border"
},
"Button": {
"shadowColor": "#A6A6A600",
"startBorderColor": "componentBorder",
"endBorderColor": "componentBorder",
"default": {
"foreground": "selectionForeground",
"startBackground": "#528CC7",
"endBackground": "#4989CC",
"startBorderColor": "#487EB8",
"endBorderColor": "#346DAD",
"shadowColor": "#A6A6A600",
"focusedBorderColor": "#A9C9F5"
}
},
"ComboBox": {
"background": "#FFFFFF",
"nonEditableBackground": "#FFFFFF",
"ArrowButton.background": "#fafafa"
},
"ComboBoxButton.background": "#FFFFFF",
"CompletionPopup": {
"selectionBackground": "#c5dffc",
"selectionInactiveBackground": "#e0e0e0"
},
"Component": {
"borderColor": "componentBorder",
"infoForeground": "infoInputForeground"
},
"DefaultTabs.background": "panel",
"EditorTabs.underlinedTabBackground": "#ffffff",
"Editor": {
"background": "#cccccc",
"foreground": "#737373",
"shortcutForeground": "#4274A6"
},
"Label": {
"errorForeground": "#C7222D",
"infoForeground": "infoPanelForeground"
},
"Link": {
"activeForeground": "linkForeground",
"hoverForeground": "linkForeground",
"pressedForeground": "linkForeground",
"visitedForeground": "linkForeground",
"secondaryForeground": "#77a8d9"
},
"Notification": {
"borderColor": "border"
},
"Menu.borderColor": "lightBorder",
"Panel.background": "panel",
"PasswordField.background": "#FFFFFF",
"Popup": {
"separatorColor": "lightBorder",
"Advertiser.borderColor": "border",
"borderColor": "windowsPopupBorder"
},
"ProgressBar": {
"trackColor": "#D1D1D1",
"progressColor": "#1E82E6",
"indeterminateStartColor": "#91C5F2",
"indeterminateEndColor": "#1E82E6"
},
"StatusBar.borderColor": "border",
"ToolWindow.Header.inactiveBackground": "panel",
"Tree.rowHeight": 20
},
"icons": {
"ColorPalette": {
"Checkbox.Border.Default": "#b0b0b0",
"Checkbox.Background.Selected": "#4F9EE3",
"Checkbox.Border.Selected": "#4B97D9"
}
}
}

View File

@ -0,0 +1,19 @@
{
"currentVersion": "1.0.0",
"versionIndex": {
"0.0.0": "0",
"1.0.0": "1"
},
"versionDetailList": [
{
"version": "0.0.0",
"title": "The underlying version",
"log": "The underlying version\n"
},
{
"version": "1.0.0",
"title": "The first version",
"log": "The first version\n"
}
]
}