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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? xtrascrollbarui.java

?? Skin Look And Feel 1.2.10, 給你的java程序換膚, 支持大量通用皮膚文件.
?? JAVA
字號(hào):
/* ====================================================================
 *
 * Skin Look And Feel 1.2.10 License.
 *
 * Copyright (c) 2000-2004 L2FProd.com.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *    any, must include the following acknowlegement:
 *       "This product includes software developed by L2FProd.com
 *        (http://www.L2FProd.com/)."
 *    Alternately, this acknowlegement may appear in the software itself,
 *    if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "Skin Look And Feel", "SkinLF" and "L2FProd.com" must not
 *    be used to endorse or promote products derived from this software
 *    without prior written permission. For written permission, please
 *    contact info@L2FProd.com.
 *
 * 5. Products derived from this software may not be called "SkinLF"
 *    nor may "SkinLF" appear in their names without prior written
 *    permission of L2FProd.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL L2FPROD.COM OR ITS CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * ====================================================================
 */
package com.l2fprod.gui.plaf.xtra;

import javax.swing.plaf.basic.*;
import javax.swing.plaf.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

/**
 * XTra Scrollbar. <br>
 *
 *
 * @author    $Author: l2fprod $
 * @created   27 avril 2002
 * @version   $Revision: 1.2 $, $Date: 2004/07/29 19:09:27 $
 */
public class XTraScrollBarUI extends BasicScrollBarUI {

  /**
   * Description of the Field
   */
  protected boolean useAlternateLayout = Boolean.TRUE.equals(UIManager.get("ScrollBar.alternateLayout"));

  /**
   * Sets the ThumbBounds attribute of the XTraScrollBarUI object
   *
   * @param x  The new ThumbBounds value
   * @param y  The new ThumbBounds value
   * @param w  The new ThumbBounds value
   * @param h  The new ThumbBounds value
   */
  public void setThumbBounds(int x, int y, int w, int h) {
    super.setThumbBounds(x, y, w, h);
  }

  /**
   * Gets the Dragging attribute of the XTraScrollBarUI object
   *
   * @return   The Dragging value
   */
  public boolean isDragging() {
    return isDragging;
  }

  /**
   * Gets the ThumbBounds attribute of the XTraScrollBarUI object
   *
   * @return   The ThumbBounds value
   */
  public Rectangle getThumbBounds() {
    return super.getThumbBounds();
  }

  /**
   * Gets the TrackBounds attribute of the XTraScrollBarUI object
   *
   * @return   The TrackBounds value
   */
  public Rectangle getTrackBounds() {
    return super.getTrackBounds();
  }

  /**
   * Description of the Method
   *
   * @return   Description of the Returned Value
   */
  public JButton decrButton() {
    return decrButton;
  }

  /**
   * Description of the Method
   *
   * @return   Description of the Returned Value
   */
  public JButton incrButton() {
    return incrButton;
  }

  /**
   * Description of the Method
   *
   * @return   Description of the Returned Value
   */
  public JScrollBar scrollbar() {
    return scrollbar;
  }

  /**
   * Description of the Method
   *
   * @param sb  Description of Parameter
   */
  protected void layoutVScrollbar(JScrollBar sb) {
    if (useAlternateLayout) {
      alternateLayoutVScrollbar(sb);
    }
    else {
      super.layoutVScrollbar(sb);
    }
  }

  /**
   * Description of the Method
   *
   * @param sb  Description of Parameter
   */
  protected void alternateLayoutVScrollbar(JScrollBar sb) {
    Dimension sbSize = sb.getSize();
    Insets sbInsets = sb.getInsets();

    /*
     *  Width and left edge of the buttons and thumb.
     */
    int itemW = sbSize.width - (sbInsets.left + sbInsets.right);
    int itemX = sbInsets.left;

    /*
     *  Nominal locations of the buttons, assuming their preferred
     *  size will fit.
     */
    int incrButtonH = incrButton.getPreferredSize().height;
    int incrButtonY = sbSize.height - (sbInsets.bottom + incrButtonH);

    int decrButtonH = decrButton.getPreferredSize().height;
    int decrButtonY = incrButtonY - decrButtonH;

    /*
     *  The thumb must fit within the height left over after we
     *  subtract the preferredSize of the buttons and the insets.
     */
    int sbInsetsH = sbInsets.top + sbInsets.bottom;
    int sbButtonsH = decrButtonH + incrButtonH;
    float trackH = sbSize.height - (sbInsetsH + sbButtonsH);

    /*
     *  Compute the height and origin of the thumb.   The case
     *  where the thumb is at the bottom edge is handled specially
     *  to avoid numerical problems in computing thumbY.  Enforce
     *  the thumbs min/max dimensions.  If the thumb doesn't
     *  fit in the track (trackH) we'll hide it later.
     */
    float min = sb.getMinimum();
    float extent = sb.getVisibleAmount();
    float range = sb.getMaximum() - min;
    float value = sb.getValue();

    int thumbH = (range <= 0)
        ? getMaximumThumbSize().height : (int) (trackH * (extent / range));
    thumbH = Math.max(thumbH, getMinimumThumbSize().height);
    thumbH = Math.min(thumbH, getMaximumThumbSize().height);

    int thumbY = decrButtonY - thumbH;
    //incrButtonY - thumbH;
    if (sb.getValue() < (sb.getMaximum() - sb.getVisibleAmount())) {
      float thumbRange = trackH - thumbH;
      thumbY = (int) (0.5f + (thumbRange * ((value - min) / (range - extent))));
      //thumbY +=  decrButtonY + decrButtonH;
    }

    /*
     *  If the buttons don't fit, allocate half of the available
     *  space to each and move the lower one (incrButton) down.
     */
    int sbAvailButtonH = (sbSize.height - sbInsetsH);
    if (sbAvailButtonH < sbButtonsH) {
      incrButtonH = decrButtonH = sbAvailButtonH / 2;
      incrButtonY = sbSize.height - (sbInsets.bottom + incrButtonH);
    }
    decrButton.setBounds(itemX, decrButtonY, itemW, decrButtonH);
    incrButton.setBounds(itemX, incrButtonY, itemW, incrButtonH);

    /*
     *  Update the trackRect field.
     */
    int itrackY = sbInsets.top;
    int itrackH = decrButtonY - itrackY;
    trackRect.setBounds(itemX, itrackY, itemW, itrackH);

    /*
     *  If the thumb isn't going to fit, zero it's bounds.  Otherwise
     *  make sure it fits between the buttons.  Note that setting the
     *  thumbs bounds will cause a repaint.
     */
    if (thumbH >= (int) trackH) {
      setThumbBounds(0, 0, 0, 0);
    }
    else {
      if ((thumbY + thumbH) > decrButtonY) {
        thumbY = decrButtonY - thumbH;
      }
      /*
       *  if (thumbY  < (decrButtonY + decrButtonH)) {
       *  thumbY = decrButtonY + decrButtonH + 1;
       *  }
       */
      setThumbBounds(itemX, thumbY, itemW, thumbH);
    }
  }

  /**
   * Description of the Method
   *
   * @param sb  Description of Parameter
   */
  protected void layoutHScrollbar(JScrollBar sb) {
    if (useAlternateLayout) {
      alternateLayoutHScrollbar(sb);
    }
    else {
      super.layoutHScrollbar(sb);
    }
  }

  /**
   * Description of the Method
   *
   * @param sb  Description of Parameter
   */
  protected void alternateLayoutHScrollbar(JScrollBar sb) {
    Dimension sbSize = sb.getSize();
    Insets sbInsets = sb.getInsets();

    /*
     *  Height and top edge of the buttons and thumb.
     */
    int itemH = sbSize.height - (sbInsets.top + sbInsets.bottom);
    int itemY = sbInsets.top;

    /*
     *  Nominal locations of the buttons, assuming their preferred
     *  size will fit.
     */
    int incrButtonW = incrButton.getPreferredSize().width;
    int incrButtonX = sbSize.width - (sbInsets.right + incrButtonW);

    int decrButtonW = decrButton.getPreferredSize().width;
    int decrButtonX = incrButtonX - decrButtonW;

    /*
     *  The thumb must fit within the width left over after we
     *  subtract the preferredSize of the buttons and the insets.
     */
    int sbInsetsW = sbInsets.left + sbInsets.right;
    int sbButtonsW = decrButtonW + incrButtonW;
    float trackW = sbSize.width - (sbInsetsW + sbButtonsW);

    /*
     *  Compute the width and origin of the thumb.  Enforce
     *  the thumbs min/max dimensions.  The case where the thumb
     *  is at the right edge is handled specially to avoid numerical
     *  problems in computing thumbX.  If the thumb doesn't
     *  fit in the track (trackH) we'll hide it later.
     */
    float min = sb.getMinimum();
    float extent = sb.getVisibleAmount();
    float range = sb.getMaximum() - min;
    float value = sb.getValue();

    int thumbW = (range <= 0)
        ? getMaximumThumbSize().width : (int) (trackW * (extent / range));
    thumbW = Math.max(thumbW, getMinimumThumbSize().width);
    thumbW = Math.min(thumbW, getMaximumThumbSize().width);

    int thumbX = decrButtonX - thumbW;
    if (sb.getValue() < (sb.getMaximum() - sb.getVisibleAmount())) {
      float thumbRange = trackW - thumbW;
      thumbX = (int) (0.5f + (thumbRange * ((value - min) / (range - extent))));
      //thumbX +=  decrButtonX + decrButtonW;
    }

    /*
     *  If the buttons don't fit, allocate half of the available
     *  space to each and move the right one (incrButton) over.
     */
    int sbAvailButtonW = (sbSize.width - sbInsetsW);
    if (sbAvailButtonW < sbButtonsW) {
      incrButtonW = decrButtonW = sbAvailButtonW / 2;
      incrButtonX = sbSize.width - (sbInsets.right + incrButtonW);
    }

    decrButton.setBounds(decrButtonX, itemY, decrButtonW, itemH);
    incrButton.setBounds(incrButtonX, itemY, incrButtonW, itemH);

    /*
     *  Update the trackRect field.
     */
    int itrackX = sbInsets.left;
    //decrButtonX + decrButtonW;
    int itrackW = decrButtonX - itrackX;
    trackRect.setBounds(itrackX, itemY, itrackW, itemH);

    /*
     *  Make sure the thumb fits between the buttons.  Note
     *  that setting the thumbs bounds causes a repaint.
     */
    if (thumbW >= (int) trackW) {
      setThumbBounds(0, 0, 0, 0);
    }
    else {
      if (thumbX + thumbW > incrButtonX) {
        thumbX = incrButtonX - thumbW;
      }
      /*
       *  if (thumbX  < decrButtonX + decrButtonW) {
       *  thumbX = decrButtonX + decrButtonW + 1;
       *  }
       */
      setThumbBounds(thumbX, itemY, thumbW, itemH);
    }
  }

  /**
   * Description of the Method
   *
   * @return   Description of the Returned Value
   */
  protected TrackListener createTrackListener() {
    if (useAlternateLayout) {
      return new MyTrackListener();
    }
    else {
      return super.createTrackListener();
    }
  }

  /**
   * Description of the Method
   *
   * @param x  Description of Parameter
   * @return   Description of the Returned Value
   */
  public static ComponentUI createUI(JComponent x) {
    return new XTraScrollBarUI();
  }

  /**
   * Track mouse drags.
   *
   * @author    fred
   * @created   27 avril 2002
   */
  public class MyTrackListener
       extends TrackListener {
    /**
     * Set the models value to the position of the top/left of the thumb
     * relative to the origin of the track.
     *
     * @param e  Description of Parameter
     */
    public void mouseDragged(MouseEvent e) {
      if (!XTraScrollBarUI.this.scrollbar().isEnabled() || !XTraScrollBarUI.this.isDragging()) {
        return;
      }

      Insets sbInsets = XTraScrollBarUI.this.scrollbar().getInsets();

      BoundedRangeModel model = XTraScrollBarUI.this.scrollbar().getModel();
      Rectangle thumbR = XTraScrollBarUI.this.getThumbBounds();
      int thumbMin;
      int thumbMax;
      int thumbPos;

      if (XTraScrollBarUI.this.scrollbar().getOrientation() == JScrollBar.VERTICAL) {
        thumbMin = sbInsets.top;
        //decrButton.getY() + decrButton.getHeight();
        thumbMax = XTraScrollBarUI.this.decrButton().getY()
        /*
         *  incrButton.getY()
         */
            - XTraScrollBarUI.this.getThumbBounds().height;
        thumbPos = Math.min(thumbMax, Math.max(thumbMin, (e.getY() - offset)));
        XTraScrollBarUI.this.setThumbBounds(thumbR.x, thumbPos, thumbR.width, thumbR.height);
      }
      else {
        thumbMin = sbInsets.left;
        //decrButton.getX() + decrButton.getWidth();
        thumbMax = XTraScrollBarUI.this.decrButton().getX()
        /*
         *  incrButton.getX()
         */
            - XTraScrollBarUI.this.getThumbBounds().width;
        thumbPos = Math.min(thumbMax, Math.max(thumbMin, (e.getX() - offset)));
        XTraScrollBarUI.this.setThumbBounds(thumbPos, thumbR.y, thumbR.width, thumbR.height);
      }

      /*
       *  Set the scrollbars value.  If the thumb has reached the end of
       *  the scrollbar, then just set the value to its maximum.  Otherwise
       *  compute the value as accurately as possible.
       */
      if (thumbPos == thumbMax) {
        XTraScrollBarUI.this.scrollbar().setValue(model.getMaximum() - model.getExtent());
      }
      else {
        float valueMax = model.getMaximum() - model.getExtent();
        float valueRange = valueMax - model.getMinimum();
        float thumbValue = thumbPos - thumbMin;
        float thumbRange = thumbMax - thumbMin;
        int value = (int) (0.5 + ((thumbValue / thumbRange) * valueRange));
        XTraScrollBarUI.this.scrollbar().setValue(value + model.getMinimum());
      }
    }
  }

}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲影院久久精品| 亚洲欧美激情视频在线观看一区二区三区| 91视频免费播放| 成人国产电影网| 成人激情av网| 99精品久久只有精品| 99在线热播精品免费| 91伊人久久大香线蕉| 99精品欧美一区二区三区小说| 97精品久久久午夜一区二区三区 | 精品一区二区日韩| 日韩免费一区二区| 欧美大胆一级视频| 精品成人一区二区| 国产亚洲欧美在线| 国产精品你懂的在线| 国产精品伦理在线| 亚洲免费av高清| 亚洲福利电影网| 蜜臀av性久久久久蜜臀aⅴ| 日本不卡一区二区| 韩国av一区二区三区在线观看| 激情综合网最新| 成人亚洲一区二区一| 91丨porny丨户外露出| 欧美日韩国产中文| 精品久久久久久亚洲综合网| 久久精品水蜜桃av综合天堂| 中文字幕制服丝袜成人av| 精品一区二区三区免费| 成人午夜碰碰视频| 欧美一级日韩免费不卡| 欧美电影免费观看高清完整版在线观看| 欧美亚洲自拍偷拍| 欧美一区二区久久| 欧美激情在线免费观看| 一区二区三区自拍| 麻豆视频观看网址久久| 成人高清在线视频| 欧美三级中文字| 精品久久久久久久久久久久包黑料 | 日韩国产精品久久久久久亚洲| 蜜芽一区二区三区| 成人在线视频首页| 欧美精品色一区二区三区| 久久久久国产一区二区三区四区| 亚洲视频在线一区观看| 麻豆免费看一区二区三区| 99精品桃花视频在线观看| 在线电影欧美成精品| 欧美国产日本视频| 五月婷婷色综合| 成人免费毛片aaaaa**| 欧美日韩一区二区三区在线| 91亚洲资源网| 日韩欧美在线123| 1区2区3区国产精品| 蜜臀av性久久久久蜜臀aⅴ四虎| 成人黄页毛片网站| 日韩视频一区二区三区在线播放| 国产精品理论片| 另类中文字幕网| 在线视频你懂得一区二区三区| 欧美精品一区二区高清在线观看| 一区二区高清在线| 国产69精品一区二区亚洲孕妇| 欧美区一区二区三区| 国产精品美女久久久久高潮| 捆绑紧缚一区二区三区视频| 在线观看日韩电影| 国产精品美女一区二区在线观看| 久久国产精品99久久久久久老狼 | 色综合久久中文综合久久牛| 日韩精品一区二区三区中文不卡 | 欧美中文字幕一二三区视频| 日本一区二区综合亚洲| 蜜臀91精品一区二区三区| 在线精品亚洲一区二区不卡| 国产精品福利一区二区| 国产一区二区三区国产| 日韩一级片网站| 亚洲不卡在线观看| 91国产精品成人| 国产精品蜜臀av| 国产高清久久久| 久久香蕉国产线看观看99| 三级不卡在线观看| 欧美调教femdomvk| 一区二区三区美女视频| 99精品国产一区二区三区不卡| 久久精品亚洲麻豆av一区二区| 精品一区二区精品| 日韩亚洲欧美中文三级| 日韩精品91亚洲二区在线观看 | 欧美tickle裸体挠脚心vk| 日韩国产欧美在线播放| 欧美伦理视频网站| 首页国产丝袜综合| 欧美精品高清视频| 日日欢夜夜爽一区| 69久久夜色精品国产69蝌蚪网| 婷婷国产v国产偷v亚洲高清| 欧美日韩免费观看一区二区三区 | 韩国精品在线观看| 精品91自产拍在线观看一区| 狠狠色综合播放一区二区| 欧美mv和日韩mv的网站| 久久精品国产亚洲aⅴ| 精品日韩在线观看| 精品一区二区国语对白| 久久蜜桃一区二区| 国产99久久久精品| 国产精品卡一卡二| 色综合久久中文综合久久97| 一区二区三区四区五区视频在线观看| 日本一区二区免费在线| 成熟亚洲日本毛茸茸凸凹| 国产精品沙发午睡系列990531| 成人午夜av电影| 亚洲色图一区二区三区| 欧美性大战久久久久久久蜜臀| 日韩中文字幕麻豆| 日韩你懂的在线播放| 国产91丝袜在线播放九色| 国产精品国产自产拍高清av王其| 色综合久久久久久久久| 午夜在线成人av| 精品奇米国产一区二区三区| 国产宾馆实践打屁股91| 最近日韩中文字幕| 欧美日韩国产高清一区二区| 男女男精品视频| 中文字幕的久久| 99r国产精品| 高清beeg欧美| 91精品免费观看| 韩国成人精品a∨在线观看| 日本一区二区不卡视频| 91福利资源站| 久久99久久精品| 中文字幕在线观看一区二区| 欧美专区在线观看一区| 精品在线免费视频| 亚洲欧美综合网| 欧美一级一级性生活免费录像| 国产成人自拍网| 亚洲123区在线观看| 久久九九久久九九| 欧美在线视频全部完| 国产在线播放一区| 一区二区三区四区在线播放| 久久综合色一综合色88| 在线视频一区二区免费| 国产伦精品一区二区三区免费 | 777xxx欧美| 国产成人在线影院| 亚洲成人激情综合网| 国产欧美精品一区| 欧美二区乱c少妇| 99视频超级精品| 精品在线一区二区| 亚洲一二三区在线观看| 日本一区二区三区国色天香| 欧美日韩和欧美的一区二区| 国产高清不卡一区| 天天射综合影视| 亚洲欧美日韩国产综合在线| 精品久久久久久久久久久久久久久久久 | 综合分类小说区另类春色亚洲小说欧美| 欧美一区日本一区韩国一区| 99综合影院在线| 国产一区二区按摩在线观看| 爽好久久久欧美精品| 亚洲美女免费视频| 久久久久久久综合狠狠综合| 555www色欧美视频| 91久久精品午夜一区二区| 成人做爰69片免费看网站| 另类小说一区二区三区| 亚洲超碰97人人做人人爱| 亚洲欧美另类图片小说| 国产三区在线成人av| 欧美mv日韩mv亚洲| 欧美一区二区三级| 欧美日本一区二区三区四区| 91免费观看视频在线| 色哟哟在线观看一区二区三区| 欧美国产丝袜视频| 国产伦精品一区二区三区在线观看| 日韩一区二区在线观看视频 | 精品一区二区三区免费观看| 国产欧美一区二区三区在线老狼| 欧美一区二区三区成人| 在线观看视频91| 91视频一区二区三区| 成人精品国产免费网站| 国产乱人伦偷精品视频不卡| 久久精品国产999大香线蕉| 日本va欧美va瓶| 日本伊人午夜精品|