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 { ...@@ -150,10 +150,10 @@ public class EditorMenuBar extends MenuBar {
this.type = new SimpleStringProperty(type); this.type = new SimpleStringProperty(type);
} }
private AxisTableEntry(String axisName) { private AxisTableEntry(String axisName, String componentName) {
super(); super();
this.axisName = new SimpleStringProperty(axisName); this.axisName = new SimpleStringProperty(axisName);
this.componentName = new SimpleStringProperty(""); this.componentName = new SimpleStringProperty(componentName);
this.type = new SimpleStringProperty(""); this.type = new SimpleStringProperty("");
} }
...@@ -1831,7 +1831,7 @@ public class EditorMenuBar extends MenuBar { ...@@ -1831,7 +1831,7 @@ public class EditorMenuBar extends MenuBar {
GridPane scenePane = new GridPane(); GridPane scenePane = new GridPane();
Scene displayScene = new Scene(scenePane); Scene displayScene = new Scene(scenePane);
Stage displayStage = new Stage(StageStyle.UTILITY); Stage displayStage = new Stage(StageStyle.UTILITY);
displayStage.setWidth(300); displayStage.setWidth(600);
displayStage.setTitle("Reference Axes"); displayStage.setTitle("Reference Axes");
displayStage.setScene(displayScene); displayStage.setScene(displayScene);
displayStage.initOwner(Nomad3DEditor.getInstance().getStage()); displayStage.initOwner(Nomad3DEditor.getInstance().getStage());
...@@ -1843,6 +1843,10 @@ public class EditorMenuBar extends MenuBar { ...@@ -1843,6 +1843,10 @@ public class EditorMenuBar extends MenuBar {
TableColumn axisNameColumn = new TableColumn<>("Name"); TableColumn axisNameColumn = new TableColumn<>("Name");
axisNameColumn.setMinWidth(300); axisNameColumn.setMinWidth(300);
axisNameColumn.setCellValueFactory(new PropertyValueFactory<AxisTableEntry, String>("axisName")); 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>() { tableView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<AxisTableEntry>() {
...@@ -1856,11 +1860,19 @@ public class EditorMenuBar extends MenuBar { ...@@ -1856,11 +1860,19 @@ public class EditorMenuBar extends MenuBar {
List<ReferenceAxis> axes = ReferenceAxisList.getInstance().get(); List<ReferenceAxis> axes = ReferenceAxisList.getInstance().get();
for (ReferenceAxis axis : axes) { 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.setItems(data);
tableView.getColumns().addAll(axisNameColumn); tableView.getColumns().addAll(axisNameColumn, componentNameColumn);
scenePane.addRow(0, tableView); 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