source: trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/BerryBasketPanel.java@ 2281

Last change on this file since 2281 was 2281, checked in by daven, 23 years ago

turned on the BerryBasket. Try right-clicking on a result in the results List
to add one - no delete yet. Re-sizing maybe improved as well - no
guarantees yet though.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1
2/*
3 * BerryBasketPanel.java
4 * Copyright (C) 2001 New Zealand Digital Library Project
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20package org.nzdl.gsdl.SimpleGraphicalClient;
21
22
23import javax.swing.*;
24import javax.swing.table.*;
25import javax.swing.border.*;
26import java.awt.*;
27import java.awt.event.*;
28import java.util.*;
29
30
31public class BerryBasketPanel extends JPanel implements Constants {
32
33 BerryBasketModel berryModel;
34 JTable berryTable;
35 JList berryList;
36 JScrollPane scrollBerryPane;
37
38 public BerryBasketPanel(CSModel csModel) {
39 super();
40 setLayout( new BorderLayout() );
41 setBorder(BorderFactory.createTitledBorder("BerryBasket"));
42 berryModel = csModel.getBerryBasketModel();
43 berryTable = new JTable(berryModel);
44
45 berryTable.setFont(berryFont);
46 berryTable.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
47
48 //berryTable.setDefaultRenderer(Color.class, new BerryCellRenderer());
49 scrollBerryPane = new JScrollPane(berryTable);
50 berryTable.setPreferredScrollableViewportSize(new Dimension(100, 70));
51
52 add(scrollBerryPane, BorderLayout.CENTER);
53 } //end constructor
54
55
56 class BerryCellRenderer extends JLabel implements TableCellRenderer {
57
58 public Component getTableCellRendererComponent(JTable table,
59 Object value,
60 boolean isSelected,
61 boolean hasFocus,
62 int row,
63 int column) {
64 this.setText(value.toString());
65 return this;
66 } // end getTableCellRendererComponent
67
68
69 } // end BerryCellRenderer
70
71} // end BerryBasketPanel
Note: See TracBrowser for help on using the repository browser.