Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 39175a0b8c4edae96e587a192ef3a9228eeb1c08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*****************************************************************************
 * Copyright (c) 2009 Atos Origin.
 *
 *    
 * All rights reserved. This program and the accompanying materials
 * are 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:
 *   Atos Origin - Initial API and implementation
 *
 *****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.figures;

import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.RectangleFigure;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.papyrus.uml.diagram.common.figure.node.InteractionRectangleFigure;

/**
 * The figure of the InteractionUse
 */
public class InteractionUseRectangleFigure extends InteractionRectangleFigure {

	/** A centered label */
	protected WrappingLabel centerLabel;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.papyrus.uml.diagram.sequence.figures.InteractionRectangleFigure#createContentPane()
	 */
	@Override
	protected RectangleFigure createContentPane() {
		// Create the ContentPane
		RectangleFigure contentPane = new RectangleFigure();
		contentPane.setOutline(false);
		contentPane.setFill(false);
		contentPane.setLayoutManager(new StackLayout());
		// Create the centered label
		centerLabel = new WrappingLabel();
		centerLabel.setAlignment(PositionConstants.CENTER);
		// Add the label to the contentPane
		contentPane.add(centerLabel);
		return contentPane;
	}

	public WrappingLabel getCenterLabel() {
		return centerLabel;
	}
}

Back to the top