?? imageview.java.svn-base
字號(hào):
package org.gggeye.easymf.ui;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Image;
/**
* 對(duì)PNG,JPEG,GIF的支持
* @author wuhua
*
*/
public class ImageView extends View {
Image image;
public ImageView(String _src, String _alt, Image _image, String _action,
HyperLink _hyperLink) {
this.image = _image;
this.action = _action;
this.name = _src;
this.value = _alt;
this.addHyperLink(_hyperLink);
}
final void resetImage(byte[] _imageBytes, Canvas _canvas) throws java.lang.Throwable {
if (_imageBytes == null)
return;
this.resetImage(Image.createImage(_imageBytes, 0,
_imageBytes.length));
}
final void resetImage(Image _image) {
if(_image == null)
return;
image = _image;
// if (_image == null) {
// this.width = 20;
// this.height = DocumentBuilder.defaultHeight;
// this.right = this.left + width;
// this.buttom = this.top + height;
//
// } else {
this.width = _image.getWidth() + ViewBuilder.LEFT_SPACE;
this.height = _image.getHeight() + ViewBuilder.TOP_SPACE;
this.right = this.left + width;
this.buttom = this.top + height;
// }
}
public void doPaint(Pen point, HtmlDocument _htmlDocument) {
if (_htmlDocument.focusIndex == this.index) {
point.drawRects(left, top, width, height);
}
doDrawImage(point);
}
protected void doDrawImage(Pen point) {
if (image == null ) {
point.drawRect(left, top, width, height);
point.drawString("圖", left, top, 20);
} else
point.drawImage(image, left + (ViewBuilder.LEFT_SPACE), top
+ (ViewBuilder.TOP_SPACE), 20);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -