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 131283 Details for
Bug 197444
Draw2d FocuseTraverseManager Performances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch using Team Synchronizing perspective
patch.txt (text/plain), 3.33 KB, created by
Manuel Selva
on 2009-04-08 10:26:54 EDT
(
hide
)
Description:
Patch using Team Synchronizing perspective
Filename:
MIME Type:
Creator:
Manuel Selva
Created:
2009-04-08 10:26:54 EDT
Size:
3.33 KB
patch
obsolete
>Index: src/org/eclipse/draw2d/FocusTraverseManager.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.draw2d/src/org/eclipse/draw2d/FocusTraverseManager.java,v >retrieving revision 1.11 >diff -u -r1.11 FocusTraverseManager.java >--- src/org/eclipse/draw2d/FocusTraverseManager.java 4 May 2005 15:48:36 -0000 1.11 >+++ src/org/eclipse/draw2d/FocusTraverseManager.java 8 Apr 2009 14:25:14 -0000 >@@ -10,6 +10,7 @@ > *******************************************************************************/ > package org.eclipse.draw2d; > >+import java.util.ArrayList; > import java.util.List; > > /** >@@ -28,7 +29,9 @@ > /** > * Default constructor. > */ >-public FocusTraverseManager() { } >+public FocusTraverseManager() { >+ >+} > > private IFigure findDeepestRightmostChildOf(IFigure fig) { > while (fig.getChildren().size() != 0) { >@@ -60,10 +63,11 @@ > return null; > } > >- int siblingPos = nextFocus.getParent().getChildren().indexOf(nextFocus); >+ List siblingsPositions = new ArrayList(); >+ siblingsPositions.add(Integer.valueOf(nextFocus.getParent().getChildren().indexOf(nextFocus))); > while (!found) { > IFigure parent = nextFocus.getParent(); >- >+ > /* > * Figure traversal is implemented using the pre-order left to right > * tree traversal algorithm. >@@ -77,29 +81,33 @@ > List siblings = parent.getChildren(); > > if (nextFocus.getChildren().size() != 0) { >- nextFocus = (IFigure)nextFocus.getChildren().get(0); >- siblingPos = 0; >+ siblingsPositions.add(Integer.valueOf(0)); >+ nextFocus = (IFigure) nextFocus.getChildren().get(0); > if (isFocusEligible(nextFocus)) >- found = true; >- } else if (siblingPos < siblings.size() - 1) { >- nextFocus = ((IFigure)(siblings.get(++siblingPos))); >+ found = true; >+ } else if (((Integer)siblingsPositions.get(siblingsPositions.size() - 1)).intValue() < siblings.size() - 1) { >+ int nextSiblingPos = ((Integer)siblingsPositions.remove(siblingsPositions.size() - 1)).intValue() + 1; >+ siblingsPositions.add(Integer.valueOf(nextSiblingPos)); >+ nextFocus = ((IFigure) (siblings.get(nextSiblingPos))); > if (isFocusEligible(nextFocus)) > found = true; > } else { >- boolean untraversedSiblingFound = false; >+ boolean untraversedSiblingFound = false; > while (!untraversedSiblingFound) { >- IFigure p = nextFocus.getParent(); >+ IFigure p = nextFocus.getParent(); > IFigure gp = p.getParent(); >- >+ > if (gp != null) { > int parentSiblingCount = gp.getChildren().size(); >- int parentIndex = gp.getChildren().indexOf(p); >+ int parentIndex = ((Integer)siblingsPositions.remove(siblingsPositions.size() - 2)).intValue(); > if (parentIndex < parentSiblingCount - 1) { >- nextFocus = ((IFigure)p.getParent() >- .getChildren().get(parentIndex + 1)); >- siblingPos = parentIndex + 1; >+ nextFocus = ((IFigure) p.getParent().getChildren().get( >+ parentIndex + 1)); >+ int nextSiblingPos = parentIndex + 1; >+ siblingsPositions.remove(siblingsPositions.size() - 1); >+ siblingsPositions.add(Integer.valueOf(nextSiblingPos)); > untraversedSiblingFound = true; >- if (isFocusEligible(nextFocus)) >+ if (isFocusEligible(nextFocus)) > found = true; > } else > nextFocus = p; >@@ -109,8 +117,9 @@ > found = true; > } > } >- } >+ } > } >+ > return nextFocus; > } >
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 197444
:
75192
| 131283