Commit 2f335de8 authored by legoc's avatar legoc
Browse files

Added the axes not associated in the axis properties

parent db366b33
......@@ -10,6 +10,7 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.logging.Logger;
import org.apache.commons.io.FilenameUtils;
......@@ -47,6 +48,7 @@ import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Point3D;
import javafx.geometry.Pos;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
......@@ -61,12 +63,11 @@ import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.control.SeparatorMenuItem;
import javafx.scene.control.Slider;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.TreeView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.Group;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
......@@ -79,7 +80,6 @@ import javafx.stage.FileChooser;
import javafx.stage.FileChooser.ExtensionFilter;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.scene.control.Slider;
/**
* Menu bar of the Nomad3DEditor.getInstance().
......@@ -174,6 +174,16 @@ public class EditorMenuBar extends MenuBar {
}
}
private static boolean isAxisDefined(String controllerName, List<AxisInfo> axisInfos) {
for (AxisInfo info : axisInfos) {
if (info.getAxisName().equals(controllerName)) {
return true;
}
}
return false;
}
/**
* Constructor.
......@@ -919,14 +929,25 @@ public class EditorMenuBar extends MenuBar {
final ObservableList<AxisTableEntry> data = FXCollections.observableArrayList();
// Add the defined axes.
List<AxisInfo> axisInfos = Nomad3DEditor.getInstance().getModel().getAxisInfos();
for (AxisInfo info : axisInfos) {
data.add(new AxisTableEntry(info.getAxisName(), info.getComponentName(), info.getType().toString()));
}
// Add the other axes.
Set<String> controllerNames = NomadLinker.getInstance().getControllersNames();
for (String controllerName : controllerNames) {
if (!isAxisDefined(controllerName, axisInfos)) {
data.add(new AxisTableEntry(controllerName, "", ""));
}
}
tableView.setItems(data);
tableView.getColumns().addAll(axisNameColumn, componentNameColumn, typeColumn);
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
scenePane.addRow(0, tableView);
displayStage.show();
......
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