source: trunk/java-client/org/nzdl/gsdl/SimpleGraphicalClient/BerryBasketModel.java@ 2225

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

added QueryHistory, tooltips on collectionInfoButton. Altered
CSModel to retain CollectionInfo objects and longCollectionNames
for performance. Added files for a BerryBasket - to be turned on
soon. Added sorting of the QueryHistory via the TableMap and TableSorter
files - from the Java Swing tutorial - not sure about GPL status
of these 2.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1/*
2 * BerryBasketModel.java
3 * Copyright (C) 2001 New Zealand Digital Library Project
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 */
19package org.nzdl.gsdl.SimpleGraphicalClient;
20
21
22import java.util.*;
23import javax.swing.event.*;
24import javax.swing.*;
25import javax.swing.table.*;
26import java.awt.*;
27
28
29class BerryBasketModel extends AbstractTableModel
30{
31
32 String[] content = {"Doc1", "Doc2", "Doc3"};
33 String[] columnTitles = {"Document", "Person", "Date"};
34
35
36 public BerryBasketModel()
37 {
38 super();
39 }
40
41 public void add(Berry berry)
42 {
43 System.out.println("adding to BerryBasketModel: " + berry.toString());
44 //addElement(berry);
45 }
46
47
48 public int getColumnCount() { return columnTitles.length; }
49
50 public int getRowCount() { return content.length;}
51
52 public Object getValueAt(int row, int col) {
53 // get Berry object
54 // extract document title (say), person, date info from Berry object
55 // depending on column number
56 // column reordering shouldn't matter, all
57 // gets dealt with automatically
58 return Color.black;
59 }
60
61 public String getColumnName(int col) {
62 return columnTitles[col];
63 }
64
65}
Note: See TracBrowser for help on using the repository browser.