1 7 8 package java.awt.event; 9 10 import java.awt.Adjustable ; 11 import java.awt.AWTEvent ; 12 import java.awt.Event ; 13 14 23 public class AdjustmentEvent extends AWTEvent { 24 25 28 public static final int ADJUSTMENT_FIRST = 601; 29 30 33 public static final int ADJUSTMENT_LAST = 601; 34 35 38 public static final int ADJUSTMENT_VALUE_CHANGED = ADJUSTMENT_FIRST; 40 43 public static final int UNIT_INCREMENT = 1; 44 45 48 public static final int UNIT_DECREMENT = 2; 49 50 53 public static final int BLOCK_DECREMENT = 3; 54 55 58 public static final int BLOCK_INCREMENT = 4; 59 60 63 public static final int TRACK = 5; 64 65 71 Adjustable adjustable; 72 73 81 int value; 82 83 93 int adjustmentType; 94 95 96 104 boolean isAdjusting; 105 106 107 110 private static final long serialVersionUID = 5700290645205279921L; 111 112 113 129 public AdjustmentEvent(Adjustable source, int id, int type, int value) { 130 this(source, id, type, value, false); 131 } 132 133 152 public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting) { 153 super(source, id); 154 adjustable = source; 155 this.adjustmentType = type; 156 this.value = value; 157 this.isAdjusting = isAdjusting; 158 } 159 160 165 public Adjustable getAdjustable() { 166 return adjustable; 167 } 168 169 174 public int getValue() { 175 return value; 176 } 177 178 190 public int getAdjustmentType() { 191 return adjustmentType; 192 } 193 194 201 public boolean getValueIsAdjusting() { 202 return isAdjusting; 203 } 204 205 public String paramString() { 206 String typeStr; 207 switch(id) { 208 case ADJUSTMENT_VALUE_CHANGED: 209 typeStr = "ADJUSTMENT_VALUE_CHANGED"; 210 break; 211 default: 212 typeStr = "unknown type"; 213 } 214 String adjTypeStr; 215 switch(adjustmentType) { 216 case UNIT_INCREMENT: 217 adjTypeStr = "UNIT_INCREMENT"; 218 break; 219 case UNIT_DECREMENT: 220 adjTypeStr = "UNIT_DECREMENT"; 221 break; 222 case BLOCK_INCREMENT: 223 adjTypeStr = "BLOCK_INCREMENT"; 224 break; 225 case BLOCK_DECREMENT: 226 adjTypeStr = "BLOCK_DECREMENT"; 227 break; 228 case TRACK: 229 adjTypeStr = "TRACK"; 230 break; 231 default: 232 adjTypeStr = "unknown type"; 233 } 234 return typeStr 235 + ",adjType="+adjTypeStr 236 + ",value="+value 237 + ",isAdjusting="+isAdjusting; 238 } 239 } 240 | Popular Tags |