|
@@ -0,0 +1,374 @@
|
|
|
+package com.its.vds.UI;
|
|
|
+
|
|
|
+import com.intellij.uiDesigner.core.GridConstraints;
|
|
|
+import com.intellij.uiDesigner.core.GridLayoutManager;
|
|
|
+import com.intellij.uiDesigner.core.Spacer;
|
|
|
+import com.its.app.utils.SysUtils;
|
|
|
+import com.its.vds.entity.TbVdsCtlr;
|
|
|
+import com.its.vds.global.AppRepository;
|
|
|
+import com.its.vds.service.VdsCtlrService;
|
|
|
+import com.sun.management.OperatingSystemMXBean;
|
|
|
+import lombok.Getter;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+
|
|
|
+import javax.swing.*;
|
|
|
+import javax.swing.plaf.FontUIResource;
|
|
|
+import javax.swing.text.StyleContext;
|
|
|
+import java.awt.*;
|
|
|
+import java.awt.datatransfer.Clipboard;
|
|
|
+import java.awt.datatransfer.StringSelection;
|
|
|
+import java.awt.event.ActionEvent;
|
|
|
+import java.awt.event.ActionListener;
|
|
|
+import java.io.IOException;
|
|
|
+import java.lang.management.ManagementFactory;
|
|
|
+import java.util.Locale;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.SortedMap;
|
|
|
+import java.util.TreeMap;
|
|
|
+
|
|
|
+@Getter
|
|
|
+public class MainUI {
|
|
|
+ private static MainUI _instance = null;
|
|
|
+ private VdsCtlrService vdsCtlrService = null;
|
|
|
+ OperatingSystemMXBean osBean = null;
|
|
|
+ private Timer timer;
|
|
|
+ private Long tick = Long.valueOf(0);
|
|
|
+
|
|
|
+ private CtlrSttsTableModel ctlrSttsTableModel = new CtlrSttsTableModel();
|
|
|
+
|
|
|
+ private JPanel rootPanel;
|
|
|
+ private JPanel pnlCtlr;
|
|
|
+ private JPanel pnlLog;
|
|
|
+ private JPanel pnlLogTitle;
|
|
|
+ private JPanel pnlCtlrTitle;
|
|
|
+ private JButton btnLogDirOpen;
|
|
|
+ private JButton btnLogPause;
|
|
|
+ private JCheckBox chkLogPause;
|
|
|
+ private JLabel lblSystime;
|
|
|
+ private JPanel pnlStatusBar;
|
|
|
+ private JTable tblCtlr;
|
|
|
+ private JTextArea taLog;
|
|
|
+ private JButton btnLogCopy;
|
|
|
+ private JLabel lblTotal;
|
|
|
+ private JLabel lblError;
|
|
|
+ private JLabel lblCpuRate;
|
|
|
+ private JLabel lblMemoryUsage;
|
|
|
+
|
|
|
+ public static MainUI getInstance() {
|
|
|
+ return _instance;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void displaySystime() {
|
|
|
+ lblSystime.setText(" " + SysUtils.getSysTimeStr() + " ");
|
|
|
+ }
|
|
|
+
|
|
|
+ public void displayResource() {
|
|
|
+ long memoryUsage = Math.round(((double) (osBean.getTotalPhysicalMemorySize() - osBean.getFreePhysicalMemorySize())) / (double) osBean.getTotalPhysicalMemorySize() * 100.0);
|
|
|
+ lblMemoryUsage.setText(String.valueOf(memoryUsage));
|
|
|
+ double cpuLoad = osBean.getSystemCpuLoad();
|
|
|
+ lblCpuRate.setText(String.valueOf(Math.round(cpuLoad * 100.0)));
|
|
|
+ }
|
|
|
+
|
|
|
+ public MainUI() {
|
|
|
+ if (_instance == null) {
|
|
|
+ _instance = this;
|
|
|
+ }
|
|
|
+ osBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
|
|
|
+
|
|
|
+ displaySystime();
|
|
|
+ displayResource();
|
|
|
+ //task = new MonitoringTask();
|
|
|
+ timer = new Timer(1000, new ActionListener() {
|
|
|
+ public void actionPerformed(ActionEvent evt) {
|
|
|
+ displaySystime();
|
|
|
+ tick++;
|
|
|
+ if (tick % 5 == 0) {
|
|
|
+ displayResource();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ timer.start();
|
|
|
+
|
|
|
+ chkLogPause.setFocusable(false);
|
|
|
+ btnLogPause.setFocusable(false);
|
|
|
+ btnLogDirOpen.setFocusable(false);
|
|
|
+ btnLogCopy.setFocusable(false);
|
|
|
+
|
|
|
+ initTblListHeader();
|
|
|
+
|
|
|
+ btnLogPause.addActionListener(new ActionListener() {
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
+ taLog.setText(null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ btnLogDirOpen.addActionListener(new ActionListener() {
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
+ Runtime rt = Runtime.getRuntime();
|
|
|
+ try {
|
|
|
+ rt.exec("explorer.exe logs");
|
|
|
+ } catch (IOException ex) {
|
|
|
+ throw new RuntimeException(ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ chkLogPause.addActionListener(new ActionListener() {
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
+ JTextAreaOutputStream.isLoggingPause = chkLogPause.isSelected();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ btnLogCopy.addActionListener(new ActionListener() {
|
|
|
+ @Override
|
|
|
+ public void actionPerformed(ActionEvent e) {
|
|
|
+ StringSelection stringSelection = new StringSelection(taLog.getText());
|
|
|
+ Clipboard clpBrd = Toolkit.getDefaultToolkit().getSystemClipboard();
|
|
|
+ clpBrd.setContents(stringSelection, null);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 목록 헤더 생성
|
|
|
+ */
|
|
|
+ private void initTblListHeader() {
|
|
|
+
|
|
|
+ tblCtlr.setModel(ctlrSttsTableModel);
|
|
|
+ tblCtlr.setBackground(Color.WHITE);
|
|
|
+ tblCtlr.setSelectionMode(1);
|
|
|
+ //tblCtlr.addMouseListener(new ListMouseListener(null));
|
|
|
+ tblCtlr.getColumnModel().getColumn(0).setPreferredWidth(50);
|
|
|
+ tblCtlr.getColumnModel().getColumn(1).setPreferredWidth(100);
|
|
|
+ tblCtlr.getColumnModel().getColumn(2).setPreferredWidth(100);
|
|
|
+ tblCtlr.getColumnModel().getColumn(3).setPreferredWidth(210);
|
|
|
+ tblCtlr.getColumnModel().getColumn(4).setPreferredWidth(50);
|
|
|
+//
|
|
|
+// this.defaultTableCellRenderer = new DefaultTableCellRenderer();
|
|
|
+// this.defaultTableCellRenderer.setHorizontalAlignment(0);
|
|
|
+// this.defaultTableCellRenderer.setBackground(new Color(255, 220, 220));
|
|
|
+// this.tableColumnModel = tblCtlr.getColumnModel();
|
|
|
+// for (int i = 0; i < this.tableColumnModel.getColumnCount(); i++)
|
|
|
+// this.tableColumnModel.getColumn(i).setCellRenderer(this.defaultTableCellRenderer);
|
|
|
+// this.tableCellRenderer = new CommTableCellRenderer();
|
|
|
+// try {
|
|
|
+// tblCtlr.setDefaultRenderer(Class.forName("java.lang.String"), this.tableCellRenderer);
|
|
|
+// } catch (ClassNotFoundException ex) {
|
|
|
+// System.exit(0);
|
|
|
+// }
|
|
|
+ }
|
|
|
+
|
|
|
+ public void LoadControllerInfo(VdsCtlrService vdsCtlrService) {
|
|
|
+ this.vdsCtlrService = vdsCtlrService;
|
|
|
+
|
|
|
+ SortedMap<Integer, TbVdsCtlr> ctlrMap = new TreeMap<>();
|
|
|
+ for (Map.Entry<String, TbVdsCtlr> e : AppRepository.getInstance().getCtlrMap().entrySet()) {
|
|
|
+ TbVdsCtlr obj = e.getValue();
|
|
|
+ if (StringUtils.equals("N", obj.getDEL_YN()) && StringUtils.equals("Y", obj.getVALD_YN())) {
|
|
|
+ ctlrMap.put(Integer.valueOf(obj.getVDS_CTLR_NMBR()), obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int ctlrTotal = ctlrMap.size();
|
|
|
+ int ctlrError = 0;
|
|
|
+ for (Map.Entry<Integer, TbVdsCtlr> e : ctlrMap.entrySet()) {
|
|
|
+ TbVdsCtlr obj = e.getValue();
|
|
|
+ ctlrSttsTableModel.Add(obj);
|
|
|
+ if (!"CMS0".equals(obj.getStts().getCMNC_STTS_CD())) {
|
|
|
+ ctlrError++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lblTotal.setText(" " + ctlrTotal + " ");
|
|
|
+ lblError.setText(" " + ctlrError + " ");
|
|
|
+ }
|
|
|
+
|
|
|
+ {
|
|
|
+// 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$$$() {
|
|
|
+ rootPanel = new JPanel();
|
|
|
+ rootPanel.setLayout(new GridLayoutManager(3, 1, new Insets(0, 0, 0, 0), -1, -1));
|
|
|
+ pnlCtlr = new JPanel();
|
|
|
+ pnlCtlr.setLayout(new GridLayoutManager(2, 1, new Insets(10, 4, 0, 4), -1, -1));
|
|
|
+ rootPanel.add(pnlCtlr, 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));
|
|
|
+ pnlCtlrTitle = new JPanel();
|
|
|
+ pnlCtlrTitle.setLayout(new GridLayoutManager(1, 6, new Insets(0, 0, 0, 0), -1, -1));
|
|
|
+ pnlCtlr.add(pnlCtlrTitle, 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 JLabel label1 = new JLabel();
|
|
|
+ Font label1Font = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, label1.getFont());
|
|
|
+ if (label1Font != null) label1.setFont(label1Font);
|
|
|
+ label1.setHorizontalAlignment(2);
|
|
|
+ label1.setHorizontalTextPosition(11);
|
|
|
+ label1.setIcon(new ImageIcon(getClass().getResource("/static/image/controller.png")));
|
|
|
+ label1.setText("제어기 정보");
|
|
|
+ pnlCtlrTitle.add(label1, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final Spacer spacer1 = new Spacer();
|
|
|
+ pnlCtlrTitle.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 JLabel label2 = new JLabel();
|
|
|
+ Font label2Font = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, label2.getFont());
|
|
|
+ if (label2Font != null) label2.setFont(label2Font);
|
|
|
+ label2.setText("제어기 전체: ");
|
|
|
+ pnlCtlrTitle.add(label2, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final JLabel label3 = new JLabel();
|
|
|
+ Font label3Font = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, label3.getFont());
|
|
|
+ if (label3Font != null) label3.setFont(label3Font);
|
|
|
+ label3.setText("통신 이상: ");
|
|
|
+ pnlCtlrTitle.add(label3, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ lblTotal = new JLabel();
|
|
|
+ Font lblTotalFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 12, lblTotal.getFont());
|
|
|
+ if (lblTotalFont != null) lblTotal.setFont(lblTotalFont);
|
|
|
+ lblTotal.setHorizontalAlignment(0);
|
|
|
+ lblTotal.setHorizontalTextPosition(0);
|
|
|
+ lblTotal.setText(" -");
|
|
|
+ pnlCtlrTitle.add(lblTotal, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ lblError = new JLabel();
|
|
|
+ Font lblErrorFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 12, lblError.getFont());
|
|
|
+ if (lblErrorFont != null) lblError.setFont(lblErrorFont);
|
|
|
+ lblError.setForeground(new Color(-65536));
|
|
|
+ lblError.setHorizontalAlignment(0);
|
|
|
+ lblError.setHorizontalTextPosition(0);
|
|
|
+ lblError.setText(" -");
|
|
|
+ pnlCtlrTitle.add(lblError, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final JScrollPane scrollPane1 = new JScrollPane();
|
|
|
+ pnlCtlr.add(scrollPane1, new GridConstraints(1, 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));
|
|
|
+ tblCtlr = new JTable();
|
|
|
+ Font tblCtlrFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, tblCtlr.getFont());
|
|
|
+ if (tblCtlrFont != null) tblCtlr.setFont(tblCtlrFont);
|
|
|
+ scrollPane1.setViewportView(tblCtlr);
|
|
|
+ pnlLog = new JPanel();
|
|
|
+ pnlLog.setLayout(new GridLayoutManager(2, 1, new Insets(0, 4, 0, 4), -1, -1));
|
|
|
+ rootPanel.add(pnlLog, 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, new Dimension(-1, 250), new Dimension(-1, 250), new Dimension(-1, 250), 0, false));
|
|
|
+ pnlLogTitle = new JPanel();
|
|
|
+ pnlLogTitle.setLayout(new GridLayoutManager(1, 6, new Insets(0, 0, 0, 0), 1, 1));
|
|
|
+ pnlLog.add(pnlLogTitle, 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 JLabel label4 = new JLabel();
|
|
|
+ Font label4Font = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, label4.getFont());
|
|
|
+ if (label4Font != null) label4.setFont(label4Font);
|
|
|
+ label4.setHorizontalAlignment(2);
|
|
|
+ label4.setIcon(new ImageIcon(getClass().getResource("/static/image/logging.png")));
|
|
|
+ label4.setText("시스템 로그");
|
|
|
+ pnlLogTitle.add(label4, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final Spacer spacer2 = new Spacer();
|
|
|
+ pnlLogTitle.add(spacer2, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
|
|
|
+ btnLogDirOpen = new JButton();
|
|
|
+ Font btnLogDirOpenFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, btnLogDirOpen.getFont());
|
|
|
+ if (btnLogDirOpenFont != null) btnLogDirOpen.setFont(btnLogDirOpenFont);
|
|
|
+ btnLogDirOpen.setHorizontalTextPosition(0);
|
|
|
+ btnLogDirOpen.setText("로그 폴더");
|
|
|
+ pnlLogTitle.add(btnLogDirOpen, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ btnLogPause = new JButton();
|
|
|
+ Font btnLogPauseFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, btnLogPause.getFont());
|
|
|
+ if (btnLogPauseFont != null) btnLogPause.setFont(btnLogPauseFont);
|
|
|
+ btnLogPause.setHorizontalTextPosition(0);
|
|
|
+ btnLogPause.setText("지우기");
|
|
|
+ pnlLogTitle.add(btnLogPause, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ chkLogPause = new JCheckBox();
|
|
|
+ Font chkLogPauseFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, chkLogPause.getFont());
|
|
|
+ if (chkLogPauseFont != null) chkLogPause.setFont(chkLogPauseFont);
|
|
|
+ chkLogPause.setHorizontalAlignment(0);
|
|
|
+ chkLogPause.setHorizontalTextPosition(11);
|
|
|
+ chkLogPause.setText("멈춤");
|
|
|
+ pnlLogTitle.add(chkLogPause, new GridConstraints(0, 2, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ btnLogCopy = new JButton();
|
|
|
+ Font btnLogCopyFont = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, btnLogCopy.getFont());
|
|
|
+ if (btnLogCopyFont != null) btnLogCopy.setFont(btnLogCopyFont);
|
|
|
+ btnLogCopy.setText("복사");
|
|
|
+ pnlLogTitle.add(btnLogCopy, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final JScrollPane scrollPane2 = new JScrollPane();
|
|
|
+ pnlLog.add(scrollPane2, new GridConstraints(1, 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));
|
|
|
+ taLog = new JTextArea();
|
|
|
+ taLog.setBackground(new Color(-16777216));
|
|
|
+ taLog.setCaretColor(new Color(-1));
|
|
|
+ taLog.setEditable(false);
|
|
|
+ Font taLogFont = this.$$$getFont$$$("D2Coding", Font.PLAIN, 14, taLog.getFont());
|
|
|
+ if (taLogFont != null) taLog.setFont(taLogFont);
|
|
|
+ taLog.setForeground(new Color(-1));
|
|
|
+ taLog.setMargin(new Insets(4, 4, 4, 4));
|
|
|
+ scrollPane2.setViewportView(taLog);
|
|
|
+ pnlStatusBar = new JPanel();
|
|
|
+ pnlStatusBar.setLayout(new GridLayoutManager(1, 7, new Insets(0, 4, 4, 4), -1, -1));
|
|
|
+ rootPanel.add(pnlStatusBar, new GridConstraints(2, 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 Spacer spacer3 = new Spacer();
|
|
|
+ pnlStatusBar.add(spacer3, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false));
|
|
|
+ lblSystime = new JLabel();
|
|
|
+ Font lblSystimeFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 12, lblSystime.getFont());
|
|
|
+ if (lblSystimeFont != null) lblSystime.setFont(lblSystimeFont);
|
|
|
+ lblSystime.setHorizontalAlignment(0);
|
|
|
+ lblSystime.setHorizontalTextPosition(0);
|
|
|
+ lblSystime.setText(" 2022-08-04 13:24:33 ");
|
|
|
+ pnlStatusBar.add(lblSystime, new GridConstraints(0, 6, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final JLabel label5 = new JLabel();
|
|
|
+ label5.setIcon(new ImageIcon(getClass().getResource("/static/image/on.png")));
|
|
|
+ label5.setText(" ");
|
|
|
+ pnlStatusBar.add(label5, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ lblCpuRate = new JLabel();
|
|
|
+ Font lblCpuRateFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 12, lblCpuRate.getFont());
|
|
|
+ if (lblCpuRateFont != null) lblCpuRate.setFont(lblCpuRateFont);
|
|
|
+ lblCpuRate.setHorizontalAlignment(2);
|
|
|
+ lblCpuRate.setHorizontalTextPosition(0);
|
|
|
+ lblCpuRate.setText(" ");
|
|
|
+ pnlStatusBar.add(lblCpuRate, new GridConstraints(0, 5, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, new Dimension(40, -1), new Dimension(40, -1), new Dimension(40, -1), 0, false));
|
|
|
+ lblMemoryUsage = new JLabel();
|
|
|
+ Font lblMemoryUsageFont = this.$$$getFont$$$("Malgun Gothic", Font.BOLD, 12, lblMemoryUsage.getFont());
|
|
|
+ if (lblMemoryUsageFont != null) lblMemoryUsage.setFont(lblMemoryUsageFont);
|
|
|
+ lblMemoryUsage.setHorizontalAlignment(2);
|
|
|
+ lblMemoryUsage.setHorizontalTextPosition(0);
|
|
|
+ lblMemoryUsage.setText(" ");
|
|
|
+ pnlStatusBar.add(lblMemoryUsage, new GridConstraints(0, 3, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, new Dimension(40, -1), new Dimension(40, -1), new Dimension(40, -1), 0, false));
|
|
|
+ final JLabel label6 = new JLabel();
|
|
|
+ Font label6Font = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, label6.getFont());
|
|
|
+ if (label6Font != null) label6.setFont(label6Font);
|
|
|
+ label6.setHorizontalAlignment(0);
|
|
|
+ label6.setHorizontalTextPosition(0);
|
|
|
+ label6.setText(" CPU 사용율(%):");
|
|
|
+ pnlStatusBar.add(label6, new GridConstraints(0, 4, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
|
|
|
+ final JLabel label7 = new JLabel();
|
|
|
+ Font label7Font = this.$$$getFont$$$("Malgun Gothic", Font.PLAIN, 12, label7.getFont());
|
|
|
+ if (label7Font != null) label7.setFont(label7Font);
|
|
|
+ label7.setHorizontalAlignment(0);
|
|
|
+ label7.setHorizontalTextPosition(0);
|
|
|
+ label7.setText(" 메모리 사용율(%):");
|
|
|
+ pnlStatusBar.add(label7, new GridConstraints(0, 2, 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 rootPanel;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|