package nl.mpi.kinnate.gedcomimport;

import java.util.ArrayList;
import javax.swing.JProgressBar;
import javax.swing.JTextArea;
import nl.mpi.arbil.userstorage.SessionStorage;
import nl.mpi.kinnate.kindocument.ImportTranslator;

/**
 * Document : TipImporter
 * Created on : Jul 25, 2012, 5:53:00 PM
 * Author : Peter Withers
 */
public class TipImporter extends GedcomImporter {

    public TipImporter(JProgressBar progressBarLocal, JTextArea importTextAreaLocal, boolean overwriteExistingLocal, SessionStorage sessionStorage) {
        super(progressBarLocal, importTextAreaLocal, overwriteExistingLocal, sessionStorage);
    }

    @Override
    protected ImportTranslator getImportTranslator() {
        ImportTranslator importTranslator = new ImportTranslator(true);
        // todo: add the translator values if required
//        importTranslator.addTranslationEntry("SEX", "F", "Gender", "Female");
//        importTranslator.addTranslationEntry("SEX", "M", "Gender", "Male");
//        importTranslator.addTranslationEntry("NAME", null, "Name", null);
//        importTranslator.addTranslationEntry("chro", null, "Chromosome", null);
        return importTranslator;
    }

    @Override
    protected ImportLineStructure getImportLineStructure(String lineString, ArrayList<String> gedcomLevelStrings) throws ImportException {
        return new TipLineStructure(lineString, gedcomLevelStrings);
    }

    @Override
    public boolean canImport(String inputFileString) {
        return (inputFileString.toLowerCase().endsWith(".tip"));
    }
}

@@ -779,279 +779,76 @@
     
-// todo: add the translator values if required%0A//        importTranslator.addTranslationEntry(%22SEX%22, %22F%22, %22Gender%22, %22Female%22);%0A//        importTranslator.addTranslationEntry(%22SEX%22, %22M%22, %22Gender%22, %22Male%22);%0A//        importTranslator.addTranslationEntry(%22NAME%22, null, %22Name
+importTranslator.addTranslationEntry(%22BIRT_Date%22, null, %22DateOfBirth
 %22, n
@@ -857,10 +857,8 @@
 l);%0A
-//
     
@@ -903,12 +903,17 @@
 ry(%22
-chro
+DEAT_Date
 %22, n
@@ -922,18 +922,19 @@
 l, %22
-Chromosome
+DateOfDeath
 %22, n

Add an importer for TIP format by making the gedcom importer more generic. refs #2193