View | Details | Raw Unified | Return to bug 118858
Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/draw2d/ui/figures/WrappingLabel.java (+6 lines)
Lines 913-918 Link Here
913
        Dimension ellipsisSize = getTruncationStringSize();
913
        Dimension ellipsisSize = getTruncationStringSize();
914
        Dimension textSize = new TextUtilitiesEx(getFigureMapMode())
914
        Dimension textSize = new TextUtilitiesEx(getFigureMapMode())
915
            .getTextExtents(getText(), currentFont);
915
            .getTextExtents(getText(), currentFont);
916
        if (textSize.width == 0) {
917
			textSize.height = 0;
918
		}       
916
        textSize.intersect(ellipsisSize);
919
        textSize.intersect(ellipsisSize);
917
920
918
        Dimension labelSize = calculateLabelSize(textSize);
921
        Dimension labelSize = calculateLabelSize(textSize);
Lines 968-973 Link Here
968
            } else {
971
            } else {
969
                preferredTextSize = getTextFigure().getPreferredSize(wHint,
972
                preferredTextSize = getTextFigure().getPreferredSize(wHint,
970
                    hHint).getCopy();
973
                    hHint).getCopy();
974
                if(preferredTextSize.width == 0){
975
                	preferredTextSize.height = 0;
976
                }
971
                prefSize = preferredTextSize.getCopy();
977
                prefSize = preferredTextSize.getCopy();
972
            }
978
            }
973
979
(-)src/org/eclipse/gmf/runtime/diagram/ui/figures/NoteFigure.java (-8 lines)
Lines 132-145 Link Here
132
		g.fillPolygon(p);			
132
		g.fillPolygon(p);			
133
	}
133
	}
134
134
135
	/**
136
	 * @see org.eclipse.draw2d.IFigure#getPreferredSize(int, int)
137
	 */
138
	public Dimension getPreferredSize(int wHint, int hHint) {
139
		return super.getPreferredSize(wHint, hHint).getUnioned(new Dimension(
140
								MapModeUtil.getMapMode(this).DPtoLP(100), 
141
								MapModeUtil.getMapMode(this).DPtoLP(50)));
142
	}
143
	
135
	
144
	/**
136
	/**
145
	 * sets or resets the diagram link mode, in diagram link mode the note
137
	 * sets or resets the diagram link mode, in diagram link mode the note
(-)src/org/eclipse/gmf/runtime/diagram/ui/editparts/NoteEditPart.java (-2 / +6 lines)
Lines 15-20 Link Here
15
import java.util.Collection;
15
import java.util.Collection;
16
import java.util.Iterator;
16
import java.util.Iterator;
17
17
18
import org.eclipse.draw2d.geometry.Dimension;
18
import org.eclipse.draw2d.geometry.Insets;
19
import org.eclipse.draw2d.geometry.Insets;
19
import org.eclipse.emf.common.notify.Notification;
20
import org.eclipse.emf.common.notify.Notification;
20
import org.eclipse.emf.ecore.EObject;
21
import org.eclipse.emf.ecore.EObject;
Lines 70-76 Link Here
70
	 */
71
	 */
71
	protected NodeFigure createNodeFigure() {
72
	protected NodeFigure createNodeFigure() {
72
		IMapMode mm = getMapMode();
73
		IMapMode mm = getMapMode();
73
		Insets insets = new Insets(mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(14));
74
		Insets insets = new Insets(mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(5), mm.DPtoLP(5));
74
		NoteFigure noteFigure = new NoteFigure(mm.DPtoLP(100), mm.DPtoLP(56), insets);
75
		NoteFigure noteFigure = new NoteFigure(mm.DPtoLP(100), mm.DPtoLP(56), insets);
75
		Object model = getModel();
76
		Object model = getModel();
76
		if (model!=null && model instanceof View){
77
		if (model!=null && model instanceof View){
Lines 79-86 Link Here
79
				 (notationView.getEAnnotation(Properties.DIAGRAMLINK_ANNOTATION)!=null ||
80
				 (notationView.getEAnnotation(Properties.DIAGRAMLINK_ANNOTATION)!=null ||
80
				  notationView.getType() == null ||
81
				  notationView.getType() == null ||
81
				  notationView.getType().length() == 0)){
82
				  notationView.getType().length() == 0)){
82
                diagramLinkMode = true;
83
				diagramLinkMode = true;
83
				noteFigure.setDiagramLinkMode(true);
84
				noteFigure.setDiagramLinkMode(true);
85
				
86
				// The default size is the minimum.
87
				noteFigure.setDefaultSize(-1, -1);
84
            }
88
            }
85
		}
89
		}
86
		return noteFigure;
90
		return noteFigure;

Return to bug 118858