Skip to content

Commit

Permalink
Taking into accound PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas ADAM <tadam@silicom.fr>
  • Loading branch information
tadam50 committed Mar 6, 2024
1 parent bfdc273 commit 28831ea
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class LayoutParameters {
private double cgmesScaleFactor = 1;
private String cgmesDiagramName = null;
private boolean cgmesUseNames = true;
private double zoneLayoutSnakeLinePadding = 90;
private int zoneLayoutSnakeLinePadding = 90;
private PathFinderType zoneLayoutPathFinder = PathFinderType.DIJKSTRA;

@JsonIgnore
Expand Down Expand Up @@ -338,11 +338,11 @@ public LayoutParameters setCgmesUseNames(boolean cgmesUseNames) {
return this;
}

public double getZoneLayoutSnakeLinePadding() {
public int getZoneLayoutSnakeLinePadding() {
return zoneLayoutSnakeLinePadding;
}

public LayoutParameters setZoneLayoutSnakeLinePadding(double zoneLayoutSnakeLinePadding) {
public LayoutParameters setZoneLayoutSnakeLinePadding(int zoneLayoutSnakeLinePadding) {
this.zoneLayoutSnakeLinePadding = zoneLayoutSnakeLinePadding;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ protected void calculateCoordSubstations(LayoutParameters layoutParameters) {
// Width by col
int maxWidthCol = 0;
// Snakeline hallway (horizontal & vertical)
int snakelineMargin = (int) layoutParameters.getZoneLayoutSnakeLinePadding();
int snakelineMargin = layoutParameters.getZoneLayoutSnakeLinePadding();
// Zone size
int nbRows = matrix.rowCount();
int nbCols = matrix.columnCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class Matrix {

public Matrix(int rows, int cols, LayoutParameters layoutParameters) {
this.cells = new MatrixCell[rows][cols];
this.snakelinePadding = (int) layoutParameters.getZoneLayoutSnakeLinePadding();
this.snakelinePadding = layoutParameters.getZoneLayoutSnakeLinePadding();
this.diagramPadding = layoutParameters.getDiagramPadding();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class MatrixZoneLayoutModel {

public MatrixZoneLayoutModel(String[][] ids, LayoutParameters layoutParameters) {
this.matrix = new Matrix(ids.length, ids[0].length, layoutParameters);
this.snakelinePadding = (int) layoutParameters.getZoneLayoutSnakeLinePadding();
this.snakelinePadding = layoutParameters.getZoneLayoutSnakeLinePadding();
}

public void addSubstationGraph(SubstationGraph graph, int row, int col) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@
"cgmesScaleFactor" : 1.0,
"cgmesDiagramName" : null,
"cgmesUseNames" : true,
"zoneLayoutSnakeLinePadding" : 90.0,
"zoneLayoutSnakeLinePadding" : 90,
"zoneLayoutPathFinder" : "DIJKSTRA"
},
"svgParams" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
"cgmesScaleFactor" : 1.0,
"cgmesDiagramName" : null,
"cgmesUseNames" : true,
"zoneLayoutSnakeLinePadding" : 90.0,
"zoneLayoutSnakeLinePadding" : 90,
"zoneLayoutPathFinder" : "DIJKSTRA"
},
"svgParams" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2949,7 +2949,7 @@
"cgmesScaleFactor" : 1.0,
"cgmesDiagramName" : null,
"cgmesUseNames" : true,
"zoneLayoutSnakeLinePadding" : 90.0,
"zoneLayoutSnakeLinePadding" : 90,
"zoneLayoutPathFinder" : "DIJKSTRA"
},
"svgParams" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
"cgmesScaleFactor" : 1.0,
"cgmesDiagramName" : null,
"cgmesUseNames" : true,
"zoneLayoutSnakeLinePadding" : 90.0,
"zoneLayoutSnakeLinePadding" : 90,
"zoneLayoutPathFinder" : "DIJKSTRA"
},
"svgParams" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@
"cgmesScaleFactor" : 1.0,
"cgmesDiagramName" : null,
"cgmesUseNames" : true,
"zoneLayoutSnakeLinePadding" : 90.0,
"zoneLayoutSnakeLinePadding" : 90,
"zoneLayoutPathFinder" : "DIJKSTRA"
},
"svgParams" : {
Expand Down

0 comments on commit 28831ea

Please sign in to comment.