blob: 6d2ca825903233200f2abe9bd50c29e4c4024e36 (
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
|
/*****************************************************************************
* Copyright (c) 2005 AIRBUS FRANCE.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* David Sciamma (Anyware Technologies),
* Mathieu Garcia (Anyware Technologies),
* Jacques Lescot (Anyware Technologies),
* Thomas Friol (Anyware Technologies),
* Nicolas Lalevee (Anyware Technologies) - initial API and implementation
*
****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.figures;
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.geometry.Dimension;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public class DestructionEventFigure extends org.eclipse.draw2d.Figure {
/**
* Constructor <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public DestructionEventFigure() {
super();
}
/**
* @return a <code>Dimension</code> that represents the minimum or default size of
* this figure.
* @since 3.0
*/
public Dimension getDefaultSize() {
return new Dimension(40,40);
}
/**
* The stop is a cross
*
* @see org.eclipse.draw2d.Figure#paintFigure(org.eclipse.draw2d.Graphics)
*/
@Override
protected void paintFigure(Graphics graphics) {
super.paintFigure(graphics);
graphics.pushState();
graphics.setLineWidth(2);
graphics.drawLine(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height);
graphics.drawLine(bounds.x, bounds.y+ bounds.height, bounds.x + bounds.width, bounds.y);
graphics.popState();
}
public void setLineWidth(int w) {
if ((lineWidth == w) || (w < 0)) {
return;
}
lineWidth = w;
repaint();
}
private int lineWidth = 1;
}
|