arcpathpointhandler.java

来自「Petri网分析工具PIPE is open-source」· Java 代码 · 共 62 行

JAVA
62
字号
//######################################################################################/* * Created on 28-Feb-2004 * Author is Michael Camacho * *///######################################################################################package pipe.gui;import java.awt.Container;import java.awt.event.MouseEvent;import javax.swing.JMenuItem;import javax.swing.JPopupMenu;import pipe.dataLayer.ArcPathPoint;public class ArcPathPointHandler extends PetriNetObjectHandler {	public ArcPathPointHandler(Container contentpane, ArcPathPoint obj) {		super(contentpane, obj);		enablePopup = true;	}			/** Creates the popup menu that the user will see when they right click on a component */		public JPopupMenu getPopup(MouseEvent e)		{      JPopupMenu popup;            if(((ArcPathPoint)myObject).isDeleteable()) popup = super.getPopup(e);      else popup = new JPopupMenu();      if(((ArcPathPoint)myObject).getIndex()==0) return null;      else {  	  	JMenuItem menuItem = new JMenuItem(new ToggleArcPointAction((ArcPathPoint)myObject));  	  	if (((ArcPathPoint)myObject).getPointType() == ArcPathPoint.STRAIGHT)  	  		menuItem.setText("Change to Curved");  	  	else  	  		menuItem.setText("Change to Straight");  	  	popup.add(menuItem);      }			return popup;		}	public void mousePressed(MouseEvent e)	{		if (myObject.isEnabled())		{			((ArcPathPoint)e.getComponent()).setVisibilityLock(true);			super.mousePressed(e);		}	}	public void mouseDragged(MouseEvent e) {		super.mouseDragged(e);		}  public void mouseReleased(MouseEvent e) {		((ArcPathPoint)e.getComponent()).setVisibilityLock(false);		super.mouseReleased(e);	}}

⌨️ 快捷键说明

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