Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added type information to getVisualPartMap #155 #576

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading