public class DrawListener extends MouseAdapter {
private Graphics2D graphics2d;// 绘图区域的Graphic2D对象,用于绘制给定的图形
private ToolsPanel toolsPanel;// 图形选择工具条
private DrawListener get;
private int x1, x2, y1, y2;//记录坐标
public int id=1;//记录每个节点的ID
public int NumOfEdge=0 ;//记录边的数量
public int [][] edge = new int[20][20];//记录节点之间是否连通
boolean temp1=false,temp2=false;//判断直线起始点是否在圆内
private int temp3=0,temp4=0;
public String[] value= new String[20];
public int[] x = new int[20]; //储存节点坐标
public int[] y = new int[20]; //储存节点坐标
public DrawListener(Graphics2D graphics2d, ToolsPanel toolsPanel
) {
this.graphics2d = graphics2d;
this.toolsPanel = toolsPanel;
}
我想再另外的类里调用这里的id啊。edge啊。改在另外的类里。求示范代码