Skip to content

Commit

Permalink
Merge pull request #4 from rememberber/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rememberber authored Dec 22, 2021
2 parents 131e0d4 + edad5ec commit 1f69d83
Show file tree
Hide file tree
Showing 17 changed files with 963 additions and 68 deletions.
97 changes: 52 additions & 45 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.0.0</version>
<version>1.1.0</version>
<packaging>jar</packaging>

<name>MooInfo</name>
Expand All @@ -26,11 +26,12 @@
<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>1.6.5</flatlaf.version>
<flatlaf-extras.version>1.6.5</flatlaf-extras.version>
<flatlaf.version>2.0-rc1</flatlaf.version>
<flatlaf-extras.version>2.0-rc1</flatlaf-extras.version>
<hutool-all.version>5.7.16</hutool-all.version>
<fastjson.version>1.2.78</fastjson.version>
<oshi-core.version>5.8.5</oshi-core.version>
<oshi-core.version>5.8.6</oshi-core.version>
<jfreechart.version>1.5.3</jfreechart.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -120,6 +121,12 @@
<artifactId>oshi-core</artifactId>
<version>${oshi-core.version}</version>
</dependency>

<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>${jfreechart.version}</version>
</dependency>
</dependencies>

<build>
Expand All @@ -134,47 +141,47 @@
<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>-->
<!-- <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>
<!-- <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>
<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>-->
<!--&lt;!&ndash; <jdkPath>X:\\path\to\linux\jdk</jdkPath>&ndash;&gt;-->
<!-- </configuration>-->
<!-- </execution>-->
<!-- <execution>-->
<!-- <id>bundling-for-mac</id>-->
<!-- <phase>package</phase>-->
Expand Down
Binary file modified screenshot/cpu_mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshot/processes_mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions src/main/java/com/luoboduner/moo/info/App.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
package com.luoboduner.moo.info;

import com.formdev.flatlaf.extras.FlatDesktop;
import com.formdev.flatlaf.util.SystemInfo;
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.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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.exception.ExceptionUtils;

import javax.swing.*;
import java.awt.*;
Expand All @@ -17,6 +22,7 @@
* @author <a href="https://github.com/rememberber">RememBerBer</a>
* @since 2021/11/07.
*/
@Slf4j
public class App {

public static ConfigUtil config = ConfigUtil.getInstance();
Expand All @@ -34,6 +40,29 @@ public static void main(String[] args) {
System.setProperty("apple.awt.application.name", "MooInfo");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "MooInfo");
System.setProperty("apple.awt.application.appearance", "system");

FlatDesktop.setAboutHandler(() -> {
try {
AboutDialog dialog = new AboutDialog();

dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error(ExceptionUtils.getStackTrace(e2));
}
});
FlatDesktop.setPreferencesHandler(() -> {
try {
SettingDialog dialog = new SettingDialog();

dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error(ExceptionUtils.getStackTrace(e2));
}
});
FlatDesktop.setQuitHandler(FlatDesktop.QuitResponse::performQuit);

}

Init.initTheme();
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.0.0";
public static final String APP_VERSION = "1.1.0";

public static final int TABLE_ROW_HEIGHT = 36;

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/com/luoboduner/moo/info/ui/component/TopMenuBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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.dialog.SystemInfoTestDialog;
import com.luoboduner.moo.info.ui.form.MainWindow;
import com.luoboduner.moo.info.util.SystemUtil;
import com.luoboduner.moo.info.util.UpgradeUtil;
Expand Down Expand Up @@ -107,6 +108,12 @@ public void init() {
logMenuItem.addActionListener(e -> logActionPerformed());
appMenu.add(logMenuItem);

// System Info Test
JMenuItem syInfoTestMenuItem = new JMenuItem();
syInfoTestMenuItem.setText("System Info Test");
syInfoTestMenuItem.addActionListener(e -> sysInfoTestActionPerformed());
appMenu.add(syInfoTestMenuItem);

// System environment variables
JMenuItem sysEnvMenuItem = new JMenuItem();
sysEnvMenuItem.setText("System environment variables");
Expand Down Expand Up @@ -335,6 +342,16 @@ private void aboutActionPerformed() {
}
}

private void sysInfoTestActionPerformed() {
try {
SystemInfoTestDialog dialog = new SystemInfoTestDialog();
dialog.pack();
dialog.setVisible(true);
} catch (Exception e2) {
log.error("Show system info test dialog failed", e2);
}
}

private void sysEnvActionPerformed() {
try {
SystemEnvResultDialog dialog = new SystemEnvResultDialog();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?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.SystemInfoTestDialog">
<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="2" same-size-horizontally="true" 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="Start"/>
</properties>
</component>
<component id="5723f" class="javax.swing.JButton" binding="buttonCancel">
<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="Cancel"/>
</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="580ba">
<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="35d0a" class="javax.swing.JTextArea" binding="textArea1" default-binding="true">
<constraints/>
<properties/>
</component>
</children>
</scrollpane>
</children>
</grid>
</children>
</grid>
</form>
Loading

0 comments on commit 1f69d83

Please sign in to comment.