buttonstateevent.java

来自「打印管理程序,测试完全通过.windows开发环境.」· Java 代码 · 共 55 行

JAVA
55
字号
/*
 * Created on 2006/06/16
 */
package jp.co.ntl.ext;


public class ButtonStateEvent {
	public static final int BTN_PRINT	= 0;
	public static final int BTN_CANCEL	= 1;
	public static final int BTN_DELETE	= 2;
	public static final int BTN_DETAIL	= 3;
	public static final int BTN_REFRESH	= 4;
	// 2007.10.19 lium 堦妵報嶞儃僞儞捛壛 add start
	public static final int BTN_PRINTALL= 5;
	// 2007.10.19 lium 堦妵報嶞儃僞儞捛壛 add end
	
	// 2007.10.22 lium 暋悢僾儕儞僞懳墳 add start
	public static final int BTN_HEAD_1	= 6;
	public static final int BTN_HEAD_2	= 7;
	public static final int BTN_HEAD_3	= 8;
	public static final int BTN_HEAD_4	= 9;
	public static final int BTN_HEAD_5	= 10;
	// 2007.10.22 lium 暋悢僾儕儞僞懳墳 add end
	
	public static final int BTN_LOGOUT	= 11;
	
	int[] btns;
	boolean[] states;
	
	public ButtonStateEvent(int[] btns, boolean[] states) {
		this.btns = btns;
		this.states = states;
	}
	
	public boolean isStateChanged(int btn) {
		for (int i = 0; i < btns.length; i++) {
			if (btns[i] == btn) {
				return true;
			}
		}
		
		return false;
	}
	
	public boolean getState(int btn) {
		for (int i = 0; i < btns.length; i++) {
			if (btns[i] == btn) {
				return states[i];
			}
		}
		
		return true;
	}
}

⌨️ 快捷键说明

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