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

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

?? jcollapsiblepane.java

?? java swing控件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/**
 * L2FProd.com Common Components 6.9.1 License.
 *
 * Copyright 2005-2006 L2FProd.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.l2fprod.common.swing;

import java.awt.AlphaComposite;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Composite;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import javax.swing.AbstractAction;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.Timer;

/**
 * <code>JCollapsiblePane</code> provides a component which can collapse or
 * expand its content area with animation and fade in/fade out effects.
 * It also acts as a standard container for other Swing components.
 * 
 * <p>
 * In this example, the <code>JCollapsiblePane</code> is used to build
 * a Search pane which can be shown and hidden on demand.
 * 
 * <pre>
 * <code>
 * JCollapsiblePane cp = new JCollapsiblePane();
 *
 * // JCollapsiblePane can be used like any other container
 * cp.setLayout(new BorderLayout());
 * 
 * // the Controls panel with a textfield to filter the tree
 * JPanel controls = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 0));
 * controls.add(new JLabel("Search:"));
 * controls.add(new JTextField(10));    
 * controls.add(new JButton("Refresh"));
 * controls.setBorder(new TitledBorder("Filters"));
 * cp.add("Center", controls);
 *   
 * JFrame frame = new JFrame();
 * frame.setLayout(new BorderLayout());
 *  
 * // Put the "Controls" first
 * frame.add("North", cp);
 *    
 * // Then the tree - we assume the Controls would somehow filter the tree
 * JScrollPane scroll = new JScrollPane(new JTree());
 * frame.add("Center", scroll);
 *
 * // Show/hide the "Controls"
 * JButton toggle = new JButton(cp.getActionMap().get(JCollapsiblePane.TOGGLE_ACTION));
 * toggle.setText("Show/Hide Search Panel");
 * frame.add("South", toggle);
 *
 * frame.pack();
 * frame.setVisible(true);
 * </code>
 * </pre>
 * 
 * <p>
 * Note: <code>JCollapsiblePane</code> requires its parent container to have a
 * {@link java.awt.LayoutManager} using {@link #getPreferredSize()} when
 * calculating its layout (example {@link com.l2fprod.common.swing.PercentLayout},
 * {@link java.awt.BorderLayout}). 
 * 
 * @javabean.attribute
 *          name="isContainer"
 *          value="Boolean.TRUE"
 *          rtexpr="true"
 * 
 * @javabean.attribute
 *          name="containerDelegate"
 *          value="getContentPane"
 *          
 * @javabean.class
 *          name="JCollapsiblePane"
 *          shortDescription="A pane which hides its content with an animation."
 *          stopClass="java.awt.Component"
 *          
 * @author rbair (from the JDNC project)
 * @author <a href="mailto:fred@L2FProd.com">Frederic Lavigne</a>
 */
public class JCollapsiblePane extends JPanel {

  /**
   * Used when generating PropertyChangeEvents for the "animationState" property
   */
  public final static String ANIMATION_STATE_KEY = "animationState";
  
  /**
   * JCollapsible has a built-in toggle action which can be bound to buttons.
   * Accesses the action through
   * <code>collapsiblePane.getActionMap().get(JCollapsiblePane.TOGGLE_ACTION)</code>.
   */
  public final static String TOGGLE_ACTION = "toggle";
  
  /**
   * The icon used by the "toggle" action when the JCollapsiblePane is
   * expanded, i.e the icon which indicates the pane can be collapsed.
   */
  public final static String COLLAPSE_ICON = "collapseIcon";
  
  /**
   * The icon used by the "toggle" action when the JCollapsiblePane is
   * collapsed, i.e the icon which indicates the pane can be expanded.
   */
  public final static String EXPAND_ICON = "expandIcon";

  /**
   * Indicates whether the component is collapsed or expanded
   */
  private boolean collapsed = false;

  /**
   * Timer used for doing the transparency animation (fade-in)
   */
  private Timer animateTimer;
  private AnimationListener animator;
  private int currentHeight = -1;
  private WrapperContainer wrapper;
  private boolean useAnimation = true;
  private AnimationParams animationParams;

  /**
   * Constructs a new JCollapsiblePane with a {@link JPanel} as content pane and
   * a vertical {@link PercentLayout} with a gap of 2 pixels as layout manager.
   */
  public JCollapsiblePane() {
    super.setLayout(new BorderLayout(0, 0));

    JPanel panel = new JPanel();
    panel.setLayout(new PercentLayout(PercentLayout.VERTICAL, 2));
    setContentPane(panel);

    animator = new AnimationListener();
    setAnimationParams(new AnimationParams(30, 8, 0.01f, 1.0f));
    
    // add an action to automatically toggle the state of the pane
    getActionMap().put(TOGGLE_ACTION, new ToggleAction());
  }

  /**
   * Toggles the JCollapsiblePane state and updates its icon based on the
   * JCollapsiblePane "collapsed" status.
   */
  private class ToggleAction extends AbstractAction  implements
    PropertyChangeListener {
    public ToggleAction() {
      super(TOGGLE_ACTION);
      updateIcon();
      // the action must track the collapsed status of the pane to update its
      // icon
      JCollapsiblePane.this.addPropertyChangeListener("collapsed", this);
    }
    public void putValue(String key, Object newValue) {
      super.putValue(key, newValue);
      if (EXPAND_ICON.equals(key) || COLLAPSE_ICON.equals(key)) {
        updateIcon();
      }
    }
    public void actionPerformed(ActionEvent e) {      
      setCollapsed(!isCollapsed());
    }
    public void propertyChange(PropertyChangeEvent evt) {
      updateIcon();
    }
    void updateIcon() {      
      if (isCollapsed()) {
        putValue(SMALL_ICON, getValue(EXPAND_ICON));
      } else {
        putValue(SMALL_ICON, getValue(COLLAPSE_ICON));
      }
    }
  }

  /**
   * Sets the content pane of this JCollapsiblePane. Components must be added
   * to this content pane, not to the JCollapsiblePane.
   * 
   * @param contentPanel
   * @throws IllegalArgumentException
   *           if contentPanel is null
   */
  public void setContentPane(Container contentPanel) {
    if (contentPanel == null) {
      throw new IllegalArgumentException("Content pane can't be null");
    }
    
    if (wrapper != null) {
      super.remove(wrapper);
    }
    wrapper = new WrapperContainer(contentPanel);
    super.addImpl(wrapper, BorderLayout.CENTER, -1);
  }

  /**
   * @return the content pane
   */
  public Container getContentPane() {
    return wrapper.c;
  }

  /**
   * Overriden to redirect call to the content pane.
   */
  public void setLayout(LayoutManager mgr) {
    // wrapper can be null when setLayout is called by "super()" constructor
    if (wrapper != null) {
      getContentPane().setLayout(mgr);
    }
  }

  /**
   * Overriden to redirect call to the content pane.
   */
  protected void addImpl(Component comp, Object constraints, int index) {
    getContentPane().add(comp, constraints, index);
  }

  /**
   * Overriden to redirect call to the content pane
   */
  public void remove(Component comp) {
    getContentPane().remove(comp);
  }

  /**
   * Overriden to redirect call to the content pane.
   */
  public void remove(int index) {
    getContentPane().remove(index);
  }
  
  /**
   * Overriden to redirect call to the content pane.
   */
  public void removeAll() {
    getContentPane().removeAll();
  }
  
  /**
   * If true, enables the animation when pane is collapsed/expanded. If false,
   * animation is turned off.
   * 
   * <p>
   * When animated, the <code>JCollapsiblePane</code> will progressively
   * reduce (when collapsing) or enlarge (when expanding) the height of its
   * content area until it becomes 0 or until it reaches the preferred height of
   * the components it contains. The transparency of the content area will also
   * change during the animation.
   * 
   * <p>
   * If not animated, the <code>JCollapsiblePane</code> will simply hide
   * (collapsing) or show (expanding) its content area.
   * 
   * @param animated
   * @javabean.property bound="true" preferred="true"
   */
  public void setAnimated(boolean animated) {
    if (animated != useAnimation) {
      useAnimation = animated;
      firePropertyChange("animated", !useAnimation, useAnimation);
    }
  }

  /**
   * @return true if the pane is animated, false otherwise
   * @see #setAnimated(boolean)
   */
  public boolean isAnimated() {
    return useAnimation;
  }

  /**
   * @return true if the pane is collapsed, false if expanded
   */
  public boolean isCollapsed() {
    return collapsed;
  }

  /**
   * Expands or collapses this <code>JCollapsiblePane</code>.
   * 
   * <p>
   * If the component is collapsed and <code>val</code> is false, then this
   * call expands the JCollapsiblePane, such that the entire JCollapsiblePane
   * will be visible. If {@link #isAnimated()} returns true, the expansion will
   * be accompanied by an animation.
   * 
   * <p>
   * However, if the component is expanded and <code>val</code> is true, then
   * this call collapses the JCollapsiblePane, such that the entire
   * JCollapsiblePane will be invisible. If {@link #isAnimated()} returns true,
   * the collapse will be accompanied by an animation.
   * 
   * @see #isAnimated()
   * @see #setAnimated(boolean)
   * @javabean.property
   *          bound="true"
   *          preferred="true"
   */
  public void setCollapsed(boolean val) {
    if (collapsed != val) {
      collapsed = val;
      if (isAnimated()) {
        if (collapsed) {
          setAnimationParams(new AnimationParams(30, Math.max(8, wrapper
            .getHeight() / 10), 1.0f, 0.01f));
          animator.reinit(wrapper.getHeight(), 0);
          animateTimer.start();
        } else {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色丁香婷婷综合久久片| 日韩欧美色电影| 国产精品久久久久精k8| voyeur盗摄精品| 亚洲精品视频一区二区| 在线观看日韩国产| 蜜臀99久久精品久久久久久软件| 日韩一区二区在线看片| 国产剧情av麻豆香蕉精品| 中文字幕第一区| 欧美日韩另类一区| 国模套图日韩精品一区二区| 国产精品拍天天在线| 欧美性大战久久久久久久蜜臀 | 亚洲国产欧美另类丝袜| 在线电影国产精品| 国产麻豆成人精品| 亚洲色图都市小说| 日韩欧美一二区| 成人h版在线观看| 午夜精品久久久久久久久久久| 欧美精品一区二| 91精品国产综合久久精品性色| 国产美女av一区二区三区| 国产精品白丝在线| 欧美精品 国产精品| 国产在线精品一区二区| 一区二区三区免费在线观看| 69av一区二区三区| 成人动漫精品一区二区| 天天操天天色综合| 国产精品免费视频观看| 欧美群妇大交群的观看方式| 国产精品1024久久| 三级一区在线视频先锋| 亚洲欧洲日产国码二区| 欧美大白屁股肥臀xxxxxx| 欧美日韩一区二区不卡| 欧美电视剧免费全集观看| 国产精品国产自产拍高清av王其| 欧美日韩精品一区二区| 亚洲国产经典视频| 久久99最新地址| 日韩三级.com| 婷婷中文字幕综合| 久久亚洲影视婷婷| 男女男精品视频| 中文av一区特黄| 秋霞成人午夜伦在线观看| 一本久久综合亚洲鲁鲁五月天| 国产欧美一区视频| 99精品欧美一区二区蜜桃免费| 樱花影视一区二区| 一区二区在线观看视频在线观看| 成人美女视频在线观看18| 中文字幕乱码日本亚洲一区二区| 这里是久久伊人| 在线观看精品一区| 91麻豆精品一区二区三区| 国产经典欧美精品| 国内精品久久久久影院色| 亚洲第一主播视频| 一区二区三区视频在线观看 | 成人av片在线观看| 韩国欧美国产一区| 韩国中文字幕2020精品| 免费在线观看精品| 日本欧美韩国一区三区| 亚洲一区自拍偷拍| 亚洲一区欧美一区| 亚洲精品视频在线观看免费| 亚洲视频综合在线| 亚洲精品欧美综合四区| 亚洲精选一二三| 亚洲精品一卡二卡| 亚洲免费在线电影| 一区二区三区欧美在线观看| 一区二区三区精品在线| 一区二区三区日韩精品视频| 亚洲黄色免费电影| 亚洲国产日产av| 日本不卡123| 久久精品国产网站| 国产精品羞羞答答xxdd| 国产高清精品网站| 不卡欧美aaaaa| 一本大道久久a久久精二百| 94-欧美-setu| 欧美日韩中文国产| 欧美一级夜夜爽| 久久综合色8888| 国产欧美日韩在线视频| 亚洲美女在线国产| 亚洲成a人片综合在线| 婷婷综合五月天| 黄色成人免费在线| 国产91精品欧美| 欧美亚洲综合网| 91精品国产黑色紧身裤美女| 精品日韩在线观看| 国产精品热久久久久夜色精品三区 | 日韩高清在线一区| 国产永久精品大片wwwapp| 99久久久国产精品免费蜜臀| 欧美三级电影在线观看| 精品久久久久香蕉网| 国产精品久久午夜| 亚洲国产va精品久久久不卡综合| 麻豆专区一区二区三区四区五区| 国产黄色精品视频| 欧美三级视频在线观看| 欧美精品一区二区三区四区| 亚洲乱码国产乱码精品精可以看 | 国产精品网曝门| 亚洲一卡二卡三卡四卡五卡| 久久成人免费网| 99re亚洲国产精品| 欧美一区二区免费观在线| 国产精品久久久久永久免费观看| 亚洲国产一区视频| 成人久久久精品乱码一区二区三区| 色噜噜狠狠成人中文综合| 欧美一二三区在线| 中文无字幕一区二区三区| 婷婷一区二区三区| 91无套直看片红桃| 欧美精品一区二区三区蜜桃视频| 亚洲自拍另类综合| 国产宾馆实践打屁股91| 在线不卡免费av| 综合av第一页| 国产一区二区三区四区在线观看 | 国产精品一区二区不卡| 欧美日韩一区二区三区高清| 国产女主播在线一区二区| 日精品一区二区三区| 91麻豆国产福利在线观看| 亚洲精品一区二区在线观看| 亚洲一区精品在线| 99re热这里只有精品视频| 精品日产卡一卡二卡麻豆| 亚洲综合免费观看高清完整版在线| 黑人巨大精品欧美黑白配亚洲 | 欧美一级精品大片| 亚洲国产综合91精品麻豆| 99re这里只有精品视频首页| 久久久亚洲精品一区二区三区 | 五月激情丁香一区二区三区| www.亚洲人| 一区二区三区四区视频精品免费 | 国产成人精品一区二区三区网站观看| 欧美肥妇毛茸茸| 亚洲国产精品一区二区久久恐怖片| 成a人片亚洲日本久久| 国产亚洲精品aa| 国产一区在线观看视频| 日韩美女视频在线| 男人的天堂久久精品| 欧美乱妇23p| 五月天久久比比资源色| 欧美久久婷婷综合色| 亚洲国产精品一区二区www在线| 在线观看一区二区精品视频| 亚洲在线免费播放| 91官网在线观看| 一区二区三区四区不卡在线| 色悠久久久久综合欧美99| 国产精品福利电影一区二区三区四区| 大陆成人av片| 亚洲欧美另类图片小说| 91视频免费观看| 亚洲一区二区三区在线播放| 色综合天天综合网国产成人综合天| 国产精品盗摄一区二区三区| 91女神在线视频| 亚洲在线观看免费| 69堂成人精品免费视频| 免费在线看一区| 久久久精品综合| 99久久精品国产一区| 一区二区三区免费在线观看| 欧美视频一区在线| 日韩在线观看一区二区| 精品日韩在线观看| 成人动漫av在线| 亚洲综合丁香婷婷六月香| 欧美剧情片在线观看| 91丨九色丨蝌蚪丨老版| 亚洲精品视频在线观看网站| 精品视频色一区| 精品在线一区二区| 欧美国产精品v| 色www精品视频在线观看| 丝袜脚交一区二区| 精品国产乱码久久久久久久 | 国产在线视视频有精品| 一色桃子久久精品亚洲| 欧美日韩精品欧美日韩精品| 国产最新精品精品你懂的| 亚洲欧美日韩久久|