Example usage for javax.swing.event ListDataListener intervalAdded

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

Introduction

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

Prototype

void intervalAdded(ListDataEvent e);

Source Link

Document

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

Usage

From source file:blue.automation.ParameterIdList.java

private void fireAddDataEvent(ListDataEvent lde) {
    if (listListeners == null) {
        return;/* ww  w.ja  va  2  s .  c o m*/
    }

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

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

From source file:blue.mixer.EffectsChain.java

private void fireAddDataEvent(ListDataEvent lde) {
    if (listeners == null) {
        return;/*www . jav  a2  s .com*/
    }

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

From source file:blue.mixer.ChannelList.java

private void fireListEvent(ListDataEvent lde) {
    if (listeners == null) {
        return;// w w  w.  j  a  va 2s .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 addElement(Object item) {
    if (!itemList.contains(item)) {
        itemList.add(item);/*from w w  w  .  jav a2s  . com*/
        ListDataEvent eve = new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, itemList.size() - 1,
                itemList.size() - 1);
        for (ListDataListener listener : listenerList) {
            listener.intervalAdded(eve);
        }
    }
}

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

@Test
public void testContentsUpdateAddStart() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 0, 0)));
    replay(mock);/*from  w  w  w . j a  v  a2  s . co m*/
    d_outer.addListDataListener(mock);
    d_inner.add(0, "Bart");
    assertEquals("Bart", d_outer.get(0));
    verify(mock);
}

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

@Test
public void testContentsUpdateAddEnd() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 2, 2)));
    replay(mock);//from   w w w .ja  va  2 s .c  o  m
    d_outer.addListDataListener(mock);
    d_inner.add("Bart");
    assertEquals("Bart", d_outer.get(2));
    verify(mock);
}

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

@Test
public void testContentsUpdateAddIndex() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 1, 1)));
    replay(mock);//from   w  ww. java 2 s.  c  o m
    d_outer.addListDataListener(mock);
    d_inner.add(2, "Henk");
    assertEquals(Arrays.asList("Gert", "Henk", "Jan"), d_outer);
    verify(mock);
}

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

@Test
public void testContentsUpdateAddAllIndex() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 1, 2)));
    replay(mock);//from  ww  w .j av a2s  .c  o m
    d_outer.addListDataListener(mock);
    d_inner.addAll(2, Arrays.asList("Henk", "Bart"));
    assertEquals(Arrays.asList("Gert", "Henk", "Bart", "Jan"), d_outer);
    verify(mock);
}

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

@Test
public void testContentsUpdateAddAllEnd() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 2, 3)));
    replay(mock);//from   w  w  w .j  av  a 2  s  . c om
    d_outer.addListDataListener(mock);
    d_inner.addAll(Arrays.asList("Henk", "Bart"));
    assertEquals(Arrays.asList("Gert", "Jan", "Henk", "Bart"), d_outer);
    verify(mock);
}

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

@Test
public void testContentsUpdateSetChangeAdd() {
    ListDataListener mock = createStrictMock(ListDataListener.class);
    mock.intervalAdded(ListDataEventMatcher
            .eqListDataEvent(new ListDataEvent(d_outer, ListDataEvent.INTERVAL_ADDED, 1, 1)));
    replay(mock);/* ww w .jav  a2s . com*/
    d_outer.addListDataListener(mock);
    d_inner.set(1, "Kees");
    assertEquals(Arrays.asList("Gert", "Kees", "Jan"), d_outer);
    verify(mock);
}