📄 protocolcdmaframe.java
字号:
"(null)" : String.valueOf(myInstance.AnswerState.GetValue() )); this.jLabelProtocolRevision.setText( myInstance.ProtocolRevision.IsNull() ? "(null)" : String.valueOf(myInstance.ProtocolRevision.GetValue()) ); this.jLabelExtendedCallerId.setText( myInstance.ExtendedCallerId.IsNull() ? "(null)" : String.valueOf(myInstance.ExtendedCallerId.GetValue()) ); } /** * This method initializes jPanelInfo * * @return javax.swing.JPanel */ private javax.swing.JPanel getJPanelInfo() { if (jPanelInfo == null) { jPanelInfo = new javax.swing.JPanel(); jPanelInfo.setLayout(null); jPanelInfo.add(getJLabel2(), null); jPanelInfo.add(getJLabel3(), null); jPanelInfo.add(getJLabel4(), null); jPanelInfo.add(getJLabelAnswerState(), null); jPanelInfo.add(getJLabelProtocolRevision(), null); jPanelInfo.add(getJLabelExtendedCallerId(), null); jPanelInfo.setBounds(18, 55, 550, 174); jPanelInfo.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Device", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null)); } return jPanelInfo; } /** * This method initializes jLabel2 * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabel2() { if (jLabel2 == null) { jLabel2 = new javax.swing.JLabel(); jLabel2.setBounds(20, 50, 100, 25); jLabel2.setText("AnswerState:"); } return jLabel2; } /** * This method initializes jLabel3 * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabel3() { if (jLabel3 == null) { jLabel3 = new javax.swing.JLabel(); jLabel3.setBounds(20, 80, 100, 25); jLabel3.setText("ProtocolRevision:"); } return jLabel3; } /** * This method initializes jLabel4 * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabel4() { if (jLabel4 == null) { jLabel4 = new javax.swing.JLabel(); jLabel4.setBounds(20, 110, 100, 25); jLabel4.setText("ExtendedCallerId:"); } return jLabel4; } /** * This method initializes jLabelID * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabelAnswerState() { if (jLabelAnswerState == null) { jLabelAnswerState = new javax.swing.JLabel(); jLabelAnswerState.setBounds(125, 50, 140, 25); jLabelAnswerState.setText(""); } return jLabelAnswerState; } /** * This method initializes jLabelRole * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabelProtocolRevision() { if (jLabelProtocolRevision == null) { jLabelProtocolRevision = new javax.swing.JLabel(); jLabelProtocolRevision.setBounds(125, 80, 140, 25); jLabelProtocolRevision.setText(""); } return jLabelProtocolRevision; } /** * This method initializes jLabelFsb * * @return javax.swing.JLabel */ private javax.swing.JLabel getJLabelExtendedCallerId() { if (jLabelExtendedCallerId == null) { jLabelExtendedCallerId = new javax.swing.JLabel(); jLabelExtendedCallerId.setBounds(125, 110, 155, 25); jLabelExtendedCallerId.setText(""); } return jLabelExtendedCallerId; } }/** * internal class * <class or interface desc> */class ProtocolCdmaAdvancedPanel extends JPanel{ private JScrollPane jScrollPane = null; private JTable jTable = null; private ProtocolCdmaTableModel dataModel = new ProtocolCdmaTableModel(); private ProtocolCdmaInstance myInstance = null; /** * Constructor * @param myInstance */ ProtocolCdmaAdvancedPanel(ProtocolCdmaInstance myInstance) { this.myInstance = myInstance; this.setLayout(new BorderLayout()); this.add(getJScrollPane(), BorderLayout.CENTER); } void refresh() throws IntelMobileException { dataModel.initialize(); } /** * This method initializes jScrollPane * * @return javax.swing.JScrollPane */ private JScrollPane getJScrollPane() { if (jScrollPane == null) { jScrollPane = new JScrollPane(); jScrollPane.setViewportView(getJTable()); } return jScrollPane; } /** * This method initializes jTable * * @return javax.swing.JTable */ private JTable getJTable() { if (jTable == null) { jTable = new JTable(dataModel); } return jTable; } /** * internal class * <class or interface desc> */ class ProtocolCdmaTableModel extends AbstractTableModel { private final String[] names = { "Attribute", "Value", "Description" }; private Object[][] data = new Object[32][3]; // These methods always need to be implemented. public int getColumnCount() { return names.length; } public int getRowCount() { return data.length; } public Object getValueAt(int row, int col) { return data[row][col]; } // The default implementations of these methods in // AbstractTableModel would work, but we can refine them. public String getColumnName(int column) { return names[column]; } public Class getColumnClass(int col) { return String.class; //return getValueAt(0, col).getClass(); } public boolean isCellEditable(int row, int col) { return false; } public void setValueAt(Object aValue, int row, int column) { data[row][column] = aValue; } // ------------- initialize -------------- private void initialize() throws IntelMobileException { int i = 0; if(!myInstance.AnswerState.IsNull()) { data[i][0] = "AnswerState"; data[i][1] = myInstance.AnswerState.IsNull() ? "" : String.valueOf(myInstance.AnswerState.GetValue()); data[i++][2] = ""; } if(!myInstance.ProtocolRevision.IsNull()) { data[i][0] = "ProtocolRevision"; data[i][1] = myInstance.ProtocolRevision.IsNull() ? "" : String.valueOf(myInstance.ProtocolRevision.GetValue()); data[i++][2] = ""; } if(!myInstance.ExtendedCallerId.IsNull()) { data[i][0] = "ExtendedCallerId"; data[i][1] = myInstance.ExtendedCallerId.IsNull() ? "" : String.valueOf(myInstance.ExtendedCallerId.GetValue()); data[i++][2] = ""; } } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -