Skip to content

Commit

Permalink
minor code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoika committed Feb 16, 2024
1 parent 65ccfd5 commit 9581635
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import org.openbpmn.bpmn.elements.Participant;
import org.openbpmn.bpmn.elements.SequenceFlow;
import org.openbpmn.bpmn.elements.core.BPMNBounds;
import org.openbpmn.bpmn.elements.core.BPMNDimension;
import org.openbpmn.bpmn.elements.core.BPMNElementNode;
import org.openbpmn.bpmn.elements.core.BPMNLabel;
import org.openbpmn.bpmn.elements.core.BPMNPoint;
Expand Down Expand Up @@ -402,10 +401,6 @@ private void updatePool(final GNode gNode, final BPMNElementNode bpmnElementNode
gNode.setSize(newSize);

BPMNBounds bpmnBounds = bpmnElementNode.getBounds();
BPMNDimension oldDimensions = new BPMNDimension(bpmnElementNode.getBounds().getDimension().getWidth(),
bpmnElementNode.getBounds().getDimension().getHeight());
BPMNPoint oldPosition = new BPMNPoint(bpmnElementNode.getBounds().getPosition().getX(),
bpmnElementNode.getBounds().getPosition().getY());

// update BPMNElement bounds....
// The BPMN Position is always absolute so we can simply update the element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.Optional;
import java.util.Set;

import org.eclipse.glsp.graph.GModelElement;
import org.eclipse.glsp.graph.GModelIndex;
Expand All @@ -46,7 +45,6 @@
import org.openbpmn.glsp.operations.BPMNResetRoutingOperation;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.google.inject.Inject;

/**
Expand Down Expand Up @@ -217,32 +215,13 @@ public boolean isBPMNElementNode(GModelElement element) {
|| element instanceof MessageGNode || element instanceof DataObjectGNode);
}

// private LabeledAction createEdgeAction(final String label, final GNode
// source, final GNode node) {
// return new LabeledAction(label,
// Lists.newArrayList(new CreateEdgeOperation(EDGE, source.getId(),
// node.getId())),
// "fa-plus-square");
// }

private LabeledAction createSequenceFlowAction(final String label, final GNode source, final GNode node) {
return new LabeledAction(label,
Lists.newArrayList(new CreateEdgeOperation(BPMNTypes.SEQUENCE_FLOW, source.getId(),
node.getId())),
"export");
}

private Set<LabeledAction> createEdgeActions(final GNode source, final Set<? extends GNode> targets) {
Set<LabeledAction> actions = Sets.newLinkedHashSet();
// add first all edge, then all weighted edge actions to keep a nice order
// targets.forEach(node -> actions
// .add(createEdgeAction("Create Edge to " + getLabel(node), source, node)));
targets.forEach(node -> actions
.add(createSequenceFlowAction("Create Sequence Flow to " + getLabel(node), source,
node)));
return actions;
}

private String getLabel(final GNode node) {
if (node instanceof TaskGNode) {
return ((TaskGNode) node).getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,32 @@ public class BPMNToolPaletteItemProvider implements ToolPaletteItemProvider {
@Inject
protected OperationHandlerRegistry operationHandlerRegistry;

private int counter;

@Override
public List<PaletteItem> getItems(final Map<String, String> args) {
counter = 0;
// Create custom Palette Groups
return Lists.newArrayList(
PaletteItem.createPaletteGroup("pool-group", "Pools", createPalettePools(),
"circuit-board", "A"),
"circuit-board", "A"),
PaletteItem.createPaletteGroup("task-group", "Tasks", createPaletteTaskItems(),
"inspect", "B"),
"inspect", "B"),
PaletteItem.createPaletteGroup("event-group", "Events", createPaletteEventItems(),
"circle-filled",
"circle-filled",
"C"),
PaletteItem.createPaletteGroup("event-group", "Event Definitions",
createPaletteEventDefinitions(),
"layers", "D"),
"layers", "D"),
PaletteItem.createPaletteGroup("gateway-group", "Gateways", createPaletteGatewayItems(),
"debug-breakpoint-log-unverified", "E"),
"debug-breakpoint-log-unverified", "E"),

PaletteItem.createPaletteGroup("gateway-group", "Data Items", createPaletteDataItems(),
"notebook-template", "F"),
"notebook-template", "F"),

PaletteItem.createPaletteGroup("edge-group", "Edges", createPaletteSequenceFlowItems(),
"export", "G"),
"export", "G"),

PaletteItem.createPaletteGroup("extension-group", "Extensions",
createPaletteExtensions(),
"extensions", "H")
"extensions", "H")

);

Expand Down

0 comments on commit 9581635

Please sign in to comment.