本文整理匯總了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();
}