CloneSet12


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
146220.975class_body_declarations[9]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1146166
E:/TSE/Projects-CloneDR/columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java
2146171
E:/TSE/Projects-CloneDR/columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/ContactDNDListView.java
Next
Last
Clone Instance
1
Line Count
146
Source Line
166
Source File
E:/TSE/Projects-CloneDR/columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java

/**
 * is invoked if the use modifies the current drop gesture
 * 
 */
public void dropActionChanged(DropTargetDragEvent event) {
}

/**
 * a drag gesture has been initiated
 * 
 */
public void dragGestureRecognized(DragGestureEvent event) {
  if (dndAction == false) {
    /*
     * HeaderItem[] items = new HeaderItem[selection1.length]; items =
     * selection1;
     * HeaderItemDNDManager.getInstance().setHeaderItemList(items);
     */
    if (selection1 == null) {
      IBasicModelPartial[] items = new IBasicModelPartial[1];
      items[0] = (IBasicModelPartial) getSelectedValue();
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
    else
      if (selection1.length != 0) {
        IBasicModelPartial[] items = new IBasicModelPartial[selection1.length];
        items = selection1;
        HeaderItemDNDManager.getInstance().setHeaderItemList(items);
      }
  /*
   * else {
   * 
   * HeaderItem[] items = new HeaderItem[1]; items[0] = (HeaderItem)
   * getSelectedValue();
   * HeaderItemDNDManager.getInstance().setHeaderItemList(items); }
   */
  }
  else {
    /*
     * HeaderItem[] items = new HeaderItem[selection2.length]; items =
     * selection2;
     * HeaderItemDNDManager.getInstance().setHeaderItemList(items);
     */
    if (selection2.length != 0) {
      IBasicModelPartial[] items = new IBasicModelPartial[selection2.length];
      items = selection2;
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
    else {
      IBasicModelPartial[] items = new IBasicModelPartial[1];
      items[0] = (IBasicModelPartial) getSelectedValue();
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
  }
  /*
   * dragSource.startDrag( event, new Cursor(Cursor.DEFAULT_CURSOR),
   * ImageLoader.getImageIcon("contact_small","Add16").getImage(), new
   * Point(5, 5), new StringSelection("contact"), this);
   */
  StringSelection text = new StringSelection("contact");
  dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this );
  clearSelection();
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * has ended
 * 
 */
public void dragDropEnd(DragSourceDropEvent event) {
  if (event.getDropSuccess()) {
    if (acceptDrop == true) {
      IBasicModelPartial[] items = HeaderItemDNDManager.getInstance().getHeaderItemList();
      for (int i = 0; i < items.length; i++) {
        ((AddressbookListModel) getModel()).removeElement(items[i]);
      }
    // removeElement();
    }
  }
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * has entered the DropSite
 * 
 */
public void dragEnter(DragSourceDragEvent event) {
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * has exited the DropSite
 * 
 */
public void dragExit(DragSourceEvent event) {
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * is currently ocurring over the DropSite
 * 
 */
public void dragOver(DragSourceDragEvent event) {
}

/**
 * is invoked when the user changes the dropAction
 * 
 */
public void dropActionChanged(DragSourceDragEvent event) {
}

/**
 * adds elements to itself
 * 
 */
/**
 * removes an element from itself
 */
public void removeElement() {
  ((AddressbookListModel) getModel()).removeElement((IBasicModelPartial) getSelectedValue());
}

public void valueChanged(ListSelectionEvent e) {
  if (dndAction == true) {
    Object[] list = getSelectedValues();
    selection1 = new IBasicModelPartial[list.length];
    for (int i = 0; i < list.length; i++) {
      selection1[i] = (IBasicModelPartial) list[i];
    }
    dndAction = false;
  }
  else {
    Object[] list = getSelectedValues();
    selection2 = new IBasicModelPartial[list.length];
    for (int i = 0; i < list.length; i++) {
      selection2[i] = (IBasicModelPartial) list[i];
    }
    dndAction = true;
  }
}


First
Previous
Clone Instance
2
Line Count
146
Source Line
171
Source File
E:/TSE/Projects-CloneDR/columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/ContactDNDListView.java

/**
 * is invoked if the use modifies the current drop gesture
 * 
 */
public void dropActionChanged(DropTargetDragEvent event) {
}

/**
 * a drag gesture has been initiated
 * 
 */
public void dragGestureRecognized(DragGestureEvent event) {
  if (dndAction == false) {
    /*
     * HeaderItem[] items = new HeaderItem[selection1.length]; items =
     * selection1;
     * HeaderItemDNDManager.getInstance().setHeaderItemList(items);
     */
    if (selection1 == null) {
      IHeaderItem[] items = new IHeaderItem[1];
      items[0] = (IHeaderItem) getSelectedValue();
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
    else
      if (selection1.length != 0) {
        IHeaderItem[] items = new IHeaderItem[selection1.length];
        items = selection1;
        HeaderItemDNDManager.getInstance().setHeaderItemList(items);
      }
  /*
   * else {
   * 
   * HeaderItem[] items = new HeaderItem[1]; items[0] = (HeaderItem)
   * getSelectedValue();
   * HeaderItemDNDManager.getInstance().setHeaderItemList(items); }
   */
  }
  else {
    /*
     * HeaderItem[] items = new HeaderItem[selection2.length]; items =
     * selection2;
     * HeaderItemDNDManager.getInstance().setHeaderItemList(items);
     */
    if (selection2.length != 0) {
      IHeaderItem[] items = new IHeaderItem[selection2.length];
      items = selection2;
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
    else {
      IHeaderItem[] items = new IHeaderItem[1];
      items[0] = (IHeaderItem) getSelectedValue();
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
  }
  /*
   * dragSource.startDrag( event, new Cursor(Cursor.DEFAULT_CURSOR),
   * ImageLoader.getImageIcon("contact_small","Add16").getImage(), new
   * Point(5, 5), new StringSelection("contact"), this);
   */
  StringSelection text = new StringSelection("contact");
  dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this );
  clearSelection();
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * has ended
 * 
 */
public void dragDropEnd(DragSourceDropEvent event) {
  if (event.getDropSuccess()) {
    if (acceptDrop == true) {
      IHeaderItem[] items = HeaderItemDNDManager.getInstance().getHeaderItemList();
      for (int i = 0; i < items.length; i++) {
        ((ContactListModel) getModel()).removeElement(items[i]);
      }
    // removeElement();
    }
  }
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * has entered the DropSite
 * 
 */
public void dragEnter(DragSourceDragEvent event) {
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * has exited the DropSite
 * 
 */
public void dragExit(DragSourceEvent event) {
}

/**
 * this message goes to DragSourceListener, informing it that the dragging
 * is currently ocurring over the DropSite
 * 
 */
public void dragOver(DragSourceDragEvent event) {
}

/**
 * is invoked when the user changes the dropAction
 * 
 */
public void dropActionChanged(DragSourceDragEvent event) {
}

/**
 * adds elements to itself
 * 
 */
/**
 * removes an element from itself
 */
public void removeElement() {
  ((ContactListModel) getModel()).removeElement((IHeaderItem) getSelectedValue());
}

public void valueChanged(ListSelectionEvent e) {
  if (dndAction == true) {
    Object[] list = getSelectedValues();
    selection1 = new IHeaderItem[list.length];
    for (int i = 0; i < list.length; i++) {
      selection1[i] = (IHeaderItem) list[i];
    }
    dndAction = false;
  }
  else {
    Object[] list = getSelectedValues();
    selection2 = new IHeaderItem[list.length];
    for (int i = 0; i < list.length; i++) {
      selection2[i] = (IHeaderItem) list[i];
    }
    dndAction = true;
  }
}


Clone AbstractionParameter Count: 2Parameter Bindings

/**
         * is invoked if the use modifies the current drop gesture
         * 
         */
public void dropActionChanged(DropTargetDragEvent event) {
}

/**
         * a drag gesture has been initiated
         * 
         */
public void dragGestureRecognized(DragGestureEvent event) {
  if (dndAction == false) {
    /*
                             * HeaderItem[] items = new HeaderItem[selection1.length]; items =
                             * selection1;
                             * HeaderItemDNDManager.getInstance().setHeaderItemList(items);
                             */
    if (selection1 == null) {
       [[#variable1135e800]][] items = new [[#variable1135e800]][1];
      items[0] = ( [[#variable1135e800]]) getSelectedValue();
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
    else
      if (selection1.length != 0) {
         [[#variable1135e800]][] items = new [[#variable1135e800]][selection1.length];
        items = selection1;
        HeaderItemDNDManager.getInstance().setHeaderItemList(items);
      }
  /*
                           * else {
                           * 
                           * HeaderItem[] items = new HeaderItem[1]; items[0] = (HeaderItem)
                           * getSelectedValue();
                           * HeaderItemDNDManager.getInstance().setHeaderItemList(items); }
                           */
  }
  else {
    /*
                             * HeaderItem[] items = new HeaderItem[selection2.length]; items =
                             * selection2;
                             * HeaderItemDNDManager.getInstance().setHeaderItemList(items);
                             */
    if (selection2.length != 0) {
       [[#variable1135e800]][] items = new [[#variable1135e800]][selection2.length];
      items = selection2;
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
    else {
       [[#variable1135e800]][] items = new [[#variable1135e800]][1];
      items[0] = ( [[#variable1135e800]]) getSelectedValue();
      HeaderItemDNDManager.getInstance().setHeaderItemList(items);
    }
  }
  /*
                   * dragSource.startDrag( event, new Cursor(Cursor.DEFAULT_CURSOR),
                   * ImageLoader.getImageIcon("contact_small","Add16").getImage(), new
                   * Point(5, 5), new StringSelection("contact"), this);
                   */
  StringSelection text = new StringSelection("contact");
  dragSource.startDrag(event, DragSource.DefaultMoveDrop, text, this );
  clearSelection();
}

/**
         * this message goes to DragSourceListener, informing it that the dragging
         * has ended
         * 
         */
public void dragDropEnd(DragSourceDropEvent event) {
  if (event.getDropSuccess()) {
    if (acceptDrop == true) {
       [[#variable1135e800]][] items = HeaderItemDNDManager.getInstance().getHeaderItemList();
      for (int i = 0; i < items.length; i++) {
        (( [[#variable1135e780]]) getModel()).removeElement(items[i]);
      }
    // removeElement();
    }
  }
}

/**
         * this message goes to DragSourceListener, informing it that the dragging
         * has entered the DropSite
         * 
         */
public void dragEnter(DragSourceDragEvent event) {
}

/**
         * this message goes to DragSourceListener, informing it that the dragging
         * has exited the DropSite
         * 
         */
public void dragExit(DragSourceEvent event) {
}

/**
         * this message goes to DragSourceListener, informing it that the dragging
         * is currently ocurring over the DropSite
         * 
         */
public void dragOver(DragSourceDragEvent event) {
}

/**
         * is invoked when the user changes the dropAction
         * 
         */
public void dropActionChanged(DragSourceDragEvent event) {
}

/**
         * adds elements to itself
         * 
         */
/**
         * removes an element from itself
         */
public void removeElement() {
  (( [[#variable1135e780]]) getModel()).removeElement(( [[#variable1135e800]]) getSelectedValue());
}

public void valueChanged(ListSelectionEvent e) {
  if (dndAction == true) {
    Object[] list = getSelectedValues();
    selection1 = new [[#variable1135e800]][list.length];
    for (int i = 0; i < list.length; i++) {
      selection1[i] = ( [[#variable1135e800]]) list[i];
    }
    dndAction = false;
  }
  else {
    Object[] list = getSelectedValues();
    selection2 = new [[#variable1135e800]][list.length];
    for (int i = 0; i < list.length; i++) {
      selection2[i] = ( [[#variable1135e800]]) list[i];
    }
    dndAction = true;
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#1135e800]]
IBasicModelPartial 
12[[#1135e800]]
IHeaderItem 
21[[#1135e780]]
AddressbookListModel 
22[[#1135e780]]
ContactListModel