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.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright 2000-2018 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.server;
  17. import java.io.Serializable;
  18. /**
  19. * <p>
  20. * This interface is implemented by all visual objects that can be scrolled
  21. * programmatically from the server-side. The unit of scrolling is pixel.
  22. * </p>
  23. *
  24. * @author Vaadin Ltd.
  25. * @since 3.0
  26. */
  27. public interface Scrollable extends Serializable {
  28. /**
  29. * Gets scroll left offset.
  30. *
  31. * <p>
  32. * Scrolling offset is the number of pixels this scrollable has been
  33. * scrolled right.
  34. * </p>
  35. *
  36. * @return Horizontal scrolling position in pixels.
  37. */
  38. public int getScrollLeft();
  39. /**
  40. * Sets scroll left offset.
  41. *
  42. * <p>
  43. * Scrolling offset is the number of pixels this scrollable has been
  44. * scrolled right.
  45. * </p>
  46. *
  47. * @param scrollLeft
  48. * the xOffset.
  49. */
  50. public void setScrollLeft(int scrollLeft);
  51. /**
  52. * Gets scroll top offset.
  53. *
  54. * <p>
  55. * Scrolling offset is the number of pixels this scrollable has been
  56. * scrolled down.
  57. * </p>
  58. *
  59. * @return Vertical scrolling position in pixels.
  60. */
  61. public int getScrollTop();
  62. /**
  63. * Sets scroll top offset.
  64. *
  65. * <p>
  66. * Scrolling offset is the number of pixels this scrollable has been
  67. * scrolled down.
  68. * </p>
  69. *
  70. * <p>
  71. * The scrolling position is limited by the current height of the content
  72. * area. If the position is below the height, it is scrolled to the bottom.
  73. * However, if the same response also adds height to the content area,
  74. * scrolling to bottom only scrolls to the bottom of the previous content
  75. * area.
  76. * </p>
  77. *
  78. * @param scrollTop
  79. * the yOffset.
  80. */
  81. public void setScrollTop(int scrollTop);
  82. }