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

📄 images.java

📁 一个简单的UNCODE 码生成程序
💻 JAVA
字号:
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.examples.texteditor;


import java.io.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.widgets.*;

public class Images {

	// Bitmap Images
	public Image Bold;
	public Image Italic;
	public Image Underline;
	public Image Strikeout;
	public Image Red;
	public Image Green;
	public Image Blue;
	public Image Erase;
	
	Image  [] AllBitmaps;

Images () {
}

public void freeAll () {
	for (int i=0; i<AllBitmaps.length; i++) AllBitmaps [i].dispose ();
	AllBitmaps = null;
}

Image createBitmapImage(Display display, String fileName) {
	InputStream sourceStream = Images.class.getResourceAsStream (fileName + ".bmp");
	InputStream maskStream = Images.class.getResourceAsStream (fileName + "_mask.bmp");
	ImageData source = new ImageData (sourceStream);
	ImageData mask = new ImageData (maskStream);
	Image result = new Image (display, source, mask);
	try {
		sourceStream.close ();
		maskStream.close ();
	} catch (IOException e) {
		e.printStackTrace ();
	}
	return result;
}

public void loadAll (Display display) {
	// Bitmap Images
	Bold = createBitmapImage (display, "bold");
	Italic = createBitmapImage (display, "italic");
	Underline = createBitmapImage (display, "underline");
	Strikeout = createBitmapImage (display, "strikeout");
	Red = createBitmapImage (display, "red");
	Green = createBitmapImage (display, "green");
	Blue = createBitmapImage (display, "blue");
	Erase = createBitmapImage (display, "erase");
	
	AllBitmaps = new Image [] {
		Bold,
		Italic,
		Underline,
		Strikeout,
		Red,
		Green,
		Blue,
		Erase,
	};
}
}

⌨️ 快捷键说明

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