package com.fr.design.gui.icontainer;

import com.fr.design.constants.UIConstants;
import com.fr.design.gui.iscrollbar.UIScrollBar;

import javax.swing.*;
import java.awt.*;

/**
 * Created by IntelliJ IDEA.
 * Author : Richer
 * Version: 7.0.3
 * Date: 12-12-25
 * Time: 下午3:09
 */
public class UIVerticalScrollPane extends JScrollPane {

    public UIVerticalScrollPane(Component c) {
        super(c, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        this.setHorizontalScrollBar(createHorizontalScrollBar());
        this.getVerticalScrollBar().setUnitIncrement(30);
        this.getVerticalScrollBar().setBlockIncrement(30);
    }

    @Override
    /**
     * 生成水平滚动条
     */
    public JScrollBar createHorizontalScrollBar() {
        return null;
    }

    @Override
    /**
     * 生成垂直滚动条
     */
    public JScrollBar createVerticalScrollBar() {
        UIScrollBar sbr = new UIScrollBar(JScrollBar.VERTICAL);
        sbr.setBackground(UIConstants.NORMAL_BACKGROUND);
        return sbr;
    }
}