📄 inputtablepanel.java
字号:
/* * $RCSfile: InputTablePanel.java,v $ * $Revision: 1.7 $ * $Date: 2005/04/30 02:43:46 $ * * 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.newnetwork;import java.awt.*;import java.awt.event.*;import java.util.ResourceBundle;import java.util.Vector;import javax.swing.*;import javax.swing.border.*;import neuralnetworktoolkit.gui.AttributesTable;/** * * * @version $Revision: 1.7 $ - $Date: 2005/04/30 02:43:46 $ * * @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 InputTablePanel extends JPanel { private int[] outputIndex = {}; private String selectionLabel; private AttributesTable table; private JPanel buttonsPanel; private JPanel inferiorPanel; private JButton forwardButton; private JButton backButton; private JLabel selectedColumnLabel; private JScrollPane tableScrollPane; private ResourceBundle resource; private ResourceBundle iconsResource; /** * * @param frame * @param displayData * @param displayHeader */ public InputTablePanel(Vector displayData, Vector displayHeader) { resource = ResourceBundle .getBundle("neuralnetworktoolkit.gui.newnetwork.resources.InputTablePanelResource"); iconsResource = ResourceBundle .getBundle("neuralnetworktoolkit.gui.resources.IconsResource"); this.setLayout(new BorderLayout()); selectionLabel = resource.getString("selectionLabel"); selectedColumnLabel = new JLabel(); selectedColumnLabel.setText(selectionLabel + resource.getString("noSelection")); forwardButton = new JButton(); forwardButton.setIcon((ImageIcon) iconsResource .getObject("stock_right24")); forwardButton.setEnabled(false); backButton = new JButton(); backButton.setIcon((ImageIcon) iconsResource .getObject("stock_left24")); backButton.setEnabled(false); buttonsPanel = new JPanel(); buttonsPanel.setLayout(new GridLayout(1, 2)); buttonsPanel.add(backButton); buttonsPanel.add(forwardButton); inferiorPanel = new JPanel(); inferiorPanel.setLayout(new BorderLayout()); inferiorPanel.add(buttonsPanel, BorderLayout.EAST); inferiorPanel.add(selectedColumnLabel, BorderLayout.WEST); inferiorPanel.setBorder(new EmptyBorder(8, 2, 2, 2)); table = new AttributesTable(displayData, displayHeader); tableScrollPane = new JScrollPane(table); table.setToolTipText(resource.getString("tableTip")); table.addMouseListener(new SelectionColumnListener()); this.add(tableScrollPane, BorderLayout.CENTER); this.add(inferiorPanel, BorderLayout.SOUTH); } //InputTablePanel() /** * * @return */ public int[] getOutputIndex() { return outputIndex; } //getOutputIndex() /** * * @param outputIndex */ public void setOutputIndex(int[] outputIndex) { this.outputIndex = outputIndex; } //setOutputIndex() /** * * */ private class SelectionColumnListener implements MouseListener { public void mouseClicked(MouseEvent evt) { } //mouseClicked() public void mouseEntered(MouseEvent evt) { } //mouseEntered() public void mouseExited(MouseEvent evt) { } //mouseExited() public void mousePressed(MouseEvent evt) { } //mousePressed() public void mouseReleased(MouseEvent evt) { setOutputIndex(table.getSelectedColumns()); selectedColumnLabel.setText(selectionLabel + "<b>" + table.getColumnName(table.getSelectedColumn()) + "</b></html>"); } //mouseReleased() } //SelectionColumnListener} //InputTablePanel
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -