< prev index next >

src/java.desktop/unix/classes/sun/awt/X11/XListPeer.java

Print this page

        

*** 74,84 **** boolean multipleSelections; int active = NONE; // Holds the array of the indexes of the elements which is selected // This array should be kept sorted, low to high. ! int selected[]; int fontHeight; int fontAscent; int fontLeading; // Holds the index of the item used in the previous operation (selectItem, deselectItem) --- 74,84 ---- boolean multipleSelections; int active = NONE; // Holds the array of the indexes of the elements which is selected // This array should be kept sorted, low to high. ! int[] selected; int fontHeight; int fontAscent; int fontLeading; // Holds the index of the item used in the previous operation (selectItem, deselectItem)
*** 172,182 **** // NOTE: needs to have target set maxLength = maxLength(); // get the index containing all indexes to selected items ! int sel[] = l.getSelectedIndexes(); selected = new int[sel.length]; // TODO: shouldn't this be arraycopy()? for (int i = 0 ; i < sel.length ; i ++) { selected[i] = sel[i]; } --- 172,182 ---- // NOTE: needs to have target set maxLength = maxLength(); // get the index containing all indexes to selected items ! int[] sel = l.getSelectedIndexes(); selected = new int[sel.length]; // TODO: shouldn't this be arraycopy()? for (int i = 0 ; i < sel.length ; i ++) { selected[i] = sel[i]; }
*** 1145,1155 **** // delete the items out of the items list and out of the selected list for (int i = s ; i <= e ; i++) { items.removeElementAt(s); int j = posInSel(i); if (j != -1) { ! int newsel[] = new int[selected.length - 1]; System.arraycopy(selected, 0, newsel, 0, j); System.arraycopy(selected, j + 1, newsel, j, selected.length - (j + 1)); selected = newsel; } --- 1145,1155 ---- // delete the items out of the items list and out of the selected list for (int i = s ; i <= e ; i++) { items.removeElementAt(s); int j = posInSel(i); if (j != -1) { ! int[] newsel = new int[selected.length - 1]; System.arraycopy(selected, 0, newsel, 0, j); System.arraycopy(selected, j + 1, newsel, j, selected.length - (j + 1)); selected = newsel; }
*** 1244,1254 **** repaint(oldSel, oldSel, PAINT_ITEMS); } } } else { // insert "index" into the selection array ! int newsel[] = new int[selected.length + 1]; int i = 0; while (i < selected.length && index > selected[i]) { newsel[i] = selected[i]; i++; } --- 1244,1254 ---- repaint(oldSel, oldSel, PAINT_ITEMS); } } } else { // insert "index" into the selection array ! int[] newsel = new int[selected.length + 1]; int i = 0; while (i < selected.length && index > selected[i]) { newsel[i] = selected[i]; i++; }
*** 1282,1292 **** // TODO: keep an int[0] and int[1] around and just use them instead // creating new ones all the time selected = new int[0]; } else { int i = posInSel(index); ! int newsel[] = new int[selected.length - 1]; System.arraycopy(selected, 0, newsel, 0, i); System.arraycopy(selected, i+1, newsel, i, selected.length - (i+1)); selected = newsel; } currentIndex = index; --- 1282,1292 ---- // TODO: keep an int[0] and int[1] around and just use them instead // creating new ones all the time selected = new int[0]; } else { int i = posInSel(index); ! int[] newsel = new int[selected.length - 1]; System.arraycopy(selected, 0, newsel, 0, i); System.arraycopy(selected, i+1, newsel, i, selected.length - (i+1)); selected = newsel; } currentIndex = index;
< prev index next >