KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > Adjustable


1 /*
2  * @(#)Adjustable.java 1.18 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt;
9
10 import java.awt.event.*;
11
12 /**
13  * The interface for objects which have an adjustable numeric value
14  * contained within a bounded range of values.
15  *
16  * @version 1.18 12/19/03
17  * @author Amy Fowler
18  * @author Tim Prinzing
19  */

20
21 public interface Adjustable {
22
23     /**
24      * Indicates that the <code>Adjustable</code> has horizontal orientation.
25      */

26     public static final int HORIZONTAL = 0;
27
28     /**
29      * Indicates that the <code>Adjustable</code> has vertical orientation.
30      */

31     public static final int VERTICAL = 1;
32
33     /**
34      * Indicates that the <code>Adjustable</code> has no orientation.
35      */

36     public static final int NO_ORIENTATION = 2;
37
38     /**
39      * Gets the orientation of the adjustable object.
40      * @return the orientation of the adjustable object;
41      * either <code>HORIZONTAL</code>, <code>VERTICAL</code>,
42      * or <code>NO_ORIENTATION</code>
43      */

44     int getOrientation();
45
46     /**
47      * Sets the minimum value of the adjustable object.
48      * @param min the minimum value
49      */

50     void setMinimum(int min);
51
52     /**
53      * Gets the minimum value of the adjustable object.
54      * @return the minimum value of the adjustable object
55      */

56     int getMinimum();
57
58     /**
59      * Sets the maximum value of the adjustable object.
60      * @param max the maximum value
61      */

62     void setMaximum(int max);
63
64     /**
65      * Gets the maximum value of the adjustable object.
66      * @return the maximum value of the adjustable object
67      */

68     int getMaximum();
69
70     /**
71      * Sets the unit value increment for the adjustable object.
72      * @param u the unit increment
73      */

74     void setUnitIncrement(int u);
75
76     /**
77      * Gets the unit value increment for the adjustable object.
78      * @return the unit value increment for the adjustable object
79      */

80     int getUnitIncrement();
81
82     /**
83      * Sets the block value increment for the adjustable object.
84      * @param b the block increment
85      */

86     void setBlockIncrement(int b);
87
88     /**
89      * Gets the block value increment for the adjustable object.
90      * @return the block value increment for the adjustable object
91      */

92     int getBlockIncrement();
93
94     /**
95      * Sets the length of the proportional indicator of the
96      * adjustable object.
97      * @param v the length of the indicator
98      */

99     void setVisibleAmount(int v);
100
101     /**
102      * Gets the length of the proportional indicator.
103      * @return the length of the proportional indicator
104      */

105     int getVisibleAmount();
106
107     /**
108      * Sets the current value of the adjustable object. If
109      * the value supplied is less than <code>minimum</code>
110      * or greater than <code>maximum</code> - <code>visibleAmount</code>,
111      * then one of those values is substituted, as appropriate.
112      * <p>
113      * Calling this method does not fire an
114      * <code>AdjustmentEvent</code>.
115      *
116      * @param v the current value, between <code>minimum</code>
117      * and <code>maximum</code> - <code>visibleAmount</code>
118      */

119     void setValue(int v);
120
121     /**
122      * Gets the current value of the adjustable object.
123      * @return the current value of the adjustable object
124      */

125     int getValue();
126
127     /**
128      * Adds a listener to receive adjustment events when the value of
129      * the adjustable object changes.
130      * @param l the listener to receive events
131      * @see AdjustmentEvent
132      */

133     void addAdjustmentListener(AdjustmentListener l);
134
135     /**
136      * Removes an adjustment listener.
137      * @param l the listener being removed
138      * @see AdjustmentEvent
139      */

140     void removeAdjustmentListener(AdjustmentListener l);
141
142 }
143
Popular Tags