| | |
| | | import com.example.client.model.TableButton; |
| | | import com.example.client.utils.BoxIteUtils; |
| | | import com.example.client.utils.CommonTable; |
| | | import com.example.client.utils.Compute; |
| | | import com.example.client.utils.GBC; |
| | | import com.example.server.cabin.service.CabinService; |
| | | import com.example.server.progressTrack.model.DjJdgzDismantTrack; |
| | |
| | | |
| | | public JPanel createTrack(Integer width, Integer height, DjJdgzNetworkLevel3 djJdgzNetworkLevel3,JFrame frame) { |
| | | nowLevel3 = djJdgzNetworkLevel3; |
| | | JPanel panel = new JPanel(); |
| | | JPanel panel = new JPanel(new BorderLayout()); |
| | | panel.setPreferredSize(new Dimension(width, height)); |
| | | JPanel topJpanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); |
| | | topJpanel.setPreferredSize(new Dimension(width - 10, 37)); |
| | | topJpanel.setPreferredSize(new Dimension(width - 10, 40)); |
| | | |
| | | JPanel centerJpanel = new JPanel(); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, height - 100)); |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeight(40,frame))); |
| | | panel.add(topJpanel, BorderLayout.NORTH); |
| | | panel.add(centerJpanel, BorderLayout.CENTER); |
| | | |
| | |
| | | btnInsert.addActionListener(new ActionListener() { |
| | | @Override |
| | | public void actionPerformed(ActionEvent e) { |
| | | frame.setEnabled(false); |
| | | SysUser user = (SysUser) CacheUtils.get("user", "user"); |
| | | if (user.getTeamgroup()==null||user.getTeamgroup().equals(nowLevel3.getTeamgroupId().toString())) { |
| | | DjJdgzDismantTrack djJdgzDismantTrack = new DjJdgzDismantTrack(); |
| | |
| | | |
| | | JScrollPane scrollPane = new JScrollPane(trackTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); |
| | | scrollPane.setViewportView(trackTable); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, height - 130)); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | centerJpanel.add(scrollPane); |
| | | |
| | | frame.addComponentListener(new ComponentAdapter() { |
| | | @Override |
| | | public void componentResized(ComponentEvent e) { |
| | | centerJpanel.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | scrollPane.setPreferredSize(new Dimension(width - 20, Compute.ComputeHeightWithScroll(40,frame))); |
| | | centerJpanel.revalidate(); |
| | | centerJpanel.repaint(); |
| | | scrollPane.revalidate(); |
| | | scrollPane.repaint(); |
| | | } |
| | | }); |
| | | return panel; |
| | | } |
| | | |
| | |
| | | Object newValue = table.getModel().getValueAt(row, column); |
| | | // 输出变化信息 |
| | | if (newValue.equals("edit")){ |
| | | jFrame.setEnabled(false); |
| | | DjJdgzDismantTrack data = list.get(row); |
| | | insert(jFrame,data); |
| | | jFrame.setEnabled(false); |
| | | }else if(newValue.equals("del")) { |
| | | int n = JOptionPane.showConfirmDialog(null, "是否删除?", "提示", JOptionPane.YES_NO_OPTION); |
| | | if (n == 0) { |