private void setEvent(String eventId) { Event e = MainModel.getEvent(eventId); Person p = MainModel.getPerson(e.getPersonId()); String eventText = p.getFirstName() + " " + p.getLastName() + System.getProperty("line.separator") + e.fullDescription(); // Log.e(tag, "setting event text to " + eventText); event_text.setText(eventText); selPersonId = e.getPersonId(); selEventId = eventId; updateLines(); showGenderImage(p.getGender()); }
private void updateSpouseLines() { clearSpouseLine(); if (!Settings.isSpouseLinesEnabled()) return; Event selEvent = MainModel.getEvent(selEventId); Person p = selEvent.getPerson(); Person spouse = MainModel.getPerson(p.getSpouseId()); if (spouse == null || selEvent == null) return; Event firstSpouseEvent = spouse.getEarliestEvent(); if (firstSpouseEvent == null) return; if (!MainModel.isEventVisible(selEvent.getId()) || !MainModel.isEventVisible(firstSpouseEvent.getId())) return; spouseLine = drawLine(selEvent, firstSpouseEvent, SPOUSE_LINE_WIDTH, Settings.getSpouseLineColor()); }
private void recDrawFamilyStoryLines(Event event, int width) { // Log.e(tag, "Called recDraw with event "+event.toString()+" width: "+width); Person p = event.getPerson(); Person mother = MainModel.getPerson(p.getMotherId()); Person father = MainModel.getPerson(p.getFatherId()); if (mother != null) { Event firstMotherEvent = mother.getEarliestEvent(); drawFamilyStoryLine(event, firstMotherEvent, width); ; recDrawFamilyStoryLines(firstMotherEvent, width - Settings.FAMILY_LINE_DEC); } if (father != null) { Event firstFatherEvent = father.getEarliestEvent(); drawFamilyStoryLine(event, firstFatherEvent, width); recDrawFamilyStoryLines(firstFatherEvent, width - Settings.FAMILY_LINE_DEC); } }