Esempio n. 1
0
 public Id createVisualTransition(Point2D point) {
   Id mathTransition =
       data.add("transition", HashTreePMap.<String, Object>empty().plus("name", "t0"));
   Id visualNode =
       data.add(
           "visualNode",
           HashTreePMap.<String, Object>empty()
               .plus("transform", AffineTransform.getTranslateInstance(point.getX(), point.getY()))
               .plus("parent", eval(currentLevel).getVisualGroupId()));
   return data.add(
       "visualTransition",
       HashTreePMap.<String, Object>empty()
           .plus("visualNode", visualNode)
           .plus("mathNode", mathTransition));
 }
Esempio n. 2
0
 public Id createVisualPlace(Point2D point, Color tokenColor) {
   Id mathPlace =
       data.add(
           "place",
           HashTreePMap.<String, Object>empty().plus("initialMarking", 0).plus("name", "p0"));
   Id visualNode =
       data.add(
           "visualNode",
           HashTreePMap.<String, Object>empty()
               .plus("transform", AffineTransform.getTranslateInstance(point.getX(), point.getY()))
               .plus("parent", eval(currentLevel).getVisualGroupId()));
   return data.add(
       "visualPlace",
       HashTreePMap.<String, Object>empty()
           .plus("tokenColor", tokenColor)
           .plus("visualNode", visualNode)
           .plus("mathNode", mathPlace));
 }