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

📄 ncctab.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: NCCTab.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.tool.ncc.NccOptions;import com.sun.electric.tool.ncc.NccPreferences;import com.sun.electric.tool.user.dialogs.EDialog;import javax.swing.JPanel;/** * Class to handle the "NCC" tab of the Preferences dialog. */public class NCCTab extends PreferencePanel{	/** Creates new form NCCTab */	public NCCTab(java.awt.Frame parent, boolean modal)	{		super(parent, modal);		initComponents();		// make all text fields select-all when entered	    EDialog.makeTextFieldSelectAllOnTab(relativeSizeTolerance);	    EDialog.makeTextFieldSelectAllOnTab(absoluteSizeTolerance);	    EDialog.makeTextFieldSelectAllOnTab(howMuchStatus);	    EDialog.makeTextFieldSelectAllOnTab(maxMatched);	    EDialog.makeTextFieldSelectAllOnTab(maxMismatched);	    EDialog.makeTextFieldSelectAllOnTab(maxMembers);	}	/** return the panel to use for this preferences tab. */	public JPanel getPanel() { return ncc; }	/** return the name of this preferences tab. */	public String getName() { return "NCC"; }	private void setOperation(int op) {        switch (op) {            case NccOptions.HIER_EACH_CELL: hierAll.setSelected(true); break;            case NccOptions.FLAT_TOP_CELL: flatTop.setSelected(true); break;            case NccOptions.LIST_ANNOTATIONS: listAnn.setSelected(true); break;            default: hierAll.setSelected(true); break;        }    }    private int getOperation() {        if (hierAll.isSelected()) return NccOptions.HIER_EACH_CELL;        if (flatTop.isSelected()) return NccOptions.FLAT_TOP_CELL;        if (listAnn.isSelected()) return NccOptions.LIST_ANNOTATIONS;        return NccOptions.HIER_EACH_CELL;    }        /**	 * Method called at the start of the dialog.	 * Caches current values and displays them in the NCC tab.	 */	public void init()	{		enableSizeChecking.setSelected(NccPreferences.getCheckSizes());		relativeSizeTolerance.setText(Double.toString(NccPreferences.getRelativeSizeTolerance()));		absoluteSizeTolerance.setText(Double.toString(NccPreferences.getAbsoluteSizeTolerance()));		haltAfterFindingFirstMismatchedCell.setSelected(NccPreferences.getHaltAfterFirstMismatch());        skipPassed.setSelected(NccPreferences.getSkipPassed());        maxMatched.setText(Integer.toString(NccPreferences.getMaxMatchedClasses()));        maxMismatched.setText(Integer.toString(NccPreferences.getMaxMismatchedClasses()));        maxMembers.setText(Integer.toString(NccPreferences.getMaxClassMembers()));        setOperation(NccPreferences.getOperation());        howMuchStatus.setText(Integer.toString(NccPreferences.getHowMuchStatus()));	}	/**	 * Method called when the "OK" panel is hit.	 * Updates any changed fields in the NCC tab.	 */	public void term()	{		boolean currBoolean = enableSizeChecking.isSelected();		if (currBoolean!=NccPreferences.getCheckSizes()) {			NccPreferences.setCheckSizes(currBoolean);		}		double currDouble = TextUtils.atof(relativeSizeTolerance.getText(), new Double(NccPreferences.getRelativeSizeTolerance()));		if (currDouble!=NccPreferences.getRelativeSizeTolerance()) {			NccPreferences.setRelativeSizeTolerance(currDouble);		}		currDouble = TextUtils.atof(absoluteSizeTolerance.getText(), new Double(NccPreferences.getAbsoluteSizeTolerance()));		if (currDouble!=NccPreferences.getAbsoluteSizeTolerance()) {			NccPreferences.setAbsoluteSizeTolerance(currDouble);		}		currBoolean = haltAfterFindingFirstMismatchedCell.isSelected();		if (currBoolean!=			NccPreferences.getHaltAfterFirstMismatch()) {			NccPreferences.setHaltAfterFirstMismatch(currBoolean);		}        currBoolean = skipPassed.isSelected();        if (currBoolean!=NccPreferences.getSkipPassed()) {            NccPreferences.setSkipPassed(currBoolean);        }        int currInt = Integer.parseInt(maxMatched.getText());        if (currInt!=NccPreferences.getMaxMatchedClasses()) {            NccPreferences.setMaxMatchedClasses(currInt);        }        currInt = Integer.parseInt(maxMismatched.getText());        if (currInt!=NccPreferences.getMaxMismatchedClasses()) {            NccPreferences.setMaxMismatchedClasses(currInt);        }        currInt = Integer.parseInt(maxMembers.getText());        if (currInt!=NccPreferences.getMaxClassMembers()) {            NccPreferences.setMaxClassMembers(currInt);        }        currInt = getOperation();        if (currInt!=NccPreferences.getOperation()) {            NccPreferences.setOperation(currInt);        }        currInt = Integer.parseInt(howMuchStatus.getText());        if (currInt!=NccPreferences.getHowMuchStatus()) {            NccPreferences.setHowMuchStatus(currInt);        }	}	/**	 * Method called when the factory reset is requested.	 */	public void reset()	{		if (NccPreferences.getFactoryOperation() != NccPreferences.getOperation())			NccPreferences.setOperation(NccPreferences.getFactoryOperation());		if (NccPreferences.getFactoryCheckSizes() != NccPreferences.getCheckSizes())			NccPreferences.setCheckSizes(NccPreferences.getFactoryCheckSizes());		if (NccPreferences.getFactoryRelativeSizeTolerance() != NccPreferences.getRelativeSizeTolerance())			NccPreferences.setRelativeSizeTolerance(NccPreferences.getFactoryRelativeSizeTolerance());		if (NccPreferences.getFactoryAbsoluteSizeTolerance() != NccPreferences.getAbsoluteSizeTolerance())			NccPreferences.setAbsoluteSizeTolerance(NccPreferences.getFactoryAbsoluteSizeTolerance());		if (NccPreferences.getFactoryHaltAfterFirstMismatch() != NccPreferences.getHaltAfterFirstMismatch())			NccPreferences.setHaltAfterFirstMismatch(NccPreferences.getFactoryHaltAfterFirstMismatch());		if (NccPreferences.getFactorySkipPassed() != NccPreferences.getSkipPassed())			NccPreferences.setSkipPassed(NccPreferences.getFactorySkipPassed());		if (NccPreferences.getFactoryHowMuchStatus() != NccPreferences.getHowMuchStatus())			NccPreferences.setHowMuchStatus(NccPreferences.getFactoryHowMuchStatus());		if (NccPreferences.getFactoryMaxMismatchedClasses() != NccPreferences.getMaxMismatchedClasses())			NccPreferences.setMaxMatchedClasses(NccPreferences.getFactoryMaxMatchedClasses());		if (NccPreferences.getFactoryMaxMismatchedClasses() != NccPreferences.getMaxMismatchedClasses())			NccPreferences.setMaxMismatchedClasses(NccPreferences.getFactoryMaxMismatchedClasses());		if (NccPreferences.getFactoryMaxClassMembers() != NccPreferences.getMaxClassMembers())			NccPreferences.setMaxClassMembers(NccPreferences.getFactoryMaxClassMembers());	}	/** 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;        operationGroup = new javax.swing.ButtonGroup();        ncc = new javax.swing.JPanel();        operation = new javax.swing.JPanel();        hierAll = new javax.swing.JRadioButton();        flatTop = new javax.swing.JRadioButton();        listAnn = new javax.swing.JRadioButton();        sizeChecking = new javax.swing.JPanel();        enableSizeChecking = new javax.swing.JCheckBox();        jLabel75 = new javax.swing.JLabel();        jLabel76 = new javax.swing.JLabel();        relativeSizeTolerance = new javax.swing.JTextField();        absoluteSizeTolerance = new javax.swing.JTextField();        checkingAllCells = new javax.swing.JPanel();        haltAfterFindingFirstMismatchedCell = new javax.swing.JCheckBox();        skipPassed = new javax.swing.JCheckBox();        progressReport = new javax.swing.JPanel();        jLabel4 = new javax.swing.JLabel();        howMuchStatus = new javax.swing.JTextField();        errorReport = new javax.swing.JPanel();        jLabel1 = new javax.swing.JLabel();        jLabel2 = new javax.swing.JLabel();        jLabel3 = new javax.swing.JLabel();        maxMatched = new javax.swing.JTextField();        maxMismatched = new javax.swing.JTextField();        maxMembers = new javax.swing.JTextField();        getContentPane().setLayout(new java.awt.GridBagLayout());        setTitle("Tool Options");        setName("");        addWindowListener(new java.awt.event.WindowAdapter() {            public void windowClosing(java.awt.event.WindowEvent evt) {                closeDialog(evt);            }        });        ncc.setLayout(new java.awt.GridBagLayout());        operation.setLayout(new java.awt.GridBagLayout());        operation.setBorder(javax.swing.BorderFactory.createTitledBorder("Operation"));        operationGroup.add(hierAll);        hierAll.setText("Hierarchical Comparison");        hierAll.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                hierAllActionPerformed(evt);            }        });        gridBagConstraints = new java.awt.GridBagConstraints();        gridBagConstraints.gridx = 0;        gridBagConstraints.gridy = 0;

⌨️ 快捷键说明

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