View | Details | Raw Unified | Return to bug 259507 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/diagram/ui/figures/BorderedNodeFigure.java (-7 / +30 lines)
Lines 1-12 Link Here
1
/******************************************************************************
1
/******************************************************************************
2
 * Copyright (c) 2003, 2007 IBM Corporation and others.
2
 * Copyright (c) 2003, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *    IBM Corporation - initial API and implementation 
9
 *    IBM Corporation - initial API and implementation
10
 *    Mariot Chauvin <mariot.chauvin@obeo.fr> - bug 259507
10
 ****************************************************************************/
11
 ****************************************************************************/
11
12
12
package org.eclipse.gmf.runtime.diagram.ui.figures;
13
package org.eclipse.gmf.runtime.diagram.ui.figures;
Lines 37-42 Link Here
37
	private BorderItemContainerFigure borderItemContainer;
38
	private BorderItemContainerFigure borderItemContainer;
38
39
39
	private IFigure mainFigure;
40
	private IFigure mainFigure;
41
	
42
	private Rectangle extendedBounds = new Rectangle();
40
43
41
	/**
44
	/**
42
	 * Creates a new BorderedNodeFigure figure.
45
	 * Creates a new BorderedNodeFigure figure.
Lines 235-246 Link Here
235
		return parent;
238
		return parent;
236
	}
239
	}
237
    
240
    
238
239
    public Rectangle getExtendedBounds() {
241
    public Rectangle getExtendedBounds() {
240
        Rectangle rect = getBounds().getCopy();
242
        if (extendedBounds == null) {
241
         if (borderItemContainer!=null){
243
	        Rectangle rect = getBounds().getCopy();
242
            return rect.union(borderItemContainer.getExtendedBounds().getCopy());
244
	         if (borderItemContainer!=null){
245
	            rect = rect.union(borderItemContainer.getExtendedBounds());
246
	        }
247
	         extendedBounds = rect;
243
        }
248
        }
244
        return rect;
249
        return extendedBounds;
250
    }
251
    
252
    @Override
253
    public void invalidate() {
254
        extendedBounds = null;
255
    	super.invalidate();
256
    }
257
    
258
    @Override
259
    public void validate() {
260
        extendedBounds = null;
261
    	super.validate();
262
    }
263
    
264
    @Override
265
    protected void fireFigureMoved() {
266
    	super.fireFigureMoved();
267
        extendedBounds = null;
245
    }
268
    }
246
}
269
}

Return to bug 259507