Пример #1
0
  void drawboard(Graphics g) {
    g.setColor(Color.black);
    g.fillRect(0, 0, getWidth(), getHeight());

    sqw = getWidth() / xdim;
    sqh = getHeight() / ydim;

    // draw background panels
    if (def != null) {
      for (int y = 0; y < ydim; y++) {
        for (int x = 0; x < xdim; x++) def.drawObject(g, x, y, sqw, sqh, this);
      }
    }

    if (USEVEC) {
      // draw each element in the vector
      for (Enumeration e = boardVec.elements(); e.hasMoreElements(); ) {
        boardContainer c = (boardContainer) e.nextElement();
        c.o.drawObject(g, c.d.width, c.d.height, sqw, sqh, this);
      }
    } else {
      // draw from grid
      for (int y = 0; y < ydim; y++) {
        for (int x = 0; x < xdim; x++)
          if (board[x][y] != null) board[x][y].drawObject(g, x, y, sqw, sqh, this);
      }
    }
  }
Пример #2
0
  // ------------------------------------------------------------------------
  // SCREEN PAINTER
  // Put some function here to paint whatever you want over the screen before and after
  // all edges and nodes have been painted.
  public void PaintScreenBefore(Graphics g) {

    Dimension d = MainClass.mainFrame.GetGraphDisplayPanel().getSize();
    NodeInfo nodeInfo;
    int x = 0;
    int y = 0;
    int step = 10;

    for (; x < d.width; x += step) {
      for (y = 0; y < d.height; y += step) {
        double val = 0;
        double sum = 0;
        double total = 0;
        double min = 10000000;
        for (Enumeration nodes = proprietaryNodeInfo.elements(); nodes.hasMoreElements(); ) {
          nodeInfo = (NodeInfo) nodes.nextElement();
          double dist = distance(x, y, nodeInfo.centerX, nodeInfo.centerY);
          if (nodeInfo.value != -1 && nodeInfo.nodeNumber.intValue() != 1) { // 121
            if (dist < min) min = dist;
            val += ((double) nodeInfo.value) / dist / dist;
            sum += (1 / dist / dist);
          }
        }
        int reading = (int) (val / sum);
        reading = reading >> 2;
        if (reading > 255) reading = 255;
        g.setColor(new Color(reading, reading, reading));
        g.fillRect(x, y, step, step);
      }
    }
  }
Пример #3
0
  /**
   * Called to create a map the parent of each bookmark.
   *
   * @param parent top level bookmark.
   * @param parentMap map to add children to.
   * @param pagenoVector vector of page numbers.
   * @param depth object indicating bookmark depth.
   */
  protected void mapChildren(
      final Bookmark parent,
      final Hashtable parentMap,
      final Vector pagenoVector,
      final Number depth) {
    getDepthMap().put(parent, depth);

    final int pageno = parent.getPageno();

    if (pageno >= 0) {
      while (pageno >= pagenoVector.size()) {
        pagenoVector.addElement(null);
      }

      pagenoVector.setElementAt(parent, pageno);
    }

    final Enumeration e = parent.elements();

    if (e.hasMoreElements()) {
      final Number childDepth = new Integer(depth.intValue() + 1);

      do {
        final Bookmark child = (Bookmark) e.nextElement();
        parentMap.put(child, parent);
        mapChildren(child, parentMap, pagenoVector, childDepth);
      } while (e.hasMoreElements());
    }
  }
Пример #4
0
  /**
   * Query the maximum image size allowed.
   *
   * @return the maximum image size allowed.
   */
  public Dimension getMaximumSize() {
    final Dimension retval = new Dimension();
    final Hashtable depthMap = getDepthMap();
    int item = 0;

    synchronized (getActiveVector()) {
      final Enumeration keys = getDepthMap().keys();

      while (keys.hasMoreElements()) {
        final Bookmark bookmark = (Bookmark) keys.nextElement();
        final Rectangle bounds = getTextBounds(item++, bookmark, depthMap.get(bookmark));
        final int width = bounds.x + bounds.width;

        if (width > retval.width) {
          retval.width = width;
        }

        retval.height = bounds.y + bounds.height;
      }
    }

    retval.width += (2 * getFontMetrics(getFont()).getMaxAdvance());
    retval.height += (2 * getFontHeight());

    return retval;
  }
Пример #5
0
  /** Mthis method perform equals based on string rapresentation of objects */
  public static void updateStringComboBox(
      javax.swing.JComboBox comboBox, Vector newItems, boolean addNullEntry) {
    Object itemSelected = null;
    if (comboBox.getSelectedIndex() >= 0) {
      itemSelected = comboBox.getSelectedItem() + "";
    }

    comboBox.removeAllItems();
    boolean selected = false;
    boolean foundNullItem = false;
    Enumeration e = newItems.elements();
    while (e.hasMoreElements()) {
      String item = "" + e.nextElement();
      comboBox.addItem(item);
      if (item.equals(itemSelected)) {
        selected = true;
        comboBox.setSelectedItem(itemSelected);
      }
      if (item.equals("")) {
        foundNullItem = true;
      }
    }

    if (addNullEntry) {
      if (!foundNullItem) comboBox.insertItemAt("", 0);
      if (!selected) comboBox.setSelectedItem("");
    }
  }
Пример #6
0
  public DefaultMutableTreeNode findNode(DefaultMutableTreeNode parent, String match) {
    if (parent == null) return null;
    // Commented by Balan on 15/03/03
    // String treename =  (String)parent.getUserObject ();
    // Comment Ends

    // Added by Balan  on 15/03/03
    String treename = "" + ((Hashtable) parent.getUserObject()).get("TREE-NAME");
    // Add Ends

    if (treename != null) {
      if (treename.equals(match)) return parent;
    }

    if (frame.model.isLeaf(parent)) return null;

    Enumeration en = parent.children();
    if ((en == null) || (!en.hasMoreElements())) return null;
    for (; en.hasMoreElements(); ) {

      DefaultMutableTreeNode child = (DefaultMutableTreeNode) en.nextElement();
      DefaultMutableTreeNode returnNode = findNode(child, match);
      if (returnNode != null) return returnNode;
    }
    return null;
  }
 private void updateParentUserObject(DefaultMutableTreeNode parent) {
   String label = ((CheckBoxNode) parent.getUserObject()).label;
   int selectedCount = 0;
   int indeterminateCount = 0;
   Enumeration children = parent.children();
   while (children.hasMoreElements()) {
     DefaultMutableTreeNode node = (DefaultMutableTreeNode) children.nextElement();
     CheckBoxNode check = (CheckBoxNode) node.getUserObject();
     if (check.status == Status.INDETERMINATE) {
       indeterminateCount++;
       break;
     }
     if (check.status == Status.SELECTED) {
       selectedCount++;
     }
   }
   onCheckboxStatusChanged(parent);
   if (indeterminateCount > 0) {
     parent.setUserObject(new CheckBoxNode(label));
   } else if (selectedCount == 0) {
     parent.setUserObject(new CheckBoxNode(label, Status.DESELECTED));
   } else if (selectedCount == parent.getChildCount()) {
     parent.setUserObject(new CheckBoxNode(label, Status.SELECTED));
   } else {
     parent.setUserObject(new CheckBoxNode(label));
   }
 }
Пример #8
0
  /**
   * Build a shape for the entire subtree by joining together the shapes for each of its edges.
   * Vertices included since needed for FullTextPanel.
   */
  public Shape constructInternalShape(DiagramBase diagram, boolean includeVertices) {
    GeneralPath shape = new GeneralPath();
    Enumeration edges = m_edgeList.elements();
    while (edges.hasMoreElements()) {
      TreeEdge edge = (TreeEdge) edges.nextElement();
      Shape edgeShape = edge.getSchemeShape(diagram);
      PathIterator path = edgeShape.getPathIterator(null);
      shape.append(path, false);

      if (includeVertices) {
        Shape vertexShape;
        if (!edge.getSourceVertex().isVirtual()) {
          vertexShape = edge.getSourceVertex().getShape(diagram);
          path = vertexShape.getPathIterator(null);
          shape.append(path, false);
        }
        if (!edge.getDestVertex().isVirtual()) {
          vertexShape = edge.getDestVertex().getShape(diagram);
          path = vertexShape.getPathIterator(null);
          shape.append(path, false);
        }
      }
    }
    BasicStroke stroke =
        new BasicStroke(
            diagram.getSubtreeLineWidth() - DiagramBase.EDGE_OUTLINE_WIDTH + 1,
            BasicStroke.CAP_ROUND,
            BasicStroke.JOIN_MITER);
    internalShapeTable.put(diagram, stroke.createStrokedShape(shape));
    return (Shape) internalShapeTable.get(diagram);
  }
 private void checkNodeValidity(@NotNull DefaultMutableTreeNode node) {
   Enumeration enumeration = node.children();
   while (enumeration.hasMoreElements()) {
     checkNodeValidity((DefaultMutableTreeNode) enumeration.nextElement());
   }
   if (node instanceof Node && node != getModelRoot()) ((Node) node).update(this);
 }
Пример #10
0
 /** Description of the Method */
 public void removeAllElements() {
   for (Enumeration<BPM_Element> e = listModel.elements(); e.hasMoreElements(); ) {
     BPM_Element elm = e.nextElement();
     elm.stopMonitor();
   }
   listModel.removeAllElements();
 }
 private void traverseToLeaves(
     final PackageDependenciesNode treeNode,
     final StringBuffer denyRules,
     final StringBuffer allowRules) {
   final Enumeration enumeration = treeNode.breadthFirstEnumeration();
   while (enumeration.hasMoreElements()) {
     PsiElement childPsiElement =
         ((PackageDependenciesNode) enumeration.nextElement()).getPsiElement();
     if (myIllegalDependencies.containsKey(childPsiElement)) {
       final Map<DependencyRule, Set<PsiFile>> illegalDeps =
           myIllegalDependencies.get(childPsiElement);
       for (final DependencyRule rule : illegalDeps.keySet()) {
         if (rule.isDenyRule()) {
           if (denyRules.indexOf(rule.getDisplayText()) == -1) {
             denyRules.append(rule.getDisplayText());
             denyRules.append("\n");
           }
         } else {
           if (allowRules.indexOf(rule.getDisplayText()) == -1) {
             allowRules.append(rule.getDisplayText());
             allowRules.append("\n");
           }
         }
       }
     }
   }
 }
Пример #12
0
 /**
  * notify listeners of a popup selection
  *
  * @param popStr popup selection string
  */
 void popNotify(String popStr) {
   Enumeration en = popListeners.elements();
   for (; en.hasMoreElements(); ) {
     PopListener listener = (PopListener) en.nextElement();
     listener.popHappened(popStr);
   }
 } // popNotify()
Пример #13
0
  /**
   * Set <CODE>Vector</CODE> of <CODE>String</CODE>s describing the cursor location from the cursor
   * location; this is invoked when the cursor location changes or the cursor display status changes
   */
  public void setCursorStringVector() {
    synchronized (cursorStringVector) {
      cursorStringVector.removeAllElements();
      float[][] cursor = new float[3][1];
      double[] cur = getCursor();
      cursor[0][0] = (float) cur[0];
      cursor[1][0] = (float) cur[1];
      cursor[2][0] = (float) cur[2];
      Enumeration maps = display.getMapVector().elements();
      while (maps.hasMoreElements()) {
        try {
          ScalarMap map = (ScalarMap) maps.nextElement();
          DisplayRealType dreal = map.getDisplayScalar();
          DisplayTupleType tuple = dreal.getTuple();
          int index = dreal.getTupleIndex();
          if (tuple != null
              && (tuple.equals(Display.DisplaySpatialCartesianTuple)
                  || (tuple.getCoordinateSystem() != null
                      && tuple
                          .getCoordinateSystem()
                          .getReference()
                          .equals(Display.DisplaySpatialCartesianTuple)))) {
            float[] fval = new float[1];
            if (tuple.equals(Display.DisplaySpatialCartesianTuple)) {
              fval[0] = cursor[index][0];
            } else {
              float[][] new_cursor = tuple.getCoordinateSystem().fromReference(cursor);
              fval[0] = new_cursor[index][0];
            }
            float[] dval = map.inverseScaleValues(fval);
            RealType real = (RealType) map.getScalar();

            // WLH 31 Aug 2000
            Real r = new Real(real, dval[0]);
            Unit overrideUnit = map.getOverrideUnit();
            Unit rtunit = real.getDefaultUnit();
            // units not part of Time string
            // DRM 2003-08-19: don't check for equality since toString
            // may be different
            if (overrideUnit != null
                && // !overrideUnit.equals(rtunit) &&
                (!Unit.canConvert(rtunit, CommonUnit.secondsSinceTheEpoch)
                    || rtunit.getAbsoluteUnit().equals(rtunit))) {
              dval[0] = (float) overrideUnit.toThis((double) dval[0], rtunit);
              r = new Real(real, dval[0], overrideUnit);
            }
            String valueString = r.toValueString();

            // WLH 27 Oct 2000
            String s = map.getScalarName() + " = " + valueString;
            // String s = real.getName() + " = " + valueString;

            cursorStringVector.addElement(s);
          } // end if (tuple != null && ...)
        } catch (VisADException e) {
        }
      } // end while(maps.hasMoreElements())
    } // end synchronized (cursorStringVector)
    render_trigger();
  }
Пример #14
0
  // -------------------------------------------
  public static String[] mergeArrays(String[] sa1, String[] sa2) {
    if (sa1 == null) {
      sa1 = new String[0];
    }
    if (sa2 == null) {
      sa2 = new String[0];
    }
    int sa1Len = sa1.length;
    int sa2Len = sa2.length;
    Hashtable tab = new Hashtable(sa1Len + sa2Len);
    for (int i = 0; i < sa1Len; i++) {
      tab.put(sa1[i], sa1[i]);
    }
    for (int i = 0; i < sa2Len; i++) {
      tab.put(sa2[i], sa2[i]);
    }

    int len = tab.size();
    String[] res = new String[len];
    int i = 0;
    for (Enumeration e = tab.keys(); e.hasMoreElements(); ) {
      String s = (String) e.nextElement();
      res[i++] = s;
    }
    return res;
  }
Пример #15
0
private void MenuPopup (MouseEvent ev, CGNode node)
    {
	if (!node.IsConcept())
	    return;

	String menuname = (String)menumap.get (node.GetType(true));
	if (menuname == null)
	    return;
	Hashtable templates = (Hashtable)menus.get (menuname);
	if (templates == null)
	    return;

	if( popup != null )
	  remove( popup );

	popup = new PopupMenu( menuname );
	
        Enumeration e = templates.keys();
        while (e.hasMoreElements()) {
            String key = (String)e.nextElement();
	    MenuItem mi = new MenuItem( key );
	    mi.setActionCommand( key );
	    mi.addActionListener( this );
	    popup.add( mi );
        }
        curnode = node;

	this.add( popup );

	popup.show( this, ev.getX(), ev.getY() );
    }
  public HierarchyBrowserBaseEx(@NotNull Project project, @NotNull PsiElement element) {
    super(project);

    setHierarchyBase(element);

    myCardLayout = new CardLayout();
    myTreePanel = new JPanel(myCardLayout);

    createTrees(myType2TreeMap);

    final HierarchyBrowserManager.State state =
        HierarchyBrowserManager.getInstance(project).getState();
    for (String type : myType2TreeMap.keySet()) {
      myType2ScopeMap.put(type, state.SCOPE != null ? state.SCOPE : SCOPE_ALL);
    }

    final Enumeration<String> keys = myType2TreeMap.keys();
    while (keys.hasMoreElements()) {
      final String key = keys.nextElement();
      final JTree tree = myType2TreeMap.get(key);
      myOccurrenceNavigators.put(
          key,
          new OccurenceNavigatorSupport(tree) {
            @Override
            @Nullable
            protected Navigatable createDescriptorForNode(DefaultMutableTreeNode node) {
              final HierarchyNodeDescriptor descriptor = getDescriptor(node);
              if (descriptor == null) return null;
              PsiElement psiElement = getOpenFileElementFromDescriptor(descriptor);
              if (psiElement == null || !psiElement.isValid()) return null;
              final VirtualFile virtualFile = psiElement.getContainingFile().getVirtualFile();
              if (virtualFile == null) return null;
              return new OpenFileDescriptor(
                  psiElement.getProject(), virtualFile, psiElement.getTextOffset());
            }

            @Override
            public String getNextOccurenceActionName() {
              return getNextOccurenceActionNameImpl();
            }

            @Override
            public String getPreviousOccurenceActionName() {
              return getPrevOccurenceActionNameImpl();
            }
          });
      myTreePanel.add(ScrollPaneFactory.createScrollPane(tree), key);
    }

    final JPanel legendPanel = createLegendPanel();
    final JPanel contentPanel;
    if (legendPanel != null) {
      contentPanel = new JPanel(new BorderLayout());
      contentPanel.add(myTreePanel, BorderLayout.CENTER);
      contentPanel.add(legendPanel, BorderLayout.SOUTH);
    } else {
      contentPanel = myTreePanel;
    }
    buildUi(createToolbar(getActionPlace(), HELP_ID).getComponent(), contentPanel);
  }
Пример #17
0
      public void propertyChange(PropertyChangeEvent e) {
        if (e.getPropertyName().equals("minimum") && startAtMin) {
          start = getMinimum();
        }

        if (e.getPropertyName().equals("minimum") || e.getPropertyName().equals("maximum")) {

          Enumeration keys = getLabelTable().keys();
          Hashtable<Object, Object> hashtable = new Hashtable<Object, Object>();

          // Save the labels that were added by the developer
          while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            Object value = labelTable.get(key);
            if (!(value instanceof LabelUIResource)) {
              hashtable.put(key, value);
            }
          }

          clear();
          createLabels();

          // Add the saved labels
          keys = hashtable.keys();
          while (keys.hasMoreElements()) {
            Object key = keys.nextElement();
            put(key, hashtable.get(key));
          }

          ((JSlider) e.getSource()).setLabelTable(this);
        }
      }
Пример #18
0
 /**
  * Paint each <code>Lite</code> object in turn after testing if it is inside the clip of the
  * Graphics. This is the right way to do it if the repainting time of <code>Lite</code> objects is
  * much greater than the time required to compute its bounds.
  *
  * @see excentric.LiteGroup#paintAll(java.awt.Graphics)
  */
 public void paint(Graphics g) {
   Rectangle clip = g.getClipBounds();
   for (Enumeration e = lites.elements(); e.hasMoreElements(); ) {
     Lite l = (Lite) e.nextElement();
     // if (l.getBounds().intersects(clip))
     l.paint(g);
   }
 }
 void removeShortcuts() {
   Menus.getMacroShortcuts().clear();
   Hashtable shortcuts = Menus.getShortcuts();
   for (Enumeration en = shortcuts.keys(); en.hasMoreElements(); ) {
     Integer key = (Integer) en.nextElement();
     String value = (String) shortcuts.get(key);
     if (value.charAt(0) == commandPrefix) shortcuts.remove(key);
   }
 }
Пример #20
0
 public String getInfo() {
   String info = "Edges: ";
   Enumeration edges = m_edgeList.elements();
   while (edges.hasMoreElements()) {
     TreeEdge edge = (TreeEdge) edges.nextElement();
     info += edge.getSourceVertex().getLabel() + " => " + edge.getDestVertex().getLabel() + "; ";
   }
   return info;
 }
Пример #21
0
 // {{{ traverseNodes() method
 public static boolean traverseNodes(
     DefaultMutableTreeNode node, HyperSearchTreeNodeCallback callbackInterface) {
   if (!callbackInterface.processNode(node)) return false;
   for (Enumeration e = node.children(); e.hasMoreElements(); ) {
     DefaultMutableTreeNode childNode = (DefaultMutableTreeNode) e.nextElement();
     if (!traverseNodes(childNode, callbackInterface)) return false;
   }
   return true;
 } // }}}
Пример #22
0
 private static void expand(JTree tree, TreePath path, int levels) {
   if (levels == 0) return;
   tree.expandPath(path);
   TreeNode node = (TreeNode) path.getLastPathComponent();
   Enumeration children = node.children();
   while (children.hasMoreElements()) {
     expand(tree, path.pathByAddingChild(children.nextElement()), levels - 1);
   }
 }
 /*
  * Applet is no longer displayed
  */
 public void stop() {
   // Tell all pages to stop talking to the server
   Enumeration e = pages.elements();
   while (e.hasMoreElements()) {
     SOAPMonitorPage pg = (SOAPMonitorPage) e.nextElement();
     if (pg != null) {
       pg.stop();
     }
   }
 }
Пример #24
0
 /** ** Prints all LocalString keys for this I18N instance */
 public void printKeyValues() {
   Enumeration e = this.getKeys();
   if (e != null) {
     for (; e.hasMoreElements(); ) {
       String k = (String) e.nextElement();
       String v = this.getString(k, "?");
       Print.logInfo("Key:" + k + " Value:" + v);
     }
   }
 }
Пример #25
0
 @Override
 public void actionPerformed(ActionEvent evt) {
   TreePath path = resultTree.getSelectionPath();
   DefaultMutableTreeNode operNode = (DefaultMutableTreeNode) path.getLastPathComponent();
   for (Enumeration e = operNode.children(); e.hasMoreElements(); ) {
     DefaultMutableTreeNode node = (DefaultMutableTreeNode) e.nextElement();
     resultTree.collapsePath(new TreePath(node.getPath()));
   }
   resultTree.scrollPathToVisible(new TreePath(operNode.getPath()));
 }
 private void step() {
   myNext = null;
   while (myEnum.hasMoreElements()) {
     final Object o = myEnum.nextElement();
     if (o instanceof FileTreeNode) {
       myNext = ((FileTreeNode) o).getFilePointer();
       break;
     }
   }
 }
Пример #27
0
 private void updateLabelSizes() {
   Dictionary labelTable = getLabelTable();
   if (labelTable != null) {
     Enumeration labels = labelTable.elements();
     while (labels.hasMoreElements()) {
       JComponent component = (JComponent) labels.nextElement();
       component.setSize(component.getPreferredSize());
     }
   }
 }
Пример #28
0
 /**
  * Fills a SubtreeFrame with info about the subtree. Used to display info when user right clicks
  * on an existing subtree.
  */
 public void buildSubtreeFrame(SubtreeFrame sFrame) {
   // Clear visited flag on all vertices in the tree
   // and determine the layer number of the root node
   int highestLayer = 100;
   Enumeration edges = m_edgeList.elements();
   while (edges.hasMoreElements()) {
     TreeEdge edge = (TreeEdge) edges.nextElement();
     edge.getDestVertex().setVisited(false);
     edge.getSourceVertex().setVisited(false);
     if (edge.getSourceVertex().getLayer() < highestLayer) {
       highestLayer = edge.getSourceVertex().getLayer();
     }
   }
   // Create list of premises and conclusion and assign
   // to text areas in the dialog
   Vector premiseList = new Vector();
   String conclusion = "";
   String criticalQuestions = "";
   edges = m_edgeList.elements();
   while (edges.hasMoreElements()) {
     TreeEdge edge = (TreeEdge) edges.nextElement();
     TreeVertex source = edge.getSourceVertex();
     TreeVertex dest = edge.getDestVertex();
     if (!source.getVisited()) {
       if (source.getLayer() == highestLayer) {
         conclusion += (String) source.getLabel();
       } else {
         premiseList.add((String) source.getLabel());
       }
       source.setVisited(true);
     }
     if (!dest.getVisited()) {
       premiseList.add((String) dest.getLabel());
       dest.setVisited(true);
     }
   }
   sFrame.setPremisesText(premiseList);
   sFrame.setConclusionText(conclusion);
   sFrame.loadArgTypeCombo();
   // Assign the correct argument type to the combo box
   for (int index = 0; index < sFrame.selectArgumentCombo.getItemCount(); index++) {
     if (m_argumentType.getName().equals(sFrame.selectArgumentCombo.getItemAt(index))) {
       sFrame.selectArgumentCombo.setSelectedIndex(index);
       sFrame.selectArgumentCombo.setEditable(false);
       break;
     }
   }
   // Construct list of critical questions
   //    Enumeration quesList = m_argumentType.getCriticalQuestions().elements();
   //    while (quesList.hasMoreElements()) {
   //      criticalQuestions += (String)quesList.nextElement() +
   //          "\r\n _____________________________ \r\n";
   //   }
   sFrame.updateTextBoxes();
 }
Пример #29
0
 /**
  * Returns the bPM attribute of the BPMsTable object
  *
  * @param name The Parameter
  * @return The bPM value
  */
 public BPM_Element getBPM(String name) {
   BPM_Element bpmElm = null;
   Enumeration<BPM_Element> bpm_enum = listModel.elements();
   while (bpm_enum.hasMoreElements()) {
     BPM_Element bpmElm1 = bpm_enum.nextElement();
     if (bpmElm1.getName().equals(name)) {
       bpmElm = bpmElm1;
     }
   }
   return bpmElm;
 }
  private static void sortNode(ParentNode node, final Comparator<ElementNode> sortComparator) {
    ArrayList<MemberNode> arrayList = new ArrayList<MemberNode>();
    Enumeration<MemberNode> children = node.children();
    while (children.hasMoreElements()) {
      arrayList.add(children.nextElement());
    }

    Collections.sort(arrayList, sortComparator);

    replaceChildren(node, arrayList);
  }