@Override public void performRequest(Request request) { if (request.getType() == RequestConstants.REQ_DIRECT_EDIT || request.getType() == RequestConstants.REQ_OPEN) { for (ControlFlowEditPart controlFlowEP : getRootConditionalChildren()) { controlFlowEP.refresh(); // make sure loaded diagram puts figs in the right spot if (!((ControlFlowModel) controlFlowEP.getModel()).getInnerConditionalModels().isEmpty()) { controlFlowEP.refresh(); } // ControlFlowBlock block = null; if (controlFlowEP != null && controlFlowEP instanceof UserCreatedControlFlowEditPart) { if (((ControlFlowBlock) controlFlowEP.getFigure()) .getBounds() .contains(((LocationRequest) request).getLocation())) { ((UserCreatedControlFlowEditPart) controlFlowEP).performDirectEdit(); } } } } else super.performRequest(request); }
private void updateConditionalUnderMouse(Point mouseLocation) { for (ControlFlowEditPart controlFlowEP : getRootConditionalChildren()) { controlFlowEP.refresh(); // make sure loaded diagram puts figs in the right spot if (!((ControlFlowModel) controlFlowEP.getModel()).getInnerConditionalModels().isEmpty()) { controlFlowEP.refresh(); } ControlFlowBlock block = null; if (controlFlowEP != null) { if (((ControlFlowBlock) controlFlowEP.getFigure()).getBounds().contains(mouseLocation)) { block = ((ControlFlowBlock) controlFlowEP.getFigure()); } else { ControlFlowBlock block2 = ((ControlFlowBlock) controlFlowEP.getFigure()); block2.showOrHide(false); controlFlowEP.setSelected(SELECTED_NONE); } } if (block == null) continue; block.showOrHide(true); controlFlowEP.setSelected(SELECTED_PRIMARY); block.showOrHideOuterBlock(mouseLocation); } }