package com.vci.client.omd.attribpool.ui; import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.util.HashMap; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JScrollPane; import com.vci.corba.omd.atm.AttribItem; public class VTFilePathPanel extends VTDataTypePanel{ /** * */ private static final long serialVersionUID = 5518664721465614158L; private HashMap detailInfoMap = null; public VTFilePathPanel(){ initUI(); addListener(); } private void initUI(){ this.setLayout(new GridBagLayout()); JPanel leftPanel = new JPanel(); JPanel rightPanel = new JPanel(); GridBagConstraints gb = new GridBagConstraints(); gb.gridx = 0; gb.gridy = 0; gb.weightx = 1.0; gb.weighty = 1.0; gb.fill = GridBagConstraints.BOTH; this.add(leftPanel, gb); gb.gridx = 1; this.add(rightPanel, gb); leftPanel.setPreferredSize(new Dimension(this.getSize().width/2, this.getSize().height)); rightPanel.setPreferredSize(new Dimension(this.getSize().width/2, this.getSize().height)); //设置左边panel的控件 leftPanel.setBorder(BorderFactory.createTitledBorder("VTFilePath")); leftPanel.setLayout(new BorderLayout()); JPanel leftPanel1 = new JPanel(); JPanel leftPanel2 = new JPanel(); JScrollPane spLP1 = new JScrollPane(); spLP1.setBorder(null); spLP1.setViewportView(leftPanel1); JScrollPane spLP2 = new JScrollPane(); spLP2.setBorder(null); spLP2.setViewportView(leftPanel2); leftPanel.add(spLP1, BorderLayout.NORTH); leftPanel.add(spLP2, BorderLayout.CENTER); leftPanel2.setLayout(new GridBagLayout()); //设置右边panel的控件 rightPanel.setBorder(BorderFactory.createTitledBorder("值域")); rightPanel.setLayout(new GridBagLayout()); JPanel rightPanel1 = new JPanel(); JPanel rightPanel2 = new JPanel(); JPanel rightPanel3 = new JPanel(); GridBagConstraints gRight = new GridBagConstraints(); gRight.gridx = 0; gRight.gridy = 0; gRight.weightx = 1.0; gRight.weighty = 1.0; gRight.fill = GridBagConstraints.BOTH; JScrollPane spRP1 = new JScrollPane(); spRP1.setBorder(null); spRP1.setViewportView(rightPanel1); JScrollPane spRP2 = new JScrollPane(); spRP2.setBorder(null); spRP2.setViewportView(rightPanel2); JScrollPane spRP3 = new JScrollPane(); spRP3.setBorder(null); spRP3.setViewportView(rightPanel3); rightPanel.add(spRP1, gRight); gRight.gridy = 1; rightPanel.add(spRP2, gRight); gRight.gridy = 2; rightPanel.add(spRP3, gRight); rightPanel3.setLayout(new GridBagLayout()); } public void addListener(){ } /** * 获取VTDataType的详细信息 * @return */ public HashMap getDetailInfo(){ detailInfoMap = new HashMap(); return detailInfoMap; } /** * 根据当前状态(查看,创建,修改), 设置相关组件的显示情况 * @param flag */ public void updataUIStatus(AttribItem abItem, int flag){ } }