Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 331125
Collapse All | Expand All

(-)src/org/eclipse/papyrus/diagram/common/figure/node/SubCompartmentLayoutManager.java (-2 / +14 lines)
Lines 30-36 Link Here
30
	protected int preferedHeight = MINIMUMCOMPARTMENTSIZE;
30
	protected int preferedHeight = MINIMUMCOMPARTMENTSIZE;
31
31
32
	@Override
32
	@Override
33
	protected Dimension calculatePreferredSize(IFigure container, int wHint, int hHint) {
33
	protected Dimension calculatePreferredSize(IFigure figure, int wHint, int hHint) {
34
		Dimension dim = new Dimension();
35
		if(figure.getChildren().size() > 0) {
36
			if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
37
				dim.height = 10;
38
				dim.width = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().width;
39
			}
40
		}
41
		return dim;
42
	}
43
	
44
	@Override
45
	public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
34
		return new Dimension(10, preferedHeight);
46
		return new Dimension(10, preferedHeight);
35
	}
47
	}
36
48
Lines 68-74 Link Here
68
				if(dim.height == 0) {
80
				if(dim.height == 0) {
69
					dim.height = 20;
81
					dim.height = 20;
70
				}
82
				}
71
83
				dim.width = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().width;
72
			}
84
			}
73
		}
85
		}
74
		return dim;
86
		return dim;
(-)src/org/eclipse/papyrus/diagram/common/figure/node/AutomaticCompartmentLayoutManager.java (-3 / +11 lines)
Lines 63-69 Link Here
63
		}
63
		}
64
		if(compartmentList.size() != 0) {
64
		if(compartmentList.size() != 0) {
65
			for(int i = 0; i < container.getChildren().size(); i++) {
65
			for(int i = 0; i < container.getChildren().size(); i++) {
66
				minimumHeight += ((IFigure)container.getChildren().get(i)).getPreferredSize().height;
66
				IFigure child = (IFigure)container.getChildren().get(i);
67
				minimumHeight += child.getPreferredSize().height;
68
				minimumWith = Math.max(minimumWith, child.getPreferredSize().width);
67
			}
69
			}
68
		} else {
70
		} else {
69
			for(int i = 0; i < notCompartmentList.size(); i++) {
71
			for(int i = 0; i < notCompartmentList.size(); i++) {
Lines 74-79 Link Here
74
			minimumHeight += 7;
76
			minimumHeight += 7;
75
		return new Dimension(minimumWith, minimumHeight);
77
		return new Dimension(minimumWith, minimumHeight);
76
	}
78
	}
79
	
80
	@Override
81
	public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
82
		return new Dimension(20,20);
83
	}
77
84
78
	/**
85
	/**
79
	 * layout by putting label in the center of figure
86
	 * layout by putting label in the center of figure
Lines 243-250 Link Here
243
	public Dimension getPreferedSize(IFigure figure) {
250
	public Dimension getPreferedSize(IFigure figure) {
244
		Dimension dim = figure.getPreferredSize();
251
		Dimension dim = figure.getPreferredSize();
245
		if(figure.getChildren().size() > 0) {
252
		if(figure.getChildren().size() > 0) {
246
			if(figure.getChildren().get(0) instanceof ResizableCompartmentFigure) {
253
			Object compartment = figure.getChildren().get(0);
247
				dim.height = ((ResizableCompartmentFigure)figure.getChildren().get(0)).getPreferredSize().height + 10;
254
			if(compartment instanceof ResizableCompartmentFigure) {
255
				dim.height = ((ResizableCompartmentFigure)compartment).getPreferredSize().height + 10;
248
				if(dim.height == 0) {
256
				if(dim.height == 0) {
249
					dim.height = MINIMUM_COMPARTMENT_HEIGHT;
257
					dim.height = MINIMUM_COMPARTMENT_HEIGHT;
250
				}
258
				}

Return to bug 331125