-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #319
- Loading branch information
Showing
19 changed files
with
454 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 0 additions & 91 deletions
91
...mn.glsp-server/src/main/java/org/openbpmn/glsp/operations/BPMNAutoAlignActionHandler.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...glsp-server/src/main/java/org/openbpmn/glsp/operations/BPMNAutoAlignOperationHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/******************************************************************************** | ||
* Copyright (c) 2022 Imixs Software Solutions GmbH and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
package org.openbpmn.glsp.operations; | ||
|
||
import java.util.Optional; | ||
import java.util.Set; | ||
import java.util.logging.Logger; | ||
|
||
import org.eclipse.emf.common.command.Command; | ||
import org.eclipse.glsp.server.operations.GModelOperationHandler; | ||
import org.openbpmn.bpmn.elements.BPMNProcess; | ||
import org.openbpmn.bpmn.elements.Participant; | ||
import org.openbpmn.bpmn.elements.core.BPMNElementNode; | ||
import org.openbpmn.glsp.model.BPMNGModelState; | ||
import org.openbpmn.glsp.utils.BPMNGridSnapper; | ||
|
||
import com.google.inject.Inject; | ||
|
||
/** | ||
* This ActionHandler reacts on AutoAlign actions send from the client | ||
* | ||
* @author rsoika | ||
* | ||
*/ | ||
public class BPMNAutoAlignOperationHandler extends GModelOperationHandler<BPMNAutoAlignOperation> { | ||
|
||
private static Logger logger = Logger.getLogger(BPMNAutoAlignOperationHandler.class.getName()); | ||
|
||
@Inject | ||
protected BPMNGModelState modelState; | ||
|
||
@Override | ||
public Optional<Command> createCommand(BPMNAutoAlignOperation operation) { | ||
|
||
return commandOf(() -> { | ||
|
||
logger.finest("Auto align all elements...."); | ||
Set<Participant> participants = modelState.getBpmnModel().getParticipants(); | ||
for (Participant participant : participants) { | ||
BPMNGridSnapper.snap(participant); | ||
} | ||
|
||
Set<BPMNProcess> processList = modelState.getBpmnModel().getProcesses(); | ||
for (BPMNProcess process : processList) { | ||
// snap all elements | ||
Set<BPMNElementNode> allNodes = process.getAllFlowElementNodes(); | ||
for (BPMNElementNode _node : allNodes) { | ||
BPMNGridSnapper.snap(_node); | ||
} | ||
} | ||
modelState.reset(); | ||
}); | ||
} | ||
|
||
} |
Oops, something went wrong.