📄 attributestable.java
字号:
/* * $RCSfile: AttributesTable.java,v $ * $Revision: 1.3 $ * $Date: 2005/04/26 02:02:25 $ * * NeuralNetworkToolkit * Copyright (C) 2004 Universidade de Brasília * * This file is part of NeuralNetworkToolkit. * * NeuralNetworkToolkit 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. * * NeuralNetworkToolkit 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 NeuralNetworkToolkit; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 - USA. */package neuralnetworktoolkit.gui;import java.util.Vector;import javax.swing.*;import javax.swing.table.*;/** * * * @version 1.0 21 Jun 2004 * * @author <a href="mailto:rodbra@pop.com.br">Rodrigo C. M. Coimbra</a> * @author <a href="mailto:hugoiver@yahoo.com.br">Hugo Iver V. Gon�alves</a> */public class AttributesTable extends JTable { private DefaultTableModel tableModel; /** * * */ public AttributesTable() { super(); tableModel = new DefaultTableModel(); this.setModel(tableModel); setDefaultProperties(); } //AttributesTable() /** * * @param attributeValues * @param attributesNames */ public AttributesTable(String[][] attributeValues, String[] attributesNames) { super(); tableModel = new DefaultTableModel(attributeValues, attributesNames); this.setModel(tableModel); setDefaultProperties(); } //AttributesTable() /** * Builds a new attributes table. * * @param attributeValuesVector Initial values for attributes. * @param attributesNamesVector Attributes names for table header. */ public AttributesTable(Vector attributeValuesVector, Vector attributesNamesVector) { super(); tableModel = new DefaultTableModel(attributeValuesVector, attributesNamesVector); this.setModel(tableModel); setDefaultProperties(); } //AttributesTable() /** * * @param tableModel */ public AttributesTable(DefaultTableModel tableModel) { super(); this.tableModel = tableModel; setModel(this.tableModel); setDefaultProperties(); } //AttributesTable() /** * * @param numRows * @param numColumns */ public AttributesTable(int numRows, int numColumns){ super(); this.tableModel = new DefaultTableModel(numRows, numColumns); setModel(tableModel); setDefaultProperties(); } //AttributesTable() /** * * @return */ public boolean isLastRow() { if(tableModel.getRowCount()==1) return true; else return false; } //isLastRow() /** * * @return */ public boolean isLastColumn() { if(this.getColumnCount()==1) return true; else return false; } //isLastColumn() /** * * */ public void setDefaultProperties() { setAutoResizeMode(JTable.AUTO_RESIZE_OFF); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); getTableHeader().setReorderingAllowed(false); setColumnSelectionAllowed(true); setRowSelectionAllowed(false); } //setDefaultProperties() /** * * */ public void setInferenceProperties() { setAutoResizeMode(JTable.AUTO_RESIZE_OFF); setSelectionMode(ListSelectionModel.SINGLE_SELECTION); getTableHeader().setReorderingAllowed(false); setColumnSelectionAllowed(false); setRowSelectionAllowed(true); } //setInferenceProperties() } //AttributesTable
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -