當前位置: 首頁>>代碼示例>>Java>>正文


Java InputEventUtil類代碼示例

本文整理匯總了Java中com.cburch.logisim.util.InputEventUtil的典型用法代碼示例。如果您正苦於以下問題:Java InputEventUtil類的具體用法?Java InputEventUtil怎麽用?Java InputEventUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InputEventUtil類屬於com.cburch.logisim.util包,在下文中一共展示了InputEventUtil類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getToolTip

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
@Override
public String getToolTip() {
	String ret = tool.getDescription();
	int index = 1;
	for (ToolbarItem item : items) {
		if (item == this)
			break;
		if (item instanceof ToolItem)
			++index;
	}
	if (index <= 10) {
		if (index == 10)
			index = 0;
		// int mask = frame.getToolkit().getMenuShortcutKeyMask(); // still not updated
		// in java 9
		ret += " (" + InputEventUtil.toKeyDisplayString(InputEvent.CTRL_DOWN_MASK) + "-" + index + ")";
	}
	return ret;
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:20,代碼來源:LayoutToolbarModel.java

示例2: AppearanceToolbarModel

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
public AppearanceToolbarModel(AbstractTool selectTool, Canvas canvas, DrawingAttributeSet attrs) {
	this.canvas = canvas;

	AbstractTool[] tools = { selectTool, new TextTool(attrs), new LineTool(attrs), new CurveTool(attrs),
			new PolyTool(false, attrs), new RectangleTool(attrs), new RoundRectangleTool(attrs),
			new OvalTool(attrs), new PolyTool(true, attrs), };

	ArrayList<ToolbarItem> rawItems = new ArrayList<ToolbarItem>();
	int i = 1;
	for (AbstractTool tool : tools) {
		tool.setCltrIndex(" (" + InputEventUtil.toKeyDisplayString(InputEvent.CTRL_DOWN_MASK) + "-" + i + ")");
		i++;
		rawItems.add(new ToolbarToolItem(tool));
	}
	items = Collections.unmodifiableList(rawItems);
	canvas.addPropertyChangeListener(Canvas.TOOL_PROPERTY, this);
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:18,代碼來源:AppearanceToolbarModel.java

示例3: getToolTip

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
public String getToolTip() {
	String ret = tool.getDescription();
	int index = 1;
	for (ToolbarItem item : items) {
		if (item == this)
			break;
		if (item instanceof ToolItem)
			++index;
	}
	if (index <= 10) {
		if (index == 10)
			index = 0;
		int mask = frame.getToolkit().getMenuShortcutKeyMask();
		ret += " (" + InputEventUtil.toKeyDisplayString(mask) + "-"
				+ index + ")";
	}
	return ret;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:19,代碼來源:LayoutToolbarModel.java

示例4: fromMouseMappings

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
Element fromMouseMappings() {
	Element elt = doc.createElement("mappings");
	MouseMappings map = file.getOptions().getMouseMappings();
	for (Map.Entry<Integer, Tool> entry : map.getMappings().entrySet()) {
		Integer mods = entry.getKey();
		Tool tool = entry.getValue();
		Element toolElt = fromTool(tool);
		String mapValue = InputEventUtil.toString(mods.intValue());
		toolElt.setAttribute("map", mapValue);
		elt.appendChild(toolElt);
	}
	return elt;
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:14,代碼來源:XmlWriter.java

示例5: getValueAt

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
@Override
public Object getValueAt(int row, int column) {
	Integer key = cur_keys.get(row);
	if (column == 0) {
		return InputEventUtil.toDisplayString(key.intValue());
	} else {
		Tool tool = getOptions().getMouseMappings().getToolFor(key);
		return tool.getDisplayName();
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:11,代碼來源:MouseOptions.java

示例6: getValueAt

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
public Object getValueAt(int row, int column) {
	Integer key = cur_keys.get(row);
	if (column == 0) {
		return InputEventUtil.toDisplayString(key.intValue());
	} else {
		Tool tool = getOptions().getMouseMappings().getToolFor(key);
		return tool.getDisplayName();
	}
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:10,代碼來源:MouseOptions.java

示例7: fromMouseMappings

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
Element fromMouseMappings() {
	Element elt = doc.createElement("mappings");
	MouseMappings map = file.getOptions().getMouseMappings();
	for (Map.Entry<Integer,Tool> entry : map.getMappings().entrySet()) {
		Integer mods = entry.getKey();
		Tool tool = entry.getValue();
		Element toolElt = fromTool(tool);
		String mapValue = InputEventUtil.toString(mods.intValue());
		toolElt.setAttribute("map", mapValue);
		elt.appendChild(toolElt);
	}
	return elt;
}
 
開發者ID:franciscaconcha,項目名稱:ProyectoLogisim,代碼行數:14,代碼來源:XmlWriter.java

示例8: getToolTip

import com.cburch.logisim.util.InputEventUtil; //導入依賴的package包/類
public String getToolTip() {
	String ret = tool.getDescription();
	int index = 1;
	for (ToolbarItem item : items) {
		if (item == this) break;
		if (item instanceof ToolItem) ++index;
	}
	if (index <= 10) {
		if (index == 10) index = 0;
		int mask = frame.getToolkit().getMenuShortcutKeyMask();
		ret += " (" + InputEventUtil.toKeyDisplayString(mask)
			+ "-" + index + ")";
	}
	return ret;
}
 
開發者ID:franciscaconcha,項目名稱:ProyectoLogisim,代碼行數:16,代碼來源:LayoutToolbarModel.java


注:本文中的com.cburch.logisim.util.InputEventUtil類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。