Skip to content

Commit

Permalink
Added type information to getVisualPartMap #155
Browse files Browse the repository at this point in the history
  • Loading branch information
azoitl authored and ptziegler committed Sep 30, 2024
1 parent 281b59c commit bea75bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.gef/src/org/eclipse/gef/EditPartViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ interface Conditional {
*
* @return the visual part map
*/
Map getVisualPartMap();
Map<IFigure, EditPart> getVisualPartMap();

/**
* Used for accessibility purposes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.KeyHandler;
import org.eclipse.gef.RootEditPart;
import org.eclipse.gef.SelectionManager;
Expand Down Expand Up @@ -98,7 +97,7 @@ public abstract class AbstractEditPartViewer implements EditPartViewer {

private EditPartFactory factory;
private final Map<Object, EditPart> mapIDToEditPart = new HashMap<>();
private final Map<IFigure, GraphicalEditPart> mapVisualToEditPart = new HashMap<>();
private final Map<IFigure, EditPart> mapVisualToEditPart = new HashMap<>();
private Map<String, Object> properties;
private Control control;
private ResourceManager resources;
Expand Down Expand Up @@ -456,7 +455,7 @@ public SelectionManager getSelectionManager() {
* @see EditPartViewer#getVisualPartMap()
*/
@Override
public Map getVisualPartMap() {
public Map<IFigure, EditPart> getVisualPartMap() {
return mapVisualToEditPart;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ protected void createDefaultRoot() {
*
* @return the lightweight system
*/
@SuppressWarnings("static-method")
protected LightweightSystem createLightweightSystem() {
return new LightweightSystem();
}
Expand Down Expand Up @@ -170,7 +171,7 @@ class ConditionalTreeSearch extends ExclusionSearch {
public boolean accept(IFigure figure) {
EditPart editpart = null;
while (editpart == null && figure != null) {
editpart = (EditPart) getVisualPartMap().get(figure);
editpart = getVisualPartMap().get(figure);
figure = figure.getParent();
}
return editpart != null && (condition == null || condition.evaluate(editpart));
Expand All @@ -180,7 +181,7 @@ public boolean accept(IFigure figure) {
new ConditionalTreeSearch(exclude));
EditPart part = null;
while (part == null && figure != null) {
part = (EditPart) getVisualPartMap().get(figure);
part = getVisualPartMap().get(figure);
figure = figure.getParent();
}
if (part == null) {
Expand Down

0 comments on commit bea75bc

Please sign in to comment.