Search in sources :

Example 31 with CyRow

use of org.cytoscape.model.CyRow in project cytoscape-api by cytoscape.

the class AbstractGraphObjectTest method testGetCyRow.

@Test
public void testGetCyRow() {
    // As long as the object is not null and is an instance of CyRow, we
    // should be satisfied.  Don't test any other properties of CyRow.
    // Leave that to the CyRow unit tests.
    CyNode n1 = net.addNode();
    assertNotNull("cyattrs exists", net.getRow(n1, "USER"));
    assertTrue("cyattrs is CyRow", net.getRow(n1, "USER") instanceof CyRow);
    CyNode n2 = net.addNode();
    assertNotNull("cyattrs exists", net.getRow(n2, "USER"));
    assertTrue("cyattrs is CyRow", net.getRow(n2, "USER") instanceof CyRow);
    CyEdge e1 = net.addEdge(n1, n2, true);
    assertNotNull("cyattrs exists", net.getRow(e1, "USER"));
    assertTrue("cyattrs is CyRow", net.getRow(e1, "USER") instanceof CyRow);
    CyEdge e2 = net.addEdge(n1, n2, false);
    assertNotNull("cyattrs exists", net.getRow(e2, "USER"));
    assertTrue("cyattrs is CyRow", net.getRow(e2, "USER") instanceof CyRow);
}
Also used : CyNode(org.cytoscape.model.CyNode) CyRow(org.cytoscape.model.CyRow) CyEdge(org.cytoscape.model.CyEdge) Test(org.junit.Test)

Example 32 with CyRow

use of org.cytoscape.model.CyRow in project cytoscape-api by cytoscape.

the class EdgeWeighterTest method testSetWeight.

@Test
public void testSetWeight() {
    CyEdge edge = mock(CyEdge.class);
    CyRow row = mock(CyRow.class);
    LayoutEdge layoutEdge = new LayoutEdge(edge, row);
    ew.setWeight(layoutEdge);
}
Also used : CyRow(org.cytoscape.model.CyRow) CyEdge(org.cytoscape.model.CyEdge) Test(org.junit.Test)

Example 33 with CyRow

use of org.cytoscape.model.CyRow in project cytoscape-api by cytoscape.

the class EdgeWeighterTest method testNormalizeWeight.

@Test
public void testNormalizeWeight() {
    CyEdge edge = mock(CyEdge.class);
    CyRow row = mock(CyRow.class);
    LayoutEdge layoutEdge = new LayoutEdge(edge, row);
    assertTrue(ew.normalizeWeight(layoutEdge));
}
Also used : CyRow(org.cytoscape.model.CyRow) CyEdge(org.cytoscape.model.CyEdge) Test(org.junit.Test)

Aggregations

CyRow (org.cytoscape.model.CyRow)33 CyTable (org.cytoscape.model.CyTable)12 CyColumn (org.cytoscape.model.CyColumn)10 ArrayList (java.util.ArrayList)9 CyEdge (org.cytoscape.model.CyEdge)8 CyNode (org.cytoscape.model.CyNode)8 Test (org.junit.Test)8 HashMap (java.util.HashMap)7 CyNetwork (org.cytoscape.model.CyNetwork)7 List (java.util.List)6 EMDataSet (org.baderlab.csplugins.enrichmentmap.model.EMDataSet)4 Arrays (java.util.Arrays)3 Collections (java.util.Collections)3 Map (java.util.Map)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3 EnrichmentMap (org.baderlab.csplugins.enrichmentmap.model.EnrichmentMap)3 CyColumnIdentifier (org.cytoscape.view.presentation.property.values.CyColumnIdentifier)3 ImmutableSet (com.google.common.collect.ImmutableSet)2 Paint (java.awt.Paint)2