Search in sources :

Example 1 with DiagramNodeDeleteEvent

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

the class WorkflowDefinitionLayoutPersistenceService method _handleDiagramNodeEvent.

private void _handleDiagramNodeEvent(DiagramNodeEvent event) {
    DiagramNodePart nodePart = event.part();
    if (event instanceof DiagramNodeAddEvent) {
        _read(nodePart);
    } else if (event instanceof DiagramNodeDeleteEvent) {
        _refreshDirtyState();
    } else if (event instanceof DiagramNodeMoveEvent) {
        DiagramNodeBounds nodeBounds = nodePart.getNodeBounds();
        if (nodeBounds.isAutoLayout()) {
            /*
				 * need to add the node bounds to the persistence cache so that
				 * "revert" could work
				 */
            _addNodeToPersistenceCache(nodePart);
            _refreshDirtyState();
        } else if (!nodeBounds.isDefaultPosition()) {
            DiagramNodePart diagramNodePart = event.part();
            _write(diagramNodePart);
        }
    }
}
Also used : DiagramNodeDeleteEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeDeleteEvent) DiagramNodeAddEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeAddEvent) DiagramNodePart(org.eclipse.sapphire.ui.diagram.editor.DiagramNodePart) DiagramNodeMoveEvent(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeMoveEvent) DiagramNodeBounds(org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds)

Aggregations

DiagramNodeAddEvent (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeAddEvent)1 DiagramNodeBounds (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeBounds)1 DiagramNodeDeleteEvent (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeDeleteEvent)1 DiagramNodeMoveEvent (org.eclipse.sapphire.ui.diagram.editor.DiagramNodeMoveEvent)1 DiagramNodePart (org.eclipse.sapphire.ui.diagram.editor.DiagramNodePart)1