|
@@ -1,4 +1,4 @@
|
|
|
-package com.its.vds.UI;
|
|
|
+package com.its.vds.ui;
|
|
|
|
|
|
import com.intellij.uiDesigner.core.GridConstraints;
|
|
|
import com.intellij.uiDesigner.core.GridLayoutManager;
|
|
@@ -14,6 +14,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
import javax.swing.Timer;
|
|
|
import javax.swing.*;
|
|
|
+import javax.swing.border.MatteBorder;
|
|
|
import javax.swing.plaf.FontUIResource;
|
|
|
import javax.swing.table.DefaultTableCellRenderer;
|
|
|
import javax.swing.table.TableCellRenderer;
|
|
@@ -24,6 +25,7 @@ import java.awt.datatransfer.Clipboard;
|
|
|
import java.awt.datatransfer.StringSelection;
|
|
|
import java.awt.event.ActionEvent;
|
|
|
import java.awt.event.ActionListener;
|
|
|
+import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.lang.management.ManagementFactory;
|
|
|
import java.util.List;
|
|
@@ -76,14 +78,38 @@ public class MainUI {
|
|
|
}
|
|
|
|
|
|
public MainUI() {
|
|
|
+ System.setProperty("awt.useSystemAAFontSettings", "false"); // AntiAliasing false
|
|
|
+
|
|
|
if (_instance == null) {
|
|
|
_instance = this;
|
|
|
}
|
|
|
osBean = ManagementFactory.getPlatformMXBean(OperatingSystemMXBean.class);
|
|
|
+ try {
|
|
|
+ Font font = Font.createFont(Font.TRUETYPE_FONT, new File("fonts/D2Coding.ttc"));
|
|
|
+ GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
|
|
+ ge.registerFont(font);
|
|
|
+ } catch (FontFormatException e) {
|
|
|
+ } catch (IOException e) {
|
|
|
+ }
|
|
|
+
|
|
|
+ //taLog.setFont(new Font(Font.MONOSPACED, Font.PLAIN, 14));
|
|
|
+ Font d2font = new Font("D2Coding", Font.PLAIN, 14);
|
|
|
+ if (d2font != null) {
|
|
|
+ taLog.setFont(d2font);
|
|
|
+ }
|
|
|
+
|
|
|
+// GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
|
|
|
+// String fontNames[] = ge.getAvailableFontFamilyNames();
|
|
|
+// for (int ii = 0; ii < fontNames.length; ii++) {
|
|
|
+// log.error("GraphicsEnvironment Fonts: {}", fontNames[ii]);
|
|
|
+// }
|
|
|
+// final Font fonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
|
|
|
+// for (Font font : fonts) {
|
|
|
+// log.error("FONTS: {}", font);
|
|
|
+// }
|
|
|
|
|
|
displaySystime();
|
|
|
displayResource();
|
|
|
- //task = new MonitoringTask();
|
|
|
timer = new Timer(1000, new ActionListener() {
|
|
|
public void actionPerformed(ActionEvent evt) {
|
|
|
displaySystime();
|
|
@@ -140,6 +166,14 @@ public class MainUI {
|
|
|
*/
|
|
|
private void initTblListUI(List<TbVdsCtlr> ctlrList) {
|
|
|
|
|
|
+ tblCtlrList.getTableHeader().setOpaque(false);
|
|
|
+ tblCtlrList.getTableHeader().setBackground(Color.LIGHT_GRAY);
|
|
|
+ tblCtlrList.setRowMargin(1);
|
|
|
+ //tblCtlrList.setGridColor(Color.LIGHT_GRAY);
|
|
|
+ tblCtlrList.setRowHeight(tblCtlrList.getRowHeight() + 5);
|
|
|
+ //tblCtlrList.setRowSelectionAllowed(true);
|
|
|
+ //tblCtlrList.setColumnSelectionAllowed(false);
|
|
|
+
|
|
|
ctlrSttsTableModel = new CtlrSttsTableModel(ctlrList);
|
|
|
tblCtlrList.setModel(ctlrSttsTableModel);
|
|
|
tblCtlrList.setBackground(Color.WHITE);
|
|
@@ -163,6 +197,12 @@ public class MainUI {
|
|
|
getColumnModel.getColumn(11).setPreferredWidth(50); // "Video",
|
|
|
getColumnModel.getColumn(12).setPreferredWidth(120);
|
|
|
getColumnModel.getColumn(13).setPreferredWidth(120);
|
|
|
+ getColumnModel.getColumn(0).setMaxWidth(30);
|
|
|
+ getColumnModel.getColumn(0).setMinWidth(30);
|
|
|
+ getColumnModel.getColumn(0).setResizable(false);
|
|
|
+ Color color = UIManager.getColor("Table.gridColor");
|
|
|
+ MatteBorder border = new MatteBorder(1, 1, 0, 0, color);
|
|
|
+ tblCtlrList.setBorder(border);
|
|
|
|
|
|
DefaultTableCellRenderer centerAlign = new DefaultTableCellRenderer();
|
|
|
centerAlign.setHorizontalAlignment(JLabel.CENTER);
|
|
@@ -243,7 +283,7 @@ public class MainUI {
|
|
|
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));
|
|
|
+ pnlCtlrTitle.setLayout(new GridLayoutManager(1, 6, new Insets(0, 0, 0, 2), -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());
|
|
@@ -270,7 +310,7 @@ public class MainUI {
|
|
|
if (lblTotalFont != null) lblTotal.setFont(lblTotalFont);
|
|
|
lblTotal.setHorizontalAlignment(0);
|
|
|
lblTotal.setHorizontalTextPosition(0);
|
|
|
- lblTotal.setText(" -");
|
|
|
+ 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());
|
|
@@ -278,7 +318,7 @@ public class MainUI {
|
|
|
lblError.setForeground(new Color(-65536));
|
|
|
lblError.setHorizontalAlignment(0);
|
|
|
lblError.setHorizontalTextPosition(0);
|
|
|
- lblError.setText(" -");
|
|
|
+ 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));
|
|
@@ -288,9 +328,9 @@ public class MainUI {
|
|
|
scrollPane1.setViewportView(tblCtlrList);
|
|
|
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));
|
|
|
+ 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, 300), new Dimension(-1, 300), new Dimension(-1, 300), 0, false));
|
|
|
pnlLogTitle = new JPanel();
|
|
|
- pnlLogTitle.setLayout(new GridLayoutManager(1, 6, new Insets(0, 0, 0, 0), 1, 1));
|
|
|
+ pnlLogTitle.setLayout(new GridLayoutManager(1, 6, new Insets(0, 0, 0, 2), 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());
|
|
@@ -326,6 +366,8 @@ public class MainUI {
|
|
|
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();
|
|
|
+ Font scrollPane2Font = this.$$$getFont$$$("D2Coding", Font.PLAIN, 12, scrollPane2.getFont());
|
|
|
+ if (scrollPane2Font != null) scrollPane2.setFont(scrollPane2Font);
|
|
|
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));
|
|
@@ -335,6 +377,7 @@ public class MainUI {
|
|
|
if (taLogFont != null) taLog.setFont(taLogFont);
|
|
|
taLog.setForeground(new Color(-1));
|
|
|
taLog.setMargin(new Insets(4, 4, 4, 4));
|
|
|
+ taLog.setText("[10:50:08.561] [ INFO] ************************************************************************************\n[10:50:08.561] [ INFO] ** Center Communication Server Information **\n[10:50:08.561] [ INFO] ** bindAddress: 0.0.0.0\n[10:50:08.561] [ INFO] ** listenPort: 9901\n[10:50:08.561] [ INFO] ** backlog: 1024\n[10:50:08.561] [ INFO] ** acceptThreads: 16\n[10:50:08.561] [ INFO] ** workerThreads: 16\n[10:50:08.561] [ INFO] ************************************************************************************\n");
|
|
|
scrollPane2.setViewportView(taLog);
|
|
|
pnlStatusBar = new JPanel();
|
|
|
pnlStatusBar.setLayout(new GridLayoutManager(1, 7, new Insets(0, 4, 4, 4), -1, -1));
|