private void moveUpAndDownPage(boolean _up) {
   int index = tabbedPanel.getSelectedIndex();
   if (index < 0) return;
   Editor page = pageList.get(index);
   if (page == null) return;
   if (_up) {
     if (index == 0) return;
     pageList.removeElementAt(index);
     pageList.insertElementAt(page, index - 1);
     tabbedPanel.removeTabAt(index);
     tabbedPanel.insertTab(
         page.isActive() ? page.getName() : page.getName() + " (D)",
         null,
         page.getComponent(),
         tooltip,
         index - 1);
   } else {
     if (index == (pageList.size() - 1)) return;
     pageList.removeElementAt(index);
     pageList.insertElementAt(page, index + 1);
     tabbedPanel.removeTabAt(index);
     tabbedPanel.insertTab(
         page.isActive() ? page.getName() : page.getName() + " (D)",
         null,
         page.getComponent(),
         tooltip,
         index + 1);
   }
   tabbedPanel.setSelectedComponent(page.getComponent());
   changed = true;
 }
Ejemplo n.º 2
0
public void DelChild (CGNode n)
        throws NoSuchElementException
    {
        int idx = childs.indexOf (n);
        if (idx == -1)
            throw new NoSuchElementException ();
        else {
            childs.removeElementAt (idx);
            arrows.removeElementAt (idx);
        }
    }
Ejemplo n.º 3
0
 /**
  * moveData
  *
  * @param curRow Old row for the data
  * @param newRow New row for the data
  */
 private void moveData(int curRow, int newRow) {
   int lastRow = rowData.size() - 1;
   if (curRow >= 0 && curRow <= lastRow && newRow >= 0 && newRow <= lastRow) {
     Object[] curData = (Object[]) rowData.elementAt(curRow);
     rowData.removeElementAt(curRow);
     rowData.insertElementAt(curData, newRow);
     fireTableDataChanged();
   }
 }
 protected void removeCurrentPage() {
   int index = tabbedPanel.getSelectedIndex();
   if (index < 0) return;
   tabbedPanel.removeTabAt(index);
   pageList.removeElementAt(index);
   updatePageCounterField(pageList.size());
   changed = true;
   if (tabbedPanel.getTabCount() <= 0) cardLayout.show(finalPanel, "FirstPanel");
   ejs.getModelEditor().getVariablesEditor().updateControlValues(false);
 }
Ejemplo n.º 5
0
  /**
   * Check bookmark at the specified row number.
   *
   * @param item row number.
   * @param checked true if checked.
   * @param activeVector vector of active bookmarks.
   */
  protected void setCheckedItem(final int item, final boolean checked, final Vector activeVector) {
    final Bookmark bookmark = getBookmark(item);

    if (bookmark.size() > 0) {
      final Enumeration e = bookmark.elements();
      int i = item + 1;

      if (e.hasMoreElements()) {
        if (checked) {
          do {
            final Bookmark child = (Bookmark) e.nextElement();
            final Bookmark next = getBookmark(i);

            if (next == child) {
              break;
            }

            activeVector.insertElementAt(child, i++);
          } while (e.hasMoreElements());
        } else {
          do {
            final Bookmark child = (Bookmark) e.nextElement();
            final Bookmark next = getBookmark(i);

            if (next != child) {
              break;
            }

            setCheckedItem(i, false);
            activeVector.removeElementAt(i);
          } while (e.hasMoreElements());
        }
      }

      repaint(20L);
    }
  }
  /**
   * Changes the selection in the menu hierarchy. The elements in the array are sorted in order from
   * the root menu element to the currently selected menu element.
   *
   * <p>Note that this method is public but is used by the look and feel engine and should not be
   * called by client applications.
   *
   * @param path an array of <code>MenuElement</code> objects specifying the selected path
   */
  public void setSelectedPath(MenuElement[] path) {
    int i, c;
    int currentSelectionCount = selection.size();
    int firstDifference = 0;

    if (path == null) {
      path = new MenuElement[0];
    }

    if (DEBUG) {
      System.out.print("Previous:  ");
      printMenuElementArray(getSelectedPath());
      System.out.print("New:  ");
      printMenuElementArray(path);
    }

    for (i = 0, c = path.length; i < c; i++) {
      if (i < currentSelectionCount && selection.elementAt(i) == path[i]) firstDifference++;
      else break;
    }

    for (i = currentSelectionCount - 1; i >= firstDifference; i--) {
      MenuElement me = selection.elementAt(i);
      selection.removeElementAt(i);
      me.menuSelectionChanged(false);
    }

    for (i = firstDifference, c = path.length; i < c; i++) {
      if (path[i] != null) {
        selection.addElement(path[i]);
        path[i].menuSelectionChanged(true);
      }
    }

    fireStateChanged();
  }
Ejemplo n.º 7
0
 public void removeRow(int row) {
   m_props.removeElementAt(row);
   fireTableRowsDeleted(row, row);
 }
Ejemplo n.º 8
0
 public void removePanel(int pos) {
   NotebookPage np = (NotebookPage) pages.elementAt(pos);
   pages.removeElementAt(pos);
   oobj.remove(np.comp);
   showPanel(curIndex);
 }