X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.g3d%2Fsrc%2Forg%2Fsimantics%2Fg3d%2Fscenegraph%2Fstructural%2FComponentNode.java;h=13ac2f523129356f9a12d659c6564ee7b2a33b08;hb=refs%2Fchanges%2F60%2F3460%2F1;hp=9cdc3bf4502cf20b4a2c62250909dedf4cd0441f;hpb=53d55c24c779745f188bdb18d32f71d20acb61b2;p=simantics%2F3d.git diff --git a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java index 9cdc3bf4..13ac2f52 100644 --- a/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java +++ b/org.simantics.g3d/src/org/simantics/g3d/scenegraph/structural/ComponentNode.java @@ -26,7 +26,7 @@ import org.simantics.objmap.graph.annotations.RelatedSetValue; import org.simantics.objmap.structural.IStructuralObject; import org.simantics.utils.datastructures.MapList; -public abstract class ComponentNode extends Node implements IComponentNode{ +public abstract class ComponentNode, T2 extends IComponentNode> extends Node implements IComponentNode{ private String name; @@ -123,7 +123,7 @@ public abstract class ComponentNode getAllConnectedNodes() { List list = new ArrayList(); for (T c : getAllConnections()) { - T2 node = (T2)c.getOther(this); + T2 node = c.getOther(this); if (node != null) list.add(node); } @@ -161,9 +161,10 @@ public abstract class ComponentNode connections = new MapList(); + @SuppressWarnings("unchecked") protected void _addConnection(String id, T c) { connections.add(id, c); - c.addConnect(this); + c.addConnect((T2) this); firePropertyChanged(id); } @@ -223,7 +224,7 @@ public abstract class ComponentNode getConnectedNodes(String id) { List list = new ArrayList(); for (T c : getConnections(id)) { - T2 node = (T2)c.getOther(this); + T2 node = c.getOther(this); if (node != null) list.add(node); }