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

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

?? riverlayout.java

?? Document will be uploaded soon
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.component.pagination;

import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.LayoutManager;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.Vector;

/**
 * <p>RiverLayout makes it very simple to construct user interfaces as components
 * are laid out similar to how text is added to a word processor (Components flow
 * like a "river". RiverLayout is however much more powerful than FlowLayout:
 * Components added with the add() method generally gets laid out horizontally,
 * but one may add a string before the component being added to specify "constraints"
 * like this:
 * add("br hfill", new JTextField("Your name here");
 * The code above forces a "line break" and extends the added component horizontally.
 * Without the "hfill" constraint, the component would take on its preferred size.
 *</p>
 * <p>
 * List of constraints:<ul>
 * <li>br - Add a line break
 * <li>p - Add a paragraph break
 * <li>tab - Add a tab stop (handy for constructing forms with labels followed by fields)
 * <li>hfill - Extend component horizontally
 * <li>vfill - Extent component vertically (currently only one allowed)
 * <li>left - Align following components to the left (default)
 * <li>center - Align following components horizontally centered
 * <li>right - Align following components to the right
 * <li>vtop - Align following components vertically top aligned
 * <li>vcenter - Align following components vertically centered (default)
 * </ul>
 * </p>
 * RiverLayout is LGPL licenced - use it freely in free and commercial programs
 *
 * @author David Ekholm
 * @version 1.1 (2005-05-23) -Bugfix: JScrollPanes were oversized (sized to their containing component)
 *  if the container containing the JScrollPane was resized.
 */
public class RiverLayout
    extends FlowLayout
    implements LayoutManager, java.io.Serializable {

	private static final long serialVersionUID = 1L;
	public static final String LINE_BREAK = "br";
   public static final String PARAGRAPH_BREAK = "p";
   public static final String TAB_STOP = "tab";
   public static final String HFILL = "hfill";
   public static final String VFILL = "vfill";
   public static final String LEFT = "left";
   public static final String RIGHT = "right";
   public static final String CENTER = "center";
   public static final String VTOP = "vtop";
   public static final String VCENTER = "vcenter";

   Map constraints = new HashMap();
   String valign = VCENTER;
   int hgap;
   int vgap;
   Insets extraInsets;
   Insets totalInsets = new Insets(0, 0, 0, 0);// Dummy values. Set by getInsets()


   public RiverLayout() {
      this(10, 5);
   }

   public RiverLayout(int hgap, int vgap) {
      this.hgap = hgap;
      this.vgap = vgap;
      setExtraInsets(new Insets(0, hgap, hgap, hgap));
   }

   /**
    * Gets the horizontal gap between components.
    */
   public int getHgap() {
       return hgap;
   }

   /**
    * Sets the horizontal gap between components.
    */
   public void setHgap(int hgap) {
       this.hgap = hgap;
   }

   /**
    * Gets the vertical gap between components.
    */
   public int getVgap() {
       return vgap;
   }

   public Insets getExtraInsets() {
      return extraInsets;
   }

   public void setExtraInsets(Insets newExtraInsets) {
     extraInsets = newExtraInsets;
   }

   protected Insets getInsets(Container target) {
      Insets insets = target.getInsets();
      totalInsets.top = insets.top + extraInsets.top;
      totalInsets.left = insets.left + extraInsets.left;
      totalInsets.bottom = insets.bottom + extraInsets.bottom;
      totalInsets.right = insets.right + extraInsets.right;
      return totalInsets;
   }

   /**
    * Sets the vertical gap between components.
    */
   public void setVgap(int vgap) {
       this.vgap = vgap;
   }


   /**
    * @param name the name of the component
    * @param comp the component to be added
    */
   public void addLayoutComponent(String name, Component comp) {
      constraints.put(comp, name);
   }

   /**
    * Removes the specified component from the layout. Not used by
    * this class.
    * @param comp the component to remove
    * @see       java.awt.Container#removeAll
    */
   public void removeLayoutComponent(Component comp) {
      constraints.remove(comp);
   }

   boolean isFirstInRow(Component comp) {
      String cons = (String) constraints.get(comp);
      return cons != null && (cons.indexOf(RiverLayout.LINE_BREAK) != -1 ||
                              cons.indexOf(RiverLayout.PARAGRAPH_BREAK) != -1);
   }

   boolean hasHfill(Component comp) {
      return hasConstraint(comp, RiverLayout.HFILL);
   }

   boolean hasVfill(Component comp) {
      return hasConstraint(comp, RiverLayout.VFILL);
   }

   boolean hasConstraint(Component comp, String test) {
      String cons = (String) constraints.get(comp);
      if (cons == null) return false;
      StringTokenizer tokens = new StringTokenizer(cons);
      while (tokens.hasMoreTokens())
         if (tokens.nextToken().equals(test)) return true;
      return false;
   }

   /**
    * Figure out tab stop x-positions
    */
   protected Ruler calcTabs(Container target) {
      Ruler ruler = new Ruler();
      int nmembers = target.getComponentCount();

      int x = 0;
      int tabIndex = 0; // First tab stop
      for (int i = 0; i < nmembers; i++) {
         Component m = target.getComponent(i);
//         if (m.isVisible()) {
            if (isFirstInRow(m) || i == 0) {
               x = 0;
               tabIndex = 0;
            }
            else x+= hgap;
            if (hasConstraint(m, TAB_STOP)) {
               ruler.setTab(tabIndex, x); // Will only increase
               x = ruler.getTab(tabIndex++); // Jump forward if neccesary
            }
            Dimension d = m.getPreferredSize();
            x += d.width;
         }
//      }
      return ruler;
   }

   /**
    * Returns the preferred dimensions for this layout given the
    * <i>visible</i> components in the specified target container.
    * @param target the component which needs to be laid out
    * @return    the preferred dimensions to lay out the
    *            subcomponents of the specified container
    * @see Container
    * @see #minimumLayoutSize
    * @see       java.awt.Container#getPreferredSize
    */
   public Dimension preferredLayoutSize(Container target) {
      synchronized (target.getTreeLock()) {
         Dimension dim = new Dimension(0, 0);
         Dimension rowDim = new Dimension(0, 0);
         int nmembers = target.getComponentCount();
         boolean firstVisibleComponent = true;
         int tabIndex = 0;
         Ruler ruler = calcTabs(target);

         for (int i = 0; i < nmembers; i++) {
            Component m = target.getComponent(i);
//            if (m.isVisible()) {
               if (isFirstInRow(m)) {
                  tabIndex = 0;
                  dim.width = Math.max(dim.width, rowDim.width);
                  dim.height += rowDim.height + vgap;
                  if (hasConstraint(m, PARAGRAPH_BREAK)) dim.height += 2*vgap;
                  rowDim = new Dimension(0, 0);
               }
               if (hasConstraint(m, TAB_STOP)) rowDim.width = ruler.getTab(tabIndex++);
               Dimension d = m.getPreferredSize();
               rowDim.height = Math.max(rowDim.height, d.height);
               if (firstVisibleComponent) {
                  firstVisibleComponent = false;
               }
               else {
                  rowDim.width += hgap;
               }
               rowDim.width += d.width;
  //          }
         }
         dim.width = Math.max(dim.width, rowDim.width);
         dim.height += rowDim.height;

         Insets insets = getInsets(target);
         dim.width += insets.left + insets.right;// + hgap * 2;
         dim.height += insets.top + insets.bottom;// + vgap * 2;
         return dim;
      }
   }

   /**
    * Returns the minimum dimensions needed to layout the <i>visible</i>
    * components contained in the specified target container.
    * @param target the component which needs to be laid out
    * @return    the minimum dimensions to lay out the
    *            subcomponents of the specified container
    * @see #preferredLayoutSize

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩亚洲欧美中文三级| 欧美片在线播放| 成人小视频免费观看| 国产91精品在线观看| 91丨九色丨尤物| 欧美巨大另类极品videosbest | 欧美日韩在线三级| 日韩女优av电影| 一区二区中文视频| 午夜激情一区二区三区| 国产一区二区三区最好精华液| 丁香婷婷深情五月亚洲| 欧美日韩一区二区在线观看 | 成人午夜免费电影| 欧美视频一区在线| 国产亚洲精品aa| 亚洲与欧洲av电影| 国产乱码字幕精品高清av| 色噜噜久久综合| 精品国产伦一区二区三区观看方式 | 欧美videossexotv100| 国产精品无遮挡| 奇米777欧美一区二区| a亚洲天堂av| 精品久久久久久久久久久久包黑料 | 精品少妇一区二区三区视频免付费 | 蜜臀久久久久久久| www.成人在线| 日韩欧美综合一区| 亚洲女人****多毛耸耸8| 国内久久精品视频| 欧美丰满高潮xxxx喷水动漫| 中文字幕一区二区三区蜜月| 韩国在线一区二区| 欧美日韩成人综合天天影院| 亚洲色图制服诱惑| 成人午夜电影网站| 精品欧美一区二区三区精品久久| 午夜私人影院久久久久| 91猫先生在线| 成人欧美一区二区三区在线播放| 国模无码大尺度一区二区三区 | 日韩一区中文字幕| 国产寡妇亲子伦一区二区| 3d动漫精品啪啪一区二区竹菊| 最新热久久免费视频| 国产成人综合自拍| 久久亚洲精华国产精华液| 久久超碰97中文字幕| 欧美一区二区三区免费观看视频| 蜜乳av一区二区三区| 91天堂素人约啪| 国产精品久久久久婷婷二区次| 国产精品资源在线| 久久新电视剧免费观看| 国内精品不卡在线| 久久久久久一二三区| 日韩黄色免费电影| 欧美日韩另类国产亚洲欧美一级| 亚洲一区二区三区四区在线免费观看 | av综合在线播放| 中文字幕在线播放不卡一区| 成人国产精品免费观看| 国产精品电影一区二区| 成人黄色免费短视频| 一区二区在线观看av| 91麻豆精品久久久久蜜臀| 国产高清久久久久| 亚洲精品视频自拍| 欧美一区二区精品| 成人禁用看黄a在线| 亚洲午夜影视影院在线观看| 欧美成人一区二区三区片免费| 成人一级片网址| 亚洲国产cao| 国产日韩欧美a| 欧美三级乱人伦电影| 国产美女主播视频一区| 一个色在线综合| 精品国产91久久久久久久妲己| voyeur盗摄精品| 久久国产剧场电影| 亚洲人妖av一区二区| 欧美v国产在线一区二区三区| 一本色道**综合亚洲精品蜜桃冫| 久久精品免费看| 麻豆国产一区二区| 自拍偷拍欧美激情| 久久品道一品道久久精品| 在线视频你懂得一区二区三区| 韩国精品主播一区二区在线观看 | 美日韩黄色大片| 亚洲女人的天堂| 国产婷婷精品av在线| 在线播放视频一区| 色狠狠一区二区三区香蕉| 国产精品一区久久久久| 秋霞成人午夜伦在线观看| 亚洲欧美欧美一区二区三区| 久久久久综合网| 日韩西西人体444www| 在线精品视频一区二区三四| 国产91丝袜在线18| 国产一区 二区 三区一级| 免费观看在线综合| 午夜欧美在线一二页| 亚洲欧美偷拍另类a∨色屁股| 欧美激情一区三区| 久久亚洲捆绑美女| www国产亚洲精品久久麻豆| 日韩欧美国产1| 日韩一级黄色片| 884aa四虎影成人精品一区| 日本大香伊一区二区三区| 97se狠狠狠综合亚洲狠狠| 国产成人三级在线观看| 国产一区 二区| 国产宾馆实践打屁股91| 国产精品夜夜嗨| 高清久久久久久| 懂色av一区二区夜夜嗨| 国产成人av电影在线| 国产精品白丝jk白祙喷水网站| 国产一本一道久久香蕉| 国产经典欧美精品| 丁香桃色午夜亚洲一区二区三区| 成人综合在线观看| 91在线码无精品| 欧美在线一二三四区| 欧美三级日韩在线| 337p亚洲精品色噜噜狠狠| 91精品国产综合久久久久久久| 日韩视频123| 久久久91精品国产一区二区精品 | 91香蕉视频mp4| 色天使久久综合网天天| 欧美一a一片一级一片| 欧美精品乱码久久久久久| 日韩午夜三级在线| 国产欧美一区二区三区在线看蜜臀| 中文字幕欧美国产| 一区二区三区在线免费观看| 无码av中文一区二区三区桃花岛| 蜜臀国产一区二区三区在线播放| 狠狠色丁香婷综合久久| 不卡一二三区首页| 欧美色窝79yyyycom| 精品剧情v国产在线观看在线| 国产农村妇女毛片精品久久麻豆 | 国产成人免费在线观看| 99久久亚洲一区二区三区青草| 91免费在线看| 欧美日韩国产首页在线观看| 久久久精品国产免大香伊| 亚洲免费伊人电影| 捆绑紧缚一区二区三区视频| 99re视频这里只有精品| 欧美日本在线播放| 亚洲国产高清在线观看视频| 午夜伦欧美伦电影理论片| 国产精品69毛片高清亚洲| 在线视频国内一区二区| 精品久久久久久无| 亚洲宅男天堂在线观看无病毒| 国产一区二区伦理| 欧美日韩在线播放| 国产精品久久久久久妇女6080| 免费精品99久久国产综合精品| www..com久久爱| 久久亚洲精华国产精华液 | 国产精品网曝门| 日本成人中文字幕| 91免费国产在线| 久久综合色婷婷| 日韩精品高清不卡| 91同城在线观看| 国产亚洲一二三区| 青青草97国产精品免费观看无弹窗版 | 欧美色爱综合网| 国产精品卡一卡二| 韩国成人在线视频| 69av一区二区三区| 夜夜嗨av一区二区三区| 国产高清不卡一区| 欧美大尺度电影在线| 婷婷综合五月天| 日本精品一级二级| 国产精品免费免费| 国产精品亚洲午夜一区二区三区| 日韩三级伦理片妻子的秘密按摩| 亚洲午夜精品网| 在线免费观看一区| 亚洲欧美视频在线观看视频| 99这里只有久久精品视频| 国产亚洲欧美在线| 国产一区二区三区四区五区美女| 日韩欧美国产午夜精品| 日韩高清不卡一区二区三区| 日韩一区二区三区观看| 日韩影院精彩在线|