📄 gatelaygentab.java
字号:
gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 50); getContentPane().add(nmoswellLabel, gridBagConstraints); nmoswellText.setHorizontalAlignment(javax.swing.JTextField.CENTER); nmoswellText.setMinimumSize(new java.awt.Dimension(5, 19)); nmoswellText.setPreferredSize(new java.awt.Dimension(50, 19)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 14; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); getContentPane().add(nmoswellText, gridBagConstraints); help6.setText("?"); help6.setToolTipText("Updates global Auto. Layout Gen. settings"); help6.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); help6.setMargin(new java.awt.Insets(0, 0, 0, 0)); help6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { help6ActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 14; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 0); getContentPane().add(help6, gridBagConstraints); pmoswellLabel.setText("PMOS Well Height"); pmoswellLabel.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 16; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 50); getContentPane().add(pmoswellLabel, gridBagConstraints); pmoswellText.setHorizontalAlignment(javax.swing.JTextField.CENTER); pmoswellText.setMinimumSize(new java.awt.Dimension(5, 19)); pmoswellText.setPreferredSize(new java.awt.Dimension(50, 19)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 16; gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST; gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 0); getContentPane().add(pmoswellText, gridBagConstraints); help7.setText("?"); help7.setToolTipText("Updates global Auto. Layout Gen. settings"); help7.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); help7.setMargin(new java.awt.Insets(0, 0, 0, 0)); help7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { help7ActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 16; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 0); getContentPane().add(help7, gridBagConstraints); simpleNameCheck.setText("Simple Name"); simpleNameCheck.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); simpleNameCheck.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING); simpleNameCheck.setMargin(new java.awt.Insets(0, 0, 0, 0)); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 18; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 50); getContentPane().add(simpleNameCheck, gridBagConstraints); help8.setText("?"); help8.setToolTipText("Updates global Auto. Layout Gen. settings"); help8.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); help8.setMargin(new java.awt.Insets(0, 0, 0, 0)); help8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { help8ActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 18; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(0, 5, 10, 0); getContentPane().add(help8, gridBagConstraints); reset.setText("Reset"); reset.setToolTipText("Updates global Auto. Layout Gen. settings"); reset.setHorizontalAlignment(javax.swing.SwingConstants.LEFT); reset.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { resetActionPerformed(evt); } }); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 20; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 0); getContentPane().add(reset, gridBagConstraints); pack(); }// </editor-fold>//GEN-END:initComponents private void help8ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help8ActionPerformed {//GEN-HEADEREND:event_help8ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help8ActionPerformed private void help7ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help7ActionPerformed {//GEN-HEADEREND:event_help7ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help7ActionPerformed private void help6ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help6ActionPerformed {//GEN-HEADEREND:event_help6ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help6ActionPerformed private void help5ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help5ActionPerformed {//GEN-HEADEREND:event_help5ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help5ActionPerformed private void help1ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help1ActionPerformed {//GEN-HEADEREND:event_help1ActionPerformed JOptionPane.showMessageDialog(parent, "check Enable NCC and select a library. After generating layout, NCC uses this library as a reference"); }//GEN-LAST:event_help1ActionPerformed private void help2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help2ActionPerformed {//GEN-HEADEREND:event_help2ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help2ActionPerformed private void help3ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help3ActionPerformed {//GEN-HEADEREND:event_help3ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help3ActionPerformed private void help4ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_help4ActionPerformed {//GEN-HEADEREND:event_help4ActionPerformed// TODO add your handling code here: }//GEN-LAST:event_help4ActionPerformed private void resetActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_resetActionPerformed {//GEN-HEADEREND:event_resetActionPerformed initializeFields();// techCombo.setSelectedIndex(0);// nccCheck.setSelected(false);// libLabel.setEnabled(false);// libCombo.setEnabled(false);// quantText.setText("0");// mosWidthText.setText("1000");// vddyText.setText("21");// gndyText.setText("-21");// nmoswellText.setText("84");// pmoswellText.setText("84");// simpleNameCheck.setSelected(false); }//GEN-LAST:event_resetActionPerformed private class EmptyFieldException extends Exception { public static final long serialVersionUID = 0; String error = new String(); EmptyFieldException(String error) { super(); this.error = error; } } /** Method called when the "OK" panel is hit. * Updates any changed fields in the Layout Generation tab. */ @Override public void term() { if(!fieldsAreValid()) return; setString(foundrySetting, (String)techCombo.getSelectedItem()); String newNccCheck = nccCheck.isSelected() ? (String)libCombo.getSelectedItem() : ""; setString(enableNCCSetting, newNccCheck); setInt(sizeQuantizationErrorSetting, Integer.parseInt(quantText.getText())); setInt(maxMosWidthSetting, Integer.parseInt(mosWidthText.getText())); setInt(vddYSetting, Integer.parseInt(vddyText.getText())); setInt(gndYSetting, Integer.parseInt(gndyText.getText())); setInt(nmosWellHeightSetting, Integer.parseInt(nmoswellText.getText())); setInt(pmosWellHeightSetting, Integer.parseInt(pmoswellText.getText())); setBoolean(simpleNameSetting, simpleNameCheck.isSelected()); } private boolean fieldsAreValid() { String param = new String(); //String errorField = new String(); try { //REFERENCE LIBRARY if(nccCheck.isSelected()) { param = (String)libCombo.getSelectedItem(); if(param.equals("")) throw new EmptyFieldException("Library Reference"); } //QUANTIZATION ERROR param = quantText.getText(); if(param.equals("")) throw new EmptyFieldException("Quantization Error"); //MAX. MOS WIDTH param = mosWidthText.getText(); if(param.equals("")) throw new EmptyFieldException("Maximum MOS Width"); //VDD Y COORDINATE param = vddyText.getText(); if(param.equals("")) throw new EmptyFieldException("VDD Y Coordinate"); //Gnd Y Coordinate param = gndyText.getText(); if(param.equals("")) throw new EmptyFieldException("Gnd Y Coordinate"); //NMOS Well Height param = nmoswellText.getText(); if(param.equals("")) throw new EmptyFieldException("NMOS Well Height"); //PMOS Well Height param = pmoswellText.getText(); if(param.equals("")) throw new EmptyFieldException("PMOS Well Height"); //Set Simple Name //boolean paramBl = simpleNameCheck.isSelected(); } catch(EmptyFieldException e) { JOptionPane.showMessageDialog(parent, "Cannot leave " + e.error + " blank!"); return false; } catch(NumberFormatException e) { JOptionPane.showMessageDialog(parent, "Non-numeric value entered in a numeric field!"); return false; } return true; } private void nccCheckActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nccCheckActionPerformed// TODO add your handling code here: boolean check = nccCheck.isSelected(); libLabel.setEnabled(check); libCombo.setEnabled(check); }//GEN-LAST:event_nccCheckActionPerformed // /**// * @param args the command line arguments// */// public static void main(String args[])// {// java.awt.EventQueue.invokeLater(new Runnable()// {// public void run()// {// new GateLayGenTab(new javax.swing.JFrame(), true).setVisible(true);// }// });// } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel gndyLabel; private javax.swing.JTextField gndyText; private javax.swing.JButton help1; private javax.swing.JButton help2; private javax.swing.JButton help3; private javax.swing.JButton help4; private javax.swing.JButton help5; private javax.swing.JButton help6; private javax.swing.JButton help7; private javax.swing.JButton help8; private javax.swing.JComboBox libCombo; private javax.swing.JLabel libLabel; private javax.swing.JLabel maxMosLabel; private javax.swing.JTextField mosWidthText; private javax.swing.JCheckBox nccCheck; private javax.swing.JLabel nmoswellLabel; private javax.swing.JTextField nmoswellText; private javax.swing.JLabel pmoswellLabel; private javax.swing.JTextField pmoswellText; private javax.swing.JLabel quantLabel; private javax.swing.JTextField quantText; private javax.swing.JButton reset; private javax.swing.JCheckBox simpleNameCheck; private javax.swing.JComboBox techCombo; private javax.swing.JLabel techLabel; private javax.swing.JLabel vddyLabel; private javax.swing.JTextField vddyText; // End of variables declaration//GEN-END:variables /** Closes the dialog */// private void closeDialog(java.awt.event.WindowEvent evt)// {// setVisible(false);// dispose();// } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -