Skip to content

Commit

Permalink
[426] Handle horizontal stack container
Browse files Browse the repository at this point in the history
Before this commit, this kind of container was not correctly handled.

Bug: #426
  • Loading branch information
lredor committed Jul 26, 2024
1 parent 6b1a6ce commit f83cf18
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public boolean isRegion() {
}

/**
* Return if this GMF node is contained in an vertical stack layout container.
* Return if this GMF node is contained in a vertical stack layout container.
*/
public boolean isVerticalRegion() {
return view.eContainer() instanceof View container && new ViewQuery(container).isVerticalRegionContainerCompartment();
Expand All @@ -445,7 +445,7 @@ public boolean isVerticalRegionContainer() {
}

/**
* Return if this GMF node is a compartment of a container having horizontal stack layout.
* Return if this GMF node is a compartment of a container having vertical stack layout.
*/
public boolean isVerticalRegionContainerCompartment() {
if (isFreeFormCompartment()) {
Expand All @@ -458,6 +458,48 @@ public boolean isVerticalRegionContainerCompartment() {

}

/**
* Return if this GMF node is contained in an horizontal stack layout container.
*/
public boolean isHorizontalRegion() {
return view.eContainer() instanceof View container && new ViewQuery(container).isHorizontalRegionContainerCompartment();
}

/**
* Return if this GMF node have horizontal stack layout.
*/
public boolean isHorizontalRegionContainer() {
return this.view.getElement() instanceof DDiagramElement element //
&& element.getDiagramElementMapping() instanceof ContainerMapping mapping //
&& new ContainerMappingQuery(mapping).isHorizontalStackContainer();
}

/**
* Return if this GMF node is a compartment of a container having horizontal stack layout.
*/
public boolean isHorizontalRegionContainerCompartment() {
if (isFreeFormCompartment()) {
if (view.eContainer() instanceof Node container) {
return new ViewQuery(container).isHorizontalRegionContainer();
}

}
return false;
}

/**
* Return if this GMF node is a compartment of a container having an horizontal or a vertical stack layout.
*/
public boolean isRegionContainerCompartment() {
if (isFreeFormCompartment()) {
if (view.eContainer() instanceof Node container) {
return new ViewQuery(container).isRegionContainer();
}

}
return false;
}

/**
* Return if this GMF node is associated to DNode Sirius diagram element.
*/
Expand Down
Loading

0 comments on commit f83cf18

Please sign in to comment.