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

📄 imagemap.java

📁 非常接近C/S操作方式的Java Ajax框架-ZK 用ZK框架使你的B/S应用程序更漂亮更易操作。 官网:www.zkoss.org
💻 JAVA
字号:
/* Imagemap.java{{IS_NOTE	Purpose:			Description:			History:		Tue Mar 28 00:25:48     2006, Created by tomyeh}}IS_NOTECopyright (C) 2006 Potix Corporation. All Rights Reserved.{{IS_RIGHT	This program is distributed under GPL Version 2.0 in the hope that	it will be useful, but WITHOUT ANY WARRANTY.}}IS_RIGHT*/package org.zkoss.zul;import org.zkoss.zk.ui.Component;import org.zkoss.zk.ui.UiException;/** * An image map. * * <p>There are two ways to use Imagemap:</p> * * <ol> * <li>Listen to the onClick event, which is an instance of * {@link org.zkoss.zk.ui.event.MouseEvent}. Then, you could call * getX() and getY() to retrieve where user has clicked.</li> * <li>Assign one or multiple of {@link Area} as its children. * Then, listen to the onClick event, and use * {@link org.zkoss.zk.ui.event.MouseEvent#getArea} to retrieve * which area is clicked.</li> * </ol> * * <p>Note: IE 5.5/6 (not 7) has a bug that failed to render PNG with * alpha transparency. See http://homepage.ntlworld.com/bobosola/index.htm for details. * Thus, if you want to display such image, you have to use the alphafix mold. * <code>&lt;imagemap mold="alphafix"/&gt;</code> * * @author tomyeh */public class Imagemap extends Image {	//-- super --//	public String getOuterAttrs() {		//Imagemap handles onclick by itself, so don't generate z.lfclk		final String attrs = super.getOuterAttrs();		final String attrnm = " z.lfclk=";		final int j = attrs.indexOf(attrnm);		if (j < 0) return attrs;		int k = attrs.indexOf('"', j + attrnm.length());		assert k > 0: attrs;		k = attrs.indexOf('"', k + 1);		assert k > 0: attrs;		return attrs.substring(0, j) + attrs.substring(k + 1);	}	/** Default: childable.	 */	public boolean isChildable() {		return true;	}	public boolean insertBefore(Component newChild, Component refChild) {		if (!(newChild instanceof Area))			throw new UiException("Unsupported child for imagemap: "+newChild);		return super.insertBefore(newChild, refChild);	}}

⌨️ 快捷键说明

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