Advertisement
Guest User

vvvvv

a guest
Jul 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public void execute() {
  2. DiagramEditor editor = DiagramEditor.getActiveEditor();
  3. RootModel root = editor.getRootModel();
  4. List<AbstractModel> mods = root.getChildren();
  5.  
  6. for(AbstractModel m : mods) {
  7. executeInt4(m, 0);
  8. }
  9. editor.checkDirty();
  10. }
  11.  
  12.  
  13. public void executeInt4(AbstractModel r, int lvl) {
  14. DiagramEditor editor = DiagramEditor.getActiveEditor();
  15. int level = lvl + 1;
  16. List<AbstractModel> abs = new ArrayList<>();
  17. List<AbstractModel> ch = r.getChildren();
  18.  
  19. for(AbstractModel c : ch) {
  20. if (!(c instanceof TypeModel) && !(c instanceof FieldModel)
  21. && !(c instanceof MethodModel)) {
  22. abs.add(c);
  23. }
  24. }
  25.  
  26. int length = abs.size();
  27. if(length == 0) {
  28. r.setLocation(200,level*(-150));
  29. editor.checkDirty();
  30.  
  31. }
  32.  
  33. else {
  34. AutoArrangeCommand auto = new AutoArrangeCommand();
  35. for(int i = 0; i < length; i++) {
  36. auto.executeInt4(abs.get(i), level);
  37. }
  38. r.setLocation(200, level*(-150));
  39. editor.checkDirty();
  40.  
  41. }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement