/**
* @return The Network model the Node is attached to
*/
public UINetwork getNetworkParent() {
NodeViewer viewer = getParentViewer();
/*
* Can only access parent network if the Node is inside a Network Viewer
*/
if (viewer instanceof NetworkViewer) {
return ((NetworkViewer) viewer).getViewerParent();
} else if (viewer != null) {
// Found the parent viewer, but it's not a network viewer
// Recursively iterate up the view graph until we find the NetworkViewer or not
//
WorldObject viewerParent = viewer.getViewerParent();
if (viewerParent instanceof UINeoNode) {
return ((UINeoNode) viewerParent).getNetworkParent();
}
}