Package cytoscape.visual

Examples of cytoscape.visual.VisualStyle


  protected abstract void createEdgeCalculators();
  protected abstract void createNodeCalculators();
  protected abstract void createVisualPropertyDependencies();
 
  public VisualStyle createVisualStyle(){
    VisualStyle vs = createVisualStyle(style, ncalcs, ecalcs);
    return vs;
   
  }
View Full Code Here


  /** Creates VisualStyle from the node and edge appearance calculators. */
  private VisualStyle createVisualStyle(CustomStyle style, Collection<Calculator> nodeAppearanceCalculators,
      Collection<Calculator> edgeAppearanceCalculators) {
    String name = style.toString();
    CySBML.LOGGER.config("createVisualStyle( " + name + " )");
    VisualStyle vs = new VisualStyle(name);
    VisualPropertyDependency deps = createVisualPropertyDependencies(vs);
   
    // add node appearance
    NodeAppearanceCalculator nac = new NodeAppearanceCalculator(deps);
    for (Calculator nc: nodeAppearanceCalculators){
      nac.setCalculator(nc);
    }
    vs.setNodeAppearanceCalculator(nac);
   
    // add edge appearance
    EdgeAppearanceCalculator eac = new EdgeAppearanceCalculator(deps);
    for (Calculator ec: edgeAppearanceCalculators){
      eac.setCalculator(ec);
    }
    vs.setEdgeAppearanceCalculator(eac);
   
    // add global appearance
    VisualMappingManager vmm = Cytoscape.getVisualMappingManager();
    GlobalAppearanceCalculator gac = vmm.getVisualStyle().getGlobalAppearanceCalculator();
    gac.setDefaultBackgroundColor(new Color(new Float(1.0), new Float(1.0), new Float(1.0)));
    vs.setGlobalAppearanceCalculator(gac);
    return vs;
  }
View Full Code Here

    VisualMappingManager manager = Cytoscape.getVisualMappingManager();
    CalculatorCatalog catalog = manager.getCalculatorCatalog();
   
    // TODO: less brutal (properties are overwritten)
    String vsName = style.toString();
    VisualStyle vs = catalog.getVisualStyle(vsName);
    if (vs != null) {
      catalog.removeVisualStyle(vsName);
    }
    // only creates the style
    vs = createVisualStyle(style);
    catalog.addVisualStyle(vs);
    manager.setVisualStyle(vs);
   
    // TODO: better get the view for the network
    Cytoscape.getCurrentNetworkView().setVisualStyle(vs.getName());
    Cytoscape.getCurrentNetworkView().applyVizmapper(vs);
  }
View Full Code Here

  public static void setVisualStyleForCurrentView(){
    setVisualStyleForView(Cytoscape.getCurrentNetworkView());
  }
 
    public static void setVisualStyleForView(CyNetworkView view){
        VisualStyle vs = getCurrentVisualStyle();
        view.setVisualStyle(vs.getName());
    }
View Full Code Here

 
  /** Gets visual style from Calculator Catalog. */
  private static VisualStyle getVisualStyle(String vsName){
    VisualMappingManager vmm = Cytoscape.getVisualMappingManager();
    CalculatorCatalog calcCatalog = vmm.getCalculatorCatalog();
    VisualStyle vs = calcCatalog.getVisualStyle(vsName);
    return vs;
  }
View Full Code Here

TOP

Related Classes of cytoscape.visual.VisualStyle

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.