Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9cdb96e6b670fd9e1cbdcb1ff32dfb634906e5fc (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
/*****************************************************************************
 * Copyright (c) 2016 CEA LIST and others.
 * 
 * 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:
 *   CEA LIST - Initial API and implementation
 *   
 *****************************************************************************/

package org.eclipse.papyrus.uml.diagram.sequence.referencialgrilling;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.emf.common.command.CommandStackListener;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.RootEditPart;
import org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBroker;
import org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener;
import org.eclipse.gmf.runtime.diagram.ui.commands.SetBoundsCommand;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramRootEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
import org.eclipse.gmf.runtime.gef.ui.internal.editpolicies.GraphicalEditPolicyEx;
import org.eclipse.gmf.runtime.notation.BasicCompartment;
import org.eclipse.gmf.runtime.notation.DecorationNode;
import org.eclipse.gmf.runtime.notation.LayoutConstraint;
import org.eclipse.gmf.runtime.notation.Location;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.AutomaticNotationEditPolicy;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil;
import org.eclipse.papyrus.uml.diagram.sequence.command.CreateCoordinateCommand;
import org.eclipse.papyrus.uml.diagram.sequence.command.CreateGrillingStructureCommand;
import org.eclipse.papyrus.uml.diagram.sequence.keyboardlistener.KeyToSetMoveLinesListener;
import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
import org.eclipse.papyrus.uml.diagram.sequence.util.LogOptions;
import org.eclipse.swt.SWT;
import org.eclipse.ui.PlatformUI;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.InteractionFragment;
import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.Lifeline;
import org.eclipse.uml2.uml.UMLPackage;

/**
 * This edit policy is used to manage the referential grid of the sequence diagram
 *
 */
public class GridManagementEditPolicy extends GraphicalEditPolicyEx implements AutomaticNotationEditPolicy, NotificationListener, IGrillingEditpolicy {
	public static final String GRID_CONNECTION = "Grid Connection"; //$NON-NLS-1$
	protected GrillingEditpart gridCompartment = null;


	public static String GRID_MANAGEMENT = "GRID_MANAGEMENT"; //$NON-NLS-1$
	public static String COLUMN = "COLUMN_"; //$NON-NLS-1$
	public static String ROW = "ROW_"; //$NON-NLS-1$

	public int threshold = 5;
	/**
	 * @return the threshold
	 */
	public int getThreshold() {
		return threshold;
	}

	/**
	 * @param threshold the threshold to set
	 */
	public void setThreshold(int threshold) {
		this.threshold = threshold;
	}



	public int margin = 50;
	public boolean respectMargin = true;
	public boolean moveAllLinesAtSamePosition = false;

	public ArrayList<DecorationNode> rows = new ArrayList<DecorationNode>();
	public ArrayList<DecorationNode> columns = new ArrayList<DecorationNode>();

	// ok if the creation a X is free
	public boolean CREATION_X_FREE = true;
	/** if the CREATION_X_FREE == false COLUMN are created at fixed position **/
	public int X_SPACING = 100;
	private ContentDiagramListener contentDiagramListener;
	private CommandStackListener commandStackListener;

	/**
	 * @return the moveAllLinesAtSamePosition
	 */
	public boolean isMoveAllLinesAtSamePosition() {
		return moveAllLinesAtSamePosition;
	}

	/**
	 * @param moveAllLinesAtSamePosition
	 *            the moveAllLinesAtSamePosition to set
	 */
	public void setMoveAllLinesAtSamePosition(boolean moveAllLinesAtSamePosition) {

		UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, ">> set moveAllLinesAtSamePosition=" + moveAllLinesAtSamePosition);//$NON-NLS-1$
		this.moveAllLinesAtSamePosition = moveAllLinesAtSamePosition;
	}

	/**
	 * @return the respectMargin
	 */
	public boolean isRespectMargin() {
		return respectMargin;
	}

	/**
	 * @param respectMargin
	 *            the respectMargin to set
	 */
	public void setRespectMargin(boolean respectMargin) {
		this.respectMargin = respectMargin;
	}



	public boolean strictRespectMargin = true;




	public Comparator<DecorationNode> RowComparator = new Comparator<DecorationNode>() {

		@Override
		public int compare(DecorationNode o1, DecorationNode o2) {
			LayoutConstraint layoutConstrainto1 = ((Node) o1).getLayoutConstraint();
			LayoutConstraint layoutConstrainto2 = ((Node) o2).getLayoutConstraint();
			if (layoutConstrainto1 != null && layoutConstrainto2 != null) {
				return ((Integer) ((Location) layoutConstrainto1).getY()).compareTo(((Integer) ((Location) layoutConstrainto2).getY()));
			}
			return 0;
		}
	};

	public Comparator<DecorationNode> ColumnComparator = new Comparator<DecorationNode>() {

		@Override
		public int compare(DecorationNode o1, DecorationNode o2) {
			LayoutConstraint layoutConstrainto1 = ((Node) o1).getLayoutConstraint();
			LayoutConstraint layoutConstrainto2 = ((Node) o2).getLayoutConstraint();
			if (layoutConstrainto1 != null && layoutConstrainto2 != null) {
				return ((Integer) ((Location) layoutConstrainto1).getX()).compareTo(((Integer) ((Location) layoutConstrainto2).getX()));
			}
			return 0;
		}
	};




	/**
	 * Constructor.
	 *
	 */
	public GridManagementEditPolicy() {
	}

	/**
	 * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#activate()
	 *
	 */
	@Override
	public void activate() {
		super.activate();
		getDiagramEventBroker().addNotificationListener(((EObject) getHost().getModel()), this);
		contentDiagramListener = new ContentDiagramListener(this);
		commandStackListener = new GridCommandStackListener(this);
		((EObject) getHost().getModel()).eResource().eAdapters().add(contentDiagramListener);
		getDiagramEditPart(getHost()).getEditingDomain().getCommandStack().addCommandStackListener(commandStackListener);
		PlatformUI.getWorkbench().getDisplay().addFilter(SWT.KeyDown, new KeyToSetMoveLinesListener(this, SWT.SHIFT, false));
		PlatformUI.getWorkbench().getDisplay().addFilter(SWT.KeyUp, new KeyToSetMoveLinesListener(this, SWT.SHIFT, true));
		refreshGrillingStructure();
	}

	/**
	 * 
	 */
	private void refreshGrillingStructure() {
		EditPart host = getHost();
		int i = 0;
		while (gridCompartment == null && i < host.getChildren().size()) {
			if (host.getChildren().get(i) instanceof GrillingEditpart) {
				gridCompartment = (GrillingEditpart) (host.getChildren().get(i));
			}
			i++;
		}
		if (gridCompartment == null) {
			CreateGrillingStructureCommand createGrillingStructureCommand = new CreateGrillingStructureCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), (View) getHost().getModel());
			// Record for undo if possible, otherwise unprotected
			execute(createGrillingStructureCommand);


		}
		while (gridCompartment == null && i < host.getChildren().size()) {
			if (host.getChildren().get(i) instanceof GrillingEditpart) {
				gridCompartment = (GrillingEditpart) (host.getChildren().get(i));
			}
			i++;
		}
		// cleanUnusedRowAndColumn();
		updateRowsAndColumns();
	}

	/**
	 * update the list of romw and colmumn
	 */
	public void updateRowsAndColumns() {


		rows.clear();
		columns.clear();
		if (gridCompartment != null) {
			for (int j = 0; j < gridCompartment.getNotationView().getChildren().size(); j++) {
				if (gridCompartment.getNotationView().getChildren().get(j) instanceof DecorationNode) {
					DecorationNode decorationNode = (DecorationNode) gridCompartment.getNotationView().getChildren().get(j);
					if (decorationNode.getType().startsWith(ROW)) {
						rows.add(decorationNode);

					}
					if (decorationNode.getType().startsWith(COLUMN)) {
						columns.add(decorationNode);
					}
				}
			}
		}
		Collections.sort(rows, RowComparator);
		Collections.sort(columns, ColumnComparator);
		UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "____ROWS_____");//$NON-NLS-1$

		for (int i=0; i<rows.size();i++) {
			UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "row "+i +" y="+getPositionY(rows.get(i)));//$NON-NLS-1$ //$NON-NLS-2$

		}
	}

	/**
	 * this class is very specific the the sequence diagram
	 * this purpose of this method is to ensure the consistency of event in the the represented diagram
	 **/
	public void updateSemanticAfterUpdate() {
		// 1. look for all Lifelines
		// There are columns.
		HashSet<Lifeline> lifelineList = new HashSet<Lifeline>();
		for (DecorationNode column : columns) {
			if ((getRef(column)) != null) {
				for (EObject referedElement : getRef(column)) {
					if (referedElement instanceof Lifeline) {
						lifelineList.add((Lifeline) referedElement);
					}
				}
			}

		}
		// for each lifeline recreat the list of covered element
		for (Lifeline lifeline : lifelineList) {
			ArrayList<InteractionFragment> covered = new ArrayList<InteractionFragment>();
			for (DecorationNode row : rows) {
				if ((getRef(row)) != null) {
					for (EObject referedElement : getRef(row)) {
						if (referedElement instanceof InteractionFragment && (!(referedElement instanceof InteractionOperand))) {
							InteractionFragment interactionFragment = (InteractionFragment) (referedElement);
							if (lifeline.getCoveredBys().contains(interactionFragment)) {
								covered.add(interactionFragment);

							}
						}

					}
				}

			}

			// 3. managment of InteractionOperand
			// There are columns.

			ArrayList<InteractionOperand> coveredbyInteractionOperand = new ArrayList<InteractionOperand>();
			for (DecorationNode column : columns) {
				if ((getRef(column)) != null) {
					for (EObject referedElement : getRef(column)) {
						if (referedElement instanceof InteractionOperand) {
							if (!(coveredbyInteractionOperand.contains(referedElement))) {
								coveredbyInteractionOperand.add((InteractionOperand) referedElement);
							} else {
								coveredbyInteractionOperand.remove((InteractionOperand) referedElement);
							}
						}
						if (referedElement.equals(lifeline)) {
							covered.addAll(coveredbyInteractionOperand);
						}
					}
				}

			}

			if (covered.size() == lifeline.getCoveredBys().size()) {
				UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "equality");//$NON-NLS-1$
				execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), covered));
			} else if (covered.size() < lifeline.getCoveredBys().size()) {
				UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "Event not managed or being created");//$NON-NLS-1$
				// covered.addAll(lifeline.getCoveredBys());
				execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), covered));
			} else if (covered.size() > lifeline.getCoveredBys().size()) {
				UMLDiagramEditorPlugin.log.trace(LogOptions.SEQUENCE_DEBUG_REFERENCEGRID, "more event than in the lifeline due to combined fragment");//$NON-NLS-1$
				execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), lifeline, UMLPackage.eINSTANCE.getLifeline_CoveredBy(), covered));
			}
		}

	}


	/**
	 * Gets the diagram event broker from the editing domain.
	 *
	 * @return the diagram event broker
	 */
	protected DiagramEventBroker getDiagramEventBroker() {
		TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain();
		if (null != theEditingDomain) {
			return DiagramEventBroker.getInstance(theEditingDomain);
		}
		return null;
	}

	/**
	 * @see org.eclipse.gef.editpolicies.AbstractEditPolicy#deactivate()
	 * 
	 */
	@Override
	public void deactivate() {
		getDiagramEventBroker().removeNotificationListener(((EObject) getHost().getModel()), this);
		super.deactivate();
	}

	/**
	 * @see org.eclipse.gmf.runtime.diagram.core.listener.NotificationListener#notifyChanged(org.eclipse.emf.common.notify.Notification)
	 *
	 * @param notifications
	 */
	@Override
	public void notifyChanged(Notification notification) {
		if (notification instanceof CommandExecutionNotification) {
			// after a command execution moveAllLinesAtSamePosition is set to false
			// we must explicitly set to true if we want to move it as a line
			//setMoveAllLinesAtSamePosition(true);
			//UMLDiagramEditorPlugin.log.trace(CustomMessages.SEQUENCE_DEBUG_REFERENCEGRID, "executed Command");//$NON-NLS-1$
		} else {

			if (notification.getEventType() == Notification.SET && notification.getNotifier() instanceof Location) {
				updateRowsAndColumns();
				if ((((EObject) notification.getNotifier()).eContainer()) instanceof DecorationNode && rows.contains((((EObject) notification.getNotifier()).eContainer()))) {
					if (notification.getFeature().equals(NotationPackage.eINSTANCE.getLocation_Y())) {
						DecorationNode movedRow=(DecorationNode)(((EObject) notification.getNotifier()).eContainer());
						// when we move line we disconnect listeners to avoid problems of infinite loop
						if (moveAllLinesAtSamePosition) {
							ArrayList<DecorationNode> rowlist = getRowAtPosition(notification.getOldIntValue());
							((EObject) getHost().getModel()).eResource().eAdapters().remove(contentDiagramListener);

							// maybe we must move other lines
							// it exist other lines
							if(!(movedRow.getElement() instanceof Lifeline)) {
								if (rows.size() > rowlist.size()) {
									updateYpositionForRow((DecorationNode) (((EObject) notification.getNotifier()).eContainer()), notification.getOldIntValue());
								}
							}
							for (Iterator<DecorationNode> iterator = rowlist.iterator(); iterator.hasNext();) {
								DecorationNode axis = (DecorationNode) iterator.next();
								if((movedRow.getElement() instanceof Lifeline)&& (axis.getElement() instanceof Lifeline)) {

									execute(new SetBoundsCommand(getDiagramEditPart(getHost()).getEditingDomain(), "update Line", new EObjectAdapter(axis), new Point(0, notification.getNewIntValue())));
								}
								else if(!(movedRow.getElement() instanceof Lifeline)) {
									execute(new SetBoundsCommand(getDiagramEditPart(getHost()).getEditingDomain(), "update Line", new EObjectAdapter(axis), new Point(0, notification.getNewIntValue())));
								}

							}
						}
						((EObject) getHost().getModel()).eResource().eAdapters().add(contentDiagramListener);
					}

				}
			}
		}
	}



	/**
	 * get the decoration node that represents a column from a position (absolute)
	 * 
	 * @param x
	 *            the position x for the column
	 * @return the decoration node
	 */
	public DecorationNode createColumnTolisten(int x, Element semantic) throws NoGrillElementFound {
		execute(new CreateCoordinateCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), ((BasicCompartment) gridCompartment.getNotationView()), COLUMN + columns.size(), semantic, x));
		refreshGrillingStructure();
		return getLastCreatedAxis();
	}

	/**
	 * get the decoration node that represents a line from a position (absolute)
	 * 
	 * @param y
	 *            the position y for the line
	 * @return the decoration node
	 */
	public DecorationNode createRowTolisten(int y, Element semantic) throws NoGrillElementFound {
		execute(new CreateCoordinateCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), ((BasicCompartment) gridCompartment.getNotationView()), ROW + rows.size(), semantic, y));
		DecorationNode row = getLastCreatedAxis();
		refreshGrillingStructure();
		return row;

	}

	/**
	 * @return get the last created Axis
	 **/
	public DecorationNode getLastCreatedAxis() throws NoGrillElementFound {
		BasicCompartment grid = ((BasicCompartment) gridCompartment.getNotationView());
		if (grid.getChildren().size() == 0) {
			throw new NoGrillElementFound();
		} else {
			return (DecorationNode) grid.getChildren().get(grid.getChildren().size() - 1);
		}

	}


	/**
	 * 
	 * @param y
	 *            the position y where we look for a row
	 * @return the rows that exists at the position [y- threshold, y+threshold]s
	 */
	public ArrayList<DecorationNode> getRowAtPosition(int y) {
		ArrayList<DecorationNode> sameLines = new ArrayList<DecorationNode>();
		for (Iterator<DecorationNode> iterator = rows.iterator(); iterator.hasNext();) {
			DecorationNode currentRow = iterator.next();
			int Yposition = getPositionY(currentRow);
			if (Yposition - threshold <= y && y <= Yposition + threshold) {
				sameLines.add(currentRow);
			}

		}
		return sameLines;
	}

	/**
	 * @param decorationNode
	 * @return the Position Y for a decoration node
	 */
	public int getPositionY(DecorationNode decorationNode) {
		LayoutConstraint constraint = decorationNode.getLayoutConstraint();
		if (constraint instanceof Location) {
			return ((Location) constraint).getY();
		}
		return 0;
	}


	protected void updateYpositionForRow(DecorationNode movedRow, int oldPosition) {
		LayoutConstraint newconstraint = movedRow.getLayoutConstraint();
		DecorationNode nextRow = getDistanceWithNextRowBeforeMoving(movedRow, oldPosition);
		if (nextRow == null) {
			return;
		}
		LayoutConstraint nextConstraint = nextRow.getLayoutConstraint();
		int nextDistance = ((Location) nextConstraint).getY() - ((Location) newconstraint).getY();
		int margin = getGridSpacing();
		if (nextDistance < margin) {
			ArrayList<DecorationNode> rowsCopy = new ArrayList<DecorationNode>();
			rowsCopy.addAll(rows);
			for (int i = rowsCopy.indexOf(nextRow); i < rowsCopy.size(); i++) {
				if(!(rowsCopy.get(i).equals(movedRow))) {
					LayoutConstraint aConstraint = rowsCopy.get(i).getLayoutConstraint();
					if (aConstraint instanceof Location) {
						execute(new SetCommand(((IGraphicalEditPart) getHost()).getEditingDomain(), aConstraint, NotationPackage.eINSTANCE.getLocation_Y(), ((Location) aConstraint).getY() + margin));
					}
				}
			}
		}
	}

	/**
	 * 
	 * @param currentRow
	 * @param currentRowPosition
	 * @return get the next row that has not the same position
	 */
	protected DecorationNode getDistanceWithNextRowBeforeMoving(DecorationNode currentRow, int oldPosition) {
		Object[] arrayRow = rows.toArray();
		List<Object> orderedRows = Arrays.asList(arrayRow);
		DecorationNode nextRow = null;
		// look for the next row
		for (Iterator<DecorationNode> iterator = rows.iterator(); iterator.hasNext();) {
			DecorationNode aRow = iterator.next();
			int Yposition = getPositionY(aRow);
			if (oldPosition  < Yposition && (!aRow.equals(currentRow))) {
				nextRow = aRow;
				return nextRow;
			}

		}
		return nextRow;

	}

	protected int getGridSpacing() {
		if (DiagramEditPartsUtil.isSnapToGridActive(getHost())) {

			RootEditPart drep = getHost().getRoot();
			if (drep instanceof DiagramRootEditPart) {
				return (int) ((DiagramRootEditPart) drep).getGridSpacing();
			}
		}
		return margin;
	}

	public static Point getLocation(DecorationNode current) throws NoGrillElementFound {
		LayoutConstraint currentConstraint = current.getLayoutConstraint();
		if (currentConstraint instanceof Location) {
			return new Point(((Location) currentConstraint).getX(), ((Location) currentConstraint).getY());
		} else {
			throw new NoGrillElementFound();
		}
	}

	public static List<EObject> getRef(DecorationNode current) {
		EAnnotation eAnnotation = current.getEAnnotation(GRID_CONNECTION);
		if (eAnnotation == null) {
			return null;
		} else {
			if (eAnnotation.getReferences().size() != 0) {
				return eAnnotation.getReferences();
			}
			return null;
		}
	}



}

Back to the top