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

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

?? cardpanel.java

?? 一個(gè)很好實(shí)用的工作流OSWORKFLOW開發(fā)例子.有著非常優(yōu)秀的靈活性.
?? JAVA
字號:
package com.opensymphony.workflow.designer.swing;

/*
 * Copyright (c) Sun Microsystems.
 */

import java.awt.*;

import javax.swing.*;

/**
 * A simpler alternative to a JPanel with a CardLayout.  The AWT CardLayout
 * layout manager can be inconvenient to use because the special "stack of
 * cards" operations it supports require a cast to use.  For example to show
 * the card named "myCard" given a JPanel with a CardLayout one would write:
 * <pre>
 * ((CardLayout)(myJPanel.getLayout())).show(myJPanel, "myCard");
 * </pre>
 * This doesn't work well with Swing - all of the CardLayout display
 * operations, like <code>show</code> call validate directly.  Swing supports
 * automatic validation (see JComponent.revalidate()); this direct call to
 * validate is inefficient.
 * <p>
 * The CardPane JPanel subclass is intended to support a layout with a modest
 * number of cards, on the order of 100 or less.  A cards name is it's
 * component name, as in java.awt.Component.getName(), which is set when the
 * component is added to the CardPanel:
 * <pre>
 * myCardPanel.add(myChild, "MyChildName");
 * myChild.getName() <i>=> "MyChildName"</i>
 * </pre>
 * As with CardLayout, the first child added to a CardPanel is made visible
 * and there's only one child visible at a time.  The <code>showCard</code>
 * method accepts either a childs name or the child itself:
 * <pre>
 * myCardPanel.show("MyChildName");
 * myCardPanel.show(myChild);
 * </pre>
 * <p>
 * The CardPanel class doesn't support the vgap/hgap CardLayout properties
 * since one can add a Border, see JComponent.setBorder().
 *
 * @author Sun Microsystems
 */

public class CardPanel extends JPanel
{

  private static class Layout implements LayoutManager
  {
    /**
     * Set the childs name (if non-null) and and make it visible
     * iff it's the only CardPanel child.
     * @see java.awt.Component#setName
     */
    public void addLayoutComponent(String name, Component child)
    {
      if(name != null)
      {
        child.setName(name);
      }
      child.setVisible(child.getParent().getComponentCount() == 1);
    }

    /**
     * If this child was visible, then make the first remaining
     * child visible.
     */
    public void removeLayoutComponent(Component child)
    {
      if(child.isVisible())
      {
        Container parent = child.getParent();
        if(parent.getComponentCount() > 0)
        {
          parent.getComponent(0).setVisible(true);
        }
      }
    }

    /**
     * @return the maximum preferred width/height + the parents insets
     */
    public Dimension preferredLayoutSize(Container parent)
    {
      int nChildren = parent.getComponentCount();
      Insets insets = parent.getInsets();
      int width = insets.left + insets.right;
      int height = insets.top + insets.bottom;
      for(int i = 0; i < nChildren; i++)
      {
        Dimension d = parent.getComponent(i).getPreferredSize();
        if(d.width > width)
        {
          width = d.width;
        }
        if(d.height > height)
        {
          height = d.height;
        }
      }
      return new Dimension(width, height);
    }

    /**
     * @return the maximum minimum width/height + the parents insets
     */
    public Dimension minimumLayoutSize(Container parent)
    {
      int nChildren = parent.getComponentCount();
      Insets insets = parent.getInsets();
      int width = insets.left + insets.right;
      int height = insets.top + insets.bottom;
      for(int i = 0; i < nChildren; i++)
      {
        if(!parent.getComponent(i).isVisible()) continue;
        Dimension d = parent.getComponent(i).getMinimumSize();
        if(d.width > width)
        {
          width = d.width;
        }
        if(d.height > height)
        {
          height = d.height;
        }
      }
      //return new Dimension(width, height);
      return new Dimension(100, height);
    }

    public void layoutContainer(Container parent)
    {
      int nChildren = parent.getComponentCount();
      Insets insets = parent.getInsets();
      for(int i = 0; i < nChildren; i++)
      {
        Component child = parent.getComponent(i);
        if(child.isVisible())
        {
          Rectangle r = parent.getBounds();
          int width = r.width - insets.left + insets.right;
          int height = r.height - insets.top + insets.bottom;
          child.setBounds(insets.left, insets.top, width, height);
          break;
        }
      }
    }
  }

  /**
   * Creates a CardPanel.  Children, called "cards" in this API, should be
   * added with add().  The first child we be made visible, subsequent
   * children will be hidden.  To show a card, use one of the show*Card
   * methods.
   */
  public CardPanel()
  {
    super(new Layout());
  }

  /**
   * Hide the currently visible child  "card" and show the
   * specified card.  If the specified card isn't a child
   * of the CardPanel then we add it here.
   */
  public Component getVisibleCard()
  {
    int index = getVisibleChildIndex();
    return index != -1 ? getComponent(index) : null;
  }

  /**
   * Return the index of the first (and one would hope - only)
   * visible child.  If a visible child can't be found,
   * perhaps the caller has inexlicably hidden all of the
   * children, then return -1.
   */
  public int getVisibleChildIndex()
  {
    int nChildren = getComponentCount();
    for(int i = 0; i < nChildren; i++)
    {
      Component child = getComponent(i);
      if(child.isVisible())
      {
        return i;
      }
    }
    return -1;
  }

  /**
   * Return the name of the visible child.
   */
  public String getVisibleChildName()
  {
    int i = getVisibleChildIndex();
    return -1 == i ? null : getComponent(i).getName();
  }

  /**
   * Hide the currently visible child  "card" and show the
   * specified card.  If the specified card isn't a child
   * of the CardPanel then we add it here.
   */
  public void showCard(Component card)
  {
    if(card.getParent() != this)
    {
      add(card);
    }
    Component visibleComponent = getVisibleCard();
    if(visibleComponent == card)
      return;
    visibleComponent.setVisible(false);
    card.setVisible(true);
    revalidate();
    repaint();
  }

  /**
   * Show the card with the specified name.
   * @see java.awt.Component#getName
   */
  public Component showCard(String name)
  {
    if(getVisibleCard()!=null && name.equals(getVisibleCard().getName())) return getVisibleCard();
    int nChildren = getComponentCount();
    for(int i = 0; i < nChildren; i++)
    {
      Component child = getComponent(i);
      if(child.getName().equals(name) && !child.isVisible())
      {
        showCard(child);
        return child;
      }
    }
    return null;
  }

  /**
   * Show the first card that was added to this CardPanel.
   */
  public void showFirstCard()
  {
    if(getComponentCount() <= 0)
    {
      return;
    }
    showCard(getComponent(0));
  }

  /**
   * Show the last card that was added to this CardPanel.
   */
  public void showLastCard()
  {
    if(getComponentCount() <= 0)
    {
      return;
    }
    showCard(getComponent(getComponentCount() - 1));
  }

  /**
   * Show the card that was added to this CardPanel after the currently
   * visible card.  If the currently visible card was added last, then
   * show the first card.
   */
  public void showNextCard()
  {
    if(getComponentCount() <= 0)
    {
      return;
    }
    int index = getVisibleChildIndex();
    if(index == -1)
    {
      showCard(getComponent(0));
    }
    else if(index == (getComponentCount() - 1))
    {
      showCard(getComponent(0));
    }
    else
    {
      showCard(getComponent(index + 1));
    }
  }

  /**
   * Show the card that was added to this CardPanel before the currently
   * visible card.  If the currently visible card was added first, then
   * show the last card.
   */
  public void showPreviousCard()
  {
    if(getComponentCount() <= 0)
    {
      return;
    }
    int index = getVisibleChildIndex();
    if(index == -1)
    {
      showCard(getComponent(0));
    }
    else if(index == 0)
    {
      showCard(getComponent(getComponentCount() - 1));
    }
    else
    {
      showCard(getComponent(index - 1));
    }
  }

}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品视频免费| 久久亚洲精华国产精华液| 自拍偷自拍亚洲精品播放| 不卡av免费在线观看| 亚洲猫色日本管| 欧美中文一区二区三区| 日韩中文欧美在线| 亚洲精品在线观看视频| www.欧美亚洲| 亚洲综合色成人| 日韩视频免费观看高清在线视频| 精品一区二区久久久| 国产日韩精品视频一区| 91高清视频在线| 五月婷婷久久综合| 337p粉嫩大胆色噜噜噜噜亚洲 | 国产精品美女久久久久aⅴ| a级精品国产片在线观看| 亚洲最色的网站| 日韩精品在线一区| www..com久久爱| 日韩av高清在线观看| 久久日韩粉嫩一区二区三区| av亚洲精华国产精华| 亚洲va欧美va人人爽| 久久久久久久久久久久久久久99| 97久久精品人人澡人人爽| 午夜伦理一区二区| 中文字幕乱码久久午夜不卡| 91国偷自产一区二区三区观看| 麻豆精品一区二区三区| 亚洲欧美一区二区在线观看| 欧美精品丝袜久久久中文字幕| 国产综合色产在线精品| 亚洲在线一区二区三区| 国产欧美久久久精品影院| 精品视频色一区| 成人一级片网址| 日韩电影免费一区| 亚洲视频香蕉人妖| 久久综合久久综合亚洲| 欧美人与禽zozo性伦| 成人手机在线视频| 美腿丝袜亚洲色图| 伊人色综合久久天天人手人婷| 久久亚区不卡日本| 欧美精品欧美精品系列| 91美女片黄在线观看| 国产美女视频一区| 欧美aaaaaa午夜精品| 亚洲综合在线五月| 国产精品初高中害羞小美女文| 精品国产免费人成在线观看| 欧美调教femdomvk| 91免费看视频| www.欧美精品一二区| 国产河南妇女毛片精品久久久 | 成人av资源在线| 精品影视av免费| 天堂一区二区在线| 亚洲国产成人porn| 亚洲精品国产高清久久伦理二区| 中文字幕欧美三区| 国产亚洲精品资源在线26u| 宅男噜噜噜66一区二区66| 在线一区二区三区| 色婷婷av一区| 91免费视频网| 91理论电影在线观看| 暴力调教一区二区三区| 成人精品免费视频| 成人美女在线视频| 成人黄色软件下载| www.99精品| 99久久伊人久久99| 成人18精品视频| 99精品欧美一区二区三区小说 | 一本到高清视频免费精品| www.av精品| eeuss鲁片一区二区三区| eeuss影院一区二区三区| 99久久伊人精品| 色综合久久久久综合体| 日本精品一级二级| 欧美日韩亚洲综合在线| 欧美人妇做爰xxxⅹ性高电影| 欧美精品tushy高清| 欧美一区二区二区| 日韩精品一区二| 久久免费电影网| 中文字幕在线观看不卡视频| 最新热久久免费视频| 亚洲一区二区偷拍精品| 日韩国产成人精品| 精品一区二区三区视频 | 日韩国产精品久久| 久久国产剧场电影| 成人免费毛片app| 一本一道久久a久久精品| 欧美性大战久久久久久久| 91麻豆精品国产91久久久久| 精品国产区一区| 国产精品女上位| 亚洲激情在线激情| 久久综合综合久久综合| 国产成人99久久亚洲综合精品| 99v久久综合狠狠综合久久| 欧美色综合网站| 精品国产乱码久久| 亚洲四区在线观看| 欧美aaa在线| 成人福利视频网站| 欧美日韩国产乱码电影| 亚洲精品一区二区三区蜜桃下载| 中文字幕制服丝袜一区二区三区 | 日韩国产欧美在线观看| 欧美在线小视频| 日韩三级中文字幕| 久久一区二区视频| 一区二区三区小说| 国模娜娜一区二区三区| 色综合久久久久综合体桃花网| 日韩一级片网址| 亚洲天堂网中文字| 国产一区欧美日韩| 91国产精品成人| 欧美国产日产图区| 美女久久久精品| 91精彩视频在线| 中文字幕乱码亚洲精品一区| 丝袜美腿亚洲综合| 91碰在线视频| 久久久久久久久一| 日本欧美大码aⅴ在线播放| 99在线热播精品免费| 欧美高清视频不卡网| 17c精品麻豆一区二区免费| 麻豆视频观看网址久久| 欧美色网站导航| 中文字幕一区二区三区四区不卡 | 国产精品福利一区二区三区| 麻豆91精品视频| 欧美日韩精品是欧美日韩精品| 中国色在线观看另类| 色综合天天综合给合国产| 国产日韩欧美精品一区| 久久国产精品色| 欧美日本韩国一区| 亚洲最新在线观看| 一本大道久久a久久综合| 亚洲国产精品传媒在线观看| 经典三级视频一区| 欧美成人精品二区三区99精品| 午夜欧美在线一二页| 欧美亚洲尤物久久| 一区二区三区欧美日韩| 91亚洲精品久久久蜜桃网站| 国产亚洲一本大道中文在线| 美女免费视频一区二区| 日韩一区二区在线播放| 免费在线观看一区二区三区| 欧美绝品在线观看成人午夜影视| 亚洲精品国产无天堂网2021| 91网站最新地址| 成人欧美一区二区三区视频网页| 国产成人综合亚洲91猫咪| 久久综合99re88久久爱| 久久69国产一区二区蜜臀| 欧美成人三级电影在线| 男女男精品视频| 精品国产亚洲在线| 国产精品一线二线三线| 国产日韩欧美制服另类| 成人手机在线视频| 亚洲免费观看视频| 欧美日韩国产片| 免费观看日韩av| 久久久久国产免费免费 | 中文字幕视频一区二区三区久| 东方欧美亚洲色图在线| 中文字幕日韩一区二区| 色久优优欧美色久优优| 亚洲成在线观看| 欧美高清精品3d| 国产制服丝袜一区| 国产精品亲子乱子伦xxxx裸| 91在线精品一区二区| 亚洲一区二区三区四区在线观看| 欧美视频第二页| 另类专区欧美蜜桃臀第一页| 久久久久综合网| a在线欧美一区| 亚洲成精国产精品女| 欧美电影免费观看高清完整版在线 | 中文字幕不卡的av| 一本一道久久a久久精品综合蜜臀| 一区二区免费在线| 日韩一区二区三区四区五区六区| 激情五月婷婷综合| 亚洲欧美日韩综合aⅴ视频|