/******************************************************************************* 
 * 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 
 *
 * @author Innar Made
 ******************************************************************************/
package org.camunda.bpm.modeler.ui.features.activity.subprocess;

import org.camunda.bpm.modeler.core.features.activity.LayoutActivityFeature;
import org.camunda.bpm.modeler.core.utils.GraphicsUtil;
import org.eclipse.graphiti.datatypes.IRectangle;
import org.eclipse.graphiti.features.IFeatureProvider;
import org.eclipse.graphiti.mm.algorithms.Text;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;

public class LayoutExpandableActivityFeature extends LayoutActivityFeature {

	public LayoutExpandableActivityFeature(IFeatureProvider fp) {
		super(fp);
	}

	@Override
	protected void layoutLabel(ContainerShape container, Shape labelShape, IRectangle bounds) {

		Text text = (Text) labelShape.getGraphicsAlgorithm();

		int padding = 5;

		int width = bounds.getWidth() - padding;
		int height = Math.min(GraphicsUtil.getLabelHeight(text), bounds.getHeight() - padding);

		Graphiti.getGaService().setLocationAndSize(text, padding, padding, width, height);
	}
}

@@ -657,64 +657,8 @@
 re;%0A
-import org.camunda.bpm.modeler.core.utils.GraphicsUtil;%0A
 impo
@@ -800,16 +800,24 @@
 orithms.
+Abstract
 Text;%0Aim
@@ -1234,16 +1234,24 @@
 s) %7B%0A%0A%09%09
+Abstract
 Text tex
@@ -1255,16 +1255,24 @@
 text = (
+Abstract
 Text) la
@@ -1311,242 +1311,110 @@
 %0A%0A%09%09
-int padding = 5;%0A%0A%09%09int width = bounds.getWidth() - padding;%0A%09%09int height = Math.min(GraphicsUtil.getLabelHeight(text), bounds.getHeight() - padding);%0A%0A%09%09Graphiti.getGaService().setLocationAndSize(text, padding, padding, width, height
+Graphiti.getGaService().setLocationAndSize(text, 5, 5, bounds.getWidth() - 10, bounds.getHeight() - 10
 );%0A%09

Fix of [CAM-4803]