Package de.chris_soft.fyllgen.data

Examples of de.chris_soft.fyllgen.data.Person


    listAllPersons.clear();
    listAllPersonComposites.clear();

    // Alle Personen in die Listen einordnen.
    int index = 0;
    Person lastPerson = null;
    for (Person person : personsList) {
      // Jede Person in die Liste aller Personen werfen.
      listAllPersons.add(person);
      listAllPersonComposites.add(null);

      // Mal schauen, wie die Person zur letzt hinzugef�gten Person steht.

      if (lastPerson != null) {
        Relationship relship = lastPerson.getRelationship(person);
        if (relship instanceof RelationshipParentChild) {
          if (relship.partner1 == lastPerson) {
            index++;
          }
          else {
View Full Code Here


  /**
   * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
   */
  public void handleEvent(Event event) {
    Family family = Family.instance;
    Person currentPerson = family.getCurrentPerson();
    String fullName = currentPerson.getValueView(Person.NAME);
    int afterSpace = fullName.lastIndexOf(' ') + 1;
    fullName = fullName.substring(0, afterSpace) + fullName.substring(afterSpace).toUpperCase();
    currentPerson.setValue(Person.NAME, fullName);
    family.setChanged(true);
    family.setCurrentPerson(currentPerson, 0);
  }
View Full Code Here

    for (Person person : listAllPersons) {
      // Alle Kinder anzeigen.
      Person[] children = person.getChildren();
      int childrenLength = children.length;
      for (int i = 0; i < childrenLength; i++) {
        Person child = children[i];
        PersonView pc1 = listAllPersonComposites.get(listAllPersons.indexOf(person));
        int childIndex = listAllPersons.indexOf(child);
        if (childIndex >= 0) {
          PersonView pc2 = listAllPersonComposites.get(childIndex);
          drawConnection(gc, pc1, pc2);
View Full Code Here

  /**
   * Zu einem Kind 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.getChildren();
    if (persons.length == 1) {
      Family.instance.setCurrentPerson(persons[0], 1);
    }
    else if (persons.length > 1) {
      PersonChoiceShell pcs = new PersonChoiceShell(GUI.instance.shell, "Zum Kind wechseln", "Zum Kind springen", null,
View Full Code Here

  /**
   * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
   */
  public void handleEvent(Event event) {
    // Create a list of all persons. The current person will be at index zero.
    Person currentPerson = Family.instance.getCurrentPerson();
    Person[] persons = Family.instance.getPersonsArray();
    List<Person> personList = new ArrayList<Person>();
    personList.addAll(Arrays.asList(persons));
    while (personList.get(0) != currentPerson) {
      personList.add(personList.remove(0));
    }

    // Get next person without children.
    for (int i = 1; i < personList.size(); i++) {
      Person person = personList.get(i);
      Person[] children = person.getChildren();
      if (children == null || children.length == 0) {
        Family.instance.setCurrentPerson(person, 1);
        break;
      }
    }
View Full Code Here

  /**
   * Zu einem Kind 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.getChildren();
    if (persons.length > 0) {
      Family.instance.setCurrentPerson(persons[0], 1);
    }
  }
View Full Code Here

    if (pcs.personChoice != null) {
      // Es wurde eine vorhandene Person angew�hlt.
      Family.instance.setCurrentPerson(pcs.personChoice, 1);
    }
    else if (pcs.newPersonName != null) {
      Person person = new Person();
      person.setValue(Person.NAME, pcs.newPersonName);
      Family.instance.addNewPerson(person);
      Family.instance.setCurrentPerson(person, 2);
    }
  }
View Full Code Here

  /**
   * Zu einem Partner 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.getPartner();
    if (persons.length > 0) {
      Family.instance.setCurrentPerson(persons[0], 1);
    }
  }
View Full Code Here

   * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
   */
  public void handleEvent(Event event) {
    // Liste aller Personen, zu denen wir schon eine Verbindung aufgebaut haben.
    List<Person> allConnections = new ArrayList<Person>();
    Person currentPerson = Family.instance.getCurrentPerson();
    allConnections.add(currentPerson);

    // Liste aller Personen, die auch eine Mail-Adresse besitzen.
    List<Person> mailPersons = new ArrayList<Person>();
    List<String> mailAddresses = new ArrayList<String>();

    // Alle Personen durchsuchen.
    int i = 0;
    while (i < allConnections.size()) {
      Person person = allConnections.get(i++);
      String mailAddress = person.getValueView(Person.MAIL).trim();
      if (mailAddress.length() > 0) {
        mailPersons.add(person);
        mailAddresses.add(mailAddress);
      }
      addPersonsToList(allConnections, person.getChildren());
      addPersonsToList(allConnections, person.getParents());
      addPersonsToList(allConnections, person.getPartner());
    }
    saveMailAddressList(mailAddresses);
    if (mailPersons.size() == 0) {
      MessageBox mb = new MessageBox(GUI.instance.shell, SWT.ICON_INFORMATION | SWT.OK);
      mb.setMessage("Leider konnte keine Person mit eingetragener E-Mail-Adresse\r\nund einer Verbindung zu "
          + currentPerson.getValue(Person.NAME) + " gefunden werden.");
      mb.setText("Nicht gefunden");
      mb.open();
      return;
    }
    PersonListSort.sort(mailPersons);

    // Shell erzeugen und anzeigen.
    PersonChoiceShell pcs = new PersonChoiceShell(GUI.instance.shell, "N�chste Person mit E-Mail-Adresse", "Anzeigen",
        null, 1, true, null, false);
    for (int k = 0; k < mailPersons.size(); k++) {
      Person person = mailPersons.get(k);
      String mailAddress = person.getValueView(Person.MAIL);
      pcs.addPerson(person, "(" + mailAddress + ")");
    }
    pcs.personChoice = currentPerson;
    pcs.open();
    if (pcs.personChoice != null) {
View Full Code Here

  /**
   * Zu einem Partner 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.getPartner();
    if (persons.length == 1) {
      Family.instance.setCurrentPerson(persons[0], 1);
    }
    else if (persons.length > 1) {
      PersonChoiceShell pcs = new PersonChoiceShell(GUI.instance.shell, "Zum Partner wechseln", "Zum Partner springen",
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.