-
- All Known Implementing Classes:
- JScrollBar, JScrollPane.ScrollBar, Scrollbar, ScrollPaneAdjustable
public interface AdjustableThe interface for objects which have an adjustable numeric value contained within a bounded range of values.
-
-
Field Summary
Fields Modifier and Type Field and Description static intHORIZONTALIndicates that theAdjustablehas horizontal orientation.static intNO_ORIENTATIONIndicates that theAdjustablehas no orientation.static intVERTICALIndicates that theAdjustablehas vertical orientation.
-
Method Summary
Methods Modifier and Type Method and Description voidaddAdjustmentListener(AdjustmentListener l)Adds a listener to receive adjustment events when the value of the adjustable object changes.intgetBlockIncrement()Gets the block value increment for the adjustable object.intgetMaximum()Gets the maximum value of the adjustable object.intgetMinimum()Gets the minimum value of the adjustable object.intgetOrientation()Gets the orientation of the adjustable object.intgetUnitIncrement()Gets the unit value increment for the adjustable object.intgetValue()Gets the current value of the adjustable object.intgetVisibleAmount()Gets the length of the proportional indicator.voidremoveAdjustmentListener(AdjustmentListener l)Removes an adjustment listener.voidsetBlockIncrement(int b)Sets the block value increment for the adjustable object.voidsetMaximum(int max)Sets the maximum value of the adjustable object.voidsetMinimum(int min)Sets the minimum value of the adjustable object.voidsetUnitIncrement(int u)Sets the unit value increment for the adjustable object.voidsetValue(int v)Sets the current value of the adjustable object.voidsetVisibleAmount(int v)Sets the length of the proportional indicator of the adjustable object.
-
-
-
Field Detail
-
HORIZONTAL
static final int HORIZONTAL
Indicates that theAdjustablehas horizontal orientation.- See Also:
- Constant Field Values
-
VERTICAL
static final int VERTICAL
Indicates that theAdjustablehas vertical orientation.- See Also:
- Constant Field Values
-
NO_ORIENTATION
static final int NO_ORIENTATION
Indicates that theAdjustablehas no orientation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getOrientation
int getOrientation()
Gets the orientation of the adjustable object.- Returns:
- the orientation of the adjustable object;
either
HORIZONTAL,VERTICAL, orNO_ORIENTATION
-
setMinimum
void setMinimum(int min)
Sets the minimum value of the adjustable object.- Parameters:
min- the minimum value
-
getMinimum
int getMinimum()
Gets the minimum value of the adjustable object.- Returns:
- the minimum value of the adjustable object
-
setMaximum
void setMaximum(int max)
Sets the maximum value of the adjustable object.- Parameters:
max- the maximum value
-
getMaximum
int getMaximum()
Gets the maximum value of the adjustable object.- Returns:
- the maximum value of the adjustable object
-
setUnitIncrement
void setUnitIncrement(int u)
Sets the unit value increment for the adjustable object.- Parameters:
u- the unit increment
-
getUnitIncrement
int getUnitIncrement()
Gets the unit value increment for the adjustable object.- Returns:
- the unit value increment for the adjustable object
-
setBlockIncrement
void setBlockIncrement(int b)
Sets the block value increment for the adjustable object.- Parameters:
b- the block increment
-
getBlockIncrement
int getBlockIncrement()
Gets the block value increment for the adjustable object.- Returns:
- the block value increment for the adjustable object
-
setVisibleAmount
void setVisibleAmount(int v)
Sets the length of the proportional indicator of the adjustable object.- Parameters:
v- the length of the indicator
-
getVisibleAmount
int getVisibleAmount()
Gets the length of the proportional indicator.- Returns:
- the length of the proportional indicator
-
setValue
void setValue(int v)
Sets the current value of the adjustable object. If the value supplied is less thanminimumor greater thanmaximum-visibleAmount, then one of those values is substituted, as appropriate.Calling this method does not fire an
AdjustmentEvent.- Parameters:
v- the current value, betweenminimumandmaximum-visibleAmount
-
getValue
int getValue()
Gets the current value of the adjustable object.- Returns:
- the current value of the adjustable object
-
addAdjustmentListener
void addAdjustmentListener(AdjustmentListener l)
Adds a listener to receive adjustment events when the value of the adjustable object changes.- Parameters:
l- the listener to receive events- See Also:
AdjustmentEvent
-
removeAdjustmentListener
void removeAdjustmentListener(AdjustmentListener l)
Removes an adjustment listener.- Parameters:
l- the listener being removed- See Also:
AdjustmentEvent
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-java/awt/Adjustable.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.