Package cytoscape.visual.mappings

Examples of cytoscape.visual.mappings.DiscreteMapping


    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
 
  public static Calculator createNodeSizeCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.NODE_SIZE;
    DiscreteMapping map = new DiscreteMapping(Double.class, CySBMLConstants.ATT_TYPE)
    map.putMapValue(CySBMLConstants.NODETYPE_SPECIES, new Double(35.0));
    map.putMapValue(CySBMLConstants.NODETYPE_REACTION, new Double(30.0));
    map.putMapValue(CySBMLConstants.NODETYPE_QUAL_SPECIES, new Double(35.0));
    map.putMapValue(CySBMLConstants.NODETYPE_QUAL_TRANSITION, new Double(30.0));
    return new BasicCalculator(createCalculatorName(style, pType), map, pType)
  }
View Full Code Here


    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
 
  public static Calculator createNodeFillColorCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.NODE_FILL_COLOR;
    DiscreteMapping map = new DiscreteMapping(Color.class, CySBMLConstants.ATT_REVERSIBLE);
    Color gray = new Color(204,204,204)
    Color red = new Color(255,102,102);
    map.putMapValue(true, gray);
    map.putMapValue(false, red);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }

  public static Calculator createNodeLineWidthCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.NODE_LINE_WIDTH;
    DiscreteMapping map = new DiscreteMapping(Double.class, CySBMLConstants.ATT_TYPE);
    map.putMapValue(CySBMLConstants.NODETYPE_SPECIES, 5.0);
    map.putMapValue(CySBMLConstants.NODETYPE_REACTION, 1.0);
    map.putMapValue(CySBMLConstants.NODETYPE_QUAL_SPECIES, 5.0);
    map.putMapValue(CySBMLConstants.NODETYPE_QUAL_TRANSITION, 1.0);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType)
  }
View Full Code Here

    colorSet.add(Color.GREEN);
    colorSet.add(Color.CYAN);
    colorSet.add(Color.MAGENTA);
    colorSet.add(Color.PINK);
       
    DiscreteMapping map = new DiscreteMapping(Color.class, CySBMLConstants.ATT_COMPARTMENT);
    map.putMapValue("-", Color.LIGHT_GRAY);
    map.putMapValue("", Color.WHITE);
    int k=0;
    for (String colorClass: colorClasses){
      if (colorClass.equals("-") || colorClass.equals("")){ continue; }
      if (k<colorSet.size()){
        map.putMapValue(colorClass, colorSet.get(k));
      } else {
        map.putMapValue(colorClass, Color.LIGHT_GRAY);
      }
      k++;
    }
    return new BasicCalculator(createCalculatorName(style, pType), map, pType)
  }
View Full Code Here

 
  /// EDGE CALCULATORS ///
   
  public static Calculator createEdgeTargetArrowCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.EDGE_TGTARROW_SHAPE;
    DiscreteMapping map = new DiscreteMapping(ArrowShape.class, Semantics.INTERACTION);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_PRODUCT, ArrowShape.ARROW);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_OUTPUT, ArrowShape.ARROW);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_REACTANT, ArrowShape.NONE);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_INPUT, ArrowShape.NONE);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_MODIFIER, ArrowShape.DIAMOND);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
 
  public static Calculator createEdgeSourceArrowCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.EDGE_SRCARROW_SHAPE;
    DiscreteMapping map = new DiscreteMapping(ArrowShape.class, Semantics.INTERACTION);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_PRODUCT, ArrowShape.NONE);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_OUTPUT, ArrowShape.NONE)
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_REACTANT, ArrowShape.NONE);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_INPUT, ArrowShape.NONE);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_MODIFIER, ArrowShape.CIRCLE);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
 
  public static Calculator createEdgeColorCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.EDGE_COLOR;
    DiscreteMapping map = new DiscreteMapping(Color.class, Semantics.INTERACTION);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_PRODUCT, Color.BLACK);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_REACTANT, Color.BLACK);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_MODIFIER, Color.BLUE);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_OUTPUT, Color.BLACK);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_INPUT, Color.BLACK);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
   
  public static Calculator createEdgeOpacityCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.EDGE_OPACITY;
    DiscreteMapping map = new DiscreteMapping(Integer.class, Semantics.INTERACTION);
    Integer opacity = 200;
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_PRODUCT, opacity);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_REACTANT, opacity);
    map.putMapValue(CySBMLConstants.EDGETYPE_REACTION_MODIFIER, opacity);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_OUTPUT, opacity);
    map.putMapValue(CySBMLConstants.EDGETYPE_TRANSITION_INPUT, opacity);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

 
  /// NODE CALCULATORS ///
 
  public static Calculator createNodeShapeCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.NODE_SHAPE;
    DiscreteMapping map = new DiscreteMapping(NodeShape.class, CySBMLConstants.ATT_TYPE);
    map.putMapValue(CySBMLConstants.NODETYPE_SPECIES, NodeShape.RECT);
    map.putMapValue(CySBMLConstants.NODETYPE_REACTION, NodeShape.RECT);
    map.putMapValue(CySBMLConstants.NODETYPE_QUAL_SPECIES, NodeShape.RECT);
    map.putMapValue(CySBMLConstants.NODETYPE_QUAL_TRANSITION, NodeShape.RECT);
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

  /// NODE CALCULATORS ///
   
  public static Calculator createNodeShapeCalculator(CustomStyle style){
    VisualPropertyType pType = VisualPropertyType.NODE_SHAPE;
    DiscreteMapping map = new DiscreteMapping(NodeShape.class, CySBMLConstants.ATT_SBOTERM);
    map.putMapValue("SBO:0000405", NodeShape.VEE);       //INPUT
    map.putMapValue("SBO:0000250", NodeShape.ELLIPSE);   //GENE
    map.putMapValue("SBO:0000252", NodeShape.DIAMOND);   //TF
    return new BasicCalculator(createCalculatorName(style, pType), map, pType);
  }
View Full Code Here

TOP

Related Classes of cytoscape.visual.mappings.DiscreteMapping

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.