/******************************************************************************* * Copyright (c) 2011 Red Hat, Inc. * All rights reserved. * This program is made available under the terms of the * Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Red Hat, Inc. - initial API and implementation ******************************************************************************/ package org.eclipse.bpmn2.modeler.ui.features.activity.subprocess; import org.eclipse.bpmn2.Activity; import org.eclipse.bpmn2.modeler.core.features.activity.ActivityLayoutFeature; import org.eclipse.graphiti.features.IFeatureProvider; import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm; import org.eclipse.graphiti.mm.algorithms.Text; import org.eclipse.graphiti.mm.pictograms.Shape; import org.eclipse.graphiti.services.Graphiti; public class SubProcessLayoutFeature extends ActivityLayoutFeature { public SubProcessLayoutFeature(IFeatureProvider fp) { super(fp); } @Override protected boolean layoutHook(Shape shape, GraphicsAlgorithm ga, Object bo, int newWidth, int newHeight) { if (bo != null && bo instanceof Activity && ga instanceof Text) { Graphiti.getGaService().setLocationAndSize(ga, 5, 5, newWidth - 10, 15); return true; } return false; } }