Commit 426d8698 authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

GREEN

refs 2490
parent e208dc75
......@@ -71,7 +71,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 4DDBB5752B82805828138AAC988C6FB5
* @ConQAT.Rating GREEN Hash: 8645F799F13BC187BF6FB1FAF2F3E6BB
*/
public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase> extends
AbstractConnectionEditPart {
......
......@@ -59,7 +59,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: D12C80B0BAFBFB9A9A76E302A528F5EB
* @ConQAT.Rating GREEN Hash: 5823EF473EB92F258B289FCBFB348A73
*/
public abstract class ElementEditPartBase<T extends ILayoutedModelElement & INamedCommentedElement>
extends PositionedEditPartBase<T> {
......
......@@ -40,7 +40,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 0528B83AC53842521014F7A44293E0B7
* @ConQAT.Rating GREEN Hash: 90FD31E34BF9379C45F7B28585100DE2
*/
public abstract class GraphicalEditPartBase<T extends EObject> extends AbstractGraphicalEditPart {
......@@ -55,9 +55,7 @@ public abstract class GraphicalEditPartBase<T extends EObject> extends AbstractG
// if not removing adapters, just refresh everything
if(notification.getEventType() != Notification.REMOVING_ADAPTER) {
// ensure that refresh is run in the UI thread
Display.getDefault().syncExec(() -> {
refresh();
});
Display.getDefault().syncExec(() -> refresh());
}
}
};
......
......@@ -38,11 +38,13 @@ import org.eclipse.gef.requests.SelectionRequest;
import org.eclipse.gef.tools.ConnectionDragCreationTool;
import org.eclipse.gef.tools.DragEditPartsTracker;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.fortiss.tooling.base.model.layout.ILayoutedModelElement;
import org.fortiss.tooling.base.ui.editpart.figure.TransparentLabel;
import org.fortiss.tooling.base.ui.layout.IDiagramLayoutConfiguration;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.service.IMarkerService;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
......@@ -75,7 +77,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 79D8F8BA81F856A6D6B2CF24FF803483
* @ConQAT.Rating GREEN Hash: E94D27DDCB3A8B5AA4D9D62298A6FB73
*/
public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> extends
GraphicalEditPartBase<T> implements NodeEditPart {
......@@ -192,8 +194,9 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex
if(labelFigure != null && labelFigure.getParent() != null) {
labelFigure.setText(determineLabelFigureText());
if(labelFigure.getIcon() != null) {
labelFigure.setIcon(IModelElementHandlerService.getInstance().getModelElementHandler(
getModel()).getIcon(getModel()));
IModelElementHandlerService mehs = IModelElementHandlerService.getInstance();
IModelElementHandler<EObject> handler = mehs.getModelElementHandler(getModel());
labelFigure.setIcon(handler.getIcon(getModel()));
}
Rectangle labelBounds = determineLabelFigureBounds();
labelFigure.setBounds(labelBounds);
......@@ -207,7 +210,8 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex
/** Returns the current tooltip description. */
protected String getBaseFigureTooltip() {
String message = IModelElementHandlerService.getInstance().getWrappedNameDescription(getModel());
String message =
IModelElementHandlerService.getInstance().getWrappedNameDescription(getModel());
ESeverity sev = IMarkerService.getInstance().getHighestViolationSeverity(getModel());
switch(sev) {
case ERROR:
......@@ -228,9 +232,10 @@ public abstract class PositionedEditPartBase<T extends ILayoutedModelElement> ex
if(decorationFigure.getParent() != null && decorationBounds != null) {
decorationFigure.getParent().setConstraint(decorationFigure, decorationBounds);
ESeverity severity = IMarkerService.getInstance().getHighestViolationSeverity(getModel());
decorationFigure.setIcon(getMarkerServiceDecorationIcon(severity,
useSmallDecorationImage()));
ESeverity severity =
IMarkerService.getInstance().getHighestViolationSeverity(getModel());
Image img = getMarkerServiceDecorationIcon(severity, useSmallDecorationImage());
decorationFigure.setIcon(img);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment