-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Big refactoring - simplifying both views
- Loading branch information
Jiri Ambroz
authored and
Jiri Ambroz
committed
Dec 2, 2022
1 parent
90f19d0
commit 40ba6e4
Showing
28 changed files
with
1,114 additions
and
1,505 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
package org.ambrogenea.familyview.configuration; | ||
|
||
import java.util.Locale; | ||
|
||
import org.ambrogenea.familyview.constant.Spaces; | ||
import org.ambrogenea.familyview.domain.FamilyData; | ||
import org.ambrogenea.familyview.enums.Diagrams; | ||
import org.ambrogenea.familyview.enums.LabelShape; | ||
|
||
import java.util.Locale; | ||
|
||
/** | ||
* @author Jiri Ambroz <[email protected]> | ||
*/ | ||
|
@@ -20,21 +19,14 @@ public class PersonConfiguration { | |
private int adultVerticalShift; | ||
private int adultFontSize; | ||
|
||
private int wideMarriageLabel; | ||
private int marriageLabelWidth; | ||
|
||
private int siblingImageWidth; | ||
private int siblingImageHeight; | ||
private int siblingVerticalShift; | ||
private int siblingFontSize; | ||
|
||
private Diagrams adultDiagram; | ||
private Diagrams siblingDiagram; | ||
private LabelShape labelShape; | ||
private String adultManImagePath; | ||
private String adultWomanImagePath; | ||
private String siblingManImagePath; | ||
private String siblingWomanImagePath; | ||
|
||
private boolean showMarriage; | ||
|
||
|
@@ -48,25 +40,19 @@ public class PersonConfiguration { | |
public PersonConfiguration() { | ||
adultImageWidth = 190; | ||
adultImageHeight = 130; | ||
marriageLabelWidth = Spaces.MIN_MARRIAGE_LABEL_WIDTH; | ||
wideMarriageLabel = 3 * (adultImageWidth + marriageLabelWidth) / 2; | ||
adultVerticalShift = 0; | ||
siblingImageWidth = 170; | ||
siblingImageHeight = 120; | ||
siblingVerticalShift = 0; | ||
adultFontSize = 12; | ||
siblingFontSize = 11; | ||
|
||
adultDiagram = Diagrams.SCROLL; | ||
siblingDiagram = Diagrams.SCROLL; | ||
labelShape = LabelShape.OVAL; | ||
adultManImagePath = "diagrams/" + adultDiagram + "_man.png"; | ||
adultWomanImagePath = "diagrams/" + adultDiagram + "_woman.png"; | ||
siblingManImagePath = "diagrams/" + siblingDiagram + "_man.png"; | ||
siblingWomanImagePath = "diagrams/" + siblingDiagram + "_woman.png"; | ||
|
||
showAge = true; | ||
showPlaces = false; | ||
showPlaces = true; | ||
shortenPlaces = false; | ||
showOccupation = true; | ||
showMarriage = true; | ||
|
@@ -108,22 +94,6 @@ public void setAdultImageHeight(int adultImageHeight) { | |
this.adultImageHeight = adultImageHeight; | ||
} | ||
|
||
public int getWideMarriageLabel() { | ||
return wideMarriageLabel; | ||
} | ||
|
||
public void setWideMarriageLabel(int wideMarriageLabel) { | ||
this.wideMarriageLabel = wideMarriageLabel; | ||
} | ||
|
||
public int getMarriageLabelWidth() { | ||
return marriageLabelWidth; | ||
} | ||
|
||
public void setMarriageLabelWidth(int marriageLabelWidth) { | ||
this.marriageLabelWidth = marriageLabelWidth; | ||
} | ||
|
||
public int getAdultVerticalShift() { | ||
return adultVerticalShift; | ||
} | ||
|
@@ -148,14 +118,6 @@ public void setSiblingImageHeight(int siblingImageHeight) { | |
this.siblingImageHeight = siblingImageHeight; | ||
} | ||
|
||
public int getSiblingVerticalShift() { | ||
return siblingVerticalShift; | ||
} | ||
|
||
public void setSiblingVerticalShift(int siblingVerticalShift) { | ||
this.siblingVerticalShift = siblingVerticalShift; | ||
} | ||
|
||
public int getAdultFontSize() { | ||
return adultFontSize; | ||
} | ||
|
@@ -180,14 +142,6 @@ public void setAdultDiagram(Diagrams adultDiagram) { | |
this.adultDiagram = adultDiagram; | ||
} | ||
|
||
public Diagrams getSiblingDiagram() { | ||
return siblingDiagram; | ||
} | ||
|
||
public void setSiblingDiagram(Diagrams siblingDiagram) { | ||
this.siblingDiagram = siblingDiagram; | ||
} | ||
|
||
public LabelShape getLabelShape() { | ||
return labelShape; | ||
} | ||
|
@@ -212,22 +166,6 @@ public void setAdultWomanImagePath(String adultWomanImagePath) { | |
this.adultWomanImagePath = adultWomanImagePath; | ||
} | ||
|
||
public String getSiblingManImagePath() { | ||
return siblingManImagePath; | ||
} | ||
|
||
public void setSiblingManImagePath(String siblingManImagePath) { | ||
this.siblingManImagePath = siblingManImagePath; | ||
} | ||
|
||
public String getSiblingWomanImagePath() { | ||
return siblingWomanImagePath; | ||
} | ||
|
||
public void setSiblingWomanImagePath(String siblingWomanImagePath) { | ||
this.siblingWomanImagePath = siblingWomanImagePath; | ||
} | ||
|
||
public boolean isShowMarriage() { | ||
return showMarriage; | ||
} | ||
|
12 changes: 12 additions & 0 deletions
12
src/main/java/org/ambrogenea/familyview/constant/Dimensions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package org.ambrogenea.familyview.constant; | ||
|
||
public class Dimensions { | ||
public static int SCROLL_IMAGE_WIDTH = 190; | ||
public static int SCROLL_IMAGE_HEIGHT = 130; | ||
public static int DOUBLE_WAVE_IMAGE_HEIGHT = 110; | ||
public static int DOUBLE_WAVE_IMAGE_WIDTH = 160; | ||
public static int PORTRAIT_IMAGE_WIDTH = 130; | ||
public static int PORTRAIT_IMAGE_HEIGHT = 130; | ||
public static int DEFAULT_IMAGE_HEIGHT = 120; | ||
public static int DEFAULT_IMAGE_WIDTH = 160; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/org/ambrogenea/familyview/dto/ParentsDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.ambrogenea.familyview.dto; | ||
|
||
import org.ambrogenea.familyview.dto.tree.Position; | ||
|
||
public class ParentsDto { | ||
private Position husbandPosition; | ||
private Position wifePosition; | ||
private int nextHeraldryY; | ||
|
||
public ParentsDto(Position husbandPosition, Position wifePosition, int nextHeraldryY) { | ||
this.husbandPosition = husbandPosition; | ||
this.wifePosition = wifePosition; | ||
this.nextHeraldryY = nextHeraldryY; | ||
} | ||
|
||
public Position getHusbandPosition() { | ||
return husbandPosition; | ||
} | ||
|
||
public void setHusbandPosition(Position husbandPosition) { | ||
this.husbandPosition = husbandPosition; | ||
} | ||
|
||
public Position getWifePosition() { | ||
return wifePosition; | ||
} | ||
|
||
public void setWifePosition(Position wifePosition) { | ||
this.wifePosition = wifePosition; | ||
} | ||
|
||
public int getNextHeraldryY() { | ||
return nextHeraldryY; | ||
} | ||
|
||
public void setNextHeraldryY(int nextHeraldryY) { | ||
this.nextHeraldryY = nextHeraldryY; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/org/ambrogenea/familyview/service/ConfigurationExtensionService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.ambrogenea.familyview.service; | ||
|
||
import org.ambrogenea.familyview.dto.AncestorPerson; | ||
|
||
/** | ||
* | ||
* @author Jiri Ambroz <[email protected]> | ||
*/ | ||
public interface ConfigurationExtensionService { | ||
int getMarriageLabelWidth(); | ||
int getMarriageLabelHeight(); | ||
int getCoupleWidth(); | ||
int getHalfSpouseLabelSpace(); | ||
int getGapBetweenCouples(); | ||
int getAllAncestorsCoupleIncrease(); | ||
int getSpouseDistance(); | ||
int getFatherHorizontalDistance(); | ||
int getMotherHorizontalDistance(); | ||
int getCoupleVerticalDifference(); | ||
int getFatherVerticalDistance(); | ||
int getMotherVerticalDistance(); | ||
int getMarriageLabelVerticalDistance(); | ||
int getMarriageLabelHorizontalDistance(); | ||
int getGenerationsVerticalDistance(); | ||
int getParentGenerationWidth(AncestorPerson person); | ||
} |
Oops, something went wrong.