Commit f7a94317 authored by legoc's avatar legoc
Browse files

Added component name in the reference axis list

parent a9d4dacd
......@@ -150,10 +150,10 @@ public class EditorMenuBar extends MenuBar {
this.type = new SimpleStringProperty(type);
}
private AxisTableEntry(String axisName) {
private AxisTableEntry(String axisName, String componentName) {
super();
this.axisName = new SimpleStringProperty(axisName);
this.componentName = new SimpleStringProperty("");
this.componentName = new SimpleStringProperty(componentName);
this.type = new SimpleStringProperty("");
}
......@@ -1831,7 +1831,7 @@ public class EditorMenuBar extends MenuBar {
GridPane scenePane = new GridPane();
Scene displayScene = new Scene(scenePane);
Stage displayStage = new Stage(StageStyle.UTILITY);
displayStage.setWidth(300);
displayStage.setWidth(600);
displayStage.setTitle("Reference Axes");
displayStage.setScene(displayScene);
displayStage.initOwner(Nomad3DEditor.getInstance().getStage());
......@@ -1844,6 +1844,10 @@ public class EditorMenuBar extends MenuBar {
axisNameColumn.setMinWidth(300);
axisNameColumn.setCellValueFactory(new PropertyValueFactory<AxisTableEntry, String>("axisName"));
TableColumn componentNameColumn = new TableColumn<>("Component Name");
componentNameColumn.setMinWidth(300);
componentNameColumn.setCellValueFactory(new PropertyValueFactory<AxisTableEntry, String>("componentName"));
tableView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<AxisTableEntry>() {
@Override
......@@ -1856,11 +1860,19 @@ public class EditorMenuBar extends MenuBar {
List<ReferenceAxis> axes = ReferenceAxisList.getInstance().get();
for (ReferenceAxis axis : axes) {
data.add(new AxisTableEntry(axis.getName()));
Component owner = axis.getComponent();
if (owner != null) {
data.add(new AxisTableEntry(axis.getName(), owner.getName()));
}
else {
data.add(new AxisTableEntry(axis.getName(), ""));
}
}
tableView.setItems(data);
tableView.getColumns().addAll(axisNameColumn);
tableView.getColumns().addAll(axisNameColumn, componentNameColumn);
scenePane.addRow(0, tableView);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment