Package org.woped.editor.controller

Examples of org.woped.editor.controller.Layout


              grid.identifyUsersWithSingleAncestor();
              grid.moveUsersWithSingleAncestors();
              grid.identifyUsersWithMultipleAncestors();
              grid.moveUsersWithMultipleAncestors();
              grid.adjustYAxis();
              Layout layout = grid.createLayout();
              layout.name = currentCompoundRole.name;
              RoleLayoutSet.add(layout);
            }
          }
         
          //Execute algorithm for the compound Groups
          if (lm.allGroups.size() > 0) {
           
            if (lm.allCompoundGroups.size() == 1) {
              boolean unrelatedGroup = false;
              Iterator<?> it = lm.allGroups.iterator();
              while (it.hasNext()) {
                Group currentGroup = (Group) it.next();
                Iterator<?> subit = currentGroup.ancestors.iterator();
                while (subit.hasNext()) {
                  CompoundGroup currentCompound = (CompoundGroup) subit.next();
                  if (currentCompound.name == "") {
                    unrelatedGroup = true;
                    break;
                  }
                }
                if (unrelatedGroup == true ) {
                  break;
                }
              }
              if (unrelatedGroup == true) {
                CompoundGroup allGroups = new CompoundGroup(Messages.getString("PetriNet.Resources.AllCompoundGroupsName"));
                allGroups.children.addAll(lm.allGroups);
                it = lm.allGroups.iterator();
                while (it.hasNext()) {
                  Group currentGroup = (Group) it.next();
                  currentGroup.ancestors.add(allGroups);
                }
                lm.allCompoundGroups.add(allGroups);
              }
            }
           
            else if (lm.allCompoundGroups.size() == 0) {
              CompoundGroup cg = new CompoundGroup(Messages.getString("PetriNet.Resources.DefaultCompoundGroupName"));
              cg.children.addAll(lm.allGroups);
              Iterator<?> it = lm.allGroups.iterator();
              while (it.hasNext()) {
                Group currentGroup = (Group) it.next();
                currentGroup.ancestors.add(cg);
              }
              lm.allCompoundGroups.add(cg);
            }

            else {
              CompoundGroup allGroups = new CompoundGroup(Messages.getString("PetriNet.Resources.AllCompoundGroupsName"));
              allGroups.children.addAll(lm.allGroups);
              Iterator<?> it = lm.allGroups.iterator();
              while (it.hasNext()) {
                Group currentGroup = (Group) it.next();
                currentGroup.ancestors.add(allGroups);
              }
              lm.allCompoundGroups.add(allGroups);
            }
         
            Iterator<?> it = lm.allCompoundGroups.iterator();
            while (it.hasNext()) {
              CompoundGroup currentCompoundGroup = (CompoundGroup) it.next();
              GroupLayoutGrid grid = new GroupLayoutGrid(currentCompoundGroup);
              grid.identifyTrueSubSets();
              grid.analyzeSubSets();
              if (grid.complexSubsets == false) {
                grid.removeTrueSubSets();
              }
              grid.identifyUsersWithSingleAncestor();
              grid.moveUsersWithSingleAncestors();
              grid.identifyUsersWithMultipleAncestors();
              grid.moveUsersWithMultipleAncestors();
              grid.adjustYAxis();
              Layout layout = grid.createLayout();
              layout.name = currentCompoundGroup.name;
              GroupLayoutSet.add(layout);
            }
          }
        }
View Full Code Here


          }
        }
       
        //Sample the grid into the interface which is used by the front end to paint the graph
        public Layout createLayout() {
          Layout layout = new Layout(elements);
          removeNullRows(layout.grid);
          Iterator<?> it = allColumns.iterator();
          while (it.hasNext()) {
            Group currentGroup = (Group) it.next();
            String name = currentGroup.name;
            int column = currentGroup.column;
            int ystart = -1;
            int yend = -1;
            boolean started = false;
            for (int i=0;i<elements[currentGroup.column].length;i++) {
              if (currentGroup.children.contains(elements[currentGroup.column][i])) {
                if (started == false) {
                  ystart = i;
                  started = true;
                }
                if (started == true) {
                  yend = i;
                }
              }
            }
            if (yend == -1) {
              yend = ystart;
            }
            GroupLocator locationOfCurrentGroup = new GroupLocator(name, column, ystart, yend);
            layout.addGroup(locationOfCurrentGroup);
          }
          return layout;
        }
View Full Code Here

          }
        }
       
        //Sample the grid into the interface which is used by the front end to paint the graph
        public Layout createLayout() {
          Layout layout = new Layout(elements);
          removeNullRows(layout.grid);
          Iterator<?> it = allColumns.iterator();
          while (it.hasNext()) {
            Role currentRole = (Role) it.next();
            String name = currentRole.name;
            int column = currentRole.column;
            int ystart = -1;
            int yend = -1;
            boolean started = false;
            for (int i=0;i<elements[currentRole.column].length;i++) {
              if (currentRole.children.contains(elements[currentRole.column][i])) {
                if (started == false) {
                  ystart = i;
                  started = true;
                }
                if (started == true) {
                  yend = i;
                }
              }
            }
            if (yend == -1) {
              yend = ystart;
            }
            RoleLocator locationOfCurrentRole = new RoleLocator(name, column, ystart, yend);
            layout.addRole(locationOfCurrentRole);
          }
          return layout;
        }
View Full Code Here

TOP

Related Classes of org.woped.editor.controller.Layout

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.