?? companydetailscomponent.java
字號:
/* CRMS, customer relationship management system Copyright (C) 2003 Service To Youth Council This program 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 2 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA For further information contact the SYC ICT department on GPL@syc.net.au 98 Kermode Street North Adelaide South Australia SA 5006 +61 (0)8 8367 0755 *//* * CompanyDetailsComponent * * Created on 08/12/2003 */package crms.applet.company;import javax.swing.*;import javax.swing.border.*;import javax.swing.event.*;import java.awt.*;import java.awt.event.*;import java.util.*;import org.w3c.dom.*;import crms.util.*;import crms.vo.*;import crms.module.*;import crms.ui.*;/** * * @author tnichols */public class CompanyDetailsComponent extends CRMSComponent { Company company = null; JTextField companyName = new JTextField(); JTextArea companyProfile = new JTextArea(); JTextField companySize = new JTextField(); JTextField companyIndustry = new JTextField(); public CompanyDetailsComponent(Company company) { setCompany(company); } public CompanyDetailsComponent() { this(null); } public void setBackground(Color color) { super.setBackground(color); if (companyName == null) return; companyName.setBackground(color); companySize.setBackground(color); companyIndustry.setBackground(color); companyProfile.setBackground(color); } public void init() { GridBagLayout gbl = new GridBagLayout(); setBackground(new Color(0xF0,0xFF,0xF5)); setLayout(gbl); setBorder(new EmptyBorder(4,4,4,4)); Insets defaultInsets = new Insets(4,0,0,4); // X Y W H WX WY \ anchor, fill, insets, paddingx paddingy add(new JLabel("Name"), new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, defaultInsets, 0, 0)); add(companyName, new GridBagConstraints(1, 0, 3, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, defaultInsets, 0, 0)); companyName.setEditable(false); add(new JLabel("Industry"), new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, defaultInsets, 0, 0)); add(companyIndustry, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, defaultInsets, 0, 0)); companyIndustry.setEditable(false); add(new JLabel("Size"), new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, defaultInsets, 0, 0)); add(companySize, new GridBagConstraints(3, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, defaultInsets, 0, 0)); companySize.setEditable(false); add(new JLabel("Profile"), new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, defaultInsets, 0, 0)); add(companyProfile, new GridBagConstraints(1, 2, 3, 3, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, defaultInsets, 0, 45)); companyProfile.setEditable(false); } public void setCompany(Company company) { this.company = company; if (company != null) { // update fields System.out.println("updating company=" + company); companyName.setText(company.getCompanyName()); companyProfile.setText(company.getNotes()); CompanySizeCode csc = company.getCompanySize(); if (csc != null) companySize.setText(csc.getName()); CompanyIdentifiersTypeCode ctc = company.getCompanyType(); if (ctc != null) companyIndustry.setText(ctc.getName()); } } }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -