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

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

?? poolscanvas.java

?? 深入java 虛擬機中的一個Java程序
?? JAVA
字號:
/*
* Copyright (c) 1996, 1997 Bill Venners. All Rights Reserved.
*
* This Java source file is part of the Interactive Illustrations Web
* Site, which is delivered in the applets directory of the CD-ROM
* that accompanies the book "Inside the Java Virtual Machine" by Bill
* Venners, published by McGraw-Hill, 1997,ISBN: 0-07-913248-0. This
* source file is provided for evaluation purposes only, but you can
* redistribute it under certain conditions, described in the full
* copyright notice below.
*
* Full Copyright Notice:
*
* All the web pages and Java applets delivered in the applets
* directory of the CD-ROM, consisting of ".html," ".gif," ".class,"
* and ".java" files, are copyrighted (c) 1996, 1997 by Bill
* Venners, and all rights are reserved.  This material may be copied
* and placed on any commercial or non-commercial web server on any
* network (including the internet) provided that the following
* guidelines are followed:
*
* a. All the web pages and Java Applets (".html," ".gif," ".class,"
* and ".java" files), including the source code, that are delivered
* in the applets directory of the CD-ROM that
* accompanies the book must be published together on the same web
* site.
*
* b. All the web pages and Java Applets (".html," ".gif," ".class,"
* and ".java" files) must be published "as is" and may not be altered
* in any way.
*
* c. All use and access to this web site must be free, and no fees
* can be charged to view these materials, unless express written
* permission is obtained from Bill Venners.
*
* d. The web pages and Java Applets may not be distributed on any
* media, other than a web server on a network, and may not accompany
* any book or publication.
*
* BILL VENNERS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
* SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
* BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR PARTICULAR PURPOSE, OR NON-INFRINGEMENT.  BILL VENNERS
* SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY A LICENSEE AS A
* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
* DERIVATIVES.
*/
import java.awt.*;

/**
* This class is the canvas upon which the user interface for the
* allocate fish mode is drawn: The object pool, handle pool, and
* the lines that connect them.
*
* @author  Bill Venners
*/
public class PoolsCanvas extends Canvas {

    private GCHeap gcHeap;
    private final int poolImageInsets = 5;

    PoolsCanvas(GCHeap heap) {
        gcHeap = heap;
    }

    public Dimension minimumSize() {
        return new Dimension(500, 240);
    }

    public Dimension preferredSize() {
        return new Dimension(500, 240);
    }

    public void paint(Graphics g) {

        // First calculate the positions of the goodies on the canvas based on the width
        // and height of the canvas.
        Dimension dim = size();

        // Divide width into three equal portions. The left portion will hold the handle pool.
        // The right portion will hold the object pool. The middle portion will have arrows
        // that go from valid handles to their respective objects.
        int xHandlePoolPortion = 0;
        int xArrowPortion = dim.width / 3;
        int xObjectPoolPortion = 2 * xArrowPortion;

        Font font = getFont();
        FontMetrics fm = getFontMetrics(font);

        int labelHeight = fm.getAscent() + fm.getDescent() + (2 * poolImageInsets);

        int heightAvailableForPools = dim.height - labelHeight - poolImageInsets;
        int objectPoolIntsCount = gcHeap.getObjectPoolSize();
        int handlePoolIntsCount = gcHeap.getHandlePoolSize() * 2;

        int maxIntsCount = objectPoolIntsCount;
        if (maxIntsCount < handlePoolIntsCount) {
            maxIntsCount = handlePoolIntsCount;
        }

        int yPixelsPerInt = heightAvailableForPools / maxIntsCount;

        int handlePoolHeight = handlePoolIntsCount * yPixelsPerInt;
        int objectPoolHeight = objectPoolIntsCount * yPixelsPerInt;

        int poolsWidth = xArrowPortion - poolImageInsets;

        int xTextStart = poolsWidth - fm.stringWidth(HeapOfFishStrings.handlePool);
        if (xTextStart < 0) {
            xTextStart = 0;
        }
        xTextStart /= 2;

        int yStart = (dim.height - handlePoolHeight - labelHeight - (2 * poolImageInsets)) / 2;
        if (yStart < 0) {
            yStart = 0;
        }
        g.setColor(Color.white);
        g.drawString(HeapOfFishStrings.handlePool, poolImageInsets + xTextStart, poolImageInsets + yStart + fm.getAscent());
        int yHandlePoolRect = yStart + labelHeight;
        g.fillRect(xHandlePoolPortion + poolImageInsets, yHandlePoolRect, poolsWidth, handlePoolHeight);

        xTextStart = poolsWidth - fm.stringWidth(HeapOfFishStrings.objectPool);
        if (xTextStart < 0) {
            xTextStart = 0;
        }
        xTextStart /= 2;

        yStart = (dim.height - objectPoolHeight - labelHeight - (2 * poolImageInsets)) / 2;
        if (yStart < 0) {
            yStart = 0;
        }

        //g.setColor(Color.white);
        g.drawString(HeapOfFishStrings.objectPool, xObjectPoolPortion + xTextStart, poolImageInsets + yStart + fm.getAscent());
        int yObjectPoolRect = yStart + labelHeight;
        //g.setColor(Color.white);
        g.fillRect(xObjectPoolPortion, yObjectPoolRect, poolsWidth, objectPoolHeight);

        // Draw the headers in the object pool
        g.setColor(Color.black);
        int i = 0;
        while (i < objectPoolIntsCount) {

            for (int j = 0; j < yPixelsPerInt; ++j) {
                int yLinePos = yObjectPoolRect + (i * yPixelsPerInt) + j;
                g.drawLine(xObjectPoolPortion, yLinePos, xObjectPoolPortion + poolsWidth - 1, yLinePos);
            }
            int header = gcHeap.getObjectPool(i);
            int length = gcHeap.getMemBlockLength(header);
            if (length <= 0) { // In case object pool gets corrupted, don't hang up.
                break;
            }
            i += length;
        }

        for (i = 0; i < gcHeap.getHandlePoolSize(); ++i) {
            ObjectHandle oh = gcHeap.getObjectHandle(i + 1);
            if (!oh.free) {

                Color color = Color.red;
                int objectSizeInInts = 3;
                if (oh.fish.getFishColor() == Color.cyan) {
                    color = Color.cyan;
                    objectSizeInInts = 2;
                }
                else if (oh.fish.getFishColor() == Color.yellow) {
                    color = Color.yellow;
                    objectSizeInInts = 1;
                }
                g.setColor(color);

                // Draw bar across handle pool
                for (int j = 0; j < yPixelsPerInt * 2; ++j) {
                    int yLinePos = yHandlePoolRect + (i * yPixelsPerInt * 2) + j;
                    g.drawLine(xHandlePoolPortion + poolImageInsets, yLinePos, xHandlePoolPortion + poolImageInsets + poolsWidth - 1, yLinePos);
                }

                // Draw colored bars to represent object in the object pool
                for (int j = 0; j < yPixelsPerInt * objectSizeInInts; ++j) {
                    int yLinePos = yObjectPoolRect + (oh.objectPos * yPixelsPerInt) + j;
                    g.drawLine(xObjectPoolPortion, yLinePos, xObjectPoolPortion + poolsWidth - 1, yLinePos);
                }

                // Draw a line from the handle to the object to show that the handle
                // points to the object.
                int yArrowStart = yHandlePoolRect + (i * yPixelsPerInt * 2) + yPixelsPerInt;
                int yArrowEnd = yObjectPoolRect + (oh.objectPos * yPixelsPerInt) + ((yPixelsPerInt * objectSizeInInts) / 2);
                g.drawLine(xHandlePoolPortion + poolImageInsets + poolsWidth + 2, yArrowStart,
                    xObjectPoolPortion - 3, yArrowEnd);
            }
        }
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产成人精品亚洲午夜| 日韩一区二区视频| 国产精一区二区三区| 日本强好片久久久久久aaa| 午夜日韩在线电影| 午夜精品久久久久久久久| 亚洲成年人影院| 性感美女久久精品| 日韩vs国产vs欧美| 九一久久久久久| 国产裸体歌舞团一区二区| 国产在线麻豆精品观看| 狠狠色综合色综合网络| 韩国av一区二区三区| 国产成人精品亚洲日本在线桃色| 国产成人免费xxxxxxxx| 国产91精品久久久久久久网曝门| 国产精品77777竹菊影视小说| 成人在线综合网| 日本乱人伦一区| 欧美一区二区三区公司| 久久精品人人做人人综合| 国产视频一区在线播放| 中文字幕制服丝袜成人av| 亚洲在线成人精品| 久久成人麻豆午夜电影| 大白屁股一区二区视频| 欧美人与禽zozo性伦| 精品国产精品网麻豆系列| 综合在线观看色| 看片的网站亚洲| 91在线丨porny丨国产| 7878成人国产在线观看| 欧美激情一区在线观看| 亚洲一区二区欧美激情| 久久66热偷产精品| 91成人国产精品| 欧美精品一区在线观看| 日韩理论片在线| 看电影不卡的网站| 91福利视频在线| 久久婷婷久久一区二区三区| 亚洲一区二区三区中文字幕| 极品美女销魂一区二区三区 | 丝袜亚洲另类欧美综合| 久久精品国产77777蜜臀| 91老师国产黑色丝袜在线| 91精品国产全国免费观看| 亚洲图片欧美激情| 国产乱人伦偷精品视频免下载| 欧美揉bbbbb揉bbbbb| 久久久国产午夜精品| 五月激情六月综合| 91视频一区二区三区| 久久先锋影音av| 美女在线观看视频一区二区| 欧美少妇一区二区| 亚洲欧洲日韩综合一区二区| 国产精品亚洲专一区二区三区| 制服丝袜中文字幕一区| 亚洲激情图片一区| 色菇凉天天综合网| 自拍偷拍欧美精品| 福利电影一区二区三区| 久久这里只有精品视频网| 另类的小说在线视频另类成人小视频在线| 欧美在线啊v一区| 亚洲视频一区二区在线| va亚洲va日韩不卡在线观看| 国产丝袜欧美中文另类| 精品夜夜嗨av一区二区三区| 日韩欧美亚洲国产另类| 日韩精品一级中文字幕精品视频免费观看| 一本一道久久a久久精品| 国产精品久久久久久久久晋中| 国产成人午夜视频| 国产日产亚洲精品系列| 成人免费看片app下载| 欧美高清性hdvideosex| 亚洲国产成人av| 欧美色窝79yyyycom| 午夜精品国产更新| 日韩一区二区高清| 九色porny丨国产精品| 日韩精品一区二区三区视频| 麻豆国产欧美一区二区三区| 久久人人97超碰com| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 综合亚洲深深色噜噜狠狠网站| jlzzjlzz欧美大全| 亚洲三级理论片| 欧美日韩在线播放一区| 日韩专区欧美专区| 久久综合久色欧美综合狠狠| 懂色av中文一区二区三区| 亚洲视频中文字幕| 欧美日韩在线电影| 国产精品一区免费视频| 亚洲女与黑人做爰| 717成人午夜免费福利电影| 久久电影网电视剧免费观看| 亚洲欧美在线另类| 欧美精品久久久久久久多人混战 | 香蕉乱码成人久久天堂爱免费| 日韩一区二区三区视频在线观看 | 亚洲国产一区二区三区青草影视| 欧美日韩综合不卡| 国产在线播放一区| 亚洲精品水蜜桃| 26uuu久久综合| 91成人在线观看喷潮| 精品一区中文字幕| 亚洲欧洲成人自拍| 欧美不卡一区二区三区| 99精品热视频| 国产真实乱对白精彩久久| 最新成人av在线| 精品欧美乱码久久久久久1区2区| 91在线精品秘密一区二区| 午夜精品久久久久久久久久久| 欧美国产乱子伦| 日韩小视频在线观看专区| 一本色道久久加勒比精品| 狠狠色狠狠色合久久伊人| 亚洲综合在线视频| 欧美国产欧美综合| 欧美成va人片在线观看| 欧美日韩一区在线观看| 成人午夜视频免费看| 美女脱光内衣内裤视频久久影院| 亚洲精品视频观看| 国产精品久久精品日日| 亚洲精品一区二区三区在线观看| 欧美久久一区二区| 97se亚洲国产综合在线| 国产成人无遮挡在线视频| 久久国产精品99精品国产| 亚洲成国产人片在线观看| 亚洲免费看黄网站| 国产欧美精品一区| 国产亚洲一本大道中文在线| 日韩精品一区二区三区在线观看| 欧美亚洲综合一区| 欧美性视频一区二区三区| 日本久久一区二区| 在线观看日韩毛片| 欧美三日本三级三级在线播放| 91蜜桃免费观看视频| 99久久精品国产一区二区三区| 国产成人久久精品77777最新版本| 国产一区二区三区在线观看免费| 奇米在线7777在线精品| 免费欧美在线视频| 美女视频一区二区三区| 蜜桃av噜噜一区| 黄色小说综合网站| 国产成人免费av在线| va亚洲va日韩不卡在线观看| 91欧美激情一区二区三区成人| 99re免费视频精品全部| 91小视频在线免费看| 欧洲精品在线观看| 欧美日韩在线观看一区二区 | 国产在线精品国自产拍免费| 精品午夜久久福利影院| 国产二区国产一区在线观看| 成人国产精品视频| 欧美最新大片在线看 | 经典三级一区二区| 国产精品一区专区| 91原创在线视频| 欧美久久久久久蜜桃| 精品999久久久| 亚洲天堂成人在线观看| 午夜精品福利一区二区三区蜜桃| 婷婷丁香久久五月婷婷| 九一九一国产精品| 91视频91自| 91精品国产综合久久香蕉的特点 | 国产剧情一区在线| 99久久精品国产一区二区三区 | 国产精品久久久一区麻豆最新章节| 中文字幕在线不卡一区二区三区| 亚洲永久免费视频| 国产在线视频精品一区| 在线中文字幕一区二区| 欧美不卡视频一区| 一区二区三区毛片| 国产乱色国产精品免费视频| 在线亚洲高清视频| www国产精品av| 亚洲午夜久久久久久久久电影网 | 青青草原综合久久大伊人精品| 精品午夜一区二区三区在线观看| 99久精品国产| 久久久久久久久免费| 三级欧美韩日大片在线看| 粉嫩嫩av羞羞动漫久久久| 这里只有精品视频在线观看| 中文字幕第一区第二区|