src/share/classes/javax/swing/JViewport.java

Print this page




 845      */
 846     public void reshape(int x, int y, int w, int h) {
 847         boolean sizeChanged = (getWidth() != w) || (getHeight() != h);
 848         if (sizeChanged) {
 849             backingStoreImage = null;
 850         }
 851         super.reshape(x, y, w, h);
 852         if (sizeChanged || viewChanged) {
 853             viewChanged = false;
 854 
 855             fireStateChanged();
 856         }
 857     }
 858 
 859 
 860     /**
 861       * Used to control the method of scrolling the viewport contents.
 862       * You may want to change this mode to get maximum performance for your
 863       * use case.
 864       *




 865       * @param mode one of the following values:
 866       * <ul>
 867       * <li> JViewport.BLIT_SCROLL_MODE
 868       * <li> JViewport.BACKINGSTORE_SCROLL_MODE
 869       * <li> JViewport.SIMPLE_SCROLL_MODE
 870       * </ul>
 871       *
 872       * @see #BLIT_SCROLL_MODE
 873       * @see #BACKINGSTORE_SCROLL_MODE
 874       * @see #SIMPLE_SCROLL_MODE
 875       *
 876       * @beaninfo
 877       *        bound: false
 878       *  description: Method of moving contents for incremental scrolls.
 879       *         enum: BLIT_SCROLL_MODE JViewport.BLIT_SCROLL_MODE
 880       *               BACKINGSTORE_SCROLL_MODE JViewport.BACKINGSTORE_SCROLL_MODE
 881       *               SIMPLE_SCROLL_MODE JViewport.SIMPLE_SCROLL_MODE
 882       *
 883       * @since 1.3
 884       */




 845      */
 846     public void reshape(int x, int y, int w, int h) {
 847         boolean sizeChanged = (getWidth() != w) || (getHeight() != h);
 848         if (sizeChanged) {
 849             backingStoreImage = null;
 850         }
 851         super.reshape(x, y, w, h);
 852         if (sizeChanged || viewChanged) {
 853             viewChanged = false;
 854 
 855             fireStateChanged();
 856         }
 857     }
 858 
 859 
 860     /**
 861       * Used to control the method of scrolling the viewport contents.
 862       * You may want to change this mode to get maximum performance for your
 863       * use case.
 864       *
 865       * Some scroll modes may be not supported by some window implementations.
 866       * In this case the unsupported mode will be replaced by another one
 867       * when the component is added to a window.
 868       *
 869       * @param mode one of the following values:
 870       * <ul>
 871       * <li> JViewport.BLIT_SCROLL_MODE
 872       * <li> JViewport.BACKINGSTORE_SCROLL_MODE
 873       * <li> JViewport.SIMPLE_SCROLL_MODE
 874       * </ul>
 875       *
 876       * @see #BLIT_SCROLL_MODE
 877       * @see #BACKINGSTORE_SCROLL_MODE
 878       * @see #SIMPLE_SCROLL_MODE
 879       *
 880       * @beaninfo
 881       *        bound: false
 882       *  description: Method of moving contents for incremental scrolls.
 883       *         enum: BLIT_SCROLL_MODE JViewport.BLIT_SCROLL_MODE
 884       *               BACKINGSTORE_SCROLL_MODE JViewport.BACKINGSTORE_SCROLL_MODE
 885       *               SIMPLE_SCROLL_MODE JViewport.SIMPLE_SCROLL_MODE
 886       *
 887       * @since 1.3
 888       */