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

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

?? screencanvas.java

?? 開發(fā)j2me 手機程序必須的用到的。文件較小
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package com.jmobilecore.ui.core;

import javax.microedition.lcdui.*;
import java.util.Vector;

/**
 * A screen that contains {@link Component}s.
 *
 * @author Greg Gridin
 */
public class ScreenCanvas extends PlatformCanvas {

    /**
     * Off the screen image for double buffer painting
     */
    protected Image offScreen;

    /**
     * Scrolling direction. Used with {@link #drawTriangle drawTriangle}
     */
    public final static int SCROLL_UP = 0x0001;

    /**
     * Scrolling direction. Used with {@link #drawTriangle drawTriangle}
     */
    public final static int SCROLL_DOWN = 0x0002;

    /**
     * Scrolling step
     */
    protected final static int CANVAS_SCROLL_STEP = 10;

    /**
     * Screen title
     */
    protected Label screenTitle;

    /**
     * Vector of GUI components
     */
    protected Vector components = null;

    /**
     * SoftKeyBar for current screen
     * this component is not in components vector
     */
    protected SoftKeyBar softKeyBar = null;

    /**
     * Currently focused component. Index points to components vector
     */
    protected int focusedIndex = -1;

    /**
     * y-coordinate offset within the body of the first component to display. For
     * example, if the screen container contains more components than can be
     * displayed at one time vertically, this offset will be adjusted to ensure
     * that the screen is scrolled to always display the currently-focused
     * component.
     */
    protected int bodyOffset = 0;

    /**
     * Indicated if focus ajjustment is required
     *
     * @see #recalcAdjustment
     * @see #refocus
     */
    protected boolean adjustFocus = false;

    /**
     * Creates a new <code>ScreenCanvas</code> instance.
     */
    public ScreenCanvas() {
        this(null, new SoftKeyBar());
    }

    /**
     * Creates a new <code>ScreenCanvas</code> instance.
     *
     * @param title The screen title, one line text
     */
    public ScreenCanvas(Label title) {
        this(title, new SoftKeyBar());
    }

    /**
     * Creates a new <code>ScreenCanvas</code> instance.
     *
     * @param title      Title for current screen
     * @param softKeyBar Container for soft keys for current screen
     */
    public ScreenCanvas(Label title, SoftKeyBar softKeyBar) {

        screenTitle = title;
        components = new Vector();
        this.softKeyBar = softKeyBar;
        if (!DOUBLE_BUFFER) {
            offScreen = Image.createImage(WIDTH, HEIGHT);
        }
    }

    /**
     * Height of the title in pixels
     */
    protected int titleHeight;

    /**
     * Height of the scrollbar in pixels
     */
    protected int softKeyBarHeight;

    /**
     * Height of the scrollable area (of current screen) in pixels
     */
    protected int paintAreaHeight;

    /**
     * Paints the screen's body, which is all of the components that have been
     * added to the screen.
     *
     * @param g Graphics context
     */
    public void paint(Graphics g) {

        Graphics saved = g;
        int oldColor = g.getColor();
        if (offScreen != null) {
            g = offScreen.getGraphics();
        }

        titleHeight = (screenTitle != null) ? screenTitle.height : 0;
        softKeyBarHeight = (softKeyBar != null) ? softKeyBar.height : 0;
        paintAreaHeight = HEIGHT - titleHeight - softKeyBarHeight;
        g.setClip(0, 0, WIDTH, HEIGHT);
        paintBodyBackground(g);
        paintBody(g);
        if (screenTitle != null) screenTitle.paint(g);
        if (softKeyBar != null) softKeyBar.paint(g);
        paintScroller(g);

        g.setColor(oldColor);
        if (g != saved) {
            saved.drawImage(offScreen, 0, 0, Graphics.LEFT | Graphics.TOP);
        }
        saved = null;
    }

    /**
     * Paints the screen's body background
     *
     * @param g Graphics context
     */
    protected void paintBodyBackground(Graphics g) {
        g.setColor(Style.BACKGROUND_COLOR);
        g.fillRect(0, titleHeight, WIDTH, paintAreaHeight);
    }

    /**
     * Paint scrolling indicator(s) at the bottom of the screen to indicate that
     * the display can scroll vertically.
     *
     * @param g Graphics context
     */
    protected void paintScroller(Graphics g) {
        int scrollDirections = getScrollDirections();
        int arrowMaxHeight = softKeyBarHeight / 2 - 1;
        if ((scrollDirections & SCROLL_UP) > 0) {
            ScreenCanvas.drawTriangle(g, WIDTH / 2,
                    HEIGHT - softKeyBarHeight, arrowMaxHeight,
                    SCROLL_UP, Style.ARROW_COLOR);
        }
        if ((scrollDirections & SCROLL_DOWN) > 0) {
            ScreenCanvas.drawTriangle(g, WIDTH / 2,
                    HEIGHT - 1, arrowMaxHeight,
                    SCROLL_DOWN, Style.ARROW_COLOR);
        }
    }

    /**
     * Support method for painting scroller
     *
     * @see #paintScroller
     */
    public static void drawTriangle(Graphics g,
                                    int tipX, int tipY,
                                    int maxHeight,
                                    int direction,
                                    int color) {

        int yIncrement = 1;
        if (direction == ScreenCanvas.SCROLL_DOWN) yIncrement = -1;

        if (color!=Color.TRANSPARENT) g.setColor(color);
        for (int height = 0; height < maxHeight; height++) {
            g.drawLine(tipX, tipY, tipX + height * 2, tipY);
            tipX--; // start one pixel over
            tipY += yIncrement; // next row to draw
        }
    }

    /**
     * Processes a press of a key.
     */
    protected void keyPressed(int keyCode) {

        if (softKeyBar != null && softKeyBar.keyPressed(keyCode))
            return;

        if (focusedIndex >= 0 && focusedIndex < components.size()) {
            Component focusedComponent = (Component) components.elementAt(focusedIndex);
            if (focusedComponent.keyPressed(keyCode)) return;
        }

        int n = -1;
        if (keyCode == KEY_UP) {
            if ((n = getPreviousFocusable()) != -1) {
                changeFocus(n);
            } else {
                scrollUp();
            }
        } else if (keyCode == KEY_DOWN) {
            if ((n = getNextFocusable()) != -1) {
                changeFocus(n);
            } else {
                scrollDown();
            }
        }
    }

    /**
     * Returns the directions the body can be scrolled in.
     * This should be dynamic depending upon what portion of the body area is
     * displayed.
     *
     * @return The directions that the body area can be scrolled. Should be 0 if
     *         all body elements can be displayed at once, but if not it should be an
     *         appropriate bitwise or of {@link #SCROLL_UP} and/or {@link #SCROLL_DOWN}
     */
    protected int getScrollDirections() {
        int directions = 0;
        if (bodyOffset > 0) directions |= SCROLL_UP;
        if (bodyOffset + paintAreaHeight < getComponentsHeight())
            directions |= SCROLL_DOWN;
        return directions;
    }

    /**
     * Adds the component to the screen.
     * <p/>
     * More presicely it adds a component to vector of components for current screen
     * Components are displayed in order of {@link #components} one component per line
     *
     * @param component the component to be added
     */
    public void add(Component component) {
        component.parentScreen = this;
        components.addElement(component);
        if (component.focusable && focusedIndex == -1) {
            component.requestFocus();
            focusedIndex = components.size() - 1;
        }
    }

    /**
     * Adds the component to the screen at the given position.
     * <p/>
     * More presicely it adds a component to vector of components for current screen
     * Components are displayed in order of {@link #components} one component per line
     *
     * @param component the component to be added
     * @param index     the position at which to insert the component,
     *                  or <code>-1</code> to append the component to the end
     */
    public void add(Component component, int index) {
        if (index == -1) {
            add(component);
        } else {
            component.parentScreen = this;
            components.insertElementAt(component, index);
            if (focusedIndex == -1) {
                if (component.focusable) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲大片在线观看| 欧美性猛交xxxx乱大交退制版| 日韩一区日韩二区| 国产精品色哟哟网站| 久久免费国产精品 | 日韩成人免费电影| 亚洲h精品动漫在线观看| 国内精品伊人久久久久av影院 | 成人免费在线视频| 成人国产免费视频| 蜜臂av日日欢夜夜爽一区| 日本vs亚洲vs韩国一区三区二区| 日韩中文字幕麻豆| 狠狠v欧美v日韩v亚洲ⅴ| 在线精品视频小说1| 欧美精品亚洲一区二区在线播放| 欧美片网站yy| 欧美电视剧免费观看| 国产亚洲欧美色| 亚洲精品欧美激情| 久久综合综合久久综合| 国产精品亚洲一区二区三区妖精 | 在线播放91灌醉迷j高跟美女| 色综合激情久久| 欧美日韩国产一二三| 亚洲欧美激情视频在线观看一区二区三区 | 亚洲欧美日韩在线不卡| 国产成人精品综合在线观看| 一本色道**综合亚洲精品蜜桃冫| 久久久777精品电影网影网 | 欧美日韩美女一区二区| 一区二区三区日韩| 久久99精品国产麻豆婷婷| 成人午夜视频免费看| 欧美日韩视频一区二区| 国产亚洲精品超碰| 国产成人综合自拍| 久久久精品人体av艺术| 国产成人鲁色资源国产91色综 | 欧美男女性生活在线直播观看| 亚洲一区二区在线观看视频| 韩国一区二区三区| 久久免费看少妇高潮| 国产jizzjizz一区二区| 欧美人牲a欧美精品| 日韩不卡一区二区三区| 精品免费99久久| 亚洲国产精品久久久久秋霞影院| 国产馆精品极品| 国产日本欧洲亚洲| 激情五月激情综合网| 久久老女人爱爱| 99re在线精品| 国产精品入口麻豆九色| 91一区二区三区在线播放| 久久免费视频一区| youjizz国产精品| 国产午夜精品一区二区三区嫩草| 国产福利精品导航| 亚洲精品第1页| 欧美一二三在线| 日韩国产在线观看| 久久久久久99久久久精品网站| 成人黄色a**站在线观看| 又紧又大又爽精品一区二区| 欧美日韩三级一区| 国产精品一级在线| 亚洲精品国产一区二区精华液 | 男女男精品视频网| 日本一区二区三区四区在线视频| 91色视频在线| 久久精品久久99精品久久| 国产精品久久久久一区二区三区 | 国产成人免费视频| 亚洲综合免费观看高清在线观看| 91麻豆精品国产自产在线| 国产精品888| 亚洲va韩国va欧美va精品| 国产欧美综合在线| 欧美日韩成人综合在线一区二区 | 日产欧产美韩系列久久99| 久久九九影视网| 欧美三级资源在线| 福利一区二区在线观看| 日精品一区二区三区| 国产精品电影院| 精品国产乱子伦一区| 狠狠色狠狠色综合日日91app| 亚洲欧美另类久久久精品| 精品成人在线观看| 欧美日韩另类一区| 97超碰欧美中文字幕| 国产在线一区观看| 日日摸夜夜添夜夜添国产精品| 亚洲天堂成人在线观看| 欧美做爰猛烈大尺度电影无法无天| 国产在线视频不卡二| 日韩高清在线不卡| 亚洲最大成人综合| 亚洲色图色小说| 久久精品免视看| 精品欧美一区二区久久| 欧美午夜一区二区三区免费大片| 成人av网站在线观看免费| 韩国精品一区二区| 九一九一国产精品| 免费的成人av| 捆绑紧缚一区二区三区视频| 午夜av一区二区三区| 久久久久久99精品| 欧美精品一区二区蜜臀亚洲| 欧美一级电影网站| 欧美成人女星排行榜| 91精品国产综合久久久久久| 欧美三级午夜理伦三级中视频| 色婷婷av一区二区三区之一色屋| 成人免费毛片嘿嘿连载视频| 国产suv精品一区二区6| 国产99精品国产| 成人午夜电影小说| 99久久久国产精品| 91视频国产观看| 一本一道久久a久久精品综合蜜臀| 成人免费观看av| 99国产精品久| 在线亚洲一区二区| 国产传媒欧美日韩成人| 成人精品视频网站| 91免费看`日韩一区二区| 色呦呦国产精品| 欧美三级电影网| 欧美一卡在线观看| 91豆麻精品91久久久久久| 91成人国产精品| 91精品国产aⅴ一区二区| 欧美一级在线观看| 国产欧美在线观看一区| 国产精品丝袜一区| 亚洲黄色性网站| 天天av天天翘天天综合网色鬼国产| 亚洲成人免费影院| 精品亚洲aⅴ乱码一区二区三区| 国产精品一二二区| 在线中文字幕一区二区| 91精品国产综合久久婷婷香蕉| 久久久亚洲欧洲日产国码αv| 欧美国产国产综合| 亚洲精品一区二区三区四区高清| 久久久精品欧美丰满| 亚洲欧美aⅴ...| 男男成人高潮片免费网站| 国产精品一二三区| 欧美中文字幕亚洲一区二区va在线| 日韩欧美中文字幕精品| 国产精品日产欧美久久久久| 亚洲动漫第一页| 国产乱人伦精品一区二区在线观看| 99re视频精品| 日韩一区二区精品| 亚洲精品ww久久久久久p站 | 7777精品伊人久久久大香线蕉| 欧美精品一区二区高清在线观看| 欧美日本国产视频| 中文字幕av在线一区二区三区| 亚洲国产色一区| 国产91精品久久久久久久网曝门| 欧美三级日韩三级国产三级| 久久精品视频在线免费观看| 天堂资源在线中文精品| 国产成人午夜视频| 在线播放91灌醉迷j高跟美女 | 国产成人在线免费观看| 欧美日韩国产一级二级| 国产精品福利一区| 国产丶欧美丶日本不卡视频| 91精品中文字幕一区二区三区| 亚洲欧美综合在线精品| 国产真实乱对白精彩久久| 欧美乱妇15p| 亚洲综合在线观看视频| 粉嫩av亚洲一区二区图片| 日韩无一区二区| 五月激情综合婷婷| 色综合色狠狠综合色| 中文幕一区二区三区久久蜜桃| 久久成人精品无人区| 欧美日韩成人一区| 有码一区二区三区| 色综合婷婷久久| 91麻豆精品国产91久久久更新时间 | 亚洲bt欧美bt精品777| 91视频在线观看| 亚洲桃色在线一区| 不卡的电视剧免费网站有什么| www成人在线观看| 精品一区二区久久久| 日韩一区二区视频在线观看| 日韩精品亚洲专区| 欧美一区二区精品在线| 三级在线观看一区二区|