Package cytoscape.view

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


        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

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

      // 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

 
  // 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

  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

    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

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

TOP

Related Classes of cytoscape.view.CyNetworkView

Copyright © 2018 www.massapicom. 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.