Skip to content
Snippets Groups Projects
Commit 2aa60113 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

fixes the issue by "deeply" highlighting the figure.

Also removes old TODOs which obviously won't be tackled: issue number not existing anymore.
refs 2693
parent 112f8419
No related branches found
No related tags found
No related merge requests found
......@@ -117,7 +117,7 @@ import org.fortiss.tooling.kernel.ui.service.IEditPartFactoryService;
* @author hoelzl
* @author $Author: aravantinos $
* @version $Rev: 13954 $
* @ConQAT.Rating YELLOW Hash: C96404EE24E8C30B5A2AABFB1342F04A
* @ConQAT.Rating YELLOW Hash: 06285E522140DBDCDD95D6BD47D2EFFB
*/
abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase<T> implements
IPostSelectionProvider, ContextMenuContextProvider {
......@@ -372,10 +372,6 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase<
* the value of {@link IDiagramLayoutConfiguration#useGrid()} provided by
* the {@link DiagramEditPartBase} of the diagram element.
*/
// TODO (FH): https://af3.fortiss.org/issues/376
// this should also use the configuration automatically
// making the IMPORTANT note irrelevant
// TODO(VA) This issue is old and not really self-explanatory, what's the status?
protected boolean enableSnapToGrid() {
return true;
}
......@@ -434,8 +430,6 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase<
/**
* Creates the {@link EditPartFactory} which is used for this editor. The
* default implementation uses the {@link EditPartFactory}.
* TODO: remove
* TODO(VA) TODO without an issue number
*/
protected EditPartFactory createEditPartFactory() {
return IEditPartFactoryService.getInstance();
......@@ -587,14 +581,14 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase<
public void setHighlight(EObject element, boolean highlighted) {
EditPart ep = findEditPart(viewer.getRootEditPart(), element);
if(ep instanceof AbstractGraphicalEditPart) {
IFigure fig = ((AbstractGraphicalEditPart)ep).getFigure();
setHighlight(fig, highlighted);
IFigure figure = ((AbstractGraphicalEditPart)ep).getFigure();
setHighlight(figure, highlighted);
}
}
/**
* Highlights a figure by setting its color to be RED. This implementation
* can be changed by more specific editors.
* Highlights a figure by setting its color to be RED. This implementation can be changed by
* more specific editors.
*/
protected void setHighlight(IFigure fig, boolean highlighted) {
if(highlighted) {
......@@ -611,6 +605,10 @@ abstract class CommonDiagramEditorBase<T extends EObject> extends GEFEditorBase<
fig.setBackgroundColor(normalColor);
highlightedFigures2NormalFgColor.remove(fig);
}
// We then re-apply ourself to each of our children recursively
for(Object subFig : fig.getChildren()) {
setHighlight((IFigure)subFig, highlighted);
}
}
/** A map from figures that are currently highlighted to their normal foreground color. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment