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

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

?? basiccombopopup.java

?? java1.6眾多例子參考
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
        // NOTE: this is added to both the List and ComboBox        //        public void mouseMoved(MouseEvent anEvent) {            if (anEvent.getSource() == list) {                Point location = anEvent.getPoint();                Rectangle r = new Rectangle();                list.computeVisibleRect( r );                if ( r.contains( location ) ) {                    updateListBoxSelectionForEvent( anEvent, false );                }            }        }        public void mouseDragged( MouseEvent e ) {            if (e.getSource() == list) {                return;            }            if ( isVisible() ) {                MouseEvent newEvent = convertMouseEvent( e );                Rectangle r = new Rectangle();                list.computeVisibleRect( r );                if ( newEvent.getPoint().y >= r.y && newEvent.getPoint().y <= r.y + r.height - 1 ) {                    hasEntered = true;                    if ( isAutoScrolling ) {                        stopAutoScrolling();                    }                    Point location = newEvent.getPoint();                    if ( r.contains( location ) ) {                        updateListBoxSelectionForEvent( newEvent, false );                    }                }                else {                    if ( hasEntered ) {                        int directionToScroll = newEvent.getPoint().y < r.y ? SCROLL_UP : SCROLL_DOWN;                        if ( isAutoScrolling && scrollDirection != directionToScroll ) {                            stopAutoScrolling();                            startAutoScrolling( directionToScroll );                        }                        else if ( !isAutoScrolling ) {                            startAutoScrolling( directionToScroll );                        }                    }                    else {                        if ( e.getPoint().y < 0 ) {                            hasEntered = true;                            startAutoScrolling( SCROLL_UP );                        }                    }                }            }        }        //        // PropertyChangeListener        //        public void propertyChange(PropertyChangeEvent e) {	    JComboBox comboBox = (JComboBox)e.getSource();            String propertyName = e.getPropertyName();            if ( propertyName == "model" ) {                ComboBoxModel oldModel = (ComboBoxModel)e.getOldValue();                ComboBoxModel newModel = (ComboBoxModel)e.getNewValue();		uninstallComboBoxModelListeners(oldModel);		installComboBoxModelListeners(newModel);                list.setModel(newModel);                if ( isVisible() ) {                    hide();                }            }            else if ( propertyName == "renderer" ) {                list.setCellRenderer( comboBox.getRenderer() );                if ( isVisible() ) {                    hide();                }            }	    else if (propertyName == "componentOrientation") {                // Pass along the new component orientation                // to the list and the scroller                ComponentOrientation o =(ComponentOrientation)e.getNewValue();                JList list = getList();                if (list!=null && list.getComponentOrientation()!=o) {                    list.setComponentOrientation(o);                }                if (scroller!=null && scroller.getComponentOrientation()!=o) {                    scroller.setComponentOrientation(o);                }                if (o!=getComponentOrientation()) {                    setComponentOrientation(o);                }            }	    else if (propertyName == "lightWeightPopupEnabled") {		setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled());	    }        }        //        // ItemListener        //        public void itemStateChanged( ItemEvent e ) {	    if (e.getStateChange() == ItemEvent.SELECTED) {		JComboBox comboBox = (JComboBox)e.getSource();		setListSelection(comboBox.getSelectedIndex());	    }	}    }    //    // end Event Listeners    //=================================================================    /**     * Overridden to unconditionally return false.     */    public boolean isFocusTraversable() {        return false;    }    //===================================================================    // begin Autoscroll methods    //    /**     * This protected method is implementation specific and should be private.     * do not call or override.     */    protected void startAutoScrolling( int direction ) {        // XXX - should be a private method within InvocationMouseMotionHandler        // if possible.        if ( isAutoScrolling ) {            autoscrollTimer.stop();        }        isAutoScrolling = true;        if ( direction == SCROLL_UP ) {            scrollDirection = SCROLL_UP;            Point convertedPoint = SwingUtilities.convertPoint( scroller, new Point( 1, 1 ), list );            int top = list.locationToIndex( convertedPoint );            list.setSelectedIndex( top );            autoscrollTimer = new Timer( 100, new AutoScrollActionHandler(                                             SCROLL_UP) );        }        else if ( direction == SCROLL_DOWN ) {            scrollDirection = SCROLL_DOWN;            Dimension size = scroller.getSize();            Point convertedPoint = SwingUtilities.convertPoint( scroller,                                                                new Point( 1, (size.height - 1) - 2 ),                                                                list );            int bottom = list.locationToIndex( convertedPoint );            list.setSelectedIndex( bottom );            autoscrollTimer = new Timer(100, new AutoScrollActionHandler(                                            SCROLL_DOWN));        }        autoscrollTimer.start();    }    /**     * This protected method is implementation specific and should be private.     * do not call or override.     */    protected void stopAutoScrolling() {        isAutoScrolling = false;        if ( autoscrollTimer != null ) {            autoscrollTimer.stop();            autoscrollTimer = null;        }    }    /**     * This protected method is implementation specific and should be private.     * do not call or override.     */    protected void autoScrollUp() {        int index = list.getSelectedIndex();        if ( index > 0 ) {            list.setSelectedIndex( index - 1 );            list.ensureIndexIsVisible( index - 1 );        }    }    /**     * This protected method is implementation specific and should be private.     * do not call or override.     */    protected void autoScrollDown() {        int index = list.getSelectedIndex();        int lastItem = list.getModel().getSize() - 1;        if ( index < lastItem ) {            list.setSelectedIndex( index + 1 );            list.ensureIndexIsVisible( index + 1 );        }    }    //    // end Autoscroll methods    //=================================================================    //===================================================================    // begin Utility methods    //    /**     * Gets the AccessibleContext associated with this BasicComboPopup.     * The AccessibleContext will have its parent set to the ComboBox.     *     * @return an AccessibleContext for the BasicComboPopup     * @since 1.5     */    public AccessibleContext getAccessibleContext() {        AccessibleContext context = super.getAccessibleContext();        context.setAccessibleParent(comboBox);        return context;    }    /**     * This is is a utility method that helps event handlers figure out where to     * send the focus when the popup is brought up.  The standard implementation     * delegates the focus to the editor (if the combo box is editable) or to     * the JComboBox if it is not editable.     */    protected void delegateFocus( MouseEvent e ) {        if ( comboBox.isEditable() ) {            Component comp = comboBox.getEditor().getEditorComponent();            if ((!(comp instanceof JComponent)) || ((JComponent)comp).isRequestFocusEnabled()) {                comp.requestFocus();            }        }        else if (comboBox.isRequestFocusEnabled()) {            comboBox.requestFocus();        }    }    /**     * Makes the popup visible if it is hidden and makes it hidden if it is      * visible.     */    protected void togglePopup() {        if ( isVisible() ) {            hide();        }        else {            show();        }    }    /**     * Sets the list selection index to the selectedIndex. This      * method is used to synchronize the list selection with the      * combo box selection.     *      * @param selectedIndex the index to set the list     */    private void setListSelection(int selectedIndex) {        if ( selectedIndex == -1 ) {            list.clearSelection();        }        else {            list.setSelectedIndex( selectedIndex );	    list.ensureIndexIsVisible( selectedIndex );        }    }    protected MouseEvent convertMouseEvent( MouseEvent e ) {        Point convertedPoint = SwingUtilities.convertPoint( (Component)e.getSource(),                                                            e.getPoint(), list );        MouseEvent newEvent = new MouseEvent( (Component)e.getSource(),                                              e.getID(),                                              e.getWhen(),                                              e.getModifiers(),                                              convertedPoint.x,                                              convertedPoint.y,                                              e.getXOnScreen(),                                              e.getYOnScreen(),                                              e.getClickCount(),                                              e.isPopupTrigger(),                                              MouseEvent.NOBUTTON );        return newEvent;    }    /**     * Retrieves the height of the popup based on the current     * ListCellRenderer and the maximum row count.     */    protected int getPopupHeightForRowCount(int maxRowCount) {	// Set the cached value of the minimum row count        int minRowCount = Math.min( maxRowCount, comboBox.getItemCount() );        int height = 0;        ListCellRenderer renderer = list.getCellRenderer();        Object value = null;        for ( int i = 0; i < minRowCount; ++i ) {            value = list.getModel().getElementAt( i );            Component c = renderer.getListCellRendererComponent( list, value, i, false, false );            height += c.getPreferredSize().height;        }                if (height == 0) {            height = comboBox.getHeight();        }                Border border = scroller.getViewportBorder();        if (border != null) {            Insets insets = border.getBorderInsets(null);            height += insets.top + insets.bottom;        }                border = scroller.getBorder();        if (border != null) {            Insets insets = border.getBorderInsets(null);            height += insets.top + insets.bottom;        }                return height;    }    /**     * Calculate the placement and size of the popup portion of the combo box based     * on the combo box location and the enclosing screen bounds. If     * no transformations are required, then the returned rectangle will     * have the same values as the parameters.     *      * @param px starting x location     * @param py starting y location     * @param pw starting width     * @param ph starting height     * @return a rectangle which represents the placement and size of the popup     */    protected Rectangle computePopupBounds(int px,int py,int pw,int ph) {	Toolkit toolkit = Toolkit.getDefaultToolkit();        Rectangle screenBounds;	// Calculate the desktop dimensions relative to the combo box.        GraphicsConfiguration gc = comboBox.getGraphicsConfiguration();        Point p = new Point();        SwingUtilities.convertPointFromScreen(p, comboBox);        if (gc != null) {	    Insets screenInsets = toolkit.getScreenInsets(gc);            screenBounds = gc.getBounds();	    screenBounds.width -= (screenInsets.left + screenInsets.right);	    screenBounds.height -= (screenInsets.top + screenInsets.bottom);            screenBounds.x += (p.x + screenInsets.left);            screenBounds.y += (p.y + screenInsets.top);        }        else {            screenBounds = new Rectangle(p, toolkit.getScreenSize());        }        Rectangle rect = new Rectangle(px,py,pw,ph);        if (py+ph > screenBounds.y+screenBounds.height	    && ph < screenBounds.height) {	    rect.y = -rect.height;	}	return rect;    }    /**     * Calculates the upper left location of the Popup.     */    private Point getPopupLocation() {	Dimension popupSize = comboBox.getSize();	Insets insets = getInsets();	// reduce the width of the scrollpane by the insets so that the popup	// is the same width as the combo box.	popupSize.setSize(popupSize.width - (insets.right + insets.left), 			  getPopupHeightForRowCount( comboBox.getMaximumRowCount()));	Rectangle popupBounds = computePopupBounds( 0, comboBox.getBounds().height,                                                    popupSize.width, popupSize.height);	Dimension scrollSize = popupBounds.getSize();	Point popupLocation = popupBounds.getLocation();	    	scroller.setMaximumSize( scrollSize );	scroller.setPreferredSize( scrollSize );	scroller.setMinimumSize( scrollSize );		list.revalidate();	return popupLocation;    }    /**     * A utility method used by the event listeners.  Given a mouse event, it changes     * the list selection to the list item below the mouse.     */    protected void updateListBoxSelectionForEvent(MouseEvent anEvent,boolean shouldScroll) {	// XXX - only seems to be called from this class. shouldScroll flag is	// never true        Point location = anEvent.getPoint();        if ( list == null )            return;        int index = list.locationToIndex(location);        if ( index == -1 ) {            if ( location.y < 0 )                index = 0;            else                index = comboBox.getModel().getSize() - 1;        }        if ( list.getSelectedIndex() != index ) {            list.setSelectedIndex(index);            if ( shouldScroll )                list.ensureIndexIsVisible(index);        }    }    //    // end Utility methods    //=================================================================}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲最大色网站| 色偷偷久久一区二区三区| 久久精品久久精品| 午夜精品成人在线视频| 亚洲成av人片一区二区梦乃| 亚洲综合激情网| 一区二区三区在线看| 一区二区三区欧美在线观看| 亚洲图片激情小说| 综合久久久久久久| 亚洲综合一区在线| 天堂精品中文字幕在线| 日韩成人一级片| 久久精品国产**网站演员| 黄网站免费久久| 粉嫩一区二区三区在线看| 91在线国产观看| 欧美在线免费观看视频| 欧美一区二区三区视频免费| 欧美v日韩v国产v| 国产欧美一区二区三区在线看蜜臀 | 国产片一区二区| 中文字幕一区二区5566日韩| 亚洲综合色区另类av| 日韩avvvv在线播放| 激情文学综合丁香| 不卡一区在线观看| 欧美日韩在线综合| 精品裸体舞一区二区三区| 日本一二三不卡| 一区二区三区不卡视频 | 成人av资源站| 欧美在线观看视频一区二区| 欧美日本一道本在线视频| 欧美tk—视频vk| 中文字幕精品—区二区四季| 亚洲视频一二三区| 免费看精品久久片| 波多野结衣亚洲一区| 在线免费观看视频一区| 欧美videos大乳护士334| 国产精品大尺度| 首页国产丝袜综合| 国产 日韩 欧美大片| 在线观看视频一区| 精品成a人在线观看| 亚洲少妇中出一区| 紧缚捆绑精品一区二区| 91成人网在线| 2024国产精品视频| 一区二区国产盗摄色噜噜| 久久精品国产网站| 色综合视频在线观看| 欧美不卡视频一区| 亚洲国产wwwccc36天堂| 国产精品1区二区.| 欧美日韩一区二区在线观看| 久久久久久久久久久久久夜| 亚洲影院理伦片| 国产成人免费av在线| 在线播放一区二区三区| 国产精品久久久久久久久免费相片| 午夜久久久久久久久久一区二区| 国产99久久精品| 91精品国产麻豆国产自产在线 | 成人av网址在线| 日韩欧美色综合网站| 亚洲综合区在线| 成人激情校园春色| 精品国产百合女同互慰| 亚洲成a人v欧美综合天堂下载 | 欧美日韩一本到| 中文字幕五月欧美| 国产盗摄精品一区二区三区在线| 在线观看91精品国产麻豆| 亚洲欧美日韩一区二区| 91精品国产综合久久精品麻豆| 国产精品欧美经典| 国产麻豆精品95视频| 91.xcao| 亚洲午夜精品久久久久久久久| 高清shemale亚洲人妖| 精品国产乱码久久久久久免费| 日韩在线一二三区| 欧美日韩国产不卡| 亚洲精品国产无天堂网2021| 不卡视频一二三四| 国产拍揄自揄精品视频麻豆| 91免费观看在线| 国产精品的网站| 成人精品免费网站| 国产精品嫩草久久久久| 国产电影一区在线| 欧美激情一区二区三区全黄| 蜜臀99久久精品久久久久久软件| 欧美美女bb生活片| 五月天中文字幕一区二区| 欧美老女人第四色| 三级久久三级久久久| 宅男噜噜噜66一区二区66| 亚瑟在线精品视频| 91精品婷婷国产综合久久竹菊| 亚洲国产sm捆绑调教视频| 欧美影院精品一区| 婷婷久久综合九色综合绿巨人| 欧美日韩一区不卡| 丝袜a∨在线一区二区三区不卡| 欧美日韩亚洲综合| 青草av.久久免费一区| 欧美一区二区三区播放老司机| 五月天视频一区| 日韩精品中文字幕在线不卡尤物| 久88久久88久久久| 久久精品水蜜桃av综合天堂| 粉嫩av一区二区三区粉嫩| 中日韩免费视频中文字幕| 99精品一区二区| 亚洲主播在线观看| 欧美一区二区三区在线观看 | 国产成人自拍网| 日本一区二区三区免费乱视频| 风间由美中文字幕在线看视频国产欧美 | 日韩一级二级三级| 国产福利不卡视频| 亚洲天堂福利av| 欧美日本一道本| 国内精品国产成人| 亚洲图片另类小说| 911精品国产一区二区在线| 极品尤物av久久免费看| 国产精品家庭影院| 91黄色免费网站| 蜜桃精品视频在线| 中文字幕在线观看不卡| 欧美性受xxxx| 国产真实乱偷精品视频免| 中文字幕一区二区三区在线观看| 91久久精品国产91性色tv| 美女性感视频久久| 国产精品久久久久久久久动漫 | 久久伊99综合婷婷久久伊| www.欧美日韩| 人人狠狠综合久久亚洲| 中文字幕第一区二区| 欧美日韩精品一区二区三区蜜桃| 黄色成人免费在线| 专区另类欧美日韩| 欧美videossexotv100| 91日韩一区二区三区| 男人的j进女人的j一区| 中文字幕一区免费在线观看| 欧美日韩国产天堂| 成人午夜免费电影| 日本不卡123| 亚洲日本一区二区三区| 日韩欧美一二三区| 色94色欧美sute亚洲线路一久 | 92国产精品观看| 精品一区二区三区影院在线午夜 | 一区二区理论电影在线观看| 欧美成人免费网站| 欧美中文一区二区三区| 高清久久久久久| 男男成人高潮片免费网站| 亚洲日本va在线观看| 久久综合九色综合久久久精品综合 | 成人黄动漫网站免费app| 免费成人av在线| 亚洲国产综合在线| 亚洲欧洲日韩av| 国产性做久久久久久| 91精品国产色综合久久不卡电影| 一本色道亚洲精品aⅴ| 国产精品影视网| 久久99久国产精品黄毛片色诱| 亚洲精品菠萝久久久久久久| 国产视频一区在线播放| 日韩女优av电影在线观看| 欧美日韩久久一区二区| 色婷婷久久综合| 成人av在线观| 国产成人免费av在线| 国内精品久久久久影院薰衣草| 香蕉av福利精品导航| 亚洲午夜羞羞片| 一区二区三区国产| 亚洲免费在线看| 国产精品家庭影院| 国产精品久线观看视频| 久久亚洲精品国产精品紫薇| 欧美va日韩va| 精品免费日韩av| 精品日韩一区二区三区| 欧美一区二区免费视频| 欧美日本在线看| 欧美一区二区三区在| 91精品国产一区二区三区蜜臀 | 亚洲视频你懂的| 日韩毛片在线免费观看| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 |