コード例 #1
0
 public void onMouseUp(MouseUpEvent event) {
   Element element = view.getElement();
   if (!isDragging()) {
     updateCSS();
     limitToBoundingBox();
     if (NodeProxy.EXPANDED.equals(model.getState())) {
       model.setState(NodeProxy.COLLAPSED);
       for (NodeProxy neighbor : graph.getNeighbors(model)) {
         boolean collapsed = NodeProxy.COLLAPSED.equals(neighbor.getState());
         boolean leafNode = graph.degree(neighbor) == 1;
         if (collapsed && leafNode) {
           graph.removeNode(neighbor);
         }
       }
     }
     parent.toggle(model);
   } else {
     parent.save(model, true);
     setDragging(false);
   }
   setMouseDown(false);
   DOM.releaseCapture(element);
   event.preventDefault();
 }
コード例 #2
0
 void updateArcs() {
   update(graph.getInArcs(model));
   update(graph.getOutArcs(model));
 }