borlandjb
发贴: 7
积分: 0
|
于 2006-04-27 20:26
我在我的程序中动态的刷新节点的值,但是在刷新后那些节点都不能拖动了 也不能改变大小了!怎么回事?大家帮忙看看,谢谢!!! class thread extends Thread { Object[] cell; JGraph graph; public thread(Object[] cell1,JGraph graph1){ cell = cell1; graph = graph1;
}
public void run() { for (int i = 0; i < cell.length; i++) { try { Thread.sleep(1000); CellView cellView = graph.getGraphLayoutCache().getMapping(cell[i], true);
Map map1 = ((GraphCell) cell[i]).getAttributes(); org.jgraph.graph.AttributeMap map12 = new org.jgraph.graph. AttributeMap(); GraphConstants.setValue(map1, "终于可以了!!!!!"); GraphConstants.setAutoSize(map1, false); map12.applyMap(map1);
DefaultGraphCell ob1 = (DefaultGraphCell) cell[i]; ob1.changeAttributes(map1); //改变实际值
cellView.setAttributes(map12); //改变VIEW // 刷新主窗口 cellView.refresh(true);
cellView.update(); graph.setSelectionCell(cell[i]);
//graph.updateUI();
} catch (InterruptedException ex) { }
}
}
};
|