cpu and memory form added
This commit is contained in:
parent
74beb9820e
commit
199ec857d6
|
@ -202,6 +202,8 @@ public class Init {
|
||||||
|
|
||||||
ThreadUtil.execute(OverviewForm::init);
|
ThreadUtil.execute(OverviewForm::init);
|
||||||
ThreadUtil.execute(DetailForm::init);
|
ThreadUtil.execute(DetailForm::init);
|
||||||
|
ThreadUtil.execute(MemoryForm::init);
|
||||||
|
ThreadUtil.execute(CpuForm::init);
|
||||||
ThreadUtil.execute(NetworkForm::init);
|
ThreadUtil.execute(NetworkForm::init);
|
||||||
ThreadUtil.execute(UsbForm::init);
|
ThreadUtil.execute(UsbForm::init);
|
||||||
ThreadUtil.execute(VariablesForm::init);
|
ThreadUtil.execute(VariablesForm::init);
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?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.CpuForm">
|
||||||
|
<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="500" height="400"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children/>
|
||||||
|
</grid>
|
||||||
|
</form>
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.luoboduner.moo.info.ui.form;
|
||||||
|
|
||||||
|
import cn.hutool.log.Log;
|
||||||
|
import cn.hutool.log.LogFactory;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CpuForm
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/rememberber">RememBerBer</a>
|
||||||
|
* @since 2021/11/16.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class CpuForm {
|
||||||
|
private JPanel mainPanel;
|
||||||
|
|
||||||
|
private static final Log logger = LogFactory.get();
|
||||||
|
|
||||||
|
private static CpuForm cpuForm;
|
||||||
|
|
||||||
|
public static CpuForm getInstance() {
|
||||||
|
if (cpuForm == null) {
|
||||||
|
cpuForm = new CpuForm();
|
||||||
|
}
|
||||||
|
return cpuForm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
cpuForm = getInstance();
|
||||||
|
|
||||||
|
initUi();
|
||||||
|
initInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initUi() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initInfo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return mainPanel;
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,7 +37,7 @@
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children/>
|
<children/>
|
||||||
</grid>
|
</grid>
|
||||||
<grid id="2168" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="2168" binding="memoryPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<tabbedpane title="Memory"/>
|
<tabbedpane title="Memory"/>
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children/>
|
<children/>
|
||||||
</grid>
|
</grid>
|
||||||
<grid id="69a2c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="69a2c" binding="cpuPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<tabbedpane title="CPU"/>
|
<tabbedpane title="CPU"/>
|
||||||
|
|
|
@ -24,6 +24,8 @@ public class MainWindow {
|
||||||
private JPanel VariablesPanel;
|
private JPanel VariablesPanel;
|
||||||
private JPanel processesPanel;
|
private JPanel processesPanel;
|
||||||
private JPanel diskPanel;
|
private JPanel diskPanel;
|
||||||
|
private JPanel memoryPanel;
|
||||||
|
private JPanel cpuPanel;
|
||||||
|
|
||||||
private static MainWindow mainWindow;
|
private static MainWindow mainWindow;
|
||||||
|
|
||||||
|
@ -43,6 +45,8 @@ public class MainWindow {
|
||||||
mainWindow = getInstance();
|
mainWindow = getInstance();
|
||||||
mainWindow.getOverviewPanel().add(OverviewForm.getInstance().getMainPanel(), gridConstraints);
|
mainWindow.getOverviewPanel().add(OverviewForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
mainWindow.getDetailPanel().add(DetailForm.getInstance().getMainPanel(), gridConstraints);
|
mainWindow.getDetailPanel().add(DetailForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
|
mainWindow.getMemoryPanel().add(MemoryForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
|
mainWindow.getCpuPanel().add(CpuForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
mainWindow.getNetworkPanel().add(NetworkForm.getInstance().getMainPanel(), gridConstraints);
|
mainWindow.getNetworkPanel().add(NetworkForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
mainWindow.getUsbPanel().add(UsbForm.getInstance().getMainPanel(), gridConstraints);
|
mainWindow.getUsbPanel().add(UsbForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
mainWindow.getVariablesPanel().add(VariablesForm.getInstance().getMainPanel(), gridConstraints);
|
mainWindow.getVariablesPanel().add(VariablesForm.getInstance().getMainPanel(), gridConstraints);
|
||||||
|
@ -77,12 +81,12 @@ public class MainWindow {
|
||||||
detailPanel = new JPanel();
|
detailPanel = new JPanel();
|
||||||
detailPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
detailPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
tabbedPane.addTab("Detail", detailPanel);
|
tabbedPane.addTab("Detail", detailPanel);
|
||||||
final JPanel panel1 = new JPanel();
|
memoryPanel = new JPanel();
|
||||||
panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
memoryPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
tabbedPane.addTab("Memory", panel1);
|
tabbedPane.addTab("Memory", memoryPanel);
|
||||||
final JPanel panel2 = new JPanel();
|
cpuPanel = new JPanel();
|
||||||
panel2.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
cpuPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
tabbedPane.addTab("CPU", panel2);
|
tabbedPane.addTab("CPU", cpuPanel);
|
||||||
diskPanel = new JPanel();
|
diskPanel = new JPanel();
|
||||||
diskPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
diskPanel.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
|
||||||
tabbedPane.addTab("Disk", diskPanel);
|
tabbedPane.addTab("Disk", diskPanel);
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
<?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.MemoryForm">
|
||||||
|
<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="500" height="400"/>
|
||||||
|
</constraints>
|
||||||
|
<properties/>
|
||||||
|
<border type="none"/>
|
||||||
|
<children/>
|
||||||
|
</grid>
|
||||||
|
</form>
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.luoboduner.moo.info.ui.form;
|
||||||
|
|
||||||
|
import cn.hutool.log.Log;
|
||||||
|
import cn.hutool.log.LogFactory;
|
||||||
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MemoryForm
|
||||||
|
*
|
||||||
|
* @author <a href="https://github.com/rememberber">RememBerBer</a>
|
||||||
|
* @since 2021/11/16.
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public class MemoryForm {
|
||||||
|
private static final Log logger = LogFactory.get();
|
||||||
|
|
||||||
|
private static MemoryForm memoryForm;
|
||||||
|
private JPanel mainPanel;
|
||||||
|
|
||||||
|
public static MemoryForm getInstance() {
|
||||||
|
if (memoryForm == null) {
|
||||||
|
memoryForm = new MemoryForm();
|
||||||
|
}
|
||||||
|
return memoryForm;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init() {
|
||||||
|
memoryForm = getInstance();
|
||||||
|
|
||||||
|
initUi();
|
||||||
|
initInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initUi() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void initInfo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// 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));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noinspection ALL
|
||||||
|
*/
|
||||||
|
public JComponent $$$getRootComponent$$$() {
|
||||||
|
return mainPanel;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue