Example usage for javax.swing.event ListDataListener intervalRemoved

List of usage examples for javax.swing.event ListDataListener intervalRemoved

Introduction

In this page you can find the example usage for javax.swing.event ListDataListener intervalRemoved.

Prototype

void intervalRemoved(ListDataEvent e);

Source Link

Document

Sent after the indices in the index0,index1 interval have been removed from the data model.

Usage

From source file:blue.automation.ParameterIdList.java

private void fireRemoveDataEvent(ListDataEvent lde) {
    if (listListeners == null) {
        return;/*  www . ja v a2s .c  o  m*/
    }

    Iterator iter = new Vector(listListeners).iterator();

    while (iter.hasNext()) {
        ListDataListener listener = (ListDataListener) iter.next();
        listener.intervalRemoved(lde);
    }
}

From source file:blue.mixer.EffectsChain.java

private void fireRemoveDataEvent(ListDataEvent lde) {
    if (listeners == null) {
        return;//from   w  w w . ja  v a  2  s.c o m
    }

    for (Iterator iter = listeners.iterator(); iter.hasNext();) {
        ListDataListener listener = (ListDataListener) iter.next();
        listener.intervalRemoved(lde);
    }
}

From source file:blue.mixer.ChannelList.java

private void fireListEvent(ListDataEvent lde) {
    if (listeners == null) {
        return;/*  w  w  w.  j  a  va  2  s.  c  om*/
    }

    for (Iterator<ListDataListener> it = listeners.iterator(); it.hasNext();) {
        ListDataListener listener = it.next();

        switch (lde.getType()) {
        case ListDataEvent.INTERVAL_ADDED:
            listener.intervalAdded(lde);
            break;
        case ListDataEvent.INTERVAL_REMOVED:
            listener.intervalRemoved(lde);
            break;
        }
    }
}

From source file:net.pandoragames.far.ui.swing.FindFilePanel.java

public void removeElementAt(int index) {
    if (index < 0 || index >= itemList.size())
        return;/* www.  j a va 2s  .co m*/
    itemList.remove(index);
    ListDataEvent eve = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, index, index);
    for (ListDataListener listener : listenerList) {
        listener.intervalRemoved(eve);
    }
}

From source file:net.pandoragames.far.ui.swing.FindFilePanel.java

public void removeElement(Object item) {
    if (itemList.contains(item)) {
        int index = itemList.indexOf(item);
        itemList.remove(index);/*w w  w.  java2  s.c  om*/
        ListDataEvent eve = new ListDataEvent(this, ListDataEvent.INTERVAL_REMOVED, index, index);
        for (ListDataListener listener : listenerList) {
            listener.intervalRemoved(eve);
        }
    }
}

From source file:org.drugis.common.beans.FilteredObservableListTest.java

@Test
public void testContentsUpdateRemoveEnd() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalRemoved(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_REMOVED, 1, 1)));
    replay(mock);/*from  w w  w .ja v  a  2 s . c o m*/
    d_outer.addListDataListener(mock);
    d_inner.remove("Jan");
    assertEquals(Arrays.asList("Gert"), d_outer);
    verify(mock);
}

From source file:org.drugis.common.beans.FilteredObservableListTest.java

@Test
public void testContentsUpdateRemoveStart() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalRemoved(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_REMOVED, 0, 0)));
    replay(mock);// ww  w.  j  a  v  a  2 s  . c  om
    d_outer.addListDataListener(mock);
    d_inner.remove("Gert");
    assertEquals(Arrays.asList("Jan"), d_outer);
    verify(mock);
}

From source file:org.drugis.common.beans.FilteredObservableListTest.java

@Test
public void testContentsUpdateRemoveAll() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalRemoved(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_REMOVED, 0, 1)));
    replay(mock);//from  w w  w  .j  av  a2 s. co m
    d_outer.addListDataListener(mock);
    d_inner.clear();
    assertEquals(Collections.emptyList(), d_outer);
    verify(mock);
}

From source file:org.drugis.common.beans.FilteredObservableListTest.java

@Test
public void testContentsUpdateSetChangeRemove() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalRemoved(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_REMOVED, 1, 1)));
    replay(mock);/* w  ww .  java2s.com*/
    d_outer.addListDataListener(mock);
    d_inner.set(2, "Paard");
    assertEquals(Arrays.asList("Gert"), d_outer);
    verify(mock);
}

From source file:org.drugis.common.beans.FilteredObservableListTest.java

@Test
public void testSetFilter() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalRemoved(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_REMOVED, 0, 1)));
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 0, 2)));
    replay(mock);//  w  ww .ja va2  s .c o m
    d_outer.addListDataListener(mock);

    d_outer.setFilter(new Predicate<String>() {
        public boolean evaluate(String str) {
            return !str.equals("Gert");
        }
    });
    assertEquals(Arrays.asList("Daan", "Jan", "Klaas"), d_outer);
    verify(mock);
}