use of org.cytoscape.view.model.CyNetworkView in project cytoscape-api by cytoscape.
the class SetCurrentNetworkViewEventTest method testGoodGetNetworkView.
@Test
public void testGoodGetNetworkView() {
CyApplicationManager source = mock(CyApplicationManager.class);
CyNetworkView n = mock(CyNetworkView.class);
SetCurrentNetworkViewEvent e = new SetCurrentNetworkViewEvent(source, n);
assertNotNull(e.getNetworkView());
assertEquals(n, e.getNetworkView());
}
use of org.cytoscape.view.model.CyNetworkView in project cytoscape-api by cytoscape.
the class ActionEnableSupport method enableForNetworkAndView.
/**
* Enable the action if the current network and view exist and are not null.
*/
private void enableForNetworkAndView() {
final CyNetworkView v = applicationManager.getCurrentNetworkView();
setEnabled(v != null);
}
use of org.cytoscape.view.model.CyNetworkView in project cytoscape-api by cytoscape.
the class CySessionTest method testSetNetworkViews.
@Test
public void testSetNetworkViews() {
CyNetworkView nv1 = mock(CyNetworkView.class);
CyNetworkView nv2 = mock(CyNetworkView.class);
Set<CyNetworkView> vs = new HashSet<CyNetworkView>();
vs.add(nv1);
vs.add(nv2);
session = new CySession.Builder().networkViews(vs).build();
assertNotNull(session);
assertNotNull(session.getNetworkViews());
assertEquals(2, session.getNetworkViews().size());
assertTrue(session.getNetworkViews().contains(nv1));
assertTrue(session.getNetworkViews().contains(nv2));
}
use of org.cytoscape.view.model.CyNetworkView in project cytoscape-api by cytoscape.
the class PartitionUtilTest method testPartition2.
@Test
public void testPartition2() {
CyNetworkView networkView = mock(CyNetworkView.class);
CyNetwork network = mock(CyNetwork.class);
when(networkView.getModel()).thenReturn(network);
EdgeWeighter edgeWeighter = new EdgeWeighter();
List<LayoutPartition> result = PartitionUtil.partition(networkView, false, edgeWeighter);
assertNotNull(result);
assertEquals(0, result.size());
}
use of org.cytoscape.view.model.CyNetworkView in project cytoscape-api by cytoscape.
the class PartitionUtilTest method testPartition1.
@Test
public void testPartition1() {
CyNetworkView networkView = mock(CyNetworkView.class);
CyNetwork network = mock(CyNetwork.class);
when(networkView.getModel()).thenReturn(network);
Collection<CyNode> nodes = new ArrayList<CyNode>();
EdgeWeighter edgeWeighter = new EdgeWeighter();
List<LayoutPartition> result = PartitionUtil.partition(networkView, nodes, edgeWeighter);
assertNotNull(result);
assertEquals(0, result.size());
}
Aggregations