Search in sources :

Example 6 with DiagramNodeBounds

use of org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds in project liferay-ide by liferay.

the class WorkflowDefinitionLayoutPersistenceService method _save.

private void _save() {
    _refreshPersistedPartsCache();
    /*
		 * For nodes that are placed using default node positions and connection
		 * bend points that are calculated using connection router, we don't
		 * modify the corresponding model properties in order to allow "revert"
		 * in source editor to work correctly. So we need to do an explicit save
		 * of the node bounds and connection bend points here.
		 */
    _removeWorkflowNodeListeners();
    _removeBendpointListeners();
    for (DiagramNodePart nodePart : _part().getNodes()) {
        Element modelElement = nodePart.getLocalModelElement();
        WorkflowNode workflowNode = (WorkflowNode) modelElement;
        if (!workflowNode.disposed()) {
            _writeWorkflowNodeBoundsToMetaData(workflowNode, nodePart);
            DiagramNodeBounds nodePartBounds = nodePart.getNodeBounds();
            nodePartBounds.setAutoLayout(false);
            nodePart.setNodeBounds(nodePartBounds);
        }
    }
    for (DiagramConnectionPart connPart : _part().getConnections()) {
        Element modelElement = connPart.getLocalModelElement();
        Transition transition = (Transition) modelElement;
        if (!transition.disposed()) {
            _writeTransitionBendPoints(transition, connPart);
        }
    }
    _addWorkflowNodeListeners();
    _addBendpointListeners();
}
Also used : Element(org.eclipse.sapphire.Element) DiagramConnectionPart(org.eclipse.sapphire.ui.diagram.DiagramConnectionPart) CanTransition(com.liferay.ide.kaleo.core.model.CanTransition) Transition(com.liferay.ide.kaleo.core.model.Transition) WorkflowNode(com.liferay.ide.kaleo.core.model.WorkflowNode) DiagramNodePart(org.eclipse.sapphire.ui.diagram.editor.DiagramNodePart) DiagramNodeBounds(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds)

Aggregations

DiagramNodeBounds (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds)6 DiagramNodePart (org.eclipse.sapphire.ui.diagram.editor.DiagramNodePart)5 CanTransition (com.liferay.ide.kaleo.core.model.CanTransition)3 Position (com.liferay.ide.kaleo.core.model.Position)3 Transition (com.liferay.ide.kaleo.core.model.Transition)3 WorkflowNode (com.liferay.ide.kaleo.core.model.WorkflowNode)3 DiagramConnectionPart (org.eclipse.sapphire.ui.diagram.DiagramConnectionPart)3 ConnectionBendpoint (com.liferay.ide.kaleo.core.model.ConnectionBendpoint)2 TransitionMetadata (com.liferay.ide.kaleo.core.model.TransitionMetadata)2 WorkflowNodeMetadata (com.liferay.ide.kaleo.core.model.WorkflowNodeMetadata)2 Point (org.eclipse.sapphire.ui.Point)2 ConnectionService (org.eclipse.sapphire.ui.diagram.ConnectionService)2 ArrayList (java.util.ArrayList)1 Element (org.eclipse.sapphire.Element)1 DiagramNodeAddEvent (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeAddEvent)1 DiagramNodeDeleteEvent (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeDeleteEvent)1 DiagramNodeMoveEvent (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeMoveEvent)1 SapphireDiagramEditorPagePart (org.eclipse.sapphire.ui.diagram.editor.SapphireDiagramEditorPagePart)1