コード例 #1
0
 public static PrimarySpiderDiagram getVennABCDiagramWithPartlyShadedBAndSpiderInZoneBC_A() {
   PrimarySpiderDiagram modelDiagram = getVennABCDiagramWithPartlyShadedB();
   HashMap<String, Region> habitats = new HashMap<>();
   habitats.put("s", new Region(Zone.fromInContours("B", "C").withOutContours("A")));
   return SpiderDiagrams.createPrimarySD(
       asList("s"), habitats, modelDiagram.getShadedZones(), modelDiagram.getPresentZones());
 }
コード例 #2
0
 @Override
 @SuppressWarnings("unchecked")
 public Map<String, Region> fromASTNode(CommonTree treeNode) throws ReadingException {
   ArrayList<ArrayList<Object>> rawHabitats = regionListTranslator.fromASTNode(treeNode);
   if (rawHabitats == null || rawHabitats.size() < 1) {
     return null;
   }
   HashMap<String, Region> habitats = new HashMap<>();
   for (ArrayList<Object> rawHabitat : rawHabitats) {
     if (rawHabitat.size() == 2) {
       habitats.put((String) rawHabitat.get(0), new Region((ArrayList<Zone>) rawHabitat.get(1)));
     }
   }
   return habitats;
 }