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

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

?? layermanager.java

?? 在手機環境里運行的J2ME坦克類射擊游戲源代碼
?? JAVA
字號:
/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 *  Copyright(c) 2003-2004 Jordi Martin Perez
*/
package org.piratis.j2me.core.game;

import javax.microedition.lcdui.Graphics;

import org.piratis.j2me.core.BBox2D;
import org.piratis.j2me.core.QuickList;


/**
 * As in MIDP2.0, the LayerManager manages Layers. The LayerManager 
 * simplifies the process of rendering the Layers that have been added 
 * to it by automatically rendering the correct regions of each Layer 
 * in the appropriate order.<br>
 * <br>
 * The LayerManager mantains an ordered list to which Layers can be
 * appended, inserted and removed. Its index in the list correlates to
 * its z-order: index 0 is closest to the user, while the higher index, the
 * further from the user.
 * TODO: is it necessary to keep an own bbox?
 * 
 * @author		Jordi Mart韓
 * @copyright	Copyright (c) 2003-2004
 * @created 	24-jun-2004
 * @version		$Id: LayerManager.java,v 1.3 2004/06/26 18:48:31 piratis Exp $
 */

public class LayerManager
{
    /**
     * Where the layers will be stored
     */
    private QuickList layers = null;
    
    /**
     * View Window
     */
    private BBox2D window = null;
    
    /**
     * Creates a new LayerManager
     */
    public LayerManager()
    {
        this.layers = new QuickList();
        // view window -> max value
        this.window = new BBox2D();
        this.window.width = this.window.height = Integer.MAX_VALUE;
    }
    
    /**
     * Appends a Layer to this LayerManager. It will be given the highest
     * position available, thus the furthest away from the user. It is also
     * first removed if was previously added
     * @param l
     */
    public void add(Layer l)
    {
        this.layers.removeElement(l);
        this.layers.add(l);
    }
    
    /**
     * Inserts a Layer at a given position. The Layer is first removed
     * if previously added, and Layers with index equals or greater than
     * the specified are shift to the right.
     * @param l Layer
     * @param idx where to insert the layer
     */
    public void insertAt(Layer l, int idx)
    {
        this.layers.removeElement(l);
        this.layers.insertElementAt(l, idx);
    }
    
    /**
     * Gets the layer at the specified index
     * @param idx the index
     * @return the Layer, if index ok
     * @throws IndexOutOfBoundsException if element not found at the
     * 	specified index
     */
    public Layer getLayerAt(int idx)
    {
        return (Layer) this.layers.elementAt(idx);
    }
    
    /**
     * Gets the number of layers
     * @return the number of layers
     */
    public int getSize()
    {
        return this.layers.length();
    }
    
    /**
     * Deletes the Layer from this LayerManager.
     * @param l the Layer to be removed
     */
    public void remove(Layer l)
    {
        this.layers.removeElement(l);
    }
    
    /**
     * Renders the LayerManager's Layers.<br>
     * <br>
     * The Layers within this LayerManager are rendered following the z-order
     * given by its position, i.e. descending order.<br>
     * <br>
     * x,y params specify where is the LayerManager to be rendered relative
     * to the Graphic's origin.
     * @param g to draw the LayerManager
     * @param x horizontal location at which to render the view window
     * @param y vertical location at which to render the view window
     * @see #setWindow(int, int, int, int)
     */
    public void paint(Graphics g, int x, int y)
    {
        // translate issues
        int transX, transY;
        transX = g.getTranslateX();
        transY = g.getTranslateY();
        g.translate(x + (x - this.window.x)- transX, 
                y + (y - this.window.y) - transY);

        // store prev clipping
        int clipX, clipY, clipW, clipH;
        clipX = g.getClipX(); clipY = g.getClipY();
        clipW = g.getClipWidth(); clipH = g.getClipHeight();
        // set clipping
        g.clipRect(this.window.x, this.window.y, 
                this.window.width, this.window.height);

        // draw sprites
        Layer l;
        for (int i = this.layers.length()-1; i >= 0; i--)
        {
            l = (Layer) this.layers.elementAt(i);
            // check visibility && inside the window!
            if (l.isVisible() && l.getBbox().collide(this.window))
                l.paint(g);
        }
        
        // restore clipping
        g.setClip(clipX, clipY, clipW, clipH);

        // restore translate issues
        g.translate(transX - g.getTranslateX(), transY - g.getTranslateY());

    }
    
    /**
     * Sets the view window on the LayerManager.
     * @param x left relative to the LayerManager's origin 
     * @param y top idem.
     * @param width
     * @param height
     */
    public void setWindow(int x, int y, int width, int height)
    {
        this.window.x = x;
        this.window.y = y;
        this.window.width = width;
        this.window.height = height;
    }
    
    /**
     * Sets the view window on the LayerManager
     * @param other the new view window
     * @see #setWindow(int, int, int, int)
     */
    public void setWindow(BBox2D other)
    {
        this.setWindow(other.x, other.y, other.width, other.height);
    }
    
    /**
     * Retrieve the current world window 
     * @return world's window
     */
    public BBox2D getWindow()
    {
        return this.window;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美mv和日韩mv国产网站| 在线观看日韩av先锋影音电影院| 亚洲最新视频在线观看| 国产精品久久久久aaaa樱花| 久久嫩草精品久久久精品一| 久久综合色婷婷| 国产欧美综合在线观看第十页| 久久久.com| 国产精品色一区二区三区| 国产精品天干天干在线综合| 亚洲欧洲另类国产综合| 一区二区三区中文免费| 亚洲小说春色综合另类电影| 日本女优在线视频一区二区| 麻豆成人91精品二区三区| 精品一区二区日韩| 国产91精品入口| 在线观看不卡一区| 欧美一区二区三区电影| 久久综合色婷婷| 亚洲色大成网站www久久九九| 亚洲电影中文字幕在线观看| 日本不卡一区二区三区高清视频| 久久国产成人午夜av影院| 成人v精品蜜桃久久一区| 日本韩国一区二区三区| 日韩欧美一二区| 综合网在线视频| 强制捆绑调教一区二区| www.亚洲激情.com| 欧美久久久久中文字幕| 国产欧美日韩亚州综合| 亚洲一区影音先锋| 久久精品国产免费看久久精品| 成人丝袜高跟foot| 欧美精品tushy高清| 久久久99久久| 亚洲成人福利片| jizzjizzjizz欧美| 日韩三级高清在线| 一区二区三区高清| 国产成人综合在线观看| 欧美丰满少妇xxxxx高潮对白| 久久久久久久电影| 男男视频亚洲欧美| 色综合天天天天做夜夜夜夜做| 日韩午夜精品视频| 亚洲一本大道在线| 色激情天天射综合网| 久久久精品中文字幕麻豆发布| 亚洲男女一区二区三区| 国产麻豆精品视频| 91精品国产免费久久综合| ㊣最新国产の精品bt伙计久久| 狠狠v欧美v日韩v亚洲ⅴ| 欧美日韩一区二区三区视频| 国产精品久久久久久久浪潮网站| 精品一区二区三区香蕉蜜桃| 91精品国产综合久久蜜臀| 亚洲精品视频在线看| 暴力调教一区二区三区| 欧美激情综合在线| 国产**成人网毛片九色 | 久久久亚洲高清| 丝袜亚洲另类欧美综合| 色欧美乱欧美15图片| 18成人在线视频| 91在线porny国产在线看| 中日韩av电影| 成人中文字幕合集| 欧美国产精品久久| 99天天综合性| 亚洲精品少妇30p| 色综合色综合色综合| 夜夜揉揉日日人人青青一国产精品| 成人免费av网站| 国产精品久久久久婷婷| 91丨porny丨户外露出| 亚洲精品国产无套在线观| 色哟哟欧美精品| 亚洲精品伦理在线| 欧美视频一二三区| 视频一区视频二区在线观看| 欧美电影一区二区| 精品一区二区免费在线观看| 国产日韩欧美精品综合| 不卡欧美aaaaa| 亚洲成人av资源| 日韩欧美在线影院| 国产精品一区二区三区网站| 中文字幕精品一区二区三区精品| 成人免费视频国产在线观看| 中文字幕视频一区| 欧美日韩国产免费| 久久99国产精品成人| 欧美激情一区二区三区| 欧美在线999| 狠狠色狠狠色综合系列| 亚洲欧洲三级电影| 欧美一级欧美三级| 国产乱码精品一区二区三区忘忧草| 国产精品污污网站在线观看| 欧美日韩在线播放| 国产一区二区三区黄视频| 亚洲欧美一区二区三区久本道91| 欧美喷潮久久久xxxxx| 日本视频在线一区| 国产精品久线观看视频| 制服丝袜成人动漫| 成人性生交大片免费看中文| 亚洲二区视频在线| 日本一区二区三区在线观看| 欧美日韩中文精品| 高清国产一区二区| 日韩国产精品久久久久久亚洲| 久久综合九色综合欧美98| 色婷婷亚洲婷婷| 成人午夜在线播放| 麻豆91在线看| 亚洲国产一区视频| 亚洲特黄一级片| 精品捆绑美女sm三区| 精品视频一区三区九区| 成人精品免费网站| 韩国女主播一区二区三区| 亚洲精品国产精华液| 久久亚区不卡日本| 91精品国产综合久久福利软件| 99麻豆久久久国产精品免费 | 91在线视频网址| 九一久久久久久| 亚洲影院在线观看| 中文字幕日韩av资源站| 久久精品视频在线看| 日韩精品专区在线影院重磅| 日本电影欧美片| 91视频在线看| 99精品国产视频| 国产不卡视频一区二区三区| 久久精品国产一区二区| 日韩和欧美的一区| 日欧美一区二区| 亚洲午夜三级在线| 一区二区久久久久久| 亚洲欧美激情在线| 亚洲乱码国产乱码精品精小说 | 成人av在线资源网| 激情五月激情综合网| 久久超碰97中文字幕| 蜜臀久久99精品久久久久宅男| 亚洲成a天堂v人片| 性做久久久久久久免费看| 亚洲综合在线五月| 香蕉加勒比综合久久| 亚洲1区2区3区视频| 日韩电影免费在线观看网站| 午夜视频一区二区| 午夜视频久久久久久| 免费在线观看视频一区| 久久电影网电视剧免费观看| 国产精品亚洲视频| 91在线一区二区三区| 欧美在线影院一区二区| 欧美男女性生活在线直播观看| 欧美日韩精品一区二区三区蜜桃 | 69堂亚洲精品首页| 欧美一区二区三区婷婷月色| 日韩一区二区免费视频| 精品蜜桃在线看| 国产清纯美女被跳蛋高潮一区二区久久w| 久久亚洲私人国产精品va媚药| 久久久精品tv| 亚洲综合视频网| 麻豆国产欧美日韩综合精品二区 | 亚洲成年人影院| 精品一区二区成人精品| 成人妖精视频yjsp地址| 在线观看国产日韩| www久久精品| 亚洲免费观看高清完整版在线观看| 午夜精品123| 成人免费va视频| 在线播放中文字幕一区| 欧美—级在线免费片| 亚洲高清不卡在线观看| 国产盗摄精品一区二区三区在线| 欧洲av一区二区嗯嗯嗯啊| 日韩免费一区二区三区在线播放| 国产精品日日摸夜夜摸av| 天堂蜜桃一区二区三区 | 91美女在线视频| 欧美变态凌虐bdsm| 日韩理论在线观看| 老司机精品视频导航| 日本韩国一区二区三区| 久久久精品国产免大香伊| 亚洲成av人片一区二区| 99麻豆久久久国产精品免费| 欧美大白屁股肥臀xxxxxx| 亚洲精品乱码久久久久|