22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.awt; 27 28 import java.awt.event.*; 29 30 import java.lang.annotation.Native; 31 32 /** 33 * The interface for objects which have an adjustable numeric value 34 * contained within a bounded range of values. 35 * 36 * @author Amy Fowler 37 * @author Tim Prinzing 38 */ 39 public interface Adjustable { 40 41 /** 42 * Indicates that the <code>Adjustable</code> has horizontal orientation. 43 */ 44 @Native public static final int HORIZONTAL = 0; 45 46 /** 47 * Indicates that the <code>Adjustable</code> has vertical orientation. 48 */ 49 @Native public static final int VERTICAL = 1; 50 51 /** 52 * Indicates that the <code>Adjustable</code> has no orientation. 53 */ 54 @Native public static final int NO_ORIENTATION = 2; 55 56 /** 57 * Gets the orientation of the adjustable object. 58 * @return the orientation of the adjustable object; 59 * either <code>HORIZONTAL</code>, <code>VERTICAL</code>, 60 * or <code>NO_ORIENTATION</code> 61 */ 62 int getOrientation(); 63 64 /** 65 * Sets the minimum value of the adjustable object. 66 * @param min the minimum value 67 */ 68 void setMinimum(int min); 69 70 /** 71 * Gets the minimum value of the adjustable object. 72 * @return the minimum value of the adjustable object 73 */ 74 int getMinimum(); 75 76 /** 77 * Sets the maximum value of the adjustable object. 78 * @param max the maximum value 79 */ 80 void setMaximum(int max); 107 * Gets the block value increment for the adjustable object. 108 * @return the block value increment for the adjustable object 109 */ 110 int getBlockIncrement(); 111 112 /** 113 * Sets the length of the proportional indicator of the 114 * adjustable object. 115 * @param v the length of the indicator 116 */ 117 void setVisibleAmount(int v); 118 119 /** 120 * Gets the length of the proportional indicator. 121 * @return the length of the proportional indicator 122 */ 123 int getVisibleAmount(); 124 125 /** 126 * Sets the current value of the adjustable object. If 127 * the value supplied is less than <code>minimum</code> 128 * or greater than <code>maximum</code> - <code>visibleAmount</code>, 129 * then one of those values is substituted, as appropriate. 130 * <p> 131 * Calling this method does not fire an 132 * <code>AdjustmentEvent</code>. 133 * 134 * @param v the current value, between <code>minimum</code> 135 * and <code>maximum</code> - <code>visibleAmount</code> 136 */ 137 void setValue(int v); 138 139 /** 140 * Gets the current value of the adjustable object. 141 * @return the current value of the adjustable object 142 */ 143 int getValue(); 144 145 /** 146 * Adds a listener to receive adjustment events when the value of 147 * the adjustable object changes. 148 * @param l the listener to receive events 149 * @see AdjustmentEvent 150 */ 151 void addAdjustmentListener(AdjustmentListener l); 152 153 /** 154 * Removes an adjustment listener. 155 * @param l the listener being removed | 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.awt; 27 28 import java.awt.event.*; 29 30 import java.lang.annotation.Native; 31 32 /** 33 * The interface for objects which have an adjustable numeric value 34 * contained within a bounded range of values. 35 * 36 * @author Amy Fowler 37 * @author Tim Prinzing 38 */ 39 public interface Adjustable { 40 41 /** 42 * Indicates that the {@code Adjustable} has horizontal orientation. 43 */ 44 @Native public static final int HORIZONTAL = 0; 45 46 /** 47 * Indicates that the {@code Adjustable} has vertical orientation. 48 */ 49 @Native public static final int VERTICAL = 1; 50 51 /** 52 * Indicates that the {@code Adjustable} has no orientation. 53 */ 54 @Native public static final int NO_ORIENTATION = 2; 55 56 /** 57 * Gets the orientation of the adjustable object. 58 * @return the orientation of the adjustable object; 59 * either {@code HORIZONTAL}, {@code VERTICAL}, 60 * or {@code NO_ORIENTATION} 61 */ 62 int getOrientation(); 63 64 /** 65 * Sets the minimum value of the adjustable object. 66 * @param min the minimum value 67 */ 68 void setMinimum(int min); 69 70 /** 71 * Gets the minimum value of the adjustable object. 72 * @return the minimum value of the adjustable object 73 */ 74 int getMinimum(); 75 76 /** 77 * Sets the maximum value of the adjustable object. 78 * @param max the maximum value 79 */ 80 void setMaximum(int max); 107 * Gets the block value increment for the adjustable object. 108 * @return the block value increment for the adjustable object 109 */ 110 int getBlockIncrement(); 111 112 /** 113 * Sets the length of the proportional indicator of the 114 * adjustable object. 115 * @param v the length of the indicator 116 */ 117 void setVisibleAmount(int v); 118 119 /** 120 * Gets the length of the proportional indicator. 121 * @return the length of the proportional indicator 122 */ 123 int getVisibleAmount(); 124 125 /** 126 * Sets the current value of the adjustable object. If 127 * the value supplied is less than {@code minimum} 128 * or greater than {@code maximum} - {@code visibleAmount}, 129 * then one of those values is substituted, as appropriate. 130 * <p> 131 * Calling this method does not fire an 132 * {@code AdjustmentEvent}. 133 * 134 * @param v the current value, between {@code minimum} 135 * and {@code maximum} - {@code visibleAmount} 136 */ 137 void setValue(int v); 138 139 /** 140 * Gets the current value of the adjustable object. 141 * @return the current value of the adjustable object 142 */ 143 int getValue(); 144 145 /** 146 * Adds a listener to receive adjustment events when the value of 147 * the adjustable object changes. 148 * @param l the listener to receive events 149 * @see AdjustmentEvent 150 */ 151 void addAdjustmentListener(AdjustmentListener l); 152 153 /** 154 * Removes an adjustment listener. 155 * @param l the listener being removed |