⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 graphicsutil.java

📁 j2me手机图书阅读器
💻 JAVA
字号:
/********************************************************************
 * 
 * 
 * 
 ********************************************************************/
package org.pook.ui.util;

import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

 

/**
 * <b>类名:GraphicsUtil.java</b> </br> 
 * 编写日期: 2006-9-22 <br/>
 * 程序功能描述: UI图形的工具类,提供填充已经绘制的功能<br/>
 * Demo: <br/>
 * Bug: <br/>
 * 
 * 程序变更日期 :<br/> 
 * 变更作者 :<br/> 
 * 变更说明 :<br/>
 * 
 * @author wuhua </br> <a href="mailto:rrq12345@163.com">rrq12345@163.com</a>
 */
public final  class GraphicsUtil {
 

	/** 指定颜色绘制边框 */
	public final static void drawRectWithColor(Graphics g, int color,  int x, int y, int width, int height) {
		g.setColor(color);
		g.drawRect(x,y, width, height);
		 
	}
	
	/** 指定颜色绘制边框 */
	public final static void darwString(Graphics g, String str , int x, int y) {
		 
		g.drawString(str, x,y,Graphics.TOP | Graphics.LEFT);
		 
	}
	
	
	/** 指定颜色填充屏幕 */
	public final static void fillScreen(Graphics g, int color,  int x, int y, int width, int height) {
		g.setColor(color);
		g.fillRect(x,y, width, height);
		 
	}
	
	/**
	 * 绘制中间图象
	 */
	public final static void drawImageMiddle(Graphics g, Image img, int x, int y){
		g.drawImage(img, x, y, Graphics.HCENTER | Graphics.TOP);
	}
	
	
	/**
	 * 绘制中间图象
	 */
	public final static void drawImageLeft(Graphics g, Image img, int x, int y){
		g.drawImage(img, x, y, Graphics.TOP | Graphics.LEFT);
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -