Package charva.awt

Examples of charva.awt.Scrollable


        /*
         * This will cause a ClassCastException if the component does not
         * implement the Scrollable interface.
         */
        Scrollable scrollable = (Scrollable) component_;
        scrollable.addScrollListener(this);

        /*
         * If the child component is a JTable, we display two viewports instead
         * of one; the TableHeader corresponding to the table is displayed in
         * the top viewport and scrolls left and right but not up and down. The
View Full Code Here


    public Dimension minimumSize() {

        Dimension size = new Dimension();
        Component view = getViewport().getView();
        if (view instanceof Scrollable) {
            Scrollable s = (Scrollable) view;
            size.setSize(s.getPreferredScrollableViewportSize());
        } else {
            size.setSize(view.getSize());
        }

        // Set the size of the viewport(s) as well
View Full Code Here

    /**
     * Called by a Scrollable object such as JTable or JList, when its state
     * changes in such a way that it may need to be scrolled.
     */
    public void scroll(ScrollEvent e_) {
        Scrollable scrollable = e_.getScrollable();

        int direction = e_.getDirection();

        /*
         * "limit" gives the row and column of the view component that must
         * appear just inside the JViewport after scrolling.
         */
        Point limit = e_.getLimit();

        /*
         * Determine the value of "limit" relative to the top left corner of
         * the JScrollPane.
         */
        Point viewportLocation = getViewport().getLocation();
        limit.translate(viewportLocation.x, viewportLocation.y);
        limit.translate(scrollable.getLocation());

        /*
         * Get the bounding rectangle of the child viewport, relative to the
         * top left corner of the JScrollPane.
         */
 
View Full Code Here

TOP

Related Classes of charva.awt.Scrollable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.