📄 actionprintxy.java
字号:
package com.zhtelecom.common.topograph.example.menuaction;
import javax.swing.AbstractAction;
import com.zhtelecom.common.topograph.TopoGraphView;
import java.awt.event.ActionEvent;
import com.zhtelecom.common.topograph.TopoNode;
public class ActionPrintXY extends AbstractAction
{
public void actionPerformed(ActionEvent e)
{
//之前已被赋值,这里获取该拓扑对象。也可以通过TopoGraphView.getContextGraphView()快速获取唯一实例。
TopoGraphView topoView = (TopoGraphView) getValue("topoGraphView");
java.util.Vector rs= topoView.getTopoDataSource().getAllTopoNode();
for(int i=0;i<rs.size();i++)
{
TopoNode node=(TopoNode) rs.get(i);
System.out.println(""+node+":X="+node.getX()+", Y="+node.getY());
}
}
public ActionPrintXY()
{
super("打印所有节点坐标");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -