Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
Issue #273
  • Loading branch information
rsoika committed Jul 24, 2023
1 parent 1338aa5 commit 33212ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public String getName() {
public void setProperties(final LabelGNode node) {
super.setProperties(node);
node.setName(name);
node.setLayout(GConstants.Layout.STACK);
node.setLayout(GConstants.Layout.FREEFORM);
node.getLayoutOptions().put(GLayoutOptions.KEY_H_ALIGN, GConstants.HAlign.CENTER);
node.getLayoutOptions().put(GLayoutOptions.KEY_V_ALIGN, GConstants.VAlign.CENTER);
node.getLayoutOptions().put(GLayoutOptions.KEY_RESIZE_CONTAINER, true);
// add a mulitLine text block to show and edit long text blocks
// add a multiLine text block to show and edit long text blocks
this.id = node.getId() + "_bpmntext";
node.getChildren().add(BPMNGModelUtil.createMultiLineTextNode(id, name));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ public void setProperties(final PoolGNode node) {
// Set min width/height for the Pool element
node.getLayoutOptions().put(GLayoutOptions.KEY_MIN_WIDTH, Participant.MIN_WIDTH);
node.getLayoutOptions().put(GLayoutOptions.KEY_MIN_HEIGHT, Participant.MIN_HEIGHT);

// set padding to 0
node.getLayoutOptions().put(GLayoutOptions.KEY_PADDING_BOTTOM, 0);
node.getLayoutOptions().put(GLayoutOptions.KEY_PADDING_TOP, 0);
node.getLayoutOptions().put(GLayoutOptions.KEY_PADDING_LEFT, 0);
node.getLayoutOptions().put(GLayoutOptions.KEY_PADDING_RIGHT, 0);
node.getLayoutOptions().put(GLayoutOptions.KEY_H_GAP, 0);
node.getLayoutOptions().put(GLayoutOptions.KEY_V_GAP, 0);
// set header with label
node.getChildren().add(BPMNGModelUtil.createBPMNContainerHeader(node));
node.getChildren().add(createContainerCompartment(node));

}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,34 +103,14 @@ public static GCompartment createBPMNContainerHeader(final BPMNGNode node) {
Map<String, Object> layoutOptions = new HashMap<>();
layoutOptions.put(V_GRAB, true);
layoutOptions.put(GLayoutOptions.KEY_V_ALIGN, "center");

return new GCompartmentBuilder(ModelTypes.COMP_HEADER) //
.id(node.getId() + "_header") //
.layout(GConstants.Layout.STACK) //
.layout(GConstants.Layout.FREEFORM) //
.layoutOptions(layoutOptions) //
.build();
}

/**
* This method tests if the given element has a Child of type GLabel. This is
* the case for Task Elements. In this case the method returns the GLabel.
* Otherwise the method returns null.
*
* @return GLabel of an element or null if no GLabel was found
*/
@Deprecated
private static GLabel findCompartmentHeader(final BPMNGNode element) {

EList<GModelElement> childs = element.getChildren();
for (GModelElement child : childs) {
if (child instanceof GLabel) {
// return Optional.of(child);
return (GLabel) child;
}
}
// we did not found a GLabel
return null;
}

/**
* Builds the optional label on the bottom for extension information
Expand Down

0 comments on commit 33212ba

Please sign in to comment.