void removeChild(IFigure child) {
   if (connectionToPaths == null) {
     return;
   }
   Rectangle bounds = child.getBounds().getCopy();
   boolean change = false;
   algorithm.removeObstacle(bounds);
   figuresToBounds.remove(child);
   child.removeFigureListener(figureListener);
   if (change) {
     isDirty = true;
     queueSomeRouting();
   }
 }
Пример #2
0
        public void fisheyeReplaced(
            GraphWidget graph, IFigure oldFisheyeFigure, IFigure newFisheyeFigure) {
          oldFisheyeFigure.removeFigureListener(nodeFigureListener);
          newFisheyeFigure.addFigureListener(nodeFigureListener);
          GraphLabel label = (GraphLabel) nodeFigureToLabel.remove(oldFisheyeFigure);
          nodeFigureToLabel.put(newFisheyeFigure, label);

          LabelAncestorListener ancestorListener =
              (LabelAncestorListener) labelToAncestorListener.get(label);
          ancestorListener.fisheyeFigure = null;
          addLabelForFigure(newFisheyeFigure, label);
          ancestorListener.fisheyeFigure = newFisheyeFigure;
          refreshLabelBounds(newFisheyeFigure, label);
        }
Пример #3
0
 public void fisheyeAdded(GraphWidget graph, IFigure originalFigure, IFigure fisheyeFigure) {
   originalFigure.removeFigureListener(nodeFigureListener);
   fisheyeFigure.addFigureListener(nodeFigureListener);
   GraphLabel label = (GraphLabel) nodeFigureToLabel.get(originalFigure);
   if (label == null) {
     return;
   }
   nodeFigureToLabel.put(fisheyeFigure, label);
   refreshLabelBounds(fisheyeFigure, label);
   addLabelForFigure(fisheyeFigure, label);
   LabelAncestorListener labelAncestorListener =
       new LabelAncestorListener(originalFigure, fisheyeFigure);
   label.addAncestorListener(labelAncestorListener);
   labelToAncestorListener.put(label, labelAncestorListener);
 }
Пример #4
0
 public void ancestorRemoved(IFigure ancestor) {
   if (fisheyeFigure != null) {
     final GraphLabel label = (GraphLabel) nodeFigureToLabel.get(fisheyeFigure);
     if (label == null) {
       return;
     }
     nodeFigureToLabel.remove(fisheyeFigure);
     Display.getDefault()
         .asyncExec(
             new Runnable() {
               public void run() {
                 label.removeAncestorListener(LabelAncestorListener.this);
               }
             });
     fisheyeFigure.removeFigureListener(nodeFigureListener);
     originalFigure.addFigureListener(nodeFigureListener);
     labelToAncestorListener.remove(label);
     fisheyeFigure = null;
     addLabelForFigure(originalFigure, label);
     refreshLabelBounds(originalFigure, label);
   }
 }