You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Scrollable.java 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. @ITMillApache2LicenseForJavaFiles@
  3. */
  4. package com.itmill.toolkit.terminal;
  5. /**
  6. * <p>
  7. * This interface is implemented by all visual objects that can be scrolled. The
  8. * unit of scrolling is pixel.
  9. * </p>
  10. *
  11. * @author IT Mill Ltd.
  12. * @version
  13. * @VERSION@
  14. * @since 3.0
  15. */
  16. public interface Scrollable {
  17. /**
  18. * Gets scroll X offset.
  19. *
  20. * <p>
  21. * Scrolling offset is the number of pixels this scrollable has been
  22. * scrolled to left.
  23. * </p>
  24. *
  25. * @return Horizontal scrolling position in pixels.
  26. */
  27. public int getScrollOffsetX();
  28. /**
  29. * Sets scroll X offset.
  30. *
  31. * <p>
  32. * Scrolling offset is the number of pixels this scrollable has been
  33. * scrolled to left.
  34. * </p>
  35. *
  36. * @param pixelsScrolledLeft
  37. * the xOffset.
  38. */
  39. public void setScrollOffsetX(int pixelsScrolledLeft);
  40. /**
  41. * Gets scroll Y offset.
  42. *
  43. * <p>
  44. * Scrolling offset is the number of pixels this scrollable has been
  45. * scrolled to down.
  46. * </p>
  47. *
  48. * @return Vertical scrolling position in pixels.
  49. */
  50. public int getScrollOffsetY();
  51. /**
  52. * Sets scroll Y offset.
  53. *
  54. * <p>
  55. * Scrolling offset is the number of pixels this scrollable has been
  56. * scrolled to down.
  57. * </p>
  58. *
  59. * @param pixelsScrolledDown
  60. * the yOffset.
  61. */
  62. public void setScrollOffsetY(int pixelsScrolledDown);
  63. /**
  64. * Is the scrolling enabled.
  65. *
  66. * <p>
  67. * Enabling scrolling allows the user to scroll the scrollable view
  68. * interactively
  69. * </p>
  70. *
  71. * @return <code>true</code> if the scrolling is allowed, otherwise
  72. * <code>false</code>.
  73. */
  74. public boolean isScrollable();
  75. /**
  76. * Enables or disables scrolling..
  77. *
  78. * <p>
  79. * Enabling scrolling allows the user to scroll the scrollable view
  80. * interactively
  81. * </p>
  82. *
  83. * @param isScrollingEnabled
  84. * true if the scrolling is allowed.
  85. */
  86. public void setScrollable(boolean isScrollingEnabled);
  87. }