?? trayicon.java
字號:
/* * @(#)TrayIcon.java * * Copyright (c) 2001 Jangho Hwang, * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. Neither the name of the JangHo Hwang nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $Id: TrayIcon.java,v 1.1 2002/03/17 07:46:48 xrath Exp $ */package rath.tools.tray;import java.awt.Image;import java.io.UnsupportedEncodingException;/** * 飄飯撈酒撈能欄肺 殿廢秦具且 瀝焊甸闌 淬籃 努貳膠撈促. * * @author Jangho Hwang, windrath@hanmail.net * @version $Id: TrayIcon.java,v 1.1 2002/03/17 07:46:48 xrath Exp $, since 2001/12/17 */public class TrayIcon{ /** * 飄飯撈酒撈能 函版矯 葷儈登哥, Icon狼 函版撈 利儈登絹具 且錠 葷儈登綽 鞘靛撈促. */ public static final int TYPE_ICON = 0x00000002; /** * 飄飯撈酒撈能 函版矯 葷儈登哥, 砒屏狼 函版撈 利儈登絹具 且錠 葷儈登綽 鞘靛撈促. */ public static final int TYPE_TIP = 0x00000004; private int uid = -1; private NativeIcon icon = null; private String tip = null; /** * 秦寸 icon父闌 啊瘤綽 飄飯撈酒撈能 按眉甫 積己茄促. */ public TrayIcon( NativeIcon icon ) { this( icon, null ); } /** * 秦寸 icon苞 tooltip(付快膠甫 棵府擱 釬矯登綽)闌 啊瘤綽 飄飯撈酒撈能 按眉甫 * 積己茄促. */ public TrayIcon( NativeIcon icon, String tip ) { setIcon( icon ); setToolTip( tip ); } /** * Shell_NotifyIcon 竊薦啊 阿 飄飯撈酒撈能闌 備盒且 絆蠟 備盒磊甫 汲瀝茄促. * 撈 藹籃 TrayIconManager甫 烹秦 汲瀝登綽 藹欄肺 竊何肺 函版秦輯綽 救等促. */ void setUniqueID( int uid ) { this.uid = uid; } /** * 撈 飄飯撈酒撈能闌 備盒竅綽 絆蠟 備盒磊甫 掘絹柯促. */ int getUniqueID() { return this.uid; } /** * 林絹柳 icon 撈固瘤肺 飄飯撈 酒撈能闌 函版茄促. 撈 皋家靛甫 齲免竅扁父 竅擱 * 登綽 巴撈 酒聰扼, * {@link TrayIconManager#modifyTrayIcon(rath.tools.tray.TrayIcon,int) TrayIconManager.modifyTrayIcon} * 皋家靛甫 烹秦 函版等 葷角闌 舅妨林絹具父 利儈等促. */ public void setIcon( NativeIcon icon ) { if( icon==null ) throw new IllegalArgumentException( "icon is null" ); this.icon = icon; } /** * 泅犁 汲瀝等 酒撈能闌 館券茄促. */ public NativeIcon getIcon() { return this.icon; } long getIconHandle() { return this.icon.getIconHandle(); } /** * 酒撈能俊 付快膠甫 棵妨躇闌錠, 釬矯瞪 砒屏 咆膠飄甫 汲瀝茄促. * {@link #setIcon(rath.tools.tray.NativeIcon) setIcon} 皋家靛貿煩 * {@link TrayIconManager#modifyTrayIcon(rath.tools.tray.TrayIcon,int) TrayIconManager.modifyTrayIcon} * 皋家靛甫 烹秦 函版等 葷角闌 舅妨林絹具父 利儈等促. */ public void setToolTip( String tip ) { this.tip = tip; } /** * 泅犁 汲瀝登絹樂綽 砒屏 咆膠飄甫 啊廉柯促. */ public String getToolTip() { return this.tip; } protected byte[] getBytes( String str ) throws UnsupportedEncodingException { return getBytes( str, System.getProperty("file.encoding") ); } protected byte[] getBytes( String str, String enc ) throws UnsupportedEncodingException { if( str==null ) return null; return str.getBytes(enc); } /** * 泅犁 tooltip 皋矯瘤甫 矯膠袍狼 default encoding set闌 葷儈竅咯 byte[]肺 * 函券矯挪 藹闌 館券茄促. */ public byte[] getToolTipBytes() throws UnsupportedEncodingException { return getBytes( this.tip ); } /** * 泅犁 tooltip 皋矯瘤甫 林絹柳 encoding set闌 葷儈竅咯 byte[]肺 * 函券矯挪 藹闌 館券茄促. */ public byte[] getToolTipBytes( String enc ) throws UnsupportedEncodingException { return getBytes( this.tip, enc ); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -