Search in sources :

Example 1 with Bounds

use of org.eclipse.sapphire.ui.Bounds in project liferay-ide by liferay.

the class WorkflowDefinitionLayoutPersistenceService method _writeWorkflowNodeBoundsToMetaData.

private void _writeWorkflowNodeBoundsToMetaData(WorkflowNode workflowNode, DiagramNodePart nodePart) {
    Bounds bounds = nodePart.getNodeBounds();
    ElementHandle<WorkflowNodeMetadata> nodeMetadata = workflowNode.getMetadata();
    WorkflowNodeMetadata metadata = nodeMetadata.content(true);
    Position position = metadata.getPosition();
    Value<Integer> valueX = position.getX();
    if (bounds.getX() != valueX.content()) {
        position.setX(bounds.getX());
    }
    Value<Integer> valueY = position.getY();
    if (bounds.getY() != valueY.content()) {
        position.setY(bounds.getY());
    }
}
Also used : Position(com.liferay.ide.kaleo.core.model.Position) DiagramNodeBounds(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds) Bounds(org.eclipse.sapphire.ui.Bounds) WorkflowNodeMetadata(com.liferay.ide.kaleo.core.model.WorkflowNodeMetadata)

Aggregations

Position (com.liferay.ide.kaleo.core.model.Position)1 WorkflowNodeMetadata (com.liferay.ide.kaleo.core.model.WorkflowNodeMetadata)1 Bounds (org.eclipse.sapphire.ui.Bounds)1 DiagramNodeBounds (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds)1