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

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

?? columnarrangement.java

?? jfreechart1.0.1 jsp繪制圖表的開發包
?? JAVA
字號:
/* ===========================================================
 * JFreeChart : a free chart library for the Java(tm) platform
 * ===========================================================
 *
 * (C) Copyright 2000-2005, by Object Refinery Limited and Contributors.
 *
 * Project Info:  http://www.jfree.org/jfreechart/index.html
 *
 * This library is free software; you can redistribute it and/or modify it 
 * under the terms of the GNU Lesser General Public License as published by 
 * the Free Software Foundation; either version 2.1 of the License, or 
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but 
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, 
 * USA.  
 *
 * [Java is a trademark or registered trademark of Sun Microsystems, Inc. 
 * in the United States and other countries.]
 *
 * ----------------------
 * ColumnArrangement.java
 * ----------------------
 * (C) Copyright 2004, 2005, by Object Refinery Limited.
 *
 * Original Author:  David Gilbert (for Object Refinery Limited);
 * Contributor(s):   -;
 *
 * $Id: ColumnArrangement.java,v 1.12.2.1 2005/10/25 20:39:38 mungady Exp $
 *
 * Changes:
 * --------
 * 22-Oct-2004 : Version 1 (DG);
 * 04-Feb-2005 : Added equals() and implemented Serializable (DG);
 * 
 */

package org.jfree.chart.block;

import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.jfree.ui.HorizontalAlignment;
import org.jfree.ui.Size2D;
import org.jfree.ui.VerticalAlignment;

/**
 * Arranges blocks in a column layout.  This class is immutable.
 */
public class ColumnArrangement implements Arrangement, Serializable {

    /** For serialization. */
    private static final long serialVersionUID = -5315388482898581555L;
    
    /** The horizontal alignment of blocks. */
    private HorizontalAlignment horizontalAlignment;
    
    /** The vertical alignment of blocks within each row. */
    private VerticalAlignment verticalAlignment;
    
    /** The horizontal gap between columns. */
    private double horizontalGap;
    
    /** The vertical gap between items in a column. */
    private double verticalGap;
    
    /**
     * Creates a new instance.
     */
    public ColumnArrangement() {   
    }
    
    /**
     * Creates a new instance.
     * 
     * @param hAlign  the horizontal alignment (currently ignored).
     * @param vAlign  the vertical alignment (currently ignored).
     * @param hGap  the horizontal gap.
     * @param vGap  the vertical gap.
     */
    public ColumnArrangement(HorizontalAlignment hAlign, 
                             VerticalAlignment vAlign,
                             double hGap, double vGap) {        
        this.horizontalAlignment = hAlign;
        this.verticalAlignment = vAlign;
        this.horizontalGap = hGap;
        this.verticalGap = vGap;
    }
    
    /**
     * Adds a block to be managed by this instance.  This method is usually 
     * called by the {@link BlockContainer}, you shouldn't need to call it 
     * directly.
     * 
     * @param block  the block.
     * @param key  a key that controls the position of the block.
     */
    public void add(Block block, Object key) {
        // since the flow layout is relatively straightforward, no information
        // needs to be recorded here
    }
    
    /**
     * Calculates and sets the bounds of all the items in the specified 
     * container, subject to the given constraint.  The <code>Graphics2D</code>
     * can be used by some items (particularly items containing text) to 
     * calculate sizing parameters.
     * 
     * @param container  the container whose items are being arranged.
     * @param g2  the graphics device.
     * @param constraint  the size constraint.
     * 
     * @return The size of the container after arrangement of the contents.
     */
    public Size2D arrange(BlockContainer container, Graphics2D g2,
                          RectangleConstraint constraint) {
        
        LengthConstraintType w = constraint.getWidthConstraintType();
        LengthConstraintType h = constraint.getHeightConstraintType();
        if (w == LengthConstraintType.NONE) {
            if (h == LengthConstraintType.NONE) {
                return arrangeNN(container, g2);  
            }
            else if (h == LengthConstraintType.FIXED) {
                throw new RuntimeException("Not implemented.");  
            }
            else if (h == LengthConstraintType.RANGE) {
                throw new RuntimeException("Not implemented.");  
            }
        }
        else if (w == LengthConstraintType.FIXED) {
            if (h == LengthConstraintType.NONE) {
                throw new RuntimeException("Not implemented.");  
            }
            else if (h == LengthConstraintType.FIXED) {
                return arrangeFF(container, g2, constraint); 
            }
            else if (h == LengthConstraintType.RANGE) {
                throw new RuntimeException("Not implemented.");  
            }
        }
        else if (w == LengthConstraintType.RANGE) {
            if (h == LengthConstraintType.NONE) {
                throw new RuntimeException("Not implemented.");  
            }
            else if (h == LengthConstraintType.FIXED) {
                return arrangeRF(container, g2, constraint);  
            }
            else if (h == LengthConstraintType.RANGE) {
                return arrangeRR(container, g2, constraint);  
            }
        }
        return new Size2D();  // TODO: complete this
        
    }

    /**
     * Calculates and sets the bounds of all the items in the specified 
     * container, subject to the given constraint.  The <code>Graphics2D</code>
     * can be used by some items (particularly items containing text) to 
     * calculate sizing parameters.
     * 
     * @param container  the container whose items are being arranged.
     * @param g2  the graphics device.
     * @param constraint  the size constraint.
     * 
     * @return The container size after the arrangement.
     */
    protected Size2D arrangeFF(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {
        // TODO: implement properly
        return arrangeNF(container, g2, constraint);
    }
    
    /**
     * Calculates and sets the bounds of all the items in the specified 
     * container, subject to the given constraint.  The <code>Graphics2D</code>
     * can be used by some items (particularly items containing text) to 
     * calculate sizing parameters.
     * 
     * @param container  the container whose items are being arranged.
     * @param constraint  the size constraint.
     * @param g2  the graphics device.
     * 
     * @return The container size after the arrangement.
     */
    protected Size2D arrangeNF(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {
    
        List blocks = container.getBlocks();
        
        double height = constraint.getHeight();
        if (height <= 0.0) {
            height = Double.POSITIVE_INFINITY;
        }
        
        double x = 0.0;
        double y = 0.0;
        double maxWidth = 0.0;
        List itemsInColumn = new ArrayList();
        for (int i = 0; i < blocks.size(); i++) {
            Block block = (Block) blocks.get(i);
            Size2D size = block.arrange(g2, RectangleConstraint.NONE);
            if (y + size.height <= height) {
                itemsInColumn.add(block);
                block.setBounds(
                    new Rectangle2D.Double(x, y, size.width, size.height)
                );
                y = y + size.height + this.verticalGap;
                maxWidth = Math.max(maxWidth, size.width);
            }
            else {
                if (itemsInColumn.isEmpty()) {
                    // place in this column (truncated) anyway
                    block.setBounds(
                        new Rectangle2D.Double(
                            x, y, size.width, Math.min(size.height, height - y)
                        )
                    );
                    y = 0.0;
                    x = x + size.width + this.horizontalGap;
                }
                else {
                    // start new column
                    itemsInColumn.clear();
                    x = x + maxWidth + this.horizontalGap;
                    y = 0.0;
                    maxWidth = size.width;
                    block.setBounds(
                        new Rectangle2D.Double(
                            x, y, size.width, Math.min(size.height, height)
                        )
                    );
                    y = size.height + this.verticalGap;
                    itemsInColumn.add(block);
                }
            }
        }
        return new Size2D(x + maxWidth, constraint.getHeight());  
    }

    protected Size2D arrangeRR(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {

        // first arrange without constraints, and see if this fits within
        // the required ranges...
        Size2D s1 = arrangeNN(container, g2);
        if (constraint.getHeightRange().contains(s1.height)) {
            return s1;  // TODO: we didn't check the width yet
        }
        else {
            RectangleConstraint c = constraint.toFixedHeight(
                constraint.getHeightRange().getUpperBound()
            );
            return arrangeRF(container, g2, c);
        }
    }
    
    /**
     * Arranges the blocks in the container using a fixed height and a
     * range for the width.
     * 
     * @param container  the container.
     * @param g2  the graphics device.
     * @param constraint  the constraint.
     * 
     * @return The size of the container after arrangement.
     */
    protected Size2D arrangeRF(BlockContainer container, Graphics2D g2,
                               RectangleConstraint constraint) {

        Size2D s = arrangeNF(container, g2, constraint);
        if (constraint.getWidthRange().contains(s.width)) {
            return s;   
        }
        else {
            RectangleConstraint c = constraint.toFixedWidth(
                constraint.getWidthRange().constrain(s.getWidth())
            );
            return arrangeFF(container, g2, c);
        }
    }

    /**
     * Arranges the blocks without any constraints.  This puts all blocks
     * into a single column.
     * 
     * @param container  the container.
     * @param g2  the graphics device.
     * 
     * @return The size after the arrangement.
     */
    protected Size2D arrangeNN(BlockContainer container, Graphics2D g2) {
        double y = 0.0;
        double height = 0.0;
        double maxWidth = 0.0;
        List blocks = container.getBlocks();
        int blockCount = blocks.size();
        if (blockCount > 0) {
            Size2D[] sizes = new Size2D[blocks.size()];
            for (int i = 0; i < blocks.size(); i++) {
                Block block = (Block) blocks.get(i);
                sizes[i] = block.arrange(g2, RectangleConstraint.NONE);
                height = height + sizes[i].getHeight();
                maxWidth = Math.max(sizes[i].width, maxWidth);
                block.setBounds(
                    new Rectangle2D.Double(
                        0.0, y, sizes[i].width, sizes[i].height
                    )
                );
                y = y + sizes[i].height + this.verticalGap;
            }
            if (blockCount > 1) {
                height = height + this.verticalGap * (blockCount - 1);   
            }
            if (this.horizontalAlignment != HorizontalAlignment.LEFT) {
                for (int i = 0; i < blocks.size(); i++) {
                    Block b = (Block) blocks.get(i);
                    if (this.horizontalAlignment 
                            == HorizontalAlignment.CENTER) {
                        //TODO: shift block right by half
                    }
                    else if (this.horizontalAlignment 
                            == HorizontalAlignment.RIGHT) {
                        //TODO: shift block over to right
                    }
                }            
            }
        }
        return new Size2D(maxWidth, height);
    }

    /**
     * Clears any cached information.
     */
    public void clear() {
        // no action required.
    }
    
    /**
     * Tests this instance for equality with an arbitrary object.
     * 
     * @param obj  the object (<code>null</code> permitted).
     * 
     * @return A boolean.
     */
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;   
        }
        if (!(obj instanceof ColumnArrangement)) {
            return false;   
        }
        ColumnArrangement that = (ColumnArrangement) obj;
        if (this.horizontalAlignment != that.horizontalAlignment) {
            return false;
        }
        if (this.verticalAlignment != that.verticalAlignment) {
            return false;
        }
        if (this.horizontalGap != that.horizontalGap) {
            return false;   
        }
        if (this.verticalGap != that.verticalGap) {
            return false;   
        }
        return true;
    }
    

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩v精品一区二区| 91精品婷婷国产综合久久竹菊| 国产欧美日韩亚州综合| 国产一区二区三区视频在线播放| 日韩欧美一二三四区| 久久99国产精品尤物| 国产偷国产偷亚洲高清人白洁 | 亚洲影视资源网| 91久久国产最好的精华液| 亚洲国产欧美日韩另类综合| 欧美日韩五月天| 免费人成黄页网站在线一区二区| 精品国产一区二区三区忘忧草| 国产精品99久久久| 亚洲色图欧美激情| 在线播放国产精品二区一二区四区| 看电影不卡的网站| 欧美高清在线一区| 欧美日本一区二区三区四区| 捆绑变态av一区二区三区| 亚洲国产成人自拍| 欧美综合色免费| 麻豆91免费看| 亚洲天堂2014| 日韩限制级电影在线观看| 成人精品电影在线观看| 性久久久久久久久| 欧美极品aⅴ影院| 欧美日韩视频在线第一区 | 国产清纯在线一区二区www| 91视视频在线观看入口直接观看www | 亚洲综合偷拍欧美一区色| 欧美日韩国产精品自在自线| 国产制服丝袜一区| 亚洲一区二区三区四区不卡 | 久久天堂av综合合色蜜桃网| 91亚洲精品乱码久久久久久蜜桃| 日本va欧美va瓶| 亚洲三级电影全部在线观看高清| 日韩精品影音先锋| 欧美视频一区在线| 成a人片亚洲日本久久| 男男gaygay亚洲| 亚洲精品视频观看| 国产日韩av一区二区| 91精品国产综合久久精品app| 国产乱码字幕精品高清av| 亚洲大片精品永久免费| 中文字幕二三区不卡| 欧美一区二区三区人| 在线观看日韩高清av| 国产成人h网站| 精品一区二区国语对白| 天天综合网 天天综合色| 国产精品不卡视频| 久久久www成人免费无遮挡大片| 欧美午夜电影在线播放| 97精品国产露脸对白| 国产成人在线观看免费网站| 男人操女人的视频在线观看欧美| 亚洲精品欧美专区| 亚洲视频在线一区观看| 亚洲国产精品ⅴa在线观看| 欧美大尺度电影在线| 欧美日本在线观看| 欧美日韩视频在线观看一区二区三区| 99精品久久只有精品| 懂色av中文一区二区三区| 久久99热这里只有精品| 免费精品视频最新在线| 日韩电影在线观看电影| 日产欧产美韩系列久久99| 亚洲第一会所有码转帖| 亚洲午夜精品久久久久久久久| 亚洲欧洲日产国产综合网| 亚洲欧洲av在线| 中文字幕一区在线观看视频| 国产精品美女www爽爽爽| 国产日韩成人精品| 国产精品久久三| 中文字幕一区二区三区在线不卡| 中文字幕不卡的av| 成人欧美一区二区三区白人 | 欧美日韩国产区一| 制服丝袜一区二区三区| 日韩女优视频免费观看| 亚洲精品在线三区| 欧美高清在线一区| 亚洲免费观看视频| 亚洲高清免费观看| 欧美bbbbb| 福利一区二区在线观看| 91美女在线观看| 欧美日韩国产一区| 欧美大片顶级少妇| 国产午夜精品一区二区三区视频 | 18欧美乱大交hd1984| 亚洲色图视频免费播放| 亚洲国产日韩一级| 免费欧美日韩国产三级电影| 国产一区二区日韩精品| 成人av网站在线观看免费| 色综合欧美在线视频区| 欧美日本视频在线| 久久一日本道色综合| 最好看的中文字幕久久| 香蕉乱码成人久久天堂爱免费| 日韩va亚洲va欧美va久久| 国产成人免费在线观看| 91成人免费网站| 日韩欧美一级精品久久| 国产精品久久久久久久久动漫| 亚洲美腿欧美偷拍| 麻豆91在线观看| 色呦呦一区二区三区| 日韩精品综合一本久道在线视频| 国产色产综合产在线视频 | 午夜精品免费在线| 国产精品一二三四| 欧美在线免费播放| 久久久久久夜精品精品免费| 亚洲欧美日韩国产成人精品影院| 美女mm1313爽爽久久久蜜臀| 成人av动漫在线| 日韩精品一区二区三区蜜臀| 亚洲美女屁股眼交3| 国产一区视频在线看| 91黄色免费看| 中文字幕av资源一区| 麻豆精品视频在线观看免费| 色婷婷久久久综合中文字幕| 欧美精品一区二区三| 亚洲一区二区三区四区在线| 大桥未久av一区二区三区中文| 欧美日韩亚洲综合一区二区三区| 中文欧美字幕免费| 麻豆久久一区二区| 欧美性猛片xxxx免费看久爱| 国产精品三级av| 国产美女娇喘av呻吟久久| 6080午夜不卡| 一区二区在线观看不卡| 粉嫩aⅴ一区二区三区四区五区| 日韩一区二区在线观看视频播放| 亚洲精品视频在线| 成人av在线一区二区| 久久视频一区二区| 精品一区二区三区不卡| 欧美精品粉嫩高潮一区二区| 一区二区三区av电影| 成人v精品蜜桃久久一区| 久久综合一区二区| 免费久久99精品国产| 91精品国产全国免费观看| 亚洲一级二级在线| 欧美亚洲国产一区二区三区va | 夫妻av一区二区| 久久蜜桃av一区二区天堂| 久久超碰97人人做人人爱| 6080午夜不卡| 麻豆91在线播放免费| 日韩三级视频在线观看| 日韩福利电影在线观看| 91精品国产91久久久久久最新毛片| 亚洲图片欧美色图| 欧美人妖巨大在线| 五月激情六月综合| 日韩一区二区麻豆国产| 蓝色福利精品导航| 久久久久久综合| 成人午夜视频在线| 亚洲色图清纯唯美| 欧美亚洲国产一区在线观看网站| 亚洲图片欧美一区| 欧美一级久久久| 国产一区亚洲一区| 国产精品久久久久aaaa| 91美女福利视频| 五月综合激情网| 欧美一级欧美一级在线播放| 麻豆精品久久久| 国产欧美日韩卡一| 日本道精品一区二区三区| 亚洲一区二区在线播放相泽| 宅男在线国产精品| 久久99精品久久久久久| 26uuu欧美| 99久久99久久精品国产片果冻| 亚洲一二三区视频在线观看| 欧美久久久久久久久| 久久av资源站| 国产精品婷婷午夜在线观看| 91极品美女在线| 九色|91porny| 国产精品动漫网站| 欧美日本韩国一区二区三区视频| 精品亚洲国产成人av制服丝袜| 国产精品久久精品日日| 欧美日韩国产乱码电影| 国产高清不卡一区二区|