1. /*
  2. * @(#)Adjustable.java 1.9 01/11/29
  3. *
  4. * Copyright 2002 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.9 11/29/01
  14. * @author Amy Fowler
  15. * @author Tim Prinzing
  16. */
  17. public interface Adjustable {
  18. /**
  19. * The horizontal orientation.
  20. */
  21. public static final int HORIZONTAL = 0;
  22. /**
  23. * The vertical orientation.
  24. */
  25. public static final int VERTICAL = 1;
  26. /**
  27. * Gets the orientation of the adjustable object.
  28. */
  29. int getOrientation();
  30. /**
  31. * Sets the minimum value of the adjustable object.
  32. * @param min the minimum value
  33. */
  34. void setMinimum(int min);
  35. /**
  36. * Gets the minimum value of the adjustable object.
  37. */
  38. int getMinimum();
  39. /**
  40. * Sets the maximum value of the adjustable object.
  41. * @param max the maximum value
  42. */
  43. void setMaximum(int max);
  44. /**
  45. * Gets the maximum value of the adjustable object.
  46. */
  47. int getMaximum();
  48. /**
  49. * Sets the unit value increment for the adjustable object.
  50. * @param u the unit increment
  51. */
  52. void setUnitIncrement(int u);
  53. /**
  54. * Gets the unit value increment for the adjustable object.
  55. */
  56. int getUnitIncrement();
  57. /**
  58. * Sets the block value increment for the adjustable object.
  59. * @param b the block increment
  60. */
  61. void setBlockIncrement(int b);
  62. /**
  63. * Gets the block value increment for the adjustable object.
  64. */
  65. int getBlockIncrement();
  66. /**
  67. * Sets the length of the proportionl indicator of the
  68. * adjustable object.
  69. * @param v the length of the indicator
  70. */
  71. void setVisibleAmount(int v);
  72. /**
  73. * Gets the length of the propertional indicator.
  74. */
  75. int getVisibleAmount();
  76. /**
  77. * Sets the current value of the adjustable object. This
  78. * value must be within the range defined by the minimum and
  79. * maximum values for this object.
  80. * @param v the current value
  81. */
  82. void setValue(int v);
  83. /**
  84. * Gets the current value of the adjustable object.
  85. */
  86. int getValue();
  87. /**
  88. * Add a listener to recieve adjustment events when the value of
  89. * the adjustable object changes.
  90. * @param l the listener to recieve events
  91. * @see AdjustmentEvent
  92. */
  93. void addAdjustmentListener(AdjustmentListener l);
  94. /**
  95. * Removes an adjustment listener.
  96. * @param l the listener being removed
  97. * @see AdjustmentEvent
  98. */
  99. void removeAdjustmentListener(AdjustmentListener l);
  100. }