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

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

?? pen.java

?? 開發框架。 一.說明: 此框架的意圖是解決手機軟件開發中常遇到
?? JAVA
字號:
package org.gggeye.easymf.ui;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Image;

/**
 * 圖形繪制包裝類
 * 
 * 跟PPC Android Pen 有異曲同工之妙
 * 
 * @author wuhua
 * <a href="http://wuhua.3geye.net">我的博客</a>
 *
 */
public class Pen {
    Graphics graphics;
    int top;
    int left;
    Font bakFont;
    int bakStyle;
    int bakColor;
    int bakClipX = 0;
    int bakClipY = 0;
    int bakClipWidth = 0;
    int bakClipHeight = 0;

    public Pen(Graphics graphics) {
        this(graphics, 0, 0);
    }

    public Pen(Graphics graphics, int top, int left) {
        this.graphics = graphics;
        this.top = top;
        this.left = left;
    }


    public final void save() {
        this.bakColor = graphics.getColor();
        this.bakStyle = graphics.getStrokeStyle();
        this.bakFont = graphics.getFont();
    }

    public final void reset() {
        graphics.setColor(this.bakColor);
        graphics.setStrokeStyle(this.bakStyle);
        graphics.setFont(this.bakFont);
    }

    public final void saveClip() {
        bakClipX = graphics.getClipX();
        bakClipY = graphics.getClipY();
        bakClipWidth = graphics.getClipWidth();
        bakClipHeight = graphics.getClipHeight();
    }

    public final void resetClip() {
        graphics.setClip(bakClipX, bakClipY,
                         bakClipWidth, bakClipHeight);
    }

    /**
     * 構造函數
     * @param graphics Graphics
     */

    public Graphics getGraphics() {
        return graphics;
    }

    /**
     * 設置左邊界和頂邊界
     * @param x int
     * @param y int
     */
    public void setOffset(int x, int y) {
        left = x;
        top = y;
    }


    public int getColor() {
        return graphics.getColor();
    }


    public void setColor(int i) {
        graphics.setColor(i);
    }

    /**
     * 該方法用于設置繪制線弧形,矩形等時指定繪制模式是SLLID或DOTTED.
     * @param i int
     */
    public void setStrokeStyle(int i) {
        graphics.setStrokeStyle(i);
    }


    public void setFont(Font font) {
        graphics.setFont(font);
    }

    public Font getFont() {
        return graphics.getFont();
    }

    /**
     * 獲取剪貼區X軸偏移量
     * @return int
     */
    public int getClipX() {
        return graphics.getClipX() - left;
    }

    /**
     * 獲取剪貼區Y軸偏移量
     * @return int
     */
    public int getClipY() {
        return graphics.getClipY() - top;
    }

    /**
     * 獲取剪貼區寬度
     * @return int
     */
    public int getClipWidth() {
        return graphics.getClipWidth();
    }

    /**
     * 獲取剪貼區高度
     * @return int
     */
    public int getClipHeight() {
        return graphics.getClipHeight();
    }

    /**
     *該方法指定的矩形區域與當前的剪貼區交叉,形成并集的新的剪貼區.
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     */
    public void clipRect(int x, int y, int width, int height) {
        graphics.clipRect(x + left, y + top, width, height);
    }

    /**
     * 設置剪貼區
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     */
    public void setClip(int x, int y, int width, int height) {
        graphics.setClip(x + left, y + top, width, height);
    }

    /**
     * 繪制直線
     * @param x int
     * @param y int
     * @param x2 int
     * @param y2 int
     */
    public void drawLine(int x, int y, int x2, int y2) {
        graphics.drawLine(x + left, y + top, x2 + left, y2 + top);
    }

    /**
     * 填充矩形框
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     */
    public void fillRect(int x, int y, int width, int height) {
        graphics.fillRect(x + left, y + top, width, height);
    }

    /**
     * 繪制矩形,通過多種顏色進行繪制
     * @param colors int[]
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     */
    public void drawRects(int[] colors, int x, int y,
                          int width, int height) {
        int cof = 0;
        for (int k = 0; k < colors.length; k++) {
            cof++;
            this.setColor(colors[k]);
            this.drawRect(x - cof,
                          y - cof,
                          width + (cof << 1),
                          height + (cof << 1));
        }
    }
    public void drawRects(int x, int y,
                         int width, int height) {
      // int[] colors = new int[] {0xB0E2FF, 0x4876FF, 0x1E90FF};
       int[] colors = new int[] {0xCEF};
       drawRects(colors, x, y, width, height);
   }



    /**
     * 填充,指定區域
     * @param color int
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     * @param size int
     */
    public void fillRect(int color, int x, int y, int width, int height,
                         int size) {
//     graphics.setColor(color);
//     //if(size == 0){
//          graphics.fillRect(x + left, y + top, width, height);
//     if(size != 0){
//         int h = height/size;
//         for(int i=1; i<size; i++){
//              graphics.fillRect(0, y + h*i, width, h);
//         }
//         graphics.fillRect(0, y + top, width, h);
//     }

    }


    /**
     * 繪制矩形
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     */
    public void drawRect(int x, int y, int width, int height) {
        graphics.drawRect(x + left, y + top, width, height);
    }

    /**
     * 填充弧形.
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     * @param startAngle int
     * @param arcAngle int
     */
    public void fillArc(int x, int y, int width, int height, int startAngle,
                        int arcAngle) {
        graphics.fillArc(x + left, y + top, width, height, startAngle, arcAngle);
    }

    /**
     * 繪制弧形
     * @param x int
     * @param y int
     * @param width int
     * @param height int
     * @param startAngle int
     * @param arcAngle int
     */
    public void drawArc(int x, int y, int width, int height, int startAngle,
                        int arcAngle) {
        graphics.drawArc(x + left, y + top, width, height, startAngle, arcAngle);
    }

    /**
     * 繪制字符串
     * @param s String
     * @param x int
     * @param y int
     * @param anchor int
     */
    public void drawChars(char[] c, int os, int len, int x, int y, int anchor) {
        graphics.drawChars(c, os, len, x + left, y + top, anchor);
    }

    public void drawChar(char c, int _x, int _y, int _anchor){
        graphics.drawChar(c, _x + left, _y + top, _anchor);
    }

    public void drawString(String s, int x, int y, int anchor) {
        graphics.drawString(s, x + left, y + top, anchor);
    }


    public void drawSubstring(String s, int x, int y, int k, int i1, int anchor) {
        graphics.drawSubstring(s, x, y, k + left, i1 + top, anchor);
    }


    public void drawImage(Image image, int x, int y, int anchor) {
        graphics.drawImage(image, x + left, y + top, anchor);
    }

    public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3) {
        graphics.fillTriangle(x1 + left, y1 + top, x2 + left, y2 + top,
                              x3 + left,
                              y3 + top);
    }


    public final void drawStrings(String[] values,  Font font, int left, int top,
                                  int fontColor) {
        if(values == null)
            return;
        this.save();
        this.setFont(font);
        this.setColor(fontColor);

        int x = left;
        int y = top;
        for (int j = 0; j < values.length; j++) {
            drawString(values[j],x, y, 20);
            x = 0;
            y += font.getHeight();
        }
       this.reset();
    }
    
    /**
	 * 繪制漸變色選擇條
	 * 
	 * @param g -- 
	 * @param color
	 * @param x
	 * @param y
	 * @param width
	 * @param height
	 */
	public final  void drawShadeRect(int color, int x , int y, int width, int height){
		 int[] rgb = getShadeColor(color, width);
		 int h = y+height;
		 for(int i =y ; i < h; i+=2){
			graphics.drawRGB(rgb, 0, width, x, i, width,
			  			2, true);
		 }
		  
		 
	}
	
	/**
	 * 獲取顏色漸變RGB數組,
	 * 為了獲取這個數據,而又跟CLDC1.0兼容,導致項目增加了一個Float類
	 * 導致程序變大
	 * @param width
	 * @return
	 */
	public final static int[] getShadeColor(int color , int width){
		 int[] rgb;
	 
		  int shadeWidth = width;
		  int nRgbData = shadeWidth * 4;
			
	      rgb = new int[nRgbData];
	    
		  int alpha = -127;
		  for (int i = 0; i < shadeWidth; i++)
	      {
		    alpha = -127 + i;
			//主要算法在這里。
			int col = color | (128 - alpha << 24);
	        rgb[i]                  = col;
	        rgb[i + shadeWidth    ] = col;
	        rgb[i + shadeWidth * 2] = col;
	        rgb[i + shadeWidth * 3] = col;		        
	      }
		  return rgb;
	}
	


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美久久久一区| 91麻豆精品久久久久蜜臀| 热久久久久久久| 最新国产の精品合集bt伙计| 91精品国产乱码久久蜜臀| av动漫一区二区| 激情成人综合网| 国产精品第13页| 久久久久久亚洲综合| 欧美一区二区三区成人| 色视频一区二区| 9久草视频在线视频精品| 国产中文字幕一区| 欧美aa在线视频| 午夜久久电影网| 久久综合色综合88| 久久精品视频在线看| 中文字幕va一区二区三区| 欧美一区二区三区在线观看视频| 94色蜜桃网一区二区三区| 韩国v欧美v日本v亚洲v| 日韩电影免费在线看| 亚洲国产日韩精品| 久久久综合精品| 欧美mv和日韩mv的网站| 日韩一卡二卡三卡四卡| 欧美日韩一卡二卡三卡| 一本大道久久a久久精品综合| 国产精品资源在线看| 精品一区二区三区在线视频| 日韩av电影一区| 日本一区中文字幕| 亚洲图片有声小说| 一区二区三区中文在线观看| 亚洲私人黄色宅男| 国产网站一区二区| 亚洲男人的天堂一区二区| 国产三级一区二区| 久久亚洲精华国产精华液 | 精品在线你懂的| 日韩国产成人精品| 欧美bbbbb| 精品一区二区三区久久久| 激情图片小说一区| 精品一区二区免费在线观看| 狠狠狠色丁香婷婷综合久久五月| 琪琪一区二区三区| 精品在线免费视频| 国产精选一区二区三区| 成人理论电影网| 色乱码一区二区三区88| 欧美午夜片在线观看| 欧美日韩高清一区| 欧美一区二区三区在线| 久久影院视频免费| 日韩一区欧美一区| 亚洲不卡av一区二区三区| 日韩一区精品字幕| 国产精品自拍毛片| aa级大片欧美| 91在线porny国产在线看| 欧美在线999| 色婷婷av久久久久久久| 91成人国产精品| 欧美三片在线视频观看| 精品国产91九色蝌蚪| 91精品国产麻豆国产自产在线| 欧美日韩视频在线观看一区二区三区| 在线区一区二视频| 色一情一伦一子一伦一区| 日本高清无吗v一区| 1024成人网| 亚洲欧美日韩一区| 亚洲蜜臀av乱码久久精品| 一区二区三区四区精品在线视频| 国产精品久久毛片| 欧美精品一区二区三区蜜桃视频| 亚洲制服丝袜一区| 免费成人美女在线观看| 久久成人羞羞网站| 激情综合亚洲精品| 色婷婷久久久亚洲一区二区三区| 久久综合色综合88| 91香蕉视频mp4| 91影院在线观看| 日本午夜精品一区二区三区电影| 久久99精品久久久久久久久久久久| 粉嫩欧美一区二区三区高清影视| 91视频免费播放| 精品免费国产二区三区 | 精品成人在线观看| 最新不卡av在线| 捆绑变态av一区二区三区| 91在线观看污| 精品国产一区二区国模嫣然| 一区二区三区四区精品在线视频| 久久9热精品视频| 91成人在线精品| 日韩一区二区免费在线观看| 色屁屁一区二区| 欧美精品123区| 中文av一区特黄| 欧美a级一区二区| 欧美亚洲国产bt| 中文字幕精品一区二区精品绿巨人| 亚洲精品中文在线影院| 国产一区在线精品| 欧美日韩国产综合一区二区三区 | 26uuu久久天堂性欧美| 亚洲一区二区三区四区的| 春色校园综合激情亚洲| 日韩欧美国产综合| 午夜精品福利一区二区三区av| 97久久超碰精品国产| 久久久精品影视| 久久精品国产亚洲a| 在线成人小视频| 亚洲精品久久久久久国产精华液| 国产精品一品二品| 精品国产伦一区二区三区免费| 亚洲1区2区3区4区| 欧美在线不卡一区| 成人激情黄色小说| 在线免费观看日本一区| 中文字幕欧美日韩一区| 国产一区二区不卡老阿姨| 欧美一区二区日韩一区二区| 亚洲综合男人的天堂| 色琪琪一区二区三区亚洲区| 亚洲色图欧美偷拍| 成人av动漫网站| 自拍av一区二区三区| 99久久久久久99| 亚洲欧美国产三级| 色综合久久综合中文综合网| 国产精品久久久久影院亚瑟 | av在线免费不卡| 国产精品二区一区二区aⅴ污介绍| 国产福利一区二区三区在线视频| 26uuu国产在线精品一区二区| 久久国产麻豆精品| 精品国产91亚洲一区二区三区婷婷| 久久99国产精品免费| 久久亚洲免费视频| 成人午夜电影网站| 亚洲精品视频一区| 欧美色中文字幕| 日韩激情中文字幕| 欧美tickling网站挠脚心| 狠狠色丁香婷综合久久| 久久久青草青青国产亚洲免观| 国产精品99久久久| 国产精品不卡一区二区三区| 91免费看`日韩一区二区| 一区二区三区精品视频在线| 欧美视频一区在线观看| 日韩激情视频在线观看| 久久综合久久久久88| 成人一道本在线| 亚洲一区二区精品久久av| 7777精品伊人久久久大香线蕉| 久久成人免费电影| 一区视频在线播放| 欧美四级电影网| 韩国中文字幕2020精品| 亚洲欧洲成人自拍| 欧美日韩精品综合在线| 韩国精品免费视频| 国产精品无人区| 欧美日韩免费在线视频| 麻豆91在线播放免费| 国产精品久久久久久亚洲伦| 欧美日韩中文字幕精品| 久久国产剧场电影| 亚洲精品成a人| 久久午夜色播影院免费高清| 99re66热这里只有精品3直播| 日韩中文字幕亚洲一区二区va在线| 精品国产乱码久久久久久老虎| av不卡免费在线观看| 蜜臀av一区二区在线观看| 国产精品免费丝袜| 久久网这里都是精品| 色狠狠av一区二区三区| 久久国产精品第一页| 亚洲三级小视频| 精品国产亚洲在线| 欧美日韩精品一二三区| 蜜桃久久久久久久| 欧美色老头old∨ideo| 欧美性三三影院| 日韩网站在线看片你懂的| 欧美国产在线观看| 亚洲激情图片qvod| 久久精品国产精品青草| 欧美另类videos死尸| 久久久久久久综合色一本| 久久精品亚洲麻豆av一区二区| 欧美电影在哪看比较好| 久久久99久久|