Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 127665 Details for
Bug 264587
Erase is not working properly for BorderedNodeFigure's
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
proposed patch cleaned up
Bug_264587 (text/plain), 5.56 KB, created by
Alex Boyko
on 2009-03-05 10:48:44 EST
(
hide
)
Description:
proposed patch cleaned up
Filename:
MIME Type:
Creator:
Alex Boyko
Created:
2009-03-05 10:48:44 EST
Size:
5.56 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.runtime.diagram.ui >Index: src/org/eclipse/gmf/runtime/diagram/ui/internal/figures/BorderItemContainerFigure.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.diagram.ui/src/org/eclipse/gmf/runtime/diagram/ui/internal/figures/BorderItemContainerFigure.java,v >retrieving revision 1.8 >diff -u -r1.8 BorderItemContainerFigure.java >--- src/org/eclipse/gmf/runtime/diagram/ui/internal/figures/BorderItemContainerFigure.java 23 Jul 2008 20:51:02 -0000 1.8 >+++ src/org/eclipse/gmf/runtime/diagram/ui/internal/figures/BorderItemContainerFigure.java 5 Mar 2009 15:47:38 -0000 >@@ -1,5 +1,5 @@ > /****************************************************************************** >- * Copyright (c) 2003, 2008 IBM Corporation and others. >+ * Copyright (c) 2003, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -11,15 +11,16 @@ > > package org.eclipse.gmf.runtime.diagram.ui.internal.figures; > >-import java.util.Iterator; >+import java.util.List; > import java.util.ListIterator; > >-import org.eclipse.draw2d.Figure; > import org.eclipse.draw2d.FigureListener; > import org.eclipse.draw2d.Graphics; >+import org.eclipse.draw2d.GraphicsSource; > import org.eclipse.draw2d.IFigure; > import org.eclipse.draw2d.ScalableFreeformLayeredPane; > import org.eclipse.draw2d.TreeSearch; >+import org.eclipse.draw2d.UpdateManager; > import org.eclipse.draw2d.Viewport; > import org.eclipse.draw2d.geometry.Point; > import org.eclipse.draw2d.geometry.Rectangle; >@@ -50,6 +51,8 @@ > > private BorderItemContainerHelper helper = new BorderItemContainerHelper(); > >+ private BorderedItemContainerUpdateManagerWrapper updateManagerWrapper = new BorderedItemContainerUpdateManagerWrapper(); >+ > /** > * Constructor > */ >@@ -313,11 +316,7 @@ > } > > public void erase() { >- if (getChildren().isEmpty()) { >- super.erase(); >- } else { >- if (getParent() == null || !isVisible()) >- return; >+ if (getParent() != null && isVisible()) { > repaint(); > } > } >@@ -326,17 +325,7 @@ > * Refresh adornments > */ > public void repaint() { >- if (getChildren().isEmpty()) { >- super.repaint(); >- } else { >- if (getParent() == null || !isVisible()) >- return; >- Rectangle rectBounds = getExtendedBounds(); >- getParent().getParent().repaint(rectBounds); >- if (getViewport() != null) { >- getViewport().repaint(rectBounds); >- } >- } >+ repaint(getExtendedBounds()); > } > > public void invalidate() { >@@ -350,6 +339,14 @@ > super.validate(); > } > >+ @Override >+ public UpdateManager getUpdateManager() { >+ if (getParent() != null) { >+ return updateManagerWrapper; >+ } >+ return super.getUpdateManager(); >+ } >+ > /** > * Gets the extended bounds of the figure which includes the bounds of all > * the border item figures. >@@ -359,9 +356,7 @@ > public Rectangle getExtendedBounds() { > if (extendedBounds == null) { > extendedBounds = getParent().getBounds().getCopy(); >- Iterator iterator = getChildren().iterator(); >- while (iterator.hasNext()) { >- Figure childFigure = (Figure) iterator.next(); >+ for (IFigure childFigure : (List<IFigure>) getChildren()) { > Rectangle childBounds = (childFigure instanceof IExpandableFigure) ? ((IExpandableFigure) childFigure) > .getExtendedBounds() > : childFigure.getBounds(); >@@ -430,4 +425,59 @@ > > } > >+ private class BorderedItemContainerUpdateManagerWrapper extends UpdateManager { >+ >+ public BorderedItemContainerUpdateManagerWrapper() { >+ } >+ >+ @Override >+ public void setGraphicsSource(GraphicsSource gs) { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().setGraphicsSource(gs); >+ } >+ >+ @Override >+ public synchronized void addDirtyRegion(IFigure figure, int x, int y, >+ int w, int h) { >+ Rectangle r = new Rectangle(x, y, w, h); >+ IFigure borderedNodeParent = BorderItemContainerFigure.this.getParent().getParent(); >+ IFigure walker = figure; >+ do { >+ walker = walker.getParent(); >+ walker.translateToParent(r); >+ } while (walker != borderedNodeParent && walker.getParent() != null); >+ walker.getUpdateManager().addDirtyRegion(walker, r.x, r.y, r.width, r.height); >+ } >+ >+ @Override >+ public synchronized void addInvalidFigure(IFigure f) { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().addInvalidFigure(f); >+ } >+ >+ @Override >+ public synchronized void performUpdate() { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().performUpdate(); >+ } >+ >+ @Override >+ public synchronized void performUpdate(Rectangle exposed) { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().performUpdate(exposed); >+ } >+ >+ @Override >+ public void performValidation() { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().performValidation(); >+ } >+ >+ @Override >+ public synchronized void runWithUpdate(Runnable runnable) { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().runWithUpdate(runnable); >+ } >+ >+ @Override >+ public void setRoot(IFigure figure) { >+ BorderItemContainerFigure.this.getParent().getUpdateManager().setRoot(figure); >+ } >+ >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 264587
:
127348
| 127665