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


Java BoundedRangeModel.setMaximum方法代码示例

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


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

示例1: componentResized

import javax.swing.BoundedRangeModel; //导入方法依赖的package包/类
@Override
     public void componentResized(ComponentEvent event) {
boolean adjustViewportToBottom = false;

BoundedRangeModel model = scrollBar.getModel();
if ((model.getValue() == model.getMaximum() - model.getExtent())
		|| model.getExtent() >= model.getMaximum()) {
	adjustViewportToBottom = true;
}

model.setExtent(viewport.getHeight());
model.setMaximum(viewport.getView().getHeight());

if (adjustViewportToBottom || !isActive) {
	model.setValue(viewport.getView().getHeight() - viewport.getHeight());
}
     }
 
开发者ID:georgy,项目名称:gmc,代码行数:18,代码来源:SplitTextPane.java

示例2: clear

import javax.swing.BoundedRangeModel; //导入方法依赖的package包/类
public void clear() {
	BoundedRangeModel progressModel = progressBar.getModel();
	progressModel.setValue(0);
	progressModel.setMinimum(0);
	progressModel.setMaximum(0);
	progressBar.setString("");
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:8,代码来源:ProgressBarMonitor.java

示例3: start

import javax.swing.BoundedRangeModel; //导入方法依赖的package包/类
@Override
public void start(String taskName, int totalWork) {
	clear();
	progressBar.setString(taskName);
	BoundedRangeModel progressModel = progressBar.getModel();
	progressModel.setMaximum(totalWork);
}
 
开发者ID:link-intersystems,项目名称:GitDirStat,代码行数:8,代码来源:ProgressBarMonitor.java

示例4: updateScrollbar

import javax.swing.BoundedRangeModel; //导入方法依赖的package包/类
private void updateScrollbar() {
    if (null == scrollBar) {
        return;
    }
    if (null == model || model.getSize() == 0) {
        internalScrollbarValueIsAdjusting = true;
        scrollBar.getModel().setRangeProperties(0, 0, 0, 0, false);
        internalScrollbarValueIsAdjusting = false;
        scrollBar.setEnabled(false);
        return;
    }
    if (! scrollBar.isEnabled()) {
        scrollBar.setEnabled(true);
    }
    int size = model.getSize();
    int firstDispIdx = getFirstDisplayedIdx();
    int displayedCount = getRowCount() * getColumnCount();
    int lastDispIdx = firstDispIdx + displayedCount - 1;
    if (lastDispIdx >= size) {
        lastDispIdx = size - 1;
    }
    BoundedRangeModel scrollModel = scrollBar.getModel();
    internalScrollbarValueIsAdjusting = true;
    scrollModel.setMinimum(0);
    scrollModel.setMaximum(size - 1);
    scrollModel.setValue(firstDispIdx);
    scrollModel.setExtent(displayedCount - 1);
    internalScrollbarValueIsAdjusting = false;
    scrollBar.setUnitIncrement(getColumnCount());
    scrollBar.setBlockIncrement(displayedCount);
}
 
开发者ID:Sofd,项目名称:sofd_swing,代码行数:32,代码来源:JGridList.java

示例5: perform

import javax.swing.BoundedRangeModel; //导入方法依赖的package包/类
public final void perform() {
    Heap heap = context.getHeap();
    @SuppressWarnings("unchecked")
    List<JavaClass> classes = heap.getAllClasses();
    List<JavaClass> matching = new ArrayList<JavaClass>();
    int count = 0;

    for (JavaClass cls : classes) {
        if (classNamePattern.matcher(cls.getName()).matches()) {
            matching.add(cls);
            count += cls.getInstancesCount();
        }

        if (context.isInterruped()) {
            return;
        }
    }

    BoundedRangeModel progress = context.getProgress();
    progress.setMaximum((count != 0) ? count : 1);

    for (JavaClass actCls : matching) {
        @SuppressWarnings("unchecked")
        List<Instance> instances = actCls.getInstances();

        for (Instance inst : instances) {
            Logger.getLogger(IteratingRule.class.getName()).log(Level.FINE, "Executing rule on {0} instance", inst); // NOI18N
            perform(inst);
            progress.setValue(progress.getValue() + 1);

            if (context.isInterruped()) {
                return;
            }
        }
    }

    if (count == 0) {
        progress.setValue(1);
    }

    summary();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:43,代码来源:IteratingRule.java


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