#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2002-08-30 13:43 IST by <uday@uday-pc.cse.iitb.ernet.in>.
# Source directory was `/home/uday/courses/cs699/02-03/java'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   5219 -rw-rw-r-- Demo.java
#   1345 -rw-rw-r-- mod_email.list
#    628 -rw-rw-r-- newgroups
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh07635; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= Demo.java ==============
if test -f 'Demo.java' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'Demo.java' '(file already exists)'
else
  $echo 'x -' extracting 'Demo.java' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'Demo.java' &&
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import java.lang.*;
X
public class Demo extends Frame implements ItemListener {
X
X	static class Student {
X		public String info[]; // rollno, name, login, emailServer
X		public String partners[]; // own name, name of 2 partners
X		Student() {}
X	}
X
X	Checkbox cb1, cb2; 
X	CheckboxGroup cbg;
X	java.awt.List lst;
X	Label label1, label2;
X	static Student[] students; 
X	static final int noOfStudents = 40;
X	static int actualNoOfStudents;
X	int selectedStudentNo = 0;
X	String displayString;
X	String s1, s2;
X
X	public static void main(String[] args){
X		readData();
X		new Demo();
X	}
X
X	static void readData() {
X		try {
X			students = new Student[noOfStudents];
X			for(int i=0; i<noOfStudents; i++) {
X				students[i] = new Student();
X				students[i].info = new String[4];
X				students[i].partners = new String[3];
X				for(int j=0; j<4; j++) {
X					students[i].info[j] = new String();	
X				}
X				for(int j=0; j<3; j++) {
X					students[i].partners[j] = new String();	
X				}
X			}
X			String inputLine;
X			BufferedReader br = new BufferedReader(new FileReader("mod_email.list"));
X			int i = 0;
X			while ((inputLine = br.readLine()) != null) {
X				int fromIndex = 0;
X				int beginIndex = 0;
X				fromIndex = inputLine.indexOf("|", fromIndex) + 1;
X				students[i].info[0] = inputLine.substring(beginIndex, fromIndex-1);
X				beginIndex = fromIndex;
X				fromIndex = inputLine.indexOf("|", fromIndex) + 1;
X				students[i].info[1] = inputLine.substring(beginIndex, fromIndex-1);
X				beginIndex = fromIndex;
X				fromIndex = inputLine.indexOf("@", fromIndex) + 1;
X				students[i].info[2] = inputLine.substring(beginIndex, fromIndex-1);
X				beginIndex = fromIndex;
X				students[i].info[3] = inputLine.substring(beginIndex);
X				i++;
X			}
X			br.close();
X			br = new BufferedReader(new FileReader("newgroups"));
X			i = 0;
X			while ((inputLine = br.readLine()) != null) {
X				int fromIndex = 0;
X				int beginIndex = 0;
X				fromIndex = inputLine.indexOf(" ", fromIndex) + 2;
X				students[i].partners[0] = inputLine.substring(beginIndex, fromIndex-2);
X				beginIndex = fromIndex;
X				fromIndex = inputLine.indexOf(" ", fromIndex) + 1;
X				students[i].partners[1] = inputLine.substring(beginIndex, fromIndex-1);
X				beginIndex = fromIndex;
X				students[i].partners[2] = inputLine.substring(beginIndex);
X				i++;
X			}
X			actualNoOfStudents = i;
X			br.close();
X		} catch (IOException e){
X			System.out.println("Error in reading data files :"+e);
X		}
X	}
X		
X	Demo() {
X		displayString = new String("Nothing selected                                                 " + // \t giving some problem
X						"                                                            " +
X						"                ");
X		cbg = new CheckboxGroup();
X		s1 = new String("Display roll number and email address");
X		s2 = new String("Display group partners");
X		cb1 = new Checkbox(s1, cbg, false);        
X		cb2 = new Checkbox(s2, cbg, false);        
X		cb1.addItemListener(this);
X		cb2.addItemListener(this);
X		lst = new java.awt.List(4, false);
X		for(int i=0; i<actualNoOfStudents; i++) {
X			System.out.println(students[i].info[1]);
X			lst.add(students[i].info[1]);
X		}
X		lst.addItemListener(this);
X		label1 = new Label();
X		label2 = new Label("                                                                                             ");
X		label1.setText(displayString);
X		this.setLayout(new FlowLayout());
X		this.setSize(900,200);
X		this.setTitle("Software Lab Demo for awt");
X		this.add(lst);
X		this.add(cb1);
X		this.add(cb2);
X		this.add(label2);
X		this.add(label1);
X
X		this.setVisible(true);
X
X		addWindowListener(new WindowAdapter() {
X				public void windowClosing(WindowEvent e) {
X				System.exit(0);}});
X	}
X
X	public void itemStateChanged(ItemEvent e) {
X		Object source = e.getItemSelectable();
X		if(source == cb1) {
X			displayString = new String("Name : " + 
X						students[selectedStudentNo].info[1] + 
X						"   Roll. no. : " + 
X						students[selectedStudentNo].info[0] +
X					        "   Email address : " + 
X						students[selectedStudentNo].info[2] + "@" + 	
X						students[selectedStudentNo].info[3]);
X		}
X		else if(source == cb2){
X			displayString = new String("Login : " + 
X						students[selectedStudentNo].partners[0] + 
X						"   Partners Login : " + 
X						students[selectedStudentNo].partners[1] + "   " +
X						students[selectedStudentNo].partners[2]); 
X		}
X		else if(source == lst) {
X			selectedStudentNo = lst.getSelectedIndex();
X			if(cbg.getSelectedCheckbox() != null) {
X				Checkbox temp = cbg.getSelectedCheckbox();
X		  		if(s1.equals(temp.getLabel()) == true) {
X					displayString = new String("Name : " + 
X								students[selectedStudentNo].info[1] + 
X								"   Roll. no. : " + 
X								students[selectedStudentNo].info[0] +
X					        		"   Email address : " + 
X								students[selectedStudentNo].info[2] + "@" + 	
X								students[selectedStudentNo].info[3]);
X		  		}
X		  		else {
X					displayString = new String("Login : " + 
X								students[selectedStudentNo].partners[0] + 
X								"   Partners Login : " + 
X								students[selectedStudentNo].partners[1] + "   " +
X								students[selectedStudentNo].partners[2]); 
X		  		}
X			}
X		}
X		label1.setText(displayString);
X	}
}
SHAR_EOF
  (set 20 02 08 30 13 40 55 'Demo.java'; eval "$shar_touch") &&
  chmod 0664 'Demo.java' ||
  $echo 'restore of' 'Demo.java' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'Demo.java:' 'MD5 check failed'
786d3e94755230fa14d0fd264ed01f8b  Demo.java
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'Demo.java'`"
    test 5219 -eq "$shar_count" ||
    $echo 'Demo.java:' 'original size' '5219,' 'current size' "$shar_count!"
  fi
fi
# ============= mod_email.list ==============
if test -f 'mod_email.list' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'mod_email.list' '(file already exists)'
else
  $echo 'x -' extracting 'mod_email.list' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'mod_email.list' &&
02305016|deepa paranjpe|adeepa@cse.iitb.ac.in
02305013|Aditya Sunil Kanade.|aditya@cse.iitb.ac.in
02305301|Alwyn Roshan Pais|alwyn@cse.iitb.ac.in
02305005|Amarnadh Sai, Eluri.|amarnadh@cse.iitb.ac.in
02305031|Arunkumar C|arun@cse.iitb.ac.in
02305002|S M Asrar Husain|asrar@cse.iitb.ac.in
02305402|Babita Sharma|babita@cfdvs.iitb.ac.in
02305018|Harsha S Mahuli|harshasm@cse.iitb.ac.in
02305004|R.P.Jagadeesh ChandraBose.|jcbose@cse.iitb.ac.in
02305006|P K Kanti Kiran|kanti@cse.iitb.ac.in
02305001|K. Kranthi Kumar|kranthi@cse.iitb.ac.in
02305015|Manoj Ransing|manoj@cse.iitb.ac.in
02305302|maruska mascarenhas|maruska@cse.iitb.ac.in
02305401|Medha Atre|medha@cse.iitb.ac.in
02305023|Vinod Prabhakar Meshram.|mvinod@cse.iitb.ac.in
02305027|Naresh Kumar Singhmar|naresh@cse.iitb.ac.in
02305029|Navneet|nkataria@cse.iitb.ac.in
02305035|Rajkumar Sen|rajkumar@cse.iitb.ac.in
02305003|Rodney P. Martis|rodney@cse.iitb.ac.in
02305404|Ronak K Kothari|ronak@cse.iitb.ac.in
02M05601|Sampada Sonalkar|sampadas@cse.iitb.ac.in
02305403|Sandeep Deshmukh|sandeep@cse.iitb.ac.in
02M05602|Shweta Gehlot|shweta@cse.iitb.ac.in
02305028|D Siva Kumar|sivak@cse.iitb.ac.in
02305033|Venkatasivaramasastry K|sivaram@cse.iitb.ac.in
02305020|Srikanth SM|srism@cse.iitb.ac.in
02305030|Abhijit J Toley|toley@cse.iitb.ac.in
02305019|Mamania Vishal S.|vishalm@cse.iitb.ac.in
SHAR_EOF
  (set 20 02 08 29 10 17 57 'mod_email.list'; eval "$shar_touch") &&
  chmod 0664 'mod_email.list' ||
  $echo 'restore of' 'mod_email.list' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'mod_email.list:' 'MD5 check failed'
f92c2119fa52d6e26a8003ed60013f3a  mod_email.list
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'mod_email.list'`"
    test 1345 -eq "$shar_count" ||
    $echo 'mod_email.list:' 'original size' '1345,' 'current size' "$shar_count!"
  fi
fi
# ============= newgroups ==============
if test -f 'newgroups' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING 'newgroups' '(file already exists)'
else
  $echo 'x -' extracting 'newgroups' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > 'newgroups' &&
adeepa  maruska medha
aditya  mvinod manoj
alwyn  sureshkm kranthi
amarnadh  jcbose sivak
arun  srism vishalm
asrar  nitinj shweta
babita  medha maruska
harshasm  kartik jcbose
jcbose  amarnadh harshasm
kanti  toley sandeep
kranthi  rodney alwyn
manoj  ashpuri aditya
maruska  adeepa babita
medha  babita adeepa
mvinod  aditya toley
naresh  sivak nkataria
nkataria  santhosh naresh
rajkumar  sattu rodney
rodney  kranthi rajkumar
ronak  sandeep srism
sampadas  shweta sivaram
sandeep  ronak kanti
shweta  sampadas asrar
sivak  naresh amarnadh
sivaram  pprasad sampadas
srism  arun ronak
toley  kanti mvinod
vishalm  satwik arun
SHAR_EOF
  (set 20 02 08 29 10 18 01 'newgroups'; eval "$shar_touch") &&
  chmod 0664 'newgroups' ||
  $echo 'restore of' 'newgroups' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'newgroups:' 'MD5 check failed'
acb90eeb7d839c12658dd9dfbfaf448c  newgroups
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'newgroups'`"
    test 628 -eq "$shar_count" ||
    $echo 'newgroups:' 'original size' '628,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh07635
exit 0
