package org.cytoscape.view.model.internal.model.snapshot;

import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNode;
import org.cytoscape.view.model.SnapshotEdgeInfo;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.internal.model.CyEdgeViewImpl;
import org.cytoscape.view.model.internal.model.VPStore;

public class CyEdgeViewSnapshotImpl extends CyViewSnapshotBase<CyEdge> implements SnapshotEdgeInfo {
	
	private final CyNetworkViewSnapshotImpl parent;

	public CyEdgeViewSnapshotImpl(CyNetworkViewSnapshotImpl parent, CyEdgeViewImpl view) {
		super(view.getSUID());
		this.parent = parent;
	}
	
	@Override
	public CyNetworkViewSnapshotImpl getNetworkSnapshot() {
		return parent;
	}
	
	private CyEdgeViewImpl getEdgeView() {
		return parent.getMutableNetworkView().getEdgeView(getSUID());
	}
	
	@Override
	public Long getModelSUID() {
		return getEdgeView().getModel().getSUID();
	}

	@Override
	public long getSourceViewSUID() {
		return getEdgeView().getSourceSuid();
	}

	@Override
	public long getTargetViewSUID() {
		return getEdgeView().getTargetSuid();
	}

	@Override
	public boolean isDirected() {
		return getEdgeView().isDirected();
	}

	@Override
	public View<CyNode> getSourceNodeView() {
		return getNetworkSnapshot().getNodeView(getSourceViewSUID());
	}

	@Override
	public View<CyNode> getTargetNodeView() {
		return getNetworkSnapshot().getNodeView(getTargetViewSUID());
	}
	
	@Override
	public VPStore getVPStore() {
		return getNetworkSnapshot().edgeVPs;
	}
	
}

package org.cytoscape.view.model.internal.model.snapshot;

import org.cytoscape.model.CyEdge;
import org.cytoscape.model.CyNode;
import org.cytoscape.view.model.SnapshotEdgeInfo;
import org.cytoscape.view.model.View;
import org.cytoscape.view.model.internal.model.CyEdgeViewImpl;
import org.cytoscape.view.model.internal.model.VPStore;

public class CyEdgeViewSnapshotImpl extends CyViewSnapshotBase<CyEdge> implements SnapshotEdgeInfo {
	
	private final CyNetworkViewSnapshotImpl parent;
	// Its ok to have a reference to the mutable view object as long as we don't follow its parent pointer.
	private final CyEdgeViewImpl view;

	public CyEdgeViewSnapshotImpl(CyNetworkViewSnapshotImpl parent, CyEdgeViewImpl view) {
		super(view.getSUID());
		this.parent = parent;
		this.view = view;
	}
	
	@Override
	public CyNetworkViewSnapshotImpl getNetworkSnapshot() {
		return parent;
	}
	
	@Override
	public Long getModelSUID() {
		return view.getModel().getSUID();
	}

	@Override
	public long getSourceViewSUID() {
		return view.getSourceSuid();
	}

	@Override
	public long getTargetViewSUID() {
		return view.getTargetSuid();
	}

	@Override
	public boolean isDirected() {
		return view.isDirected();
	}

	@Override
	public View<CyNode> getSourceNodeView() {
		return getNetworkSnapshot().getNodeView(getSourceViewSUID());
	}

	@Override
	public View<CyNode> getTargetNodeView() {
		return getNetworkSnapshot().getNodeView(getTargetViewSUID());
	}
	
	@Override
	public VPStore getVPStore() {
		return getNetworkSnapshot().edgeVPs;
	}
	
}

Revert previous commit to CyEdgeViewSnapshotImpl, was causing NPE in renderer.