wangxichen 4 дней назад
Родитель
Сommit
f928d271aa
1 измененных файлов с 48 добавлено и 19 удалено
  1. 48 19
      src/com/mes/ui/MesClient.java

+ 48 - 19
src/com/mes/ui/MesClient.java

@@ -504,55 +504,84 @@ public class MesClient extends JFrame {
         JPanel indexPanelA = new JPanel();
         indexScrollPaneA = new JScrollPane(indexPanelA);
         indexPanelA.setLayout(null);
+        indexPanelA.setPreferredSize(new Dimension(950, 490));
+
+        JLabel printCodeTitle = new JLabel("当前打码长码");
+        printCodeTitle.setFont(new Font("微软雅黑", Font.BOLD, 18));
+        printCodeTitle.setBounds(52, 145, 200, 28);
+        indexPanelA.add(printCodeTitle);
 
         product_sn = new JTextField();
         product_sn.setHorizontalAlignment(SwingConstants.CENTER);
         product_sn.setEditable(false);
         product_sn.setFont(new Font("微软雅黑", Font.PLAIN, 28));
-        product_sn.setBounds(81, 70, 802, 70);
+        product_sn.setBounds(52, 180, 864, 90);
         indexPanelA.add(product_sn);
         product_sn.setColumns(10);
 
         JLabel pnTitle = new JLabel("打码型号");
-        pnTitle.setFont(new Font("微软雅黑", Font.PLAIN, 16));
-        pnTitle.setBounds(81, 15, 76, 34);
+        pnTitle.setFont(new Font("微软雅黑", Font.BOLD, 22));
+        pnTitle.setBounds(52, 18, 102, 54);
         indexPanelA.add(pnTitle);
 
-        printModelCombo = new JComboBox<>();
-        printModelCombo.setFont(new Font("微软雅黑", Font.PLAIN, 16));
-        printModelCombo.setBounds(161, 16, 85, 32);
+        printModelCombo = new JComboBox<String>() {
+            @Override
+            public void doLayout() {
+                super.doLayout();
+                for (Component child : getComponents()) {
+                    if (child instanceof AbstractButton) {
+                        Rectangle bounds = child.getBounds();
+                        int arrowWidth = Math.min(bounds.width * 2, getWidth() / 2);
+                        int x = getComponentOrientation().isLeftToRight()
+                                ? bounds.x + bounds.width - arrowWidth : bounds.x;
+                        child.setBounds(x, bounds.y, arrowWidth, bounds.height);
+                        break;
+                    }
+                }
+            }
+        };
+        ListCellRenderer<? super String> modelRenderer = printModelCombo.getRenderer();
+        printModelCombo.setRenderer((list, value, index, selected, focused) -> {
+            Component cell = modelRenderer.getListCellRendererComponent(list, value, index, selected, focused);
+            if (cell instanceof JLabel) {
+                ((JLabel) cell).setHorizontalAlignment(SwingConstants.CENTER);
+            }
+            return cell;
+        });
+        printModelCombo.setFont(new Font("微软雅黑", Font.BOLD, 28));
+        printModelCombo.setBounds(156, 18, 218, 54);
         printModelCombo.setEnabled(false);
         indexPanelA.add(printModelCombo);
 
         planQtyLabel = new JLabel("计划:—  可发:—");
-        planQtyLabel.setFont(new Font("微软雅黑", Font.BOLD, 16));
-        planQtyLabel.setBounds(258, 15, 200, 34);
+        planQtyLabel.setFont(new Font("微软雅黑", Font.BOLD, 18));
+        planQtyLabel.setBounds(52, 91, 260, 38);
         indexPanelA.add(planQtyLabel);
 
         planStatusLabel = new JLabel("正在加载打码型号");
-        planStatusLabel.setFont(new Font("微软雅黑", Font.PLAIN, 14));
-        planStatusLabel.setBounds(81, 48, 790, 19);
+        planStatusLabel.setFont(new Font("微软雅黑", Font.PLAIN, 16));
+        planStatusLabel.setBounds(396, 18, 383, 54);
         indexPanelA.add(planStatusLabel);
 
         op035QtyLabel = new JLabel("OP035上线:—");
         op035QtyLabel.setFont(new Font("微软雅黑", Font.BOLD, 18));
-        op035QtyLabel.setBounds(460, 15, 147, 34);
+        op035QtyLabel.setBounds(526, 91, 166, 38);
         indexPanelA.add(op035QtyLabel);
 
         op100QtyLabel = new JLabel("OP100已打码:—");
         op100QtyLabel.setFont(new Font("微软雅黑", Font.BOLD, 18));
-        op100QtyLabel.setBounds(608, 15, 171, 34);
+        op100QtyLabel.setBounds(326, 91, 188, 38);
         indexPanelA.add(op100QtyLabel);
 
         remainingQtyLabel = new JLabel("差值:—");
         remainingQtyLabel.setFont(new Font("微软雅黑", Font.BOLD, 18));
         remainingQtyLabel.setForeground(Color.GREEN);
-        remainingQtyLabel.setBounds(782, 15, 98, 34);
+        remainingQtyLabel.setBounds(714, 91, 202, 38);
         indexPanelA.add(remainingQtyLabel);
 
         JButton refreshQtyButton = new JButton("刷新");
         refreshQtyButton.setFont(new Font("微软雅黑", Font.PLAIN, 16));
-        refreshQtyButton.setBounds(880, 19, 90, 32);
+        refreshQtyButton.setBounds(810, 24, 106, 42);
         refreshQtyButton.addActionListener(e -> refreshPlanQty(refreshQtyButton));
         indexPanelA.add(refreshQtyButton);
         printModelCombo.addActionListener(e -> {
@@ -588,7 +617,7 @@ public class MesClient extends JFrame {
 
         fxlabel = new JLabel("该工件为返修件,请仔细检查");
         fxlabel.setFont(new Font("微软雅黑", Font.PLAIN, 38));
-        fxlabel.setBounds(81, 190, 810, 70);
+        fxlabel.setBounds(52, 422, 864, 58);
         fxlabel.setForeground(Color.RED);
         fxlabel.setHorizontalAlignment(SwingConstants.CENTER);
         fxlabel.setVisible(false);
@@ -602,25 +631,25 @@ public class MesClient extends JFrame {
 
         feedingLight = new JLabel("请求镭雕码(DB5000.0.4)", imageGray, SwingConstants.LEFT);
         feedingLight.setFont(new Font("微软雅黑", Font.PLAIN, 14));
-        feedingLight.setBounds(81, 150, 400, 30);
+        feedingLight.setBounds(52, 303, 405, 34);
         indexPanelA.add(feedingLight);
 
         replyLight = new JLabel("二维码接收反馈(DB5000.0.5)", imageGray, SwingConstants.LEFT);
         replyLight.setFont(new Font("微软雅黑", Font.PLAIN, 14));
-        replyLight.setBounds(481, 150, 400, 30);
+        replyLight.setBounds(483, 303, 433, 34);
         indexPanelA.add(replyLight);
 
         // PLC 码内容回显
         plcCodeLabel = new JLabel("PLC码(DB5000.260):-");
         plcCodeLabel.setFont(new Font("微软雅黑", Font.PLAIN, 18));
-        plcCodeLabel.setBounds(81, 270, 600, 35);
+        plcCodeLabel.setBounds(52, 365, 676, 39);
         indexPanelA.add(plcCodeLabel);
 
         // 打码成功提示:PLC 反馈到位后显示
         successLabel = new JLabel("打码成功");
         successLabel.setFont(new Font("微软雅黑", Font.BOLD, 22));
         successLabel.setForeground(Color.GREEN);
-        successLabel.setBounds(700, 270, 190, 35);
+        successLabel.setBounds(744, 365, 172, 39);
         successLabel.setVisible(false);
         indexPanelA.add(successLabel);