diff --git a/com/gallery/GalleryRemote/MainFrame.java b/com/gallery/GalleryRemote/MainFrame.java index 52c5dcc..606cbc2 100644 --- a/com/gallery/GalleryRemote/MainFrame.java +++ b/com/gallery/GalleryRemote/MainFrame.java @@ -351,7 +351,6 @@ private void updatePicturesList() { } else { if (jPicturesList.getModel() != currentAlbum) { jPicturesList.setModel( currentAlbum ); - currentAlbum.setListSelectionModel(jPicturesList.getSelectionModel()); currentAlbum.addListDataListener( this ); } diff --git a/com/gallery/GalleryRemote/model/Album.java b/com/gallery/GalleryRemote/model/Album.java index 3a65e4d..9f0b83d 100644 --- a/com/gallery/GalleryRemote/model/Album.java +++ b/com/gallery/GalleryRemote/model/Album.java @@ -27,8 +27,6 @@ import java.util.Vector; import javax.swing.*; -import javax.swing.event.ListDataEvent; -import javax.swing.event.ListDataListener; import com.gallery.GalleryRemote.GalleryCommCapabilities; import com.gallery.GalleryRemote.Log; @@ -54,12 +52,8 @@ public class Album extends Picture implements ListModel, Serializable * LOCAL STORAGE */ Vector pictures = new Vector(); - - /* ------------------------------------------------------------------------- - * WORKAROUND FOR LIST SELECTION BUG - */ - transient ListSelectionModel listSelectionModel; - + + /* ------------------------------------------------------------------------- * SERVER INFO */ @@ -234,16 +228,9 @@ public void clearPictures() { *@param n item number of the picture to remove */ public void removePicture( int n ) { - // deselect pictures pictures at the end of the list so they will - // not cause selection problems (the JList doesn't synch properly - // the selection to the model) - listSelectionModel.removeSelectionInterval(sizePictures() - 1, sizePictures() - 1); - pictures.remove( n ); - //ListDataEvent lde = new ListDataEvent( com.gallery.GalleryRemote.GalleryRemote.getInstance().mainFrame, ListDataEvent.INTERVAL_REMOVED, n, n ); fireIntervalRemoved(this, n, n); - //notifyListeners(lde); } public void removePicture( Picture p ) { @@ -259,19 +246,12 @@ public void removePictures( int[] indices ) { int min, max; min = max = indices[0]; - // deselect pictures pictures at the end of the list so they will - // not cause selection problems (the JList doesn't synch properly - // the selection to the model) - listSelectionModel.removeSelectionInterval(sizePictures() - 1 - indices.length, sizePictures() - 1); - for ( int i = indices.length - 1; i >= 0; i-- ) { pictures.remove( indices[i] ); if (indices[i] > max) max = indices[i]; if (indices[i] < min) min = indices[i]; } - //ListDataEvent lde = new ListDataEvent( com.gallery.GalleryRemote.GalleryRemote.getInstance().mainFrame, ListDataEvent.INTERVAL_REMOVED, min, max ); - //notifyListeners(lde); fireIntervalRemoved(this, min, max); } @@ -434,9 +414,9 @@ && getName() != null } - public void setListSelectionModel(ListSelectionModel listSelectionModel) { - this.listSelectionModel = listSelectionModel; - } + //public void setListSelectionModel(ListSelectionModel listSelectionModel) { + // this.listSelectionModel = listSelectionModel; + //} /* ------------------------------------------------------------------------- @@ -525,8 +505,6 @@ public void setCanCreateSubAlbum( boolean b ){ public boolean getCanCreateSubAlbum(){ return canCreateSubAlbum; } - - /* ------------------------------------------------------------------------- diff --git a/com/gallery/GalleryRemote/model/Picture.java b/com/gallery/GalleryRemote/model/Picture.java index 4b8e486..5b31f69 100644 --- a/com/gallery/GalleryRemote/model/Picture.java +++ b/com/gallery/GalleryRemote/model/Picture.java @@ -46,13 +46,10 @@ public class Picture extends GalleryAbstractListModel implements Serializable, P File source = null; String caption = null; Album album = null; - private int listIndex; transient double fileSize = 0; transient String escapedCaption = null; - transient protected EventListenerList listenerList = new EventListenerList(); - /** * Constructor for the Picture object */ @@ -218,21 +215,6 @@ public Album getAlbum() { return album; } - /** Getter for property listIndex. - * @return Value of property listIndex. - * - */ - public int getListIndex() { - return this.listIndex; - } - - /** Setter for property listIndex. - * @param listIndex New value of property listIndex. - * - */ - public void setListIndex(int listIndex) { - } - public String toString() { return source.getName(); }