package resampler.ui;

import java.awt.Dimension;
import java.awt.Rectangle;

import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLCapabilitiesChooser;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLJPanel;
import javax.swing.Scrollable;

/**
 * Component that wraps a GLJPanel and implements a Scrollable interface
 * Its parent, JScrollPane, is not able to change its size.
 *   
 * @author likan
 */
public class GLScrollablePanel extends GLJPanel implements Scrollable
{
    public GLScrollablePanel()
    {
        super();
    }

    public GLScrollablePanel(GLCapabilities capabilities,
            GLCapabilitiesChooser chooser, GLContext context)
    {
        super(capabilities, chooser, context);
    }

    public GLScrollablePanel(GLCapabilities capabilities)
    {
        super(capabilities);
    }

    public Dimension getPreferredScrollableViewportSize()
    {
        return getPreferredSize();
    }

    public int getScrollableBlockIncrement(Rectangle visibleRect, 
            int orientation, int direction)
    {
        return 30;
    }

    public boolean getScrollableTracksViewportHeight()
    {
        return false;
    }

    public boolean getScrollableTracksViewportWidth()
    {
        return false;
    }

    public int getScrollableUnitIncrement(Rectangle visibleRect,
            int orientation, int direction)
    {
        return 60;
    }
}
