/**
* Shows the a dialog allowing the user to edit the ray.
*/
private void editRayAction() {
// getProperty the currently selected body
TreePath path = this.tree.getSelectionPath();
// make sure something is selected
if (path != null) {
// getProperty the selected node
DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
// make sure its a ray that is selected
if (node.getUserObject() instanceof SandboxRay) {
// getProperty the ray from the node
SandboxRay ray = (SandboxRay) node.getUserObject();
// show the right dialog
synchronized (Simulation.LOCK) {
SandboxRay nRay = EditRayDialog.show(ControlUtilities.getParentWindow(this), ray);
this.simulation.getRays().remove(ray);
this.simulation.getRays().add(nRay);
node.setUserObject(nRay);
}
}
}
}
SimulationTreePanel.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:featurea
作者:
评论列表
文章目录