⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fillgendialog.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: FillGenDialog.java * * Copyright (c) 2003 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;import com.sun.electric.database.hierarchy.Cell;import com.sun.electric.database.text.TextUtils;import com.sun.electric.technology.DRCTemplate;import com.sun.electric.technology.Layer;import com.sun.electric.technology.Technology;import com.sun.electric.tool.Job;import com.sun.electric.tool.drc.DRC;import com.sun.electric.tool.generator.layout.TechType;import com.sun.electric.tool.generator.layout.fill.FillGenConfig;import com.sun.electric.tool.generator.layout.fill.FillGenJob;import com.sun.electric.tool.generator.layout.fill.FillGeneratorTool;import com.sun.electric.tool.user.ui.TopLevel;import java.awt.Component;import java.awt.Container;import java.awt.Dimension;import java.awt.Frame;import java.awt.GridBagConstraints;import java.awt.Insets;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.geom.Rectangle2D;import java.lang.reflect.Constructor;import java.util.ArrayList;import java.util.List;import javax.swing.ButtonGroup;import javax.swing.DefaultComboBoxModel;import javax.swing.JButton;import javax.swing.JCheckBox;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JRadioButton;import javax.swing.JTextField;/** * Unused class to manage fill generators. */public class FillGenDialog extends EDialog {    private JCheckBox[] tiledCells;    private List<FillGenButton> metalOptions = new ArrayList<FillGenButton>();    private Technology tech;    private static class FillGenButton extends JCheckBox    {        JTextField vddSpace, vddWidth, gndSpace, gndWidth;        JComboBox vddUnit, vddWUnit, gndUnit, gndWUnit;        int metal;        FillGenButton(int metal)        {            super("Metal " + metal);            this.metal = metal;        }    }    /** Creates new form FillGenDialog */    public FillGenDialog(Technology tech, Frame parent) {        super(parent, true);        this.tech = tech;        // Setting the correct default        initComponents();        templateButton.setSelected(true);        // top group        topGroup.add(templateButton);        assert(tech != null);        // Setting the title        setTitle("Fill Cell Generator for '" + tech.getTechName() + "'");        int numMetals = tech.getNumMetals();        String[] units = new String[] { "lambda", "tracks" };        for (int i = 0; i < numMetals; i++)        {            int metal = i+1;            Layer metalLayer = tech.findLayer("Metal-"+metal);            DRCTemplate rule = DRC.getSpacingRule(metalLayer, null, metalLayer, null, false, -1, 0, 0);            FillGenButton button = new FillGenButton(metal);            metalOptions.add(button);            java.awt.GridBagConstraints gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 0;            gridBagConstraints.gridy = metal;            gridBagConstraints.insets = new Insets(0, 5, 0, 0);            metalPanel.add(button, gridBagConstraints);            button.addActionListener(new ActionListener() {                public void actionPerformed(ActionEvent evt) {                    metalOptionActionPerformed(evt);                }            });            button.setSelected(false);            // vdd space            JTextField text = new JTextField();            button.vddSpace = text;            text.setColumns(4);            text.setHorizontalAlignment(javax.swing.JTextField.TRAILING);            if (rule != null)                text.setText(Double.toString(rule.getValue(0)));            text.setMinimumSize(new Dimension(40, 21));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 1;            gridBagConstraints.gridy = metal;            metalPanel.add(text, gridBagConstraints);            // vdd space unit            JComboBox combox = new JComboBox();            button.vddUnit = combox;            combox.setModel(new javax.swing.DefaultComboBoxModel(units));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 2;            gridBagConstraints.gridy = metal;            metalPanel.add(combox, gridBagConstraints);            // Gnd space            text = new JTextField();            button.gndSpace = text;            text.setColumns(4);            text.setHorizontalAlignment(javax.swing.JTextField.TRAILING);            text.setText(Double.toString(rule.getValue(0)));            text.setMinimumSize(new Dimension(40, 21));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 3;            gridBagConstraints.gridy = metal;            gridBagConstraints.insets = new Insets(0, 10, 0, 0);            metalPanel.add(text, gridBagConstraints);            // Gnd space unit            combox = new JComboBox();            button.gndUnit = combox;            combox.setModel(new DefaultComboBoxModel(units));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 4;            gridBagConstraints.gridy = metal;            metalPanel.add(combox, gridBagConstraints);            // Min size rule            rule = DRC.getMinValue(metalLayer, DRCTemplate.DRCRuleType.MINWID);            // vdd width            text = new JTextField();            button.vddWidth = text;            text.setColumns(4);            text.setHorizontalAlignment(JTextField.TRAILING);            text.setText(Double.toString(rule.getValue(0)));            text.setMinimumSize(new Dimension(40, 21));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 5;            gridBagConstraints.gridy = metal;            gridBagConstraints.insets = new Insets(0, 5, 0, 0);            metalPanel.add(text, gridBagConstraints);            // vdd width unit            combox = new JComboBox();            button.vddWUnit = combox;            combox.setModel(new DefaultComboBoxModel(units));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 6;            gridBagConstraints.gridy = metal;            metalPanel.add(combox, gridBagConstraints);            // Gnd width            text = new JTextField();            button.gndWidth = text;            text.setColumns(4);            text.setHorizontalAlignment(JTextField.TRAILING);            text.setText(Double.toString(rule.getValue(0)));            text.setMinimumSize(new Dimension(40, 21));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 7;            gridBagConstraints.gridy = metal;            gridBagConstraints.insets = new Insets(0, 5, 0, 0);            metalPanel.add(text, gridBagConstraints);            // Gnd width unit            combox = new JComboBox();            button.gndWUnit = combox;            combox.setModel(new DefaultComboBoxModel(units));            gridBagConstraints = new GridBagConstraints();            gridBagConstraints.gridx = 8;            gridBagConstraints.gridy = metal;            metalPanel.add(combox, gridBagConstraints);        }        // Loading tiles information        tiledCells = new JCheckBox[12];        tiledCells[0] = jCheckBox1;        tiledCells[1] = jCheckBox2;        tiledCells[2] = jCheckBox3;        tiledCells[3] = jCheckBox4;        tiledCells[4] = jCheckBox5;        tiledCells[5] = jCheckBox6;        tiledCells[6] = jCheckBox7;        tiledCells[7] = jCheckBox8;        tiledCells[8] = jCheckBox9;        tiledCells[9] = jCheckBox10;        tiledCells[10] = jCheckBox11;        tiledCells[11] = jCheckBox12;        try        {            Class<?> extraPanelClass = Class.forName("com.sun.electric.plugins.generator.FillCelllGenPanel");            Constructor instance = extraPanelClass.getDeclaredConstructor(FillGenDialog.class, JPanel.class,            ButtonGroup.class, JButton.class, JRadioButton.class);  // using varargs            instance.newInstance(this, floorplanPanel, topGroup, okButton, templateButton); // using varargs        } catch (Exception e)        {             if (Job.getDebug())                System.out.println("GNU Release can't find the Fill Cell Generator dialog");            // Adding here the default OKAction            okButton.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                okButtonActionPerformed();            }            });            optionActionPerformed();        }        finishInitialization();        setVisible(true);   }    /** 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.     */    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents    private void initComponents() {        java.awt.GridBagConstraints gridBagConstraints;        topGroup = new javax.swing.ButtonGroup();        jTabbedPane1 = new javax.swing.JTabbedPane();        floorplanPanel = new javax.swing.JPanel();        metalPanel = new javax.swing.JPanel();        vddSpaceLabel = new javax.swing.JLabel();        vddWidthLabel = new javax.swing.JLabel();        gndSpaceLabel = new javax.swing.JLabel();        gndWidthLabel = new javax.swing.JLabel();        templatePanel = new javax.swing.JPanel();        masterDimPanel = new javax.swing.JPanel();        jTextField2 = new javax.swing.JTextField();        jTextField1 = new javax.swing.JTextField();        jLabel3 = new javax.swing.JLabel();

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -