本文整理汇总了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());
}
}
示例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("");
}
示例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);
}
示例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);
}
示例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();
}