亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? basicprogressbarui.java

?? java1.6眾多例子參考
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * @(#)BasicProgressBarUI.java	1.74 08/05/29 * * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */package javax.swing.plaf.basic;import sun.swing.SwingUtilities2;import java.awt.*;import java.awt.geom.AffineTransform;import java.awt.event.*;import javax.swing.*;import javax.swing.event.*;import javax.swing.plaf.*;import java.beans.PropertyChangeListener;import java.beans.PropertyChangeEvent;import java.io.Serializable;import sun.swing.DefaultLookup;/** * A Basic L&F implementation of ProgressBarUI. * * @version 1.74 05/29/08 * @author Michael C. Albers * @author Kathy Walrath */public class BasicProgressBarUI extends ProgressBarUI {    private int cachedPercent;    private int cellLength, cellSpacing;    // The "selectionForeground" is the color of the text when it is painted    // over a filled area of the progress bar. The "selectionBackground"    // is for the text over the unfilled progress bar area.    private Color selectionForeground, selectionBackground;    private Animator animator;     protected JProgressBar progressBar;    protected ChangeListener changeListener;    private Handler handler;    /**      * The current state of the indeterminate animation's cycle.     * 0, the initial value, means paint the first frame.     * When the progress bar is indeterminate and showing,     * the default animation thread updates this variable     * by invoking incrementAnimationIndex()     * every repaintInterval milliseconds.     */    private int animationIndex = 0;    /**     * The number of frames per cycle. Under the default implementation,     * this depends on the cycleTime and repaintInterval.  It     * must be an even number for the default painting algorithm.  This     * value is set in the initIndeterminateValues method.     */    private int numFrames;   //0 1|numFrames-1 ... numFrames/2    /**     * Interval (in ms) between repaints of the indeterminate progress bar.     * The value of this method is set      * (every time the progress bar changes to indeterminate mode)     * using the      * "ProgressBar.repaintInterval" key in the defaults table.     */    private int repaintInterval;    /**     * The number of milliseconds until the animation cycle repeats.     * The value of this method is set      * (every time the progress bar changes to indeterminate mode)     * using the      * "ProgressBar.cycleTime" key in the defaults table.     */    private int cycleTime;  //must be repaintInterval*2*aPositiveInteger    //performance stuff    private static boolean ADJUSTTIMER = true; //makes a BIG difference;    					       //make this false for					       //performance tests    /**                                                                  * Used to hold the location and size of the bouncing box (returned     * by getBox) to be painted.     *     * @since 1.5     */                                                                 protected Rectangle boxRect;                                                                        /**                                                                  * The rectangle to be updated the next time the              * animation thread calls repaint.  For bouncing-box                 * animation this rect should include the union of         * the currently displayed box (which needs to be erased)            * and the box to be displayed next.     * This rectangle's values are set in      * the setAnimationIndex method.     */                                                                 private Rectangle nextPaintRect;                                                                        //cache    /** The component's painting area, not including the border. */    private Rectangle componentInnards;    //the current painting area    private Rectangle oldComponentInnards; //used to see if the size changed    /** For bouncing-box animation, the change in position per frame. */    private double delta = 0.0;    private int maxPosition = 0; //maximum X (horiz) or Y box location        public static ComponentUI createUI(JComponent x) {	return new BasicProgressBarUI();    }        public void installUI(JComponent c) {	progressBar = (JProgressBar)c;	installDefaults();	installListeners();        if (progressBar.isIndeterminate()) {            initIndeterminateValues();        }    }        public void uninstallUI(JComponent c) {        if (progressBar.isIndeterminate()) {            cleanUpIndeterminateValues();        }	uninstallDefaults();	uninstallListeners();	progressBar = null;    }        protected void installDefaults() {        LookAndFeel.installProperty(progressBar, "opaque", Boolean.TRUE); 	LookAndFeel.installBorder(progressBar,"ProgressBar.border");		LookAndFeel.installColorsAndFont(progressBar,					 "ProgressBar.background",					 "ProgressBar.foreground",					 "ProgressBar.font");	cellLength = UIManager.getInt("ProgressBar.cellLength");        if (cellLength == 0) cellLength = 1;        cellSpacing = UIManager.getInt("ProgressBar.cellSpacing");        selectionForeground = UIManager.getColor("ProgressBar.selectionForeground");	selectionBackground = UIManager.getColor("ProgressBar.selectionBackground");    }        protected void uninstallDefaults() { 	LookAndFeel.uninstallBorder(progressBar);	    }        protected void installListeners() {	//Listen for changes in the progress bar's data.	changeListener = getHandler();	progressBar.addChangeListener(changeListener);	//Listen for changes between determinate and indeterminate state.	progressBar.addPropertyChangeListener(getHandler());    }	        private Handler getHandler() {        if (handler == null) {            handler = new Handler();        }        return handler;    }    /**     * Starts the animation thread, creating and initializing     * it if necessary. This method is invoked when an     * indeterminate progress bar should start animating.     * Reasons for this may include:     * <ul>     *    <li>The progress bar is determinate and becomes displayable     *    <li>The progress bar is displayable and becomes determinate     *    <li>The progress bar is displayable and determinate and this     *        UI is installed     * </ul>     * If you implement your own animation thread,     * you must override this method.     *     * @since 1.4     * @see #stopAnimationTimer     */    protected void startAnimationTimer() {        if (animator == null) {	    animator = new Animator();         }        animator.start(getRepaintInterval());    }    /**     * Stops the animation thread.     * This method is invoked when the indeterminate     * animation should be stopped. Reasons for this may include:     * <ul>     *    <li>The progress bar changes to determinate     *    <li>The progress bar is no longer part of a displayable hierarchy     *    <li>This UI in uninstalled     * </ul>     * If you implement your own animation thread,     * you must override this method.     *     * @since 1.4     * @see #startAnimationTimer     */    protected void stopAnimationTimer() {	if (animator != null) {            animator.stop();	}    }    /**     * Removes all listeners installed by this object.     */    protected void uninstallListeners() {	progressBar.removeChangeListener(changeListener);	progressBar.removePropertyChangeListener(getHandler());        handler = null;    }        /**     * Returns the baseline.     *     * @throws NullPointerException {@inheritDoc}     * @throws IllegalArgumentException {@inheritDoc}     * @see javax.swing.JComponent#getBaseline(int, int)     * @since 1.6     */    public int getBaseline(JComponent c, int width, int height) {        super.getBaseline(c, width, height);        if (progressBar.isStringPainted() &&                progressBar.getOrientation() == JProgressBar.HORIZONTAL) {            FontMetrics metrics = progressBar.                    getFontMetrics(progressBar.getFont());            Insets insets = progressBar.getInsets();            int y = insets.top;            height = height - insets.top - insets.bottom;            return y + (height + metrics.getAscent() -                        metrics.getLeading() -                        metrics.getDescent()) / 2;        }        return -1;    }    /**     * Returns an enum indicating how the baseline of the component     * changes as the size changes.     *     * @throws NullPointerException {@inheritDoc}     * @see javax.swing.JComponent#getBaseline(int, int)     * @since 1.6     */    public Component.BaselineResizeBehavior getBaselineResizeBehavior(            JComponent c) {        super.getBaselineResizeBehavior(c);        if (progressBar.isStringPainted() &&                progressBar.getOrientation() == JProgressBar.HORIZONTAL) {            return Component.BaselineResizeBehavior.CENTER_OFFSET;        }        return Component.BaselineResizeBehavior.OTHER;    }    // Many of the Basic*UI components have the following methods.    // This component does not have these methods because *ProgressBarUI    //  is not a compound component and does not accept input.    //    // protected void installComponents()    // protected void uninstallComponents()    // protected void installKeyboardActions()    // protected void uninstallKeyboardActions()    protected Dimension getPreferredInnerHorizontal() {        Dimension horizDim = (Dimension)DefaultLookup.get(progressBar, this,            "ProgressBar.horizontalSize");        if (horizDim == null) {            horizDim = new Dimension(146, 12);        }        return horizDim;    }        protected Dimension getPreferredInnerVertical() {        Dimension vertDim = (Dimension)DefaultLookup.get(progressBar, this,            "ProgressBar.vertictalSize");        if (vertDim == null) {            vertDim = new Dimension(12, 146);        }        return vertDim;    }        /**     * The "selectionForeground" is the color of the text when it is painted     * over a filled area of the progress bar.     */    protected Color getSelectionForeground() {	return selectionForeground;    }        /**     * The "selectionBackground" is the color of the text when it is painted     * over an unfilled area of the progress bar.     */    protected Color getSelectionBackground() {	return selectionBackground;    }        private int getCachedPercent() {	return cachedPercent;    }        private void setCachedPercent(int cachedPercent) {	this.cachedPercent = cachedPercent;    }        /**     * Returns the width (if HORIZONTAL) or height (if VERTICAL)     * of each of the indivdual cells/units to be rendered in the     * progress bar. However, for text rendering simplification and      * aesthetic considerations, this function will return 1 when     * the progress string is being rendered.     *     * @return the value representing the spacing between cells     * @see    #setCellLength     * @see    JProgressBar#isStringPainted     */    protected int getCellLength() {	if (progressBar.isStringPainted()) {	    return 1;	} else {	    return cellLength;	}    }        protected void setCellLength(int cellLen) {	this.cellLength = cellLen;    }        /**     * Returns the spacing between each of the cells/units in the     * progress bar. However, for text rendering simplification and      * aesthetic considerations, this function will return 0 when     * the progress string is being rendered.     *     * @return the value representing the spacing between cells     * @see    #setCellSpacing     * @see    JProgressBar#isStringPainted     */    protected int getCellSpacing() {	if (progressBar.isStringPainted()) {	    return 0;	} else {	    return cellSpacing;	}    }        protected void setCellSpacing(int cellSpace) {	this.cellSpacing = cellSpace;    }        /**     * This determines the amount of the progress bar that should be filled     * based on the percent done gathered from the model. This is a common     * operation so it was abstracted out. It assumes that your progress bar     * is linear. That is, if you are making a circular progress indicator,     * you will want to override this method.     */    protected int getAmountFull(Insets b, int width, int height) {	int amountFull = 0;	BoundedRangeModel model = progressBar.getModel();		if ( (model.getMaximum() - model.getMinimum()) != 0) {	    if (progressBar.getOrientation() == JProgressBar.HORIZONTAL) {	        amountFull = (int)Math.round(width *					     progressBar.getPercentComplete());	    } else {	        amountFull = (int)Math.round(height *					     progressBar.getPercentComplete());	    }	}	return amountFull;    }        /**     * Delegates painting to one of two methods:     * paintDeterminate or paintIndeterminate.     */    public void paint(Graphics g, JComponent c) {        if (progressBar.isIndeterminate()) {            paintIndeterminate(g, c);        } else {            paintDeterminate(g, c);        }    }    /**     * Stores the position and size of     * the bouncing box that would be painted for the current animation index     * in <code>r</code> and returns <code>r</code>.     * Subclasses that add to the painting performed     * in this class's implementation of <code>paintIndeterminate</code> --     * to draw an outline around the bouncing box, for example --     * can use this method to get the location of the bouncing     * box that was just painted.     * By overriding this method,     * you have complete control over the size and position      * of the bouncing box,     * without having to reimplement <code>paintIndeterminate</code>.     *     * @param r  the Rectangle instance to be modified;     *           may be <code>null</code>     * @return   <code>null</code> if no box should be drawn;     *           otherwise, returns the passed-in rectangle     *           (if non-null)     *           or a new rectangle     *     * @see #setAnimationIndex

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合久久久久久久久久久| 91麻豆精品国产91久久久久久| 精品一区二区三区不卡 | 亚洲国产精品精华液ab| 久久久久国产精品人| 欧美mv日韩mv国产网站app| 欧美成人艳星乳罩| 久久天堂av综合合色蜜桃网| 久久综合狠狠综合| 日本一二三不卡| 17c精品麻豆一区二区免费| 综合精品久久久| 一区二区三区中文在线| 性感美女久久精品| 美美哒免费高清在线观看视频一区二区| 毛片一区二区三区| 国产成人精品影视| 91麻豆精品秘密| 欧美日韩亚洲不卡| 日韩午夜在线影院| 亚洲国产精品一区二区尤物区| 午夜精品福利一区二区三区蜜桃| 日本在线不卡视频| 国产精品1区2区3区| 93久久精品日日躁夜夜躁欧美| 欧美在线免费视屏| 日韩精品一区二区三区三区免费 | 免费人成在线不卡| 狠狠色伊人亚洲综合成人| 国产suv一区二区三区88区| eeuss鲁一区二区三区| 欧美午夜在线观看| 欧美成人一区二区三区片免费| 国产欧美一区二区三区沐欲 | 成人深夜在线观看| 欧美性高清videossexo| 日韩欧美的一区二区| 中文一区在线播放 | 在线观看日韩一区| 欧美一级黄色片| 中文幕一区二区三区久久蜜桃| 亚洲成人在线网站| 狠狠色狠狠色合久久伊人| 91日韩一区二区三区| 5月丁香婷婷综合| 国产精品免费aⅴ片在线观看| 亚洲一区二区在线播放相泽| 久久国产精品露脸对白| 不卡电影一区二区三区| 欧美一区二区视频在线观看| 国产精品嫩草影院com| 午夜伊人狠狠久久| 丰满岳乱妇一区二区三区| 欧美日韩国产美女| 国产精品免费aⅴ片在线观看| 视频一区二区中文字幕| 成人午夜免费av| 91精品在线观看入口| 中文字幕一区在线| 色婷婷av一区二区| 久久精品免视看| 天天做天天摸天天爽国产一区| 成人av综合一区| 精品久久久久99| 亚洲国产综合91精品麻豆| 岛国精品一区二区| 日韩欧美亚洲国产另类| 一区二区三区四区国产精品| 国产999精品久久久久久绿帽| 91精品欧美福利在线观看| 亚洲女人的天堂| 成人午夜大片免费观看| 日韩视频国产视频| 亚洲高清不卡在线观看| 色婷婷综合久久久久中文一区二区| 亚洲精品一区二区三区影院| 午夜精品一区二区三区免费视频| 91一区二区三区在线观看| 久久精品一区二区三区不卡| 男女性色大片免费观看一区二区| 欧美亚洲免费在线一区| 中文字幕日本不卡| 成人免费视频播放| 久久精品日韩一区二区三区| 另类中文字幕网| 欧美人成免费网站| 亚洲国产中文字幕在线视频综合| 91美女片黄在线观看91美女| 国产精品第四页| 懂色av一区二区三区蜜臀 | 日韩精品电影一区亚洲| 在线观看中文字幕不卡| 亚洲欧洲一区二区在线播放| 成人理论电影网| 国产精品久久久久一区| 成人国产精品免费| 国产亚洲成年网址在线观看| 国产呦精品一区二区三区网站| 精品国产一区久久| 国产专区综合网| 久久久久久久久蜜桃| 国产精品小仙女| 国产精品丝袜91| 成人avav影音| 亚洲丝袜制服诱惑| 91福利国产精品| 亚洲高清久久久| 777色狠狠一区二区三区| 视频一区二区三区中文字幕| 欧美一区二区三区免费观看视频| 青青草精品视频| 亚洲精品在线三区| 成人午夜大片免费观看| 综合久久久久综合| 欧美在线观看禁18| 三级久久三级久久久| 91精品婷婷国产综合久久| 麻豆国产91在线播放| www精品美女久久久tv| 风间由美中文字幕在线看视频国产欧美| 国产欧美日韩一区二区三区在线观看| 成人污视频在线观看| 一区二区三区资源| 欧美精品一卡二卡| 久草中文综合在线| 国产欧美中文在线| 在线观看日韩毛片| bt欧美亚洲午夜电影天堂| 一区二区三区四区视频精品免费 | 成人动漫一区二区| 又紧又大又爽精品一区二区| 欧美日韩在线精品一区二区三区激情| 水野朝阳av一区二区三区| 久久一二三国产| 91免费看片在线观看| 日本在线不卡一区| 国产精品亲子乱子伦xxxx裸| 在线视频国产一区| 六月丁香婷婷色狠狠久久| 国产精品视频yy9299一区| 91久久精品一区二区三区| 蜜臀av一区二区| 国产精品电影一区二区| 欧美日韩国产三级| 国产91丝袜在线播放| 亚洲1区2区3区视频| 精品免费国产二区三区 | 久久久美女艺术照精彩视频福利播放| 99久久精品一区| 日本va欧美va瓶| 国产精品国产三级国产aⅴ入口| 欧美日韩国产精品成人| 国产成人综合视频| 无码av免费一区二区三区试看| 欧美激情一区三区| 51久久夜色精品国产麻豆| 成人午夜视频福利| 日本aⅴ亚洲精品中文乱码| 亚洲国产高清在线| 日韩一级二级三级精品视频| 99久久综合狠狠综合久久| 麻豆国产一区二区| 一区二区三区四区精品在线视频 | 国产伦精品一区二区三区免费 | 亚洲国产成人tv| 国产精品乱码人人做人人爱| 日韩一区二区不卡| 色婷婷香蕉在线一区二区| 国产美女一区二区三区| 青娱乐精品在线视频| 一区二区在线看| 欧美高清在线视频| 欧美不卡在线视频| 欧美在线观看视频在线| 97se亚洲国产综合自在线不卡| 精品亚洲aⅴ乱码一区二区三区| 亚洲国产精品久久久久秋霞影院 | 不卡的av电影| 精品一区免费av| 日韩精品91亚洲二区在线观看| 亚洲精品视频一区| 国产精品免费网站在线观看| 欧美大片在线观看一区二区| 欧美日韩视频第一区| 91丝袜高跟美女视频| 成人听书哪个软件好| 国产成人精品三级麻豆| 另类欧美日韩国产在线| 五月天激情综合网| 夜夜揉揉日日人人青青一国产精品| 国产精品久久二区二区| 欧美极品xxx| 久久久久国色av免费看影院| 精品播放一区二区| 26uuu国产日韩综合| 久久亚洲综合av| 久久久激情视频| 国产欧美一区二区在线观看| 欧美国产精品v| 国产精品美女久久福利网站|