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

📄 guiaction.java

📁 Petri网分析工具PIPE is open-source
💻 JAVA
字号:
/* * Created on 07-Mar-2004 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */package pipe.gui;import java.io.File;import javax.swing.AbstractAction;import javax.swing.ImageIcon;import javax.swing.KeyStroke;/** * GuiAction class * @author Maxim and others * * Handles loading icon based on action name and setting up other stuff *  * Toggleable actions store the toggle state in a way that allows ChangeListeners  * to be notified of changes  */abstract class GuiAction extends AbstractAction {	GuiAction (String name, String tooltip, String keystroke) {		super(name);		String iconFileName = CreateGui.imgPath+name+ ".png";		if(new File(iconFileName).exists())			putValue(SMALL_ICON, new ImageIcon(iconFileName));				if(tooltip != null)			putValue(SHORT_DESCRIPTION, tooltip);				if(keystroke != null)			putValue(ACCELERATOR_KEY,KeyStroke.getKeyStroke(keystroke));	}	  GuiAction (String name, String tooltip, String keystroke, boolean toggleable) {    this(name,tooltip,keystroke);    this.putValue("selected",new Boolean(false));  }  public boolean isSelected() {    Boolean b=(Boolean)getValue("selected");    if(b!=null) return b.booleanValue();    return false; // default  }  public void setSelected(boolean selected) {    Boolean b=(Boolean)getValue("selected");    if(b!=null) {      this.putValue("selected",null);      this.putValue("selected",new Boolean(selected));    }  }}

⌨️ 快捷键说明

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