/* * [SmoothPan.java] * * Summary: Allows smooth scrolling of multiple panels of text. * * Copyright: (c) 1998-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2002-06-28 original. */ package com.mindprod.smooth; /** * Allows smooth scrolling of multiple panels of text. * * @author Roedy Green, Canadian Mind Products * @version 1.0 2002-06-28 original. * @since 2002-06-28 */ public class SmoothPan { /** * Close the grid of panels display. Shuts down any pan operations in progress. */ public native void closePanels(); /** * Create a grid of panels, using the C windowing library, * Pop them up in the default location. * * @param rows Number of rows of panels to create. * @param columns Number of columns of panels to create. * @param panelWidth width of each panel in pixels. * @param PanelHeight height of each panel in pixels. */ public native void createPanels( int rows, int columns, int panelWidth, int PanelHeight ); /** * Smoothly pan over the image, and return when * all of it has been displayed to the user. * Normally this method would be called on its own * thread. You must have called createPanels first. * The image (usually text) appears to move smoothly * and slowly upward. * * @param rgbImage Image encoded as 8-bit RGB with the high byte * 0, in row major order. * @param width width of the image in pixels. * @param height height of the image in pixels. * @param lockRow All pixels above this pixel row are locked in place * and do not move. * @param smoothness controls how smoothly the image pans. * 1 = one pixel at a time, very smoothly, * 2 = two pixels at a time, less smoothly, * etc. * @param slowness How slowly to pan the image. This parameter * represents the delay in milliseconds between * screen animation refreshes. * 0=pan as fast as possible. * @param panelRow Row of the panel in which to display the image. * @param panelColumn column of the panel in which to display the image. */ public native void pan( int[] rgbImage, int width, int height, int lockRow, int smoothness, int slowness, int panelRow, int panelColumn ); }