Skip to content

Commit

Permalink
Adds a flag to determine whether automatic layout has been applied or…
Browse files Browse the repository at this point in the history
… not.
  • Loading branch information
simonbrowndotje committed Nov 12, 2023
1 parent 703be90 commit 843b364
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ subprojects { proj ->

description = 'Structurizr'
group = 'com.structurizr'
version = '1.27.0'
version = '1.27.1'

repositories {
mavenCentral()
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.27.1 (unreleased)

- Adds a flag to determine whether automatic layout has been applied or not.

## 1.27.0 (23rd October 2023)

- Upgrades dependencies, targets Java 17.
Expand Down
20 changes: 20 additions & 0 deletions structurizr-core/src/com/structurizr/view/AutomaticLayout.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public final class AutomaticLayout {
private int nodeSeparation;
private int edgeSeparation;
private boolean vertices;
private boolean applied;

AutomaticLayout() {
}
Expand All @@ -22,6 +23,7 @@ public final class AutomaticLayout {
setNodeSeparation(nodeSeparation);
setEdgeSeparation(edgeSeparation);
setVertices(vertices);
setApplied(false);
}

/**
Expand Down Expand Up @@ -118,6 +120,24 @@ void setVertices(boolean vertices) {
this.vertices = vertices;
}

/**
* Returns whether automatic layout has been applied.
*
* @return true if automatic layout has been applied, false otherwise
*/
public boolean isApplied() {
return applied;
}

/**
* Sets whether automatic layout has been applied.
*
* @param applied true if automatic layout has been applied, false otherwise
*/
public void setApplied(boolean applied) {
this.applied = applied;
}

public enum Implementation {
Graphviz,
Dagre
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ void setAutomaticLayout() {
assertEquals(200, automaticLayout.getNodeSeparation());
assertEquals(300, automaticLayout.getEdgeSeparation());
assertTrue(automaticLayout.isVertices());
assertFalse(automaticLayout.isApplied());
}

@Test
Expand Down

0 comments on commit 843b364

Please sign in to comment.