Skip to content

Commit

Permalink
Merge pull request #19 from rememberber/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rememberber authored Jul 24, 2023
2 parents 696076e + 8178acb commit d6f3638
Show file tree
Hide file tree
Showing 19 changed files with 195 additions and 90 deletions.
129 changes: 66 additions & 63 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.luoboduner.moo.info</groupId>
<artifactId>MooInfo</artifactId>
<version>1.1.2</version>
<version>1.1.3</version>
<packaging>jar</packaging>

<name>MooInfo</name>
Expand All @@ -15,22 +15,22 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

<logback.version>1.2.10</logback.version>
<logback.version>1.4.5</logback.version>
<forms_rt.version>7.0.3</forms_rt.version>
<lombok.version>1.18.22</lombok.version>
<junit-jupiter-api.version>5.8.2</junit-jupiter-api.version>
<lombok.version>1.18.24</lombok.version>
<junit-jupiter-api.version>5.9.1</junit-jupiter-api.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<guava.version>31.0.1-jre</guava.version>
<okhttp.version>4.9.3</okhttp.version>
<flatlaf.version>2.1</flatlaf.version>
<flatlaf-extras.version>2.1</flatlaf-extras.version>
<flatlaf-intellij-themes.version>2.1</flatlaf-intellij-themes.version>
<hutool-all.version>5.7.21</hutool-all.version>
<fastjson.version>1.2.79</fastjson.version>
<oshi-core.version>6.1.5</oshi-core.version>
<guava.version>31.1-jre</guava.version>
<okhttp.version>4.10.0</okhttp.version>
<flatlaf.version>3.1.1</flatlaf.version>
<flatlaf-extras.version>3.1.1</flatlaf-extras.version>
<flatlaf-intellij-themes.version>3.1.1</flatlaf-intellij-themes.version>
<hutool-all.version>5.8.11</hutool-all.version>
<fastjson.version>2.0.22</fastjson.version>
<oshi-core.version>6.4.4</oshi-core.version>
<jfreechart.version>1.5.3</jfreechart.version>
</properties>

Expand Down Expand Up @@ -78,12 +78,12 @@
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
<exclusions>
<exclusion>
<artifactId>kotlin-stdlib</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
</exclusion>
</exclusions>
<!-- <exclusions>-->
<!-- <exclusion>-->
<!-- <artifactId>kotlin-stdlib</artifactId>-->
<!-- <groupId>org.jetbrains.kotlin</groupId>-->
<!-- </exclusion>-->
<!-- </exclusions>-->
</dependency>

<dependency>
Expand Down Expand Up @@ -134,55 +134,57 @@
<plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.5</version>
<version>1.7.2</version>
<configuration>
<bundleJre>true</bundleJre>
<mainClass>com.luoboduner.moo.info.App</mainClass>
<generateInstaller>true</generateInstaller>
</configuration>
<executions>
<!-- <execution>-->
<!-- <id>bundling-for-windows</id>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>package</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <platform>windows</platform>-->
<!-- <createZipball>true</createZipball>-->
<!-- &lt;!&ndash; <administratorRequired>true</administratorRequired>&ndash;&gt;-->
<!-- <winConfig>-->

<!-- &lt;!&ndash; general properties &ndash;&gt;-->
<!-- <generateSetup>true</generateSetup>-->
<!-- <generateMsi>true</generateMsi>-->
<!-- <generateMsm>true</generateMsm>-->

<!-- &lt;!&ndash; setup generation properties &ndash;&gt;-->
<!-- <setupMode>installForAllUsers</setupMode>-->
<!-- <createDesktopIconTask>true</createDesktopIconTask>-->
<!-- <disableDirPage>false</disableDirPage>-->
<!-- <disableFinishedPage>false</disableFinishedPage>-->
<!-- <removeOldLibs>true</removeOldLibs>-->
<!-- <setupLanguages>-->
<!-- <english>compiler:Default.isl</english>-->
<!-- &lt;!&ndash; <spanish>compiler:Languages\Chinese.isl</spanish>&ndash;&gt;-->
<!-- </setupLanguages>-->
<!-- </winConfig>-->
<!-- </configuration>-->
<!-- </execution>-->
<execution>
<id>bundling-for-linux</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>linux</platform>
<createTarball>true</createTarball>
<!-- <jdkPath>X:\\path\to\linux\jdk</jdkPath>-->
</configuration>
</execution>
<execution>
<id>bundling-for-windows</id>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>windows</platform>
<createZipball>true</createZipball>
<additionalModules>jdk.crypto.ec</additionalModules>
<!-- <administratorRequired>true</administratorRequired>-->
<winConfig>

<!-- general properties -->
<generateSetup>true</generateSetup>
<generateMsi>true</generateMsi>
<generateMsm>true</generateMsm>

<!-- setup generation properties -->
<setupMode>installForAllUsers</setupMode>
<createDesktopIconTask>true</createDesktopIconTask>
<disableDirPage>false</disableDirPage>
<disableFinishedPage>false</disableFinishedPage>
<removeOldLibs>true</removeOldLibs>
<setupLanguages>
<english>compiler:Default.isl</english>
<!-- <spanish>compiler:Languages\Chinese.isl</spanish>-->
</setupLanguages>
</winConfig>
</configuration>
</execution>
<!-- <execution>-->
<!-- <id>bundling-for-linux</id>-->
<!-- <phase>package</phase>-->
<!-- <goals>-->
<!-- <goal>package</goal>-->
<!-- </goals>-->
<!-- <configuration>-->
<!-- <platform>linux</platform>-->
<!-- <createTarball>true</createTarball>-->
<!-- <additionalModules>jdk.crypto.ec</additionalModules>-->
<!-- &lt;!&ndash; <jdkPath>X:\\path\to\linux\jdk</jdkPath>&ndash;&gt;-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- <execution>-->
<!-- <id>bundling-for-mac</id>-->
<!-- <phase>package</phase>-->
Expand All @@ -192,6 +194,7 @@
<!-- <configuration>-->
<!-- <platform>mac</platform>-->
<!-- <createTarball>true</createTarball>-->
<!-- <additionalModules>jdk.crypto.ec</additionalModules>-->
<!-- &lt;!&ndash; <jdkPath>X:\\path\to\mac\jdk</jdkPath>&ndash;&gt;-->
<!-- </configuration>-->
<!-- </execution>-->
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/com/luoboduner/moo/info/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ public static void main(String[] args) {
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("apple.awt.application.name", "MooInfo");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "MooInfo");
if (UIUtil.isDarkLaf()) {
System.setProperty("apple.awt.application.appearance", "system");
}
System.setProperty("apple.awt.application.appearance", "system");

FlatDesktop.setAboutHandler(() -> {
try {
Expand Down Expand Up @@ -73,8 +71,8 @@ public static void main(String[] args) {
Init.initTheme();

// install inspectors
FlatInspector.install( "ctrl shift alt X" );
FlatUIDefaultsInspector.install( "ctrl shift alt Y" );
FlatInspector.install("ctrl shift alt X");
FlatUIDefaultsInspector.install("ctrl shift alt Y");

mainFrame = new MainFrame();
mainFrame.init();
Expand Down
24 changes: 19 additions & 5 deletions src/main/java/com/luoboduner/moo/info/ui/Init.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.formdev.flatlaf.*;
import com.formdev.flatlaf.FlatDarculaLaf;
import com.formdev.flatlaf.FlatDarkLaf;
import com.formdev.flatlaf.FlatIntelliJLaf;
import com.formdev.flatlaf.FlatLightLaf;
import com.formdev.flatlaf.extras.FlatSVGIcon;
import com.formdev.flatlaf.intellijthemes.FlatCyanLightIJTheme;
import com.formdev.flatlaf.intellijthemes.FlatDarkPurpleIJTheme;
import com.formdev.flatlaf.intellijthemes.FlatLightFlatIJTheme;
import com.formdev.flatlaf.intellijthemes.*;
import com.formdev.flatlaf.themes.FlatMacDarkLaf;
import com.formdev.flatlaf.themes.FlatMacLightLaf;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.ui.component.TopMenuBar;
import com.luoboduner.moo.info.ui.form.*;
Expand Down Expand Up @@ -111,7 +114,18 @@ public static void initTheme() {
case "IntelliJ Light":
FlatLightFlatIJTheme.setup();
break;

case "Xcode-Dark":
FlatXcodeDarkIJTheme.setup();
break;
case "Vuesion":
FlatVuesionIJTheme.setup();
break;
case "Flat macOS Light":
FlatMacLightLaf.setup();
break;
case "Flat macOS Dark":
FlatMacDarkLaf.setup();
break;
default:
FlatDarculaLaf.setup();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/luoboduner/moo/info/ui/UiConsts.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
public class UiConsts {

public static final String APP_NAME = "MooInfo";
public static final String APP_VERSION = "1.1.2";
public static final String APP_VERSION = "1.1.3";

public static final int TABLE_ROW_HEIGHT = 36;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ public class TopMenuBar extends JMenuBar {
"Flat Darcula(Recommended)",
"Dark purple",
"IntelliJ Cyan",
"IntelliJ Light"};
"IntelliJ Light",
"Xcode-Dark",
"Vuesion",
"Flat macOS Light",
"Flat macOS Dark"};

private static String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<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="0" left="0" bottom="0" right="0"/>
<margin top="10" left="10" bottom="0" right="0"/>
<constraints/>
<properties/>
<border type="empty"/>
Expand Down
13 changes: 12 additions & 1 deletion src/main/java/com/luoboduner/moo/info/ui/dialog/AboutDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import cn.hutool.core.thread.ThreadUtil;
import com.formdev.flatlaf.extras.FlatSVGIcon;
import com.formdev.flatlaf.util.SystemInfo;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.ui.UiConsts;
import com.luoboduner.moo.info.util.ComponentUtil;
import com.luoboduner.moo.info.util.ScrollUtil;
import com.luoboduner.moo.info.util.SystemUtil;
import com.luoboduner.moo.info.util.UpgradeUtil;

import javax.swing.*;
Expand Down Expand Up @@ -47,6 +49,15 @@ public AboutDialog() {
setContentPane(contentPane);
setModal(true);

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

setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
Expand Down Expand Up @@ -359,7 +370,7 @@ private void onOK() {
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(0, 0, 0, 0), -1, -1));
panel1.setLayout(new GridLayoutManager(9, 2, new Insets(10, 10, 0, 0), -1, -1));
scrollPane.setViewportView(panel1);
panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(), null, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
logoLabel = new JLabel();
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/luoboduner/moo/info/ui/dialog/SettingDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.formdev.flatlaf.util.SystemInfo;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import com.luoboduner.moo.info.App;
import com.luoboduner.moo.info.util.ComponentUtil;
import com.luoboduner.moo.info.util.ScrollUtil;
import com.luoboduner.moo.info.util.SystemUtil;

import javax.swing.*;
import javax.swing.border.TitledBorder;
Expand Down Expand Up @@ -35,6 +37,15 @@ public SettingDialog() {
setContentPane(contentPane);
setModal(true);

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

setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<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"/>
<margin top="0" left="0" bottom="10" right="10"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
Expand Down
Loading

0 comments on commit d6f3638

Please sign in to comment.