1 | package de.uka.ipd.sdq.pcm.gmf.allocation.edit.parts; |
2 | |
3 | import org.eclipse.draw2d.PositionConstants; |
4 | import org.eclipse.draw2d.geometry.Dimension; |
5 | import org.eclipse.gmf.runtime.draw2d.ui.figures.WrapLabel; |
6 | import org.eclipse.swt.graphics.Image; |
7 | |
8 | public class PcmWrapLabel extends WrapLabel { |
9 | |
10 | /** |
11 | * |
12 | */ |
13 | public PcmWrapLabel() { |
14 | super(); |
15 | this.setAlignment(PositionConstants.CENTER); |
16 | } |
17 | |
18 | /** |
19 | * @param i |
20 | */ |
21 | public PcmWrapLabel(Image i) { |
22 | super(i); |
23 | this.setAlignment(PositionConstants.CENTER); |
24 | } |
25 | |
26 | /** |
27 | * @param s |
28 | * @param i |
29 | */ |
30 | public PcmWrapLabel(String s, Image i) { |
31 | super(s, i); |
32 | this.setAlignment(PositionConstants.CENTER); |
33 | } |
34 | |
35 | /** |
36 | * @param s |
37 | */ |
38 | public PcmWrapLabel(String s) { |
39 | super(s); |
40 | this.setAlignment(PositionConstants.CENTER); |
41 | } |
42 | |
43 | /* (non-Javadoc) |
44 | * @see org.eclipse.draw2d.Figure#getMaximumSize() |
45 | */ |
46 | @Override |
47 | public Dimension getMaximumSize() { |
48 | Dimension d = super.getMaximumSize(); |
49 | Dimension newDim = new Dimension(d.width,getPreferredSize().height); |
50 | |
51 | return newDim; |
52 | } |
53 | |
54 | |
55 | } |