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