FileDocCategorySizeDatePackage
DMControl.javaAPI DocExample2554Tue Dec 08 01:21:00 GMT 1998DataManagement

DMControl

public class DMControl extends Object implements IIndividualsDM, IFamiliesDM

Fields Summary
HumanInterface.FamilyFrame
target
Family
ff
Individual
record
DataManagement.FlatFile.FlatFile
fileType
FamilyDM
familyDM
IndividualDM
individualDM
Constructors Summary
public DMControl()

    familyDM = new FamilyDM();
    individualDM = new IndividualDM();
  
Methods Summary
public java.util.EnumerationfamilyList()

    return familyDM.list();
  
public java.util.HashtablegetFamilies()

    return familyDM.getRecords();
  
public java.util.HashtablegetIndividuals()

    return individualDM.getRecords();
  
public java.util.EnumerationindividualList()

    return individualDM.list();
  
public voidreadData(java.lang.String filename)

    fileType = new FlatFile();
    fileType.setTarget(target);
    target.textArea.setText("Parsing " + filename);
    fileType.readData(filename);
    familyDM.setData(fileType.getFamily());
    individualDM.setData(fileType.getIndividual());
    target.textArea.setText(target.textArea.getText() + "\nFinished parsing file....");
  
public voidsaveData(java.lang.String file)

    try {
      BufferedWriter out = new BufferedWriter(new FileWriter(file));
      target.textArea.setText("Saving as " + file);
      Enumeration list = getIndividuals().keys();
      while(list.hasMoreElements()) {
        out.write(((Individual)individualDM.getRecord(list.nextElement())).toString("0"));
        out.write("1 _BLOB\n");
      }
      list = getFamilies().keys();
      while(list.hasMoreElements()) {
        out.write(((Family)familyDM.getRecord(list.nextElement())).toString("0"));
      }
      out.write("0 TRLR");
      out.close();
      target.textArea.setText(target.textArea.getText() + "\nFinished saving file....");
    }
    catch(FileNotFoundException ex) {}
    catch(IOException exe) {}
  
public voidsetTarget(java.awt.Frame frame)

    target = (HumanInterface.FamilyFrame)frame;
  
public voidsetUpRecords(java.util.Hashtable families, java.util.Hashtable individuals)

note
Allows the setup of the family tree with a default set of family details.

    familyDM.setData(families);
    individualDM.setData(individuals);
  
public voidwriteFamily(Family record)

public voidwriteIndividual(Individual record)