1 7 8 package org.jdesktop.swing.event; 9 10 16 public class ProgressEvent extends MessageEvent { 17 18 private int minimum; 19 private int maximum; 20 private int progress; 21 22 private boolean indeterminate = true; 23 24 27 public ProgressEvent(Object source) { 28 super(source); 29 } 30 31 38 public ProgressEvent(Object source, int progress) { 39 super(source); 40 this.progress = progress; 41 setIndeterminate(false); 42 } 43 44 53 public ProgressEvent(Object source, int min, int max) { 54 super(source); 55 setMaximum(max); 56 setMinimum(min); 57 setIndeterminate(max == min); 58 } 59 60 private void setMaximum(int max) { 61 this.maximum = max; 62 } 63 64 public int getMaximum() { 65 return maximum; 66 } 67 68 private void setMinimum(int min) { 69 this.minimum = min; 70 } 71 72 public int getMinimum() { 73 return minimum; 74 } 75 76 private void setIndeterminate(boolean indeterminate) { 77 this.indeterminate = indeterminate; 78 } 79 80 public boolean isIndeterminate() { 81 return indeterminate; 82 } 83 84 public int getProgress() { 85 return progress; 86 } 87 } 88 | Popular Tags |