本文整理汇总了Java中javax.swing.event.ListDataListener.intervalAdded方法的典型用法代码示例。如果您正苦于以下问题:Java ListDataListener.intervalAdded方法的具体用法?Java ListDataListener.intervalAdded怎么用?Java ListDataListener.intervalAdded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.event.ListDataListener
的用法示例。
在下文中一共展示了ListDataListener.intervalAdded方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: callListenersAdd
import javax.swing.event.ListDataListener; //导入方法依赖的package包/类
private void callListenersAdd(ListEdit<T> edit, ListDataEvent dataEvent) {
assert (!editProtection[0]);
editProtection[0] = true;
try {
if (edit != null) {
addEdit(edit);
}
if (dataEvent != null) {
for (ListDataListener l : listDataListeners) {
l.intervalAdded(dataEvent);
}
}
}
finally {
editProtection[0] = false;
}
}
示例2: fireChange
import javax.swing.event.ListDataListener; //导入方法依赖的package包/类
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 ());
}
}
}
示例3: fireListDataEvent
import javax.swing.event.ListDataListener; //导入方法依赖的package包/类
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;
}
}
}
}
示例4: dispatchListDataEvent
import javax.swing.event.ListDataListener; //导入方法依赖的package包/类
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);
}
}
}
示例5: notifyAllListeners
import javax.swing.event.ListDataListener; //导入方法依赖的package包/类
/**
* Notify all registered observer objects for change in list..
*/
private void notifyAllListeners() {
int newNumber = list.size() - 1;
for (ListDataListener listener : listeners) {
listener.intervalAdded(new ListDataEvent(this,
ListDataEvent.INTERVAL_ADDED, newNumber, newNumber));
}
}
示例6: fireDataAdded
import javax.swing.event.ListDataListener; //导入方法依赖的package包/类
private void fireDataAdded(int start, int stop) {
if (stop <= start) return;
for(ListDataListener l : listeners) {
l.intervalAdded(new ListDataEvent(this, ListDataEvent.INTERVAL_ADDED, start, stop));
}
}