Path: blob/master/src/java.desktop/share/classes/java/awt/Adjustable.java
41152 views
/*1* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.awt;2627import java.awt.event.*;2829import java.lang.annotation.Native;3031/**32* The interface for objects which have an adjustable numeric value33* contained within a bounded range of values.34*35* @author Amy Fowler36* @author Tim Prinzing37*/38public interface Adjustable {3940/**41* Indicates that the {@code Adjustable} has horizontal orientation.42*/43@Native public static final int HORIZONTAL = 0;4445/**46* Indicates that the {@code Adjustable} has vertical orientation.47*/48@Native public static final int VERTICAL = 1;4950/**51* Indicates that the {@code Adjustable} has no orientation.52*/53@Native public static final int NO_ORIENTATION = 2;5455/**56* Gets the orientation of the adjustable object.57* @return the orientation of the adjustable object;58* either {@code HORIZONTAL}, {@code VERTICAL},59* or {@code NO_ORIENTATION}60*/61int getOrientation();6263/**64* Sets the minimum value of the adjustable object.65* @param min the minimum value66*/67void setMinimum(int min);6869/**70* Gets the minimum value of the adjustable object.71* @return the minimum value of the adjustable object72*/73int getMinimum();7475/**76* Sets the maximum value of the adjustable object.77* @param max the maximum value78*/79void setMaximum(int max);8081/**82* Gets the maximum value of the adjustable object.83* @return the maximum value of the adjustable object84*/85int getMaximum();8687/**88* Sets the unit value increment for the adjustable object.89* @param u the unit increment90*/91void setUnitIncrement(int u);9293/**94* Gets the unit value increment for the adjustable object.95* @return the unit value increment for the adjustable object96*/97int getUnitIncrement();9899/**100* Sets the block value increment for the adjustable object.101* @param b the block increment102*/103void setBlockIncrement(int b);104105/**106* Gets the block value increment for the adjustable object.107* @return the block value increment for the adjustable object108*/109int getBlockIncrement();110111/**112* Sets the length of the proportional indicator of the113* adjustable object.114* @param v the length of the indicator115*/116void setVisibleAmount(int v);117118/**119* Gets the length of the proportional indicator.120* @return the length of the proportional indicator121*/122int getVisibleAmount();123124/**125* Sets the current value of the adjustable object. If126* the value supplied is less than {@code minimum}127* or greater than {@code maximum} - {@code visibleAmount},128* then one of those values is substituted, as appropriate.129* <p>130* Calling this method does not fire an131* {@code AdjustmentEvent}.132*133* @param v the current value, between {@code minimum}134* and {@code maximum} - {@code visibleAmount}135*/136void setValue(int v);137138/**139* Gets the current value of the adjustable object.140* @return the current value of the adjustable object141*/142int getValue();143144/**145* Adds a listener to receive adjustment events when the value of146* the adjustable object changes.147* @param l the listener to receive events148* @see AdjustmentEvent149*/150void addAdjustmentListener(AdjustmentListener l);151152/**153* Removes an adjustment listener.154* @param l the listener being removed155* @see AdjustmentEvent156*/157void removeAdjustmentListener(AdjustmentListener l);158159}160161162