Examples of CyNetworkView


Examples of cytoscape.view.CyNetworkView

   *  Nodes with unknown positions are layouted above the complete layout.
   * @param network
   */
  public void applyLayoutPositionsToNetwork(CyNetwork network){
   
    CyNetworkView view = Cytoscape.getNetworkView(network.getIdentifier());
      String key;
      BoundingBox box;
      Point point;
     
      double offset = 80.0;
      double current_x = min_x;
      double current_y = min_y - 2.0*offset;
     
      double x;
      double y;
     
    @SuppressWarnings("unchecked")
    List<Node> nodes = network.nodesList();
      for (Node node : nodes){
        key = node.getIdentifier();
        if (speciesBoundingBoxes.containsKey(key)){
          box = speciesBoundingBoxes.get(key);
        } else {
          box = reactionBoundingBoxes.get(key);
        }
       
        // set the position of the node
        giny.view.NodeView nodeView = view.getNodeView(node);
       
        point = box.getPosition();
        x = point.getX();
        y = point.getY();
       
View Full Code Here

Examples of cytoscape.view.CyNetworkView

        nodeView.setYPosition(y);
      }
  }
 
  public void applyLayoutPositionsToLayoutNetwork(CyNetwork network){
    CyNetworkView view = Cytoscape.getNetworkView(network.getIdentifier());
      String key;
      BoundingBox box;
      Point point;
     
      double offset = 80.0;
      double current_x = min_x;
      double current_y = min_y - 2.0*offset;
     
      double x;
      double y;
     
    @SuppressWarnings("unchecked")
    List<Node> nodes = network.nodesList();
      for (Node node : nodes){
        key = node.getIdentifier();
        if (speciesGlyphBoundingBoxes.containsKey(key)){
          box = speciesGlyphBoundingBoxes.get(key);
        } else {
          box = reactionGlyphBoundingBoxes.get(key);
        }
       
        // set the position of the node
        giny.view.NodeView nodeView = view.getNodeView(node);
       
        point = box.getPosition();
        x = point.getX();
        y = point.getY();
       
View Full Code Here

Examples of cytoscape.view.CyNetworkView

import cytoscape.view.CyNetworkView;

public class CytoscapeLayoutTools {
 
  public static void saveLayoutOfCurrentViewInFile(File file){
    CyNetworkView view = Cytoscape.getCurrentNetworkView();
    if (view != null){
      saveLayoutOfViewInFile(view, file);
    }
  }
View Full Code Here

Examples of cytoscape.view.CyNetworkView

      // Creates the XML file
      XMLInterface.writeXMLFileForLayout(file, boxes);
  }
 
  public static void loadLayoutOfCurrentViewFromFile(File file){
    CyNetworkView view = Cytoscape.getCurrentNetworkView();
    if (view != null){
      loadLayoutForViewFromFile(view, file);
    }
  }
View Full Code Here

Examples of cytoscape.view.CyNetworkView

 
  // USING THE LAYOUT EXTENSION FOR STORAGE ///
    // ??? FIXME: is the current Layout saved
  @Deprecated
  public static void saveLayoutOfCurrentViewInSBMLFile(File file){
    CyNetworkView view = Cytoscape.getCurrentNetworkView();
    SBMLDocument doc = writeLayoutOfNetworkViewToSBMLDocument(view);
    if (doc != null){
      try {
        SBMLWriter.write(doc, file, CySBML.NAME, CySBML.VERSION);
       
View Full Code Here

Examples of cytoscape.view.CyNetworkView

  protected void applyLayout(CyNetwork network) {
    if (nodeIds.size() > LAYOUT_NODE_NUMBER){
      CySBML.LOGGER.info(String.format("More than %d nodes, no layout applied.", LAYOUT_NODE_NUMBER));
    } else {
      CyLayoutAlgorithm layout = CyLayouts.getLayout("force-directed");
      CyNetworkView view = Cytoscape.getNetworkView(network.getIdentifier());
      view.applyLayout(layout);
    }
  }
View Full Code Here

Examples of cytoscape.view.CyNetworkView

    nAtts = Cytoscape.getNodeAttributes();
  }
 
  public void createSpeciesNetworkAndView(){
    CyNetwork net = createSpeciesNetwork();
    CyNetworkView view = Cytoscape.getNetworkView(net.getIdentifier());

    view.redrawGraph(true, true);
    view.updateView();
  }
View Full Code Here

Examples of cytoscape.view.CyNetworkView

    view.updateView();
  }
 
  public void createReactionNetworkAndView(){
    CyNetwork net = createReactionNetwork();
    CyNetworkView view = Cytoscape.getNetworkView(net.getIdentifier());
    view.redrawGraph(true, true);
    view.updateView();
  }
View Full Code Here

Examples of org.cytoscape.view.model.CyNetworkView

      VisualStyle appStyle = this.mcodeUtil.getAppStyle(maxScore);

      this.mcodeUtil.registerVisualStyle(appStyle);

      CyNetworkView netView = resultsPanel.getNetworkView();

      if ((netView != null) &&
        (this.visualMappingMgr.getVisualStyle(netView) == appStyle)) {
        appStyle.apply(netView);
        netView.updateView();
      }
    }
  }
View Full Code Here

Examples of org.cytoscape.view.model.CyNetworkView

    public void actionPerformed(ActionEvent event) {
        resultFound = false;
        CurrentParameters resultParaSet=null;
        //get the network object, this contains the graph
        final CyNetwork network = applicationManager.getCurrentNetwork();
        final CyNetworkView networkView = this.applicationManager.getCurrentNetworkView();
       
        ParameterSet currentParamsCopy = getMainPanel().getCurrentParamsCopy();
//       curParams.setNetworkID(network.getSUID());
        if (network == null) {
            System.err.println("Can't get a network.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.