当前位置: 首页>>代码示例>>Java>>正文


Java ListDataEvent.INTERVAL_REMOVED属性代码示例

本文整理汇总了Java中javax.swing.event.ListDataEvent.INTERVAL_REMOVED属性的典型用法代码示例。如果您正苦于以下问题:Java ListDataEvent.INTERVAL_REMOVED属性的具体用法?Java ListDataEvent.INTERVAL_REMOVED怎么用?Java ListDataEvent.INTERVAL_REMOVED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.swing.event.ListDataEvent的用法示例。


在下文中一共展示了ListDataEvent.INTERVAL_REMOVED属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fireChange

private void fireChange (ListDataEvent ev) {
    if (list.getListenerCount () == 0) {
        return ;
    }
    Object[] arr = list.getListenerList ();
    for (int i = arr.length - 1; i >= 0; i -= 2) {
        ListDataListener l = (ListDataListener)arr[i];
        switch (ev.getType ()) {
            case ListDataEvent.CONTENTS_CHANGED: l.contentsChanged (ev); break;
            case ListDataEvent.INTERVAL_ADDED: l.intervalAdded (ev); break;
            case ListDataEvent.INTERVAL_REMOVED: l.intervalRemoved (ev); break;
            default:
                throw new IllegalArgumentException  ("Unknown type: " + ev.getType ());
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:FilteredListModel.java

示例2: fireListDataEvent

private void fireListDataEvent(int type, int index1, int index2) {
    ListDataEvent event = new ListDataEvent(this, type, index1, index2);

    for (ListDataListener listener : dataListeners) {
        switch (type) {
            case ListDataEvent.CONTENTS_CHANGED: {
                listener.contentsChanged(event);
                break;
            }

            case ListDataEvent.INTERVAL_ADDED: {
                listener.intervalAdded(event);
                break;
            }

            case ListDataEvent.INTERVAL_REMOVED: {
                listener.intervalRemoved(event);
                break;
            }
        }

    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:23,代码来源:LogDevicesComboBoxSupport.java

示例3: removeTab

@Override
public void removeTab(int index) {
    TabData[] td = new TabData[]{(TabData) list.get(index)};
    list.remove(index);
    ComplexListDataEvent lde = new ComplexListDataEvent(this,
                                                        ListDataEvent.INTERVAL_REMOVED,
                                                        index, index);
    lde.setAffectedItems(td);
    fireIntervalRemoved(lde);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DefaultTabDataModel.java

示例4: removeTabs

/**
 * Remove a range of tabs from <code>start</code> up to <i>and including</i> 
 * <code>finish</code>.
 */
@Override
public void removeTabs(int start, int end) {
    java.util.List affected = new ArrayList(list.subList(start, end));
    if (start == end) {
        list.remove(start);
    } else {
        list.removeRange(start, end);
    }
    ComplexListDataEvent lde = new ComplexListDataEvent(this,
                                                        ListDataEvent.INTERVAL_REMOVED,
                                                        start, end);
    lde.setAffectedItems((TabData[]) affected.toArray(new TabData[0]));
    fireIntervalRemoved(lde);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:DefaultTabDataModel.java

示例5: notifyRemoval

/** Notifies removal of inteval from (inclusive) to (exclusive) and
 * updates its structures.
 *
 * !!! as a side effect updates size !!!
 *
 * @return s - number of removals
 */
private void notifyRemoval (int from, int to) {
    ListDataEvent ev = new ListDataEvent (
        this, ListDataEvent.INTERVAL_REMOVED, from, to - 1
    );
    removeInterval (external, from, to);
    int cnt = to - from;
    size -= cnt;

    regenerateCheckedBitSet ();
    fireChange (ev);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:FilteredListModel.java

示例6: dispatchListDataEvent

private void dispatchListDataEvent(final ListDataEvent e) {
    for (final ListDataListener l : m_listeners) {
        if (e.getType() == ListDataEvent.INTERVAL_ADDED) {
            l.intervalAdded(e);
        } else if (e.getType() == ListDataEvent.INTERVAL_REMOVED) {
            l.intervalRemoved(e);
        } else { // CONTENTS_CHANGED
            l.contentsChanged(e);
        }
    }
}
 
开发者ID:knime,项目名称:knime-activelearning,代码行数:11,代码来源:ClassModel.java


注:本文中的javax.swing.event.ListDataEvent.INTERVAL_REMOVED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。