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


Java ListDataEvent.getIndex1方法代码示例

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


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

示例1: intervalAdded

import javax.swing.event.ListDataEvent; //导入方法依赖的package包/类
public void intervalAdded(ListDataEvent e) {
    if (container.getContentPolicy() == TabbedContainer.CONTENT_POLICY_ADD_ALL) {
        Component curC = null;
        for (int i = e.getIndex0(); i <= e.getIndex1(); i++) {
            curC = toComp(container.getModel().getTab(i));
            contentDisplayer.add(curC, "");
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DefaultTabbedContainerUI.java

示例2: adjustSelectionForEvent

import javax.swing.event.ListDataEvent; //导入方法依赖的package包/类
private void adjustSelectionForEvent(ListDataEvent e) {
    if (e.getType() == e.CONTENTS_CHANGED || sel == -1) {
        return;
    }
    int start = e.getIndex0();
    int end = e.getIndex1() + 1;
    if (e.getType() == e.INTERVAL_REMOVED) {
        if (sel < start) {
            return;
        } else {
            if (sel >= start) {
                if (sel > end) {
                    sel -= end - start;
                } else {
                    sel = start;
                    if (sel >= dataModel.size()) {
                        sel = dataModel.size() - 1;
                    }
                }
                cs.fireChange();
            }
        }
    } else {
        if (sel < start) {
            //not affected, do nothing
            return;
        }
        if (sel >= start) {
            if (end - 1 == start) {
                sel++;
            } else if (sel < end) {
                sel = (end + (sel - start)) - 1;
            } else {
                sel += (end - start) - 1;
            }
            cs.fireChange();
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:DefaultTabSelectionModel.java

示例3: intervalAdded

import javax.swing.event.ListDataEvent; //导入方法依赖的package包/类
@Override
public void intervalAdded(ListDataEvent e) {
    for (int i = e.getIndex1(); i >= e.getIndex0(); i--) {
        Object obj = listModel.getElementAt(i);
        if (obj instanceof ClassPathSupport.Item) {
            DefaultMutableTreeNode node = toTreeNode(obj);
            treeModel.insertNodeInto(node, (MutableTreeNode)treeModel.getRoot(), e.getIndex0());
            TreePath path = new TreePath(node.getPath());
            tree.setSelectionPath(path);
            tree.makeVisible(path);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:PathsCustomizer.java

示例4: intervalRemoved

import javax.swing.event.ListDataEvent; //导入方法依赖的package包/类
@Override
public void intervalRemoved(ListDataEvent e) {
    for (int i = e.getIndex1(); i >= e.getIndex0(); i--) {
        treeModel.removeNodeFromParent((MutableTreeNode)treeModel.getChild(treeModel.getRoot(), i));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:PathsCustomizer.java


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