001: /*
002: * @(#)Adjustable.java 1.15 06/10/10
003: *
004: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006: *
007: * This program is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU General Public License version
009: * 2 only, as published by the Free Software Foundation.
010: *
011: * This program is distributed in the hope that it will be useful, but
012: * WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * General Public License version 2 for more details (a copy is
015: * included at /legal/license.txt).
016: *
017: * You should have received a copy of the GNU General Public License
018: * version 2 along with this work; if not, write to the Free Software
019: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020: * 02110-1301 USA
021: *
022: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023: * Clara, CA 95054 or visit www.sun.com if you need additional
024: * information or have any questions.
025: *
026: */
027:
028: package java.awt;
029:
030: import java.awt.event.*;
031:
032: /**
033: * The interface for objects which have an adjustable numeric value
034: * contained within a bounded range of values.
035: *
036: * @version 1.10 08/19/02
037: * @author Amy Fowler
038: * @author Tim Prinzing
039: */
040:
041: public interface Adjustable {
042: /**
043: * The horizontal orientation.
044: */
045: public static final int HORIZONTAL = 0;
046: /**
047: * The vertical orientation.
048: */
049: public static final int VERTICAL = 1;
050:
051: /**
052: * Indicates that the <code>Adjustable</code> has no orientation.
053: */
054: public static final int NO_ORIENTATION = 2;
055:
056: /**
057: * Gets the orientation of the adjustable object.
058: */
059: int getOrientation();
060:
061: /**
062: * Sets the minimum value of the adjustable object.
063: * @param min the minimum value
064: */
065: void setMinimum(int min);
066:
067: /**
068: * Gets the minimum value of the adjustable object.
069: */
070: int getMinimum();
071:
072: /**
073: * Sets the maximum value of the adjustable object.
074: * @param max the maximum value
075: */
076: void setMaximum(int max);
077:
078: /**
079: * Gets the maximum value of the adjustable object.
080: */
081: int getMaximum();
082:
083: /**
084: * Sets the unit value increment for the adjustable object.
085: * @param u the unit increment
086: */
087: void setUnitIncrement(int u);
088:
089: /**
090: * Gets the unit value increment for the adjustable object.
091: */
092: int getUnitIncrement();
093:
094: /**
095: * Sets the block value increment for the adjustable object.
096: * @param b the block increment
097: */
098: void setBlockIncrement(int b);
099:
100: /**
101: * Gets the block value increment for the adjustable object.
102: */
103: int getBlockIncrement();
104:
105: /**
106: * Sets the length of the proportionl indicator of the
107: * adjustable object.
108: * @param v the length of the indicator
109: */
110: void setVisibleAmount(int v);
111:
112: /**
113: * Gets the length of the propertional indicator.
114: */
115: int getVisibleAmount();
116:
117: /**
118: * Sets the current value of the adjustable object. This
119: * value must be within the range defined by the minimum and
120: * maximum values for this object.
121: * @param v the current value
122: */
123: void setValue(int v);
124:
125: /**
126: * Gets the current value of the adjustable object.
127: */
128: int getValue();
129:
130: /**
131: * Add a listener to recieve adjustment events when the value of
132: * the adjustable object changes.
133: * @param l the listener to recieve events
134: * @see AdjustmentEvent
135: */
136: void addAdjustmentListener(AdjustmentListener l);
137:
138: /**
139: * Removes an adjustment listener.
140: * @param l the listener being removed
141: * @see AdjustmentEvent
142: */
143: void removeAdjustmentListener(AdjustmentListener l);
144: }
|