Package de.chris_soft.fyllgen.data

Examples of de.chris_soft.fyllgen.data.Person


  /**
   * Zu einem Elternteil wechseln.
   * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
   */
  public void handleEvent(Event event) {
    Person currentPerson = Family.instance.getCurrentPerson();
    Person[] persons = currentPerson.getParents();
    if (persons.length == 1) {
      Family.instance.setCurrentPerson(persons[0], 1);
    }
    else if (persons.length > 1) {
      PersonChoiceShell pcs = new PersonChoiceShell(GUI.instance.shell, "Zum Elternteil wechseln",
View Full Code Here


   */
  private void writeShortConnectionIntoFile(List<Person> listFound) {
    try {
      new File("Short Connections").mkdir();
      PrintStream out = new PrintStream(new FileOutputStream("Short Connections/" + Statics.getUniqueID() + ".txt"));
      Person lastPerson = null;
      for (Person person : listFound) {
        if (lastPerson != null) {
          Relationship relship = lastPerson.getRelationship(person);
          if (relship instanceof RelationshipParentChild) {
            if (relship.partner1 == lastPerson) {
              out.println("...ist Elternteil von...");
            }
            else {
View Full Code Here

  private List<Person> search() {
    List<Person> persons = new ArrayList<Person>(Arrays.asList(Family.instance.getPersonsArray()));
    Map<Person, Person> map = FamilyUtilities.createNextPersonsMap(currentPerson, persons);
    if (map.containsKey(searchPerson)) {
      persons.clear();
      Person p0 = searchPerson;
      while (p0 != currentPerson) {
        persons.add(p0);
        p0 = map.get(p0);
      }
      persons.add(p0);
View Full Code Here

  /**
   * Zu einem Elternteil wechseln.
   * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
   */
  public void handleEvent(Event event) {
    Person currentPerson = Family.instance.getCurrentPerson();
    Person[] persons = currentPerson.getParents();
    if (persons.length > 0) {
      Family.instance.setCurrentPerson(persons[0], 1);
    }
  }
View Full Code Here

    Person[] persons = Family.instance.getPersonsArray();
    List<Person> allConnections = new ArrayList<Person>();
    allConnections.add(Family.instance.getCurrentPerson());
    int i = 0;
    while (i < allConnections.size()) {
      Person person = allConnections.get(i++);
      addPersonsToList(allConnections, person.getChildren());
      addPersonsToList(allConnections, person.getParents());
      addPersonsToList(allConnections, person.getPartner());
    }
    boolean bFound = false;
    for (Person person : persons) {
      if (!allConnections.contains(person)) {
        bFound = true;
View Full Code Here

    // Eigenen Paragraph f�r die Verbindung zur Hauptperson erzeugen.
    Paragraph paragraph = new Paragraph();
    paragraph.add(new Chunk("\r\nVerbindung zu " + person0Name + ":\r\n"));
    while (person != person0) {
      Person currPerson = person;
      Person nextPerson = nextPersons.get(person);

      // Das hier passiert nur, wenn der Packenius/Vietor-Filter eingeschaltet
      // ist!
      if (nextPerson == null) {
        break;
      }

      int count = 0;
      String s = "";
      // Richtung Vorfahren.
      if (nextPerson.isChildOf(currPerson)) {
        while (currPerson != person0 && nextPerson.isChildOf(currPerson)) {
          currPerson = nextPerson;
          nextPerson = nextPersons.get(currPerson);
          count++;
        }
        if (count == 1) {
          if (person.isFemale()) {
            s += "Mutter";
          }
          else if (person.isMale()) {
            s += "Vater";
          }
          else {
            s += "Elternteil";
          }
        }
        else {
          for (int i = 2; i < count; i++) {
            s += "Ur-";
          }
          if (person.isFemale()) {
            s += "Gro�mutter";
          }
          else if (person.isMale()) {
            s += "Gro�vater";
          }
          else {
            s += "Gro�elter";
          }
        }
      }

      // Richtung Nachkommen.
      else if (nextPerson.isParentOf(currPerson)) {
        while (currPerson != person0 && nextPerson.isParentOf(currPerson)) {
          currPerson = nextPerson;
          nextPerson = nextPersons.get(currPerson);
          count++;
        }
        if (count == 1) {
View Full Code Here

      paragraph.add(new Chunk(personListHeader, fontHelvetica12));
      document.add(paragraph);

      // Person list.
      for (int i = 0; i < personList.length; i++) {
        Person person = personList[i];

        // Name extension.
        String nameExt = getNameExtension(currPerson, person);
        paragraph = new Paragraph();

        // Name of the person.
        String fullPersonName = person.getValue(Person.NAME) + nameExt;
        if (createPrintVersion) {
          fullPersonName += "  [" + (personsSorted.indexOf(person) + 1) + "]";
        }
        if (persons.contains(person)) {
          Chunk chunk = new Chunk(fullPersonName, fontTimes12ItalicBlue);
          Anchor iref = new Anchor(chunk);
          iref.setReference("#p-" + person.getXREFID());
          paragraph.add(iref);
        }
        else {
          Chunk chunk = new Chunk(fullPersonName, fontHelvetica12);
          paragraph.add(chunk);
View Full Code Here

    if (relationType.equals(Relationship.CHILDREN) || relationType.equals(Relationship.SIBLINGS)
      || relationType.equals(Relationship.PARENTS)) {
      List<Person> personList2 = Arrays.asList(personList);
      PersonListSort.sortByBirthday(personList2);
      for (int i = 0; i < personList.length; i++) {
        Person p0 = personList2.get(i);
        personList[i] = p0;
      }
    }

    // Order partners by marriage date.
    else if (relationType.equals(Relationship.PARTNERS)) {
      List<Person> personList2 = Arrays.asList(personList);
      PersonListSort.sortByMarriageDate(personList2, currPerson);
      for (int i = 0; i < personList.length; i++) {
        Person p0 = personList2.get(i);
        personList[i] = p0;
        Relationship relship = currPerson.getRelationship(p0);
        String relType = relship.getType();
        String marriageDate = relship.getValue(RelationshipPartners.STARTDATE);
        String marriageEnd = relship.getValue(RelationshipPartners.ENDDATE);

        if (relType.equals(RelationshipPartners.MARRIAGE)) {
          String divorceExtraText = "";
          if (i < personList.length - 1) { // Nicht die letzte Person.
            Relationship relship2 = currPerson.getRelationship(personList2.get(i + 1));
            String marriageDate2 = relship2.getValue(RelationshipPartners.STARTDATE);
            long lP0DeathDate = Statics.getMinYYYYMMDDlong(p0.getValueView(Person.DEATHDAY));
            if (Statics.getMinYYYYMMDDlong(marriageDate2) > lP0DeathDate && lP0DeathDate > 9999) {
              divorceExtraText = ", verwittwet";
            }
          }
          if (marriageDate != null) {
View Full Code Here

          paragraph = new Paragraph();
          paragraph.add(new Chunk("\r\n"));
          document.add(paragraph);
        }
        Image image = listImages_D.get(i);
        Person person = listPersons_D.get(i);
        image.setBorderWidth(5);

        // Image anzeigen - dient gleichzeitig als Link und als Anchor.
        Chunk imageChunk = new Chunk(image, 0, 0, true);
        Anchor imageAnchor = new Anchor(imageChunk);
        imageAnchor.setName("anhang-d-" + i);
        imageAnchor.setReference("#p-" + person.getXREFID());
        document.add(imageAnchor);

        // Etwas Platz zum n�chsten Image lassen.
        document.add(new Phrase(" "));
      }
View Full Code Here

    // System.out.println("addFamily-1");
    // Nach unten alle Eltern durchgehen.
    for (int i = 0; i > minGeneration; i--) {
      List<Person> listSingleGeneration = listGenerationsToView.get(i - minGeneration);
      for (int k = 0; k < listSingleGeneration.size(); k++) {
        Person person = listSingleGeneration.get(k);
        addToLists(listGenerationsToView.get(i - 1 - minGeneration), listAllPersons, person.getParents());
      }
    }

    // System.out.println("addFamily-2");
    // Nach oben alle Kinder durchgehen.
    for (int i = 0; i < maxGeneration; i++) {
      List<Person> listSingleGeneration = listGenerationsToView.get(i - minGeneration);
      for (int k = 0; k < listSingleGeneration.size(); k++) {
        Person person = listSingleGeneration.get(k);
        addToLists(listGenerationsToView.get(i + 1 - minGeneration), listAllPersons, person.getChildren());
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.chris_soft.fyllgen.data.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.