Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0130a532ecf9c00b206c5abcc37f47b4047bb593 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*****************************************************************************
 * 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:
 *  Alexia Allanic (Atos Origin) alexia.allanic@atosorigin.com - LayouttoolInterface Interface
 *
 *****************************************************************************/

package org.eclipse.papyrus.layout;

import java.util.Map;

import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;

/**
 * The class LayouttoolInterface.
 */
public interface LayouttoolInterface {

	/**
	 * Get the registered editor class.
	 * 
	 * @return Class
	 */
	Class getEditorClass();

	/**
	 * Is a node.
	 * 
	 * @param element
	 *        the element
	 * 
	 * @return true, if the EditPart is a node
	 */
	boolean isNode(EditPart element);

	/**
	 * Is a relationship.
	 * 
	 * @param element
	 *        the element
	 * 
	 * @return true, if the EditPart is a relationship
	 */
	boolean isRelationship(EditPart element);

	/**
	 * Get bounds of EditPart.
	 * 
	 * @param element
	 *        the Node to have their coordinates
	 * 
	 * @return Rectangle coordinates of the node
	 */
	Rectangle getBounds(EditPart element);

	/**
	 * Get source of relationship.
	 * 
	 * @param element
	 *        relationship to have his source
	 * 
	 * @return EditPart source node of the relationship
	 */
	EditPart getSource(EditPart element);

	/**
	 * Get destination of relationship.
	 * 
	 * @param element
	 *        relationship to have his destination
	 * 
	 * @return EditPart destination node of the relationship
	 */
	EditPart getTarget(EditPart element);

	/**
	 * Get layout area.
	 * 
	 * @param element
	 *        the element
	 * 
	 * @return Rectangle coordinates of layout area
	 */
	Rectangle getLayoutArea(EditPart[] element);

	/**
	 * Execute layout.
	 * 
	 * @param map
	 *        the map
	 */
	void execute(Map<EditPart, Rectangle> map);

}

Back to the top