Package java.awt

Examples of java.awt.Adjustable


     * Changes scrollbar value on increment.
     * Fires adjustment event on value change.
     * @param increment change amount
     */
    private void updateAdjValue(final int increment) {
        Adjustable adj = state.getAdjustable();
        int oldVal = adj.getValue();
        state.setValue(type, oldVal + increment);
        if (oldVal != adj.getValue()){
            fireEvent();
        }
    }
View Full Code Here


     * Scrolls to scrollbar maximum or minimum value
     * @param max scroll to maximum if true, scroll to minimum
     * otherwise
     */
    void setAdjMinMaxValue(boolean max) {
        Adjustable adj = state.getAdjustable();
        int newVal = max ? adj.getMaximum() : adj.getMinimum();
        int oldVal = adj.getValue();
        adj.setValue(newVal);
        if (oldVal != newVal) {
            type = AdjustmentEvent.TRACK;
            fireEvent();
        }
    }
View Full Code Here

    }

    private class PageNumberListener implements AdjustmentListener {
        public void adjustmentValueChanged(AdjustmentEvent e) {
            if (displayMode == PreviewPanel.CONTINUOUS || displayMode == PreviewPanel.CONT_FACING) {
                Adjustable a = e.getAdjustable();
                int value = +e.getValue();
                int min = a.getMinimum();
                int max = a.getMaximum();
                int page = ( (renderer.getNumberOfPages() * value) / (max - min) );
                if (page != currentPage) {
                    int oldPage = currentPage;
                    currentPage = page;
                    firePageChange(oldPage, currentPage);
View Full Code Here

    }

    private class PageNumberListener implements AdjustmentListener {
        public void adjustmentValueChanged(AdjustmentEvent e) {
            if (displayMode == PreviewPanel.CONTINUOUS || displayMode == PreviewPanel.CONT_FACING) {
                Adjustable a = e.getAdjustable();
                int value = +e.getValue();
                int min = a.getMinimum();
                int max = a.getMaximum();
                int page = ( (renderer.getNumberOfPages() * value) / (max - min) );
                if (page != currentPage) {
                    int oldPage = currentPage;
                    currentPage = page;
                    firePageChange(oldPage, currentPage);
View Full Code Here

        toStringSource());

  output.printGolden("Scroll ScrollPane to " + Double.toString(proportionalValue) + " proportional horizontal value");

  Adjustable adj = getHAdjustable();

  scrollTo(new ValueScrollAdjuster((int)(adj.getMinimum() +

                 (adj.getMaximum() -

            adj.getVisibleAmount() -

            adj.getMinimum()) * proportionalValue),

           Adjustable.VERTICAL,

           getVAdjustable()));

View Full Code Here

        toStringSource());

  output.printGolden("Scroll ScrollPane to " + Double.toString(proportionalValue) + " proportional vertical value");

  Adjustable adj = getVAdjustable();

  scrollTo(new ValueScrollAdjuster((int)(adj.getMinimum() +

                (adj.getMaximum() -

                 adj.getVisibleAmount() -

                 adj.getMinimum()) * proportionalValue),

           Adjustable.VERTICAL,

           getVAdjustable()));

View Full Code Here

            log.log(Level.FINER, "x = " + e.getX() + ", y = " + e.getY() + ", src is " + e.getSource());
        }
        int increment = 0;

        if (sp != null && e.getScrollAmount() != 0) {
            Adjustable adj = getAdjustableToScroll(sp);
            if (adj != null) {
                increment = getIncrementFromAdjustable(adj, e);
                if (log.isLoggable(Level.FINER)) {
                    log.log(Level.FINER, "increment from adjustable(" + adj.getClass() + ") : " + increment);
                }
                scrollAdjustable(adj, increment);
            }
        }
    }
View Full Code Here

            } else {
                repaint = true;
            }
        }

        Adjustable adj = state.getAdjustable();
        int oldVal = adj.getValue();
        state.setValue(AdjustmentEvent.TRACK, val);
        if (oldVal != adj.getValue()) {
            fireEvent();
            if (repaint) {
                repaint();
            }
        }
View Full Code Here

     * Changes scrollbar value on increment.
     * Fires adjustment event on value change.
     * @param increment change amount
     */
    private void updateAdjValue(final int increment) {
        Adjustable adj = state.getAdjustable();
        int oldVal = adj.getValue();
        state.setValue(type, oldVal + increment);
        if (oldVal != adj.getValue()){
            fireEvent();
        }
    }
View Full Code Here

     * Scrolls to scrollbar maximum or minimum value
     * @param max scroll to maximum if true, scroll to minimum
     * otherwise
     */
    void setAdjMinMaxValue(boolean max) {
        Adjustable adj = state.getAdjustable();
        int newVal = max ? adj.getMaximum() : adj.getMinimum();
        int oldVal = adj.getValue();
        adj.setValue(newVal);
        if (oldVal != newVal) {
            type = AdjustmentEvent.TRACK;
            fireEvent();
        }
    }
View Full Code Here

TOP

Related Classes of java.awt.Adjustable

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.