Skip to content
Snippets Groups Projects
Commit 13695814 authored by Florian Hölzl's avatar Florian Hölzl
Browse files

fixed bend point NPE.

refs 352
parent 69f5ba96
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,13 @@ import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase>
extends AbstractConnectionEditPart {
/**
* Stores the diagram layout configuration. Since connections are contained
* in the root layer, the configuration must be stored here. The parent
* cannot be used.
*/
protected final IDiagramLayoutConfiguration layoutConfiguration;
/** The underlying model object. */
protected final T modelElement;
......@@ -97,8 +104,10 @@ public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase>
/** Constructor. */
@SuppressWarnings("unchecked")
protected ConnectionEditPartBase(T modelElement) {
protected ConnectionEditPartBase(T modelElement,
IDiagramLayoutConfiguration layoutConfiguration) {
this.modelElement = modelElement;
this.layoutConfiguration = layoutConfiguration;
setModel(modelElement);
this.modelElementHandler = (IModelElementHandler<T>) IModelElementHandlerService.INSTANCE
.getModelElementHandler(modelElement);
......@@ -276,15 +285,11 @@ public abstract class ConnectionEditPartBase<T extends ConnectionSegmentBase>
/**
* Returns the layout configuration for the diagram containing this
* connection edit part. This method delegates to its parent graphical edit
* part.
* connection edit part. This method delegates does not delegate to the
* parent edit part, since the parent is the root layer, unfortunately not
* the diagram edit part.
*/
@SuppressWarnings("rawtypes")
public IDiagramLayoutConfiguration getLayoutConfiguration() {
if (getParent() instanceof GraphicalEditPartBase) {
return ((GraphicalEditPartBase) getParent())
.getLayoutConfiguration();
}
return null;
return layoutConfiguration;
}
}
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