1. /*
  2. * @(#)Adjustable.java 1.15 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt;
  8. import java.awt.event.*;
  9. /**
  10. * The interface for objects which have an adjustable numeric value
  11. * contained within a bounded range of values.
  12. *
  13. * @version 1.15 01/23/03
  14. * @author Amy Fowler
  15. * @author Tim Prinzing
  16. */
  17. public interface Adjustable {
  18. /**
  19. * Indicates that the <code>Adjustable</code> has horizontal orientation.
  20. */
  21. public static final int HORIZONTAL = 0;
  22. /**
  23. * Indicates that the <code>Adjustable</code> has vertical orientation.
  24. */
  25. public static final int VERTICAL = 1;
  26. /**
  27. * Indicates that the <code>Adjustable</code> has no orientation.
  28. */
  29. public static final int NO_ORIENTATION = 2;
  30. /**
  31. * Gets the orientation of the adjustable object.
  32. * @return the orientation of the adjustable object;
  33. * either <code>HORIZONTAL</code>, <code>VERTICAL</code>,
  34. * or <code>NO_ORIENTATION</code>
  35. */
  36. int getOrientation();
  37. /**
  38. * Sets the minimum value of the adjustable object.
  39. * @param min the minimum value
  40. */
  41. void setMinimum(int min);
  42. /**
  43. * Gets the minimum value of the adjustable object.
  44. * @return the minimum value of the adjustable object
  45. */
  46. int getMinimum();
  47. /**
  48. * Sets the maximum value of the adjustable object.
  49. * @param max the maximum value
  50. */
  51. void setMaximum(int max);
  52. /**
  53. * Gets the maximum value of the adjustable object.
  54. * @return the maximum value of the adjustable object
  55. */
  56. int getMaximum();
  57. /**
  58. * Sets the unit value increment for the adjustable object.
  59. * @param u the unit increment
  60. */
  61. void setUnitIncrement(int u);
  62. /**
  63. * Gets the unit value increment for the adjustable object.
  64. * @return the unit value increment for the adjustable object
  65. */
  66. int getUnitIncrement();
  67. /**
  68. * Sets the block value increment for the adjustable object.
  69. * @param b the block increment
  70. */
  71. void setBlockIncrement(int b);
  72. /**
  73. * Gets the block value increment for the adjustable object.
  74. * @return the block value increment for the adjustable object
  75. */
  76. int getBlockIncrement();
  77. /**
  78. * Sets the length of the proportional indicator of the
  79. * adjustable object.
  80. * @param v the length of the indicator
  81. */
  82. void setVisibleAmount(int v);
  83. /**
  84. * Gets the length of the proportional indicator.
  85. * @return the length of the proportional indicator
  86. */
  87. int getVisibleAmount();
  88. /**
  89. * Sets the current value of the adjustable object. This
  90. * value must be within the range defined by the minimum and
  91. * maximum values for this object.
  92. * @param v the current value
  93. */
  94. void setValue(int v);
  95. /**
  96. * Gets the current value of the adjustable object.
  97. * @return the current value of the adjustable object
  98. */
  99. int getValue();
  100. /**
  101. * Adds a listener to receive adjustment events when the value of
  102. * the adjustable object changes.
  103. * @param l the listener to receive events
  104. * @see AdjustmentEvent
  105. */
  106. void addAdjustmentListener(AdjustmentListener l);
  107. /**
  108. * Removes an adjustment listener.
  109. * @param l the listener being removed
  110. * @see AdjustmentEvent
  111. */
  112. void removeAdjustmentListener(AdjustmentListener l);
  113. }