/* //paragraph [1] Title: [{\Large \bf \begin{center}] [\end{center}}] //paragraph [10] Footnote: [{\footnote{] [}}] //[ue] [\"{u}] //[ae] [\"{a}] //[oe] [\"{o}] //[TOC] [\tableofcontents] [1] PictureTable: Class Definitions Dezember 2004 Christian Bohnebuck, Uwe Hartmann, Marion Langen and Holger M[ue]nx during Prof. G[ue]ting's practical course 'Extensible Database Systems' at Fernuniversit[ae]t Hagen. [TOC] 1 Introduction See the documentation of ~PictureAlgebra.h~ for a general introduction to the Picture algebra. This module is part of a SECONDO viewer ~PictureViewer~ which shows ~picture~ objects and their ~histograms~. 2 Includes and other preparations */ package viewer.pictureviewer; import viewer.pictureviewer.*; import viewer.PictureViewer; import sj.lang.*; import javax.swing.*; import javax.swing.table.*; import java.awt.*; import java.util.*; import gui.*; import java.awt.event.*; import javax.swing.event.*; import tools.*; import java.io.*; import java.awt.image.*; import java.lang.*; /* 3 Class PictureTable This is used to store Icons or strings and display them. The real data - picture or histogram - is stored inside the icon. */ public class PictureTable extends JTable { private PictureViewer destinationofEvent; //private PictureIcon picdummy; private Vector vnames = new Vector(); private Vector vtypes = new Vector(); static private ImageIcon icon = new ImageIcon(); static String histogramPostfixes[] = { "_hist_red", "_hist_green", "_hist_blue", "_hist_brightness" }; /* 3.1 Constructor ~PictureTable~ Create a new table with all data , names and types. Send an event to PictureViewer if a cell is selected with the mouse. */ public PictureTable( Vector data, Vector names, Vector columntypes, PictureViewer pV ) { super( data, names ); setNames( names ); setTypes( columntypes ); setCellSelectionEnabled( true ); setSelectionMode( ListSelectionModel.SINGLE_SELECTION); setRowHeight( 44 ); destinationofEvent = pV; //picdummy = new PictureIcon(); } /* 3.1 Function ~setNames~ Store the names of the columns. */ private void setNames( Vector names ) { for ( int i=0; i< names.size() ; i++ ) vnames.add( names.elementAt(i) ); } /* 3.1 Function ~setTypes~ Store the types of the columns. */ private void setTypes( Vector types ) { for ( int i=0; i< types.size() ; i++ ) vtypes.add( types.elementAt(i) ); } /* 3.1 Function ~isCellEditable~ No cell is editable. */ public boolean isCellEditable( int roe, int col) { return false; } /* 3.1 Function ~getColumnType~ Returns the type of column with index ix. */ public String getColumnType(int ix) { int index = ix; String columnName = getColumnName( ix ); for ( int i=0; i