siliconcompilertab.java
来自「The ElectricTM VLSI Design System is an 」· Java 代码 · 共 658 行 · 第 1/2 页
JAVA
658 行
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: SiliconCompilerTab.java * * Copyright (c) 2004 Sun Microsystems and Static Free Software * * Electric(tm) is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Electric(tm) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Electric(tm); see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */package com.sun.electric.tool.user.dialogs.options;import com.sun.electric.database.text.TextUtils;import com.sun.electric.technology.ArcProto;import com.sun.electric.technology.Technology;import com.sun.electric.tool.sc.SilComp;import com.sun.electric.tool.user.dialogs.EDialog;import java.util.Iterator;import javax.swing.JPanel;/** * Class to handle the "Silicon Compiler" tab of the Preferences dialog. */public class SiliconCompilerTab extends PreferencePanel{ /** Creates new form SiliconCompilerTab */ public SiliconCompilerTab(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); // make all text fields select-all when entered EDialog.makeTextFieldSelectAllOnTab(numRows); EDialog.makeTextFieldSelectAllOnTab(horizWireWidth); EDialog.makeTextFieldSelectAllOnTab(vertWireWidth); EDialog.makeTextFieldSelectAllOnTab(powerWidth); EDialog.makeTextFieldSelectAllOnTab(mainPowerWidth); EDialog.makeTextFieldSelectAllOnTab(pWellHeight); EDialog.makeTextFieldSelectAllOnTab(pWellOffset); EDialog.makeTextFieldSelectAllOnTab(nWellHeight); EDialog.makeTextFieldSelectAllOnTab(nWellOffset); EDialog.makeTextFieldSelectAllOnTab(viaSize); EDialog.makeTextFieldSelectAllOnTab(minMetalSpacing); EDialog.makeTextFieldSelectAllOnTab(feedThruSize); EDialog.makeTextFieldSelectAllOnTab(minPortDist); EDialog.makeTextFieldSelectAllOnTab(minActiveDist); } /** return the panel to use for this preferences tab. */ public JPanel getPanel() { return siliconCompiler; } /** return the name of this preferences tab. */ public String getName() { return "Silicon Compiler"; } /** * Method called at the start of the dialog. * Caches current values and displays them in the Selection tab. */ public void init() { // the layout information numRows.setText(Integer.toString(SilComp.getNumberOfRows())); // the arc information for(Iterator<ArcProto> it = Technology.getCurrent().getArcs(); it.hasNext(); ) { ArcProto ap = it.next(); horizRoutingArc.addItem(ap.getName()); vertRoutingArc.addItem(ap.getName()); mainPowerArc.addItem(ap.getName()); } horizRoutingArc.setSelectedItem(SilComp.getHorizRoutingArc()); horizWireWidth.setText(TextUtils.formatDouble(SilComp.getHorizArcWidth())); vertRoutingArc.setSelectedItem(SilComp.getVertRoutingArc()); vertWireWidth.setText(TextUtils.formatDouble(SilComp.getVertArcWidth())); powerWidth.setText(TextUtils.formatDouble(SilComp.getPowerWireWidth())); mainPowerWidth.setText(TextUtils.formatDouble(SilComp.getMainPowerWireWidth())); mainPowerArc.setSelectedItem(SilComp.getMainPowerArc()); // the Well information pWellHeight.setText(TextUtils.formatDouble(SilComp.getPWellHeight())); pWellOffset.setText(TextUtils.formatDouble(SilComp.getPWellOffset())); nWellHeight.setText(TextUtils.formatDouble(SilComp.getNWellHeight())); nWellOffset.setText(TextUtils.formatDouble(SilComp.getNWellOffset())); // the Design Rules viaSize.setText(TextUtils.formatDouble(SilComp.getViaSize())); minMetalSpacing.setText(TextUtils.formatDouble(SilComp.getMinMetalSpacing())); feedThruSize.setText(TextUtils.formatDouble(SilComp.getFeedThruSize())); minPortDist.setText(TextUtils.formatDouble(SilComp.getMinPortDistance())); minActiveDist.setText(TextUtils.formatDouble(SilComp.getMinActiveDistance())); } /** * Method called when the "OK" panel is hit. * Updates any changed fields in the Selection tab. */ public void term() { // layout int currentNumRows = TextUtils.atoi(numRows.getText()); if (currentNumRows != SilComp.getNumberOfRows()) SilComp.setNumberOfRows(currentNumRows); // arcs String currentHorizRoutingArc = (String)horizRoutingArc.getSelectedItem(); if (!currentHorizRoutingArc.equals(SilComp.getHorizRoutingArc())) SilComp.setHorizRoutingArc(currentHorizRoutingArc); double currDouble = TextUtils.atof(horizWireWidth.getText()); if (currDouble != SilComp.getHorizArcWidth()) SilComp.setHorizArcWidth(currDouble); String currentVertRoutingArc = (String)vertRoutingArc.getSelectedItem(); if (!currentVertRoutingArc.equals(SilComp.getVertRoutingArc())) SilComp.setVertRoutingArc(currentVertRoutingArc); currDouble = TextUtils.atof(vertWireWidth.getText()); if (currDouble != SilComp.getVertArcWidth()) SilComp.setVertArcWidth(currDouble); currDouble = TextUtils.atof(powerWidth.getText()); if (currDouble != SilComp.getPowerWireWidth()) SilComp.setPowerWireWidth(currDouble); currDouble = TextUtils.atof(mainPowerWidth.getText()); if (currDouble != SilComp.getMainPowerWireWidth()) SilComp.setMainPowerWireWidth(currDouble); String currentMainPowerArc = (String)mainPowerArc.getSelectedItem(); if (!currentMainPowerArc.equals(SilComp.getMainPowerArc())) SilComp.setMainPowerArc(currentMainPowerArc); // wells currDouble = TextUtils.atof(pWellHeight.getText()); if (currDouble != SilComp.getPWellHeight()) SilComp.setPWellHeight(currDouble); currDouble = TextUtils.atof(pWellOffset.getText()); if (currDouble != SilComp.getPWellOffset()) SilComp.setPWellOffset(currDouble); currDouble = TextUtils.atof(nWellHeight.getText()); if (currDouble != SilComp.getNWellHeight()) SilComp.setNWellHeight(currDouble); currDouble = TextUtils.atof(nWellOffset.getText()); if (currDouble != SilComp.getNWellOffset()) SilComp.setNWellOffset(currDouble); // design rules currDouble = TextUtils.atof(viaSize.getText()); if (currDouble != SilComp.getViaSize()) SilComp.setViaSize(currDouble); currDouble = TextUtils.atof(minMetalSpacing.getText()); if (currDouble != SilComp.getMinMetalSpacing()) SilComp.setMinMetalSpacing(currDouble); currDouble = TextUtils.atof(feedThruSize.getText()); if (currDouble != SilComp.getFeedThruSize()) SilComp.setFeedThruSize(currDouble); currDouble = TextUtils.atof(minPortDist.getText()); if (currDouble != SilComp.getMinPortDistance()) SilComp.setMinPortDistance(currDouble); currDouble= TextUtils.atof(minActiveDist.getText()); if (currDouble != SilComp.getMinActiveDistance()) SilComp.setMinActiveDistance(currDouble); } /** * Method called when the factory reset is requested. */ public void reset() { if (SilComp.getFactoryNumberOfRows() != SilComp.getNumberOfRows()) SilComp.setNumberOfRows(SilComp.getFactoryNumberOfRows()); if (!SilComp.getFactoryHorizRoutingArc().equals(SilComp.getHorizRoutingArc())) SilComp.setHorizRoutingArc(SilComp.getFactoryHorizRoutingArc()); if (SilComp.getFactoryHorizArcWidth() != SilComp.getHorizArcWidth()) SilComp.setHorizArcWidth(SilComp.getFactoryHorizArcWidth()); if (!SilComp.getFactoryVertRoutingArc().equals(SilComp.getVertRoutingArc())) SilComp.setVertRoutingArc(SilComp.getFactoryVertRoutingArc()); if (SilComp.getFactoryVertArcWidth() != SilComp.getVertArcWidth()) SilComp.setVertArcWidth(SilComp.getFactoryVertArcWidth()); if (SilComp.getFactoryPowerWireWidth() != SilComp.getPowerWireWidth()) SilComp.setPowerWireWidth(SilComp.getFactoryPowerWireWidth()); if (SilComp.getFactoryMainPowerWireWidth() != SilComp.getMainPowerWireWidth()) SilComp.setMainPowerWireWidth(SilComp.getFactoryMainPowerWireWidth()); if (!SilComp.getFactoryMainPowerArc().equals(SilComp.getMainPowerArc())) SilComp.setMainPowerArc(SilComp.getFactoryMainPowerArc()); if (SilComp.getFactoryPWellHeight() != SilComp.getPWellHeight()) SilComp.setPWellHeight(SilComp.getFactoryPWellHeight()); if (SilComp.getFactoryPWellOffset() != SilComp.getPWellOffset()) SilComp.setPWellOffset(SilComp.getFactoryPWellOffset()); if (SilComp.getFactoryNWellHeight() != SilComp.getNWellHeight()) SilComp.setNWellHeight(SilComp.getFactoryNWellHeight()); if (SilComp.getFactoryNWellOffset() != SilComp.getNWellOffset()) SilComp.setNWellOffset(SilComp.getFactoryNWellOffset()); if (SilComp.getFactoryViaSize() != SilComp.getViaSize()) SilComp.setViaSize(SilComp.getFactoryViaSize()); if (SilComp.getFactoryMinMetalSpacing() != SilComp.getMinMetalSpacing()) SilComp.setMinMetalSpacing(SilComp.getFactoryMinMetalSpacing()); if (SilComp.getFactoryFeedThruSize() != SilComp.getFeedThruSize()) SilComp.setFeedThruSize(SilComp.getFactoryFeedThruSize()); if (SilComp.getFactoryMinPortDistance() != SilComp.getMinPortDistance()) SilComp.setMinPortDistance(SilComp.getFactoryMinPortDistance()); if (SilComp.getFactoryMinActiveDistance() != SilComp.getMinActiveDistance()) SilComp.setMinActiveDistance(SilComp.getFactoryMinActiveDistance()); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents()//GEN-BEGIN:initComponents { java.awt.GridBagConstraints gridBagConstraints; siliconCompiler = new javax.swing.JPanel(); jPanel5 = new javax.swing.JPanel(); jPanel3 = new javax.swing.JPanel(); jLabel11 = new javax.swing.JLabel(); numRows = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); horizRoutingArc = new javax.swing.JComboBox(); jLabel1 = new javax.swing.JLabel(); horizWireWidth = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); vertWireWidth = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); vertRoutingArc = new javax.swing.JComboBox(); jLabel5 = new javax.swing.JLabel(); powerWidth = new javax.swing.JTextField(); jLabel9 = new javax.swing.JLabel(); mainPowerWidth = new javax.swing.JTextField(); jLabel10 = new javax.swing.JLabel(); mainPowerArc = new javax.swing.JComboBox(); jSeparator1 = new javax.swing.JSeparator(); jPanel6 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel20 = new javax.swing.JLabel(); pWellHeight = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); pWellOffset = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel(); nWellHeight = new javax.swing.JTextField(); jLabel8 = new javax.swing.JLabel(); nWellOffset = new javax.swing.JTextField(); jPanel4 = new javax.swing.JPanel(); jLabel12 = new javax.swing.JLabel(); viaSize = new javax.swing.JTextField(); jLabel13 = new javax.swing.JLabel(); minMetalSpacing = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); feedThruSize = new javax.swing.JTextField(); jLabel15 = new javax.swing.JLabel(); minPortDist = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); minActiveDist = new javax.swing.JTextField(); jSeparator2 = new javax.swing.JSeparator(); getContentPane().setLayout(new java.awt.GridBagLayout()); setTitle("Silicon Compiler Options"); setName(""); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { closeDialog(evt); } }); siliconCompiler.setLayout(new java.awt.GridBagLayout()); jPanel5.setLayout(new javax.swing.BoxLayout(jPanel5, javax.swing.BoxLayout.Y_AXIS)); jPanel3.setLayout(new java.awt.GridBagLayout()); jPanel3.setBorder(new javax.swing.border.TitledBorder("Layout")); jLabel11.setText("Number of rows of cells:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); jPanel3.add(jLabel11, gridBagConstraints); numRows.setColumns(8); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4); jPanel3.add(numRows, gridBagConstraints); jPanel5.add(jPanel3); jPanel1.setLayout(new java.awt.GridBagLayout()); jPanel1.setBorder(new javax.swing.border.TitledBorder("Arcs")); jLabel2.setText("Horizontal routing arc:"); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4); jPanel1.add(jLabel2, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.insets = new java.awt.Insets(4, 4, 2, 4); jPanel1.add(horizRoutingArc, gridBagConstraints);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?