⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jaweedit.java

📁 jawe的最新版本,基于Java的图形化工作流编辑器。图形化工作流编辑器 。使用JAVA语言开发
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
            acts.add(twin);         } else if (twin instanceof Transition) {            trans.add(twin);         }         if (twin instanceof XMLCollectionElement && !(twin instanceof Tool)) {            XMLCollectionElement cel = (XMLCollectionElement) twin;            String oldid = cel.getId();            Set sids = null;            XMLCollection destCol = destCollection;            if (cel instanceof Activity) {               sids = skipActIds;               destCol = actsCollection;            } else if (cel instanceof Transition) {               sids = skipTransIds;               destCol = transCollection;            } else {               sids = skipIds;            }            String id = JaWEManager.getInstance()               .getIdFactory()               .generateSimilarOrIdenticalUniqueId(destCol, sids, oldid);            if (!oldid.equals(id)) {               if (cel instanceof Activity) {                  actIdMappings.put(oldid, cel);               }               cel.setId(id);               sids.add(id);            }         }         duplicatedElements.add(twin);      }      it = duplicatedElements.iterator();      while (it.hasNext()) {         XMLElement el = (XMLElement) it.next();         if (el instanceof ActivitySet) {            ActivitySet as = (ActivitySet) el;            duplicateActivitySetContext(as, skipActIds, skipTransIds);         }      }      it = trans.iterator();      while (it.hasNext()) {         Transition t = (Transition) it.next();         if (actIdMappings.containsKey(t.getFrom())) {            Activity act = (Activity) actIdMappings.get(t.getFrom());            t.setFrom(act.getId());         }         if (actIdMappings.containsKey(t.getTo())) {            Activity act = (Activity) actIdMappings.get(t.getTo());            t.setTo(act.getId());         }      }      it = duplicatedElements.iterator();      while (it.hasNext()) {         XMLElement duplicated = (XMLElement) it.next();         if (!(duplicated instanceof Transition)) {            if (duplicated instanceof Activity) {               actsCollection.add(duplicated);            } else {               destCollection.add(duplicated);            }         }      }      it = duplicatedElements.iterator();      while (it.hasNext()) {         XMLElement duplicated = (XMLElement) it.next();         if (duplicated instanceof Transition) {            transCollection.add(duplicated);         }      }      it = acts.iterator();      while (it.hasNext()) {         XMLElement duplicated = (XMLElement) it.next();         if (duplicated instanceof Activity) {            JaWEManager.getInstance()               .getXPDLUtils()               .correctSplitAndJoin((Activity) duplicated);         }      }      JaWEManager.getInstance().getLoggingManager().debug("Paste ended");      jc.endUndouableChange(new ArrayList(duplicatedElements));      isPasteInProgress = false;   }   public void delete() {      JaWEController jc = JaWEManager.getInstance().getJaWEController();      jc.startUndouableChange();      XMLCollection toSel = null;      int lastElementIndex = 0;      List sels = jc.getSelectionManager().getSelectedElements();      for (int i = 0; i < sels.size(); i++) {         XMLElement el = (XMLElement) sels.get(i);         toSel = (XMLCollection) el.getParent();         lastElementIndex = toSel.indexOf(el);         toSel.remove(el);      }      List toSelect = new ArrayList();      if (toSel.size() == 0)         toSelect.add(toSel);      else {         if (toSel.size() <= lastElementIndex || lastElementIndex < 0) {            toSelect.add(toSel.get(toSel.size() - 1));         } else {            toSelect.add(toSel.get(lastElementIndex));         }      }      jc.endUndouableChange(toSelect);   }   protected void prepareForPaste() {      Iterator it = clipboard.iterator();      List twinElements = new ArrayList();      while (it.hasNext()) {         XMLElement copied = (XMLElement) it.next();         XMLCollection parent = (XMLCollection) copied.getParent();         XMLElement twin = JaWEManager.getInstance()            .getXPDLObjectFactory()            .makeIdenticalXPDLObject(parent, copied);         twin.setReadOnly(false);         twinElements.add(twin);      }      clipboard = new ArrayList(twinElements);   }   public void clear() {      clipboard.clear();   }   public List getClipboard() {      return clipboard;   }   public boolean isPasteInProgress() {      return isPasteInProgress;   }   public List getAllReferences(XMLComplexElement referencedWpOrParOrApp) {      List references = new ArrayList();      XPDLHandler xpdlh = JaWEManager.getInstance().getXPDLHandler();      Iterator it = xpdlh.getAllPackages().iterator();      while (it.hasNext()) {         Package pkg = (Package) it.next();         references.addAll(Utils.makeSearchResultList(JaWEManager.getInstance()            .getXPDLUtils()            .getReferences(pkg, referencedWpOrParOrApp)));      }      return references;   }   protected void duplicateActivitySetContext(ActivitySet as,                                              Set skipActIds,                                              Set skipTransIds) {      Map actIdMappings = new HashMap();      List toIterate = new ArrayList(as.getActivities().toElements());      toIterate.addAll(as.getTransitions().toElements());      Iterator itat = toIterate.iterator();      while (itat.hasNext()) {         XMLCollectionElement actOrTrans = (XMLCollectionElement) itat.next();         String oldid = actOrTrans.getId();         Set sids = null;         if (actOrTrans instanceof Activity) {            sids = skipActIds;         } else {            sids = skipTransIds;         }         String id = JaWEManager.getInstance()            .getIdFactory()            .generateSimilarOrIdenticalUniqueId((XMLCollection) actOrTrans.getParent(),                                                sids,                                                oldid);         if (!oldid.equals(id)) {            if (actOrTrans instanceof Activity) {               actIdMappings.put(oldid, actOrTrans);            }            actOrTrans.setId(id);            sids.add(id);         }      }      Iterator it = as.getTransitions().toElements().iterator();      while (it.hasNext()) {         Transition t = (Transition) it.next();         if (actIdMappings.containsKey(t.getFrom())) {            Activity act = (Activity) actIdMappings.get(t.getFrom());            t.setFrom(act.getId());         }         if (actIdMappings.containsKey(t.getTo())) {            Activity act = (Activity) actIdMappings.get(t.getTo());            t.setTo(act.getId());         }      }      it = as.getActivities().toElements().iterator();      while (it.hasNext()) {         JaWEManager.getInstance()            .getXPDLUtils()            .correctSplitAndJoin((Activity) it.next());      }   }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -