Skip to content

Commit

Permalink
Merge pull request #131 from kieler/mka/region-spacing
Browse files Browse the repository at this point in the history
replace region surrounding spacing by ELK nodeNodeSpacing
  • Loading branch information
a-sr authored Dec 12, 2024
2 parents aa5b1c5 + 5c8850e commit b3353ad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ class StateSynthesis extends SubSynthesis<State, KNode> {
|| (SHOW_INHERITANCE.booleanValue && !state.allVisibleInheritedRegions.empty)
|| !state.declarations.filter(MethodImplementationDeclaration).empty
) {
node.addRegionsArea
node.addRegionsArea(state)
node.setLayoutOption(CoreOptions.NODE_SIZE_CONSTRAINTS, EnumSet.of(SizeConstraint.MINIMUM_SIZE))
}
}
Expand Down Expand Up @@ -491,7 +491,7 @@ class StateSynthesis extends SubSynthesis<State, KNode> {
node.setLayoutOption(RectPackingOptions.WHITE_SPACE_ELIMINATION_STRATEGY, WhiteSpaceEliminationStrategy.EQUAL_BETWEEN_STRUCTURES)
node.setLayoutOption(RectPackingOptions.OMIT_NODE_MICRO_LAYOUT, true)
node.setLayoutOption(CoreOptions::PADDING, new ElkPadding(0))
node.setLayoutOption(CoreOptions::SPACING_NODE_NODE, 1.0)
node.setLayoutOption(CoreOptions::SPACING_NODE_NODE, 5.0)
}

def static void configureLayoutRegionDependencies(KNode node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ActionsAsDataflowHook extends SynthesisHook {

if (SHOW_ACTIONS_AS_DATAFLOW.booleanValue) {
container.children.remove(actionContainer)
node.addRegionsArea
node.addRegionsArea(state)

val actions = <Action> newArrayList(state.actions)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class ControlflowRegionStyles {
background = REGION_BACKGROUND.color;
foreground = REGION_FOREGROUND.color;
lineWidth = 1;
setSurroundingSpace(2, 0);
]
}

Expand Down Expand Up @@ -337,4 +336,4 @@ class ControlflowRegionStyles {
def KRectangle setUserScheduleStyle(KRectangle krendering) {
krendering.foreground = USER_SCHEDULE_COLOR.color
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,10 @@ class StateStyles {
/**
* Add a child area to a macro state
*/
def addRegionsArea(KNode node) {
def addRegionsArea(KNode node, State state) {
node.contentContainer.addChildArea().setGridPlacementData() => [
from(LEFT, 5, 0, TOP, -4, 0).to(RIGHT, 5, 0, BOTTOM, 5, 0)
val spacing = state.isInitial ? 9 : 7;
from(LEFT, spacing, 0, TOP, -4, 0).to(RIGHT, spacing, 0, BOTTOM, spacing, 0)
minCellHeight = 5;
minCellWidth = 5;
]
Expand Down

0 comments on commit b3353ad

Please sign in to comment.