Beispiel #1
0
 public void removeRow(int index) {
   remove(rows.get(index));
   remove(struts.get(index));
   rows.remove(index);
   struts.remove(index);
   repaint();
   updateUI();
 }
 private void removeTodoItem() {
   Object possibleSelection = todoItemsList.getSelectedValue();
   if (possibleSelection != null) {
     todoItems.remove(possibleSelection.toString());
     updateTodoItems();
   }
 }
Beispiel #3
0
 public void removeFriendFromList(String name) {
   for (int i = 0; i < list.size(); ) {
     if (list.get(i).toString().equals(name)) list.remove(i);
     else i++;
   }
   copy2view();
   list_fri.setListData(list_view.toArray());
 }
    /**
     * Removes specific rows from the list of reading lists.
     *
     * @param aRows rows to remove.
     */
    public void removeRows(int[] aRows) {
      Arrays.sort(aRows);

      java.util.List<ReadingList> newLists = new ArrayList<ReadingList>(Arrays.asList(lists));
      for (int i = aRows.length - 1; i >= 0; i--) {
        newLists.remove(aRows[i]);
      }

      setLists(newLists.toArray(new ReadingList[newLists.size()]));
    }
Beispiel #5
0
  static void removeFromLayers(Shape shape) {
    if (!layerOf.containsKey(shape)) return;

    int oldLayer = layerOf.get(shape);
    layerContents.get(oldLayer).remove(shape);
    if (layerContents.get(oldLayer).isEmpty()) {
      layerContents.remove(oldLayer);
      layers.remove((Integer) oldLayer);
    }
    layerOf.remove(shape);
  }
Beispiel #6
0
  /**
   * Merge two clusters in the cluster list for given cluster indices.
   *
   * @param clusterCenterList The list of cluster centers.
   * @param clusterPair Indices of the two clusters to merge.
   */
  private static void mergeClusters(
      final java.util.List<ClusterInfo> clusterCenterList, final int[] clusterPair) {

    final int idx1 = clusterPair[0];
    final int idx2 = clusterPair[1];
    final int size1 = clusterCenterList.get(idx1).size;
    final int size2 = clusterCenterList.get(idx2).size;
    final int newClusterSize = size1 + size2;

    final double[][] newCenterRe = new double[3][3];
    final double[][] newCenterIm = new double[3][3];
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        newCenterRe[i][j] =
            (size1 * clusterCenterList.get(idx1).centerRe[i][j]
                    + size2 * clusterCenterList.get(idx2).centerRe[i][j])
                / newClusterSize;

        newCenterIm[i][j] =
            (size1 * clusterCenterList.get(idx1).centerIm[i][j]
                    + size2 * clusterCenterList.get(idx2).centerIm[i][j])
                / newClusterSize;
      }
    }

    if (idx1 < idx2) {
      clusterCenterList.remove(idx2);
      clusterCenterList.remove(idx1);
    } else {
      clusterCenterList.remove(idx1);
      clusterCenterList.remove(idx2);
    }

    ClusterInfo clusterCenter = new ClusterInfo();
    clusterCenter.setClusterCenter(
        clusterCenterList.size(), newCenterRe, newCenterIm, newClusterSize);
    clusterCenterList.add(clusterCenter);
  }
  protected void moveControlPoint(
      ControlPointMarker controlPoint, Point lastMousePoint, Point moveToPoint) {
    View view = this.wwd.getView();
    Globe globe = this.wwd.getModel().getGlobe();

    Position refPos = controlPoint.getPosition();
    if (refPos == null) return;

    Line ray = view.computeRayFromScreenPoint(moveToPoint.getX(), moveToPoint.getY());
    Line previousRay = view.computeRayFromScreenPoint(lastMousePoint.getX(), lastMousePoint.getY());

    Vec4 vec = AirspaceEditorUtil.intersectGlobeAt(this.wwd, refPos.getElevation(), ray);
    Vec4 previousVec =
        AirspaceEditorUtil.intersectGlobeAt(this.wwd, refPos.getElevation(), previousRay);

    if (vec == null || previousVec == null) {
      return;
    }

    Position pos = globe.computePositionFromPoint(vec);
    Position previousPos = globe.computePositionFromPoint(previousVec);
    LatLon change = pos.subtract(previousPos);

    java.util.List<LatLon> boundary = new ArrayList<LatLon>();
    for (LatLon ll : this.polygon.getOuterBoundary()) {
      boundary.add(ll);
    }

    boundary.set(controlPoint.getIndex(), new Position(pos.add(change), refPos.getAltitude()));

    // ExtrudedPolygon ensures that the last boundary position is the same as the first. Remove the
    // last point
    // before setting the boundary.
    boundary.remove(boundary.size() - 1);

    this.polygon.setOuterBoundary(boundary);
  }
Beispiel #8
0
 static void removeCounter(Counter counter) {
   counters.remove(counter);
 }
Beispiel #9
0
 /**
  * Removes the component of a specific <code>PluginComponent</code> from this <code>
  * PluginContainer</code>.
  *
  * @param c the <code>PluginComponent</code> which is to have its component removed from this
  *     <code>PluginContainer</code>
  */
 private synchronized void removePluginComponent(PluginComponent c) {
   container.remove((Component) c.getComponent());
   pluginComponents.remove(c);
 }
 public void removeRow(final int row) {
   if (row >= 0 && row < myData.size()) {
     myData.remove(row);
     fireTableRowsDeleted(row, row);
   }
 }
Beispiel #11
0
 /**
  * Remove the given property change listener.
  *
  * @param l Listener to remove.
  */
 public void removePropertyChangeListener(PropertyChangeListener l) {
   _changeListeners.remove(l);
 }