Commit a83dd380 authored by Ivan Dages's avatar Ivan Dages
Browse files

camera controls help

parent 93225000
......@@ -9,6 +9,7 @@ import java.util.logging.Logger;
import fr.ill.ics.n3d.Nomad3DEditor;
import fr.ill.ics.n3d.io.Nomad3DExporter;
import fr.ill.ics.n3d.io.Nomad3DImporter;
import fr.ill.ics.n3d.model.Axis;
import fr.ill.ics.n3d.model.Component;
import fr.ill.ics.n3d.model.ConfigParams;
......@@ -23,6 +24,7 @@ import javafx.collections.ObservableList;
import javafx.collections.transformation.SortedList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.HPos;
import javafx.geometry.Insets;
import javafx.geometry.Point3D;
import javafx.geometry.Pos;
......@@ -35,7 +37,6 @@ import javafx.scene.control.CheckMenuItem;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
......@@ -45,6 +46,7 @@ import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.TextField;
import javafx.scene.control.TreeView;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.input.KeyCombination;
......@@ -74,6 +76,9 @@ public class EditorMenuBar extends MenuBar {
/** Selection menu. */
private Menu selection;
/** Help menu. */
private Menu help;
/** Components' axes visibility. */
private boolean showAxes;
......@@ -975,7 +980,61 @@ public class EditorMenuBar extends MenuBar {
new SeparatorMenuItem(),
markWallItem, markPartsItem);
this.getMenus().addAll(this.file, this.edit, this.view, this.selection);
this.help = new Menu("Help");
MenuItem cameraHelpItem = new MenuItem("Camera");
cameraHelpItem.setOnAction(event -> {
GridPane scenePane = new GridPane();
scenePane.setVgap(5);
scenePane.setHgap(10);
scenePane.setAlignment(Pos.CENTER);
scenePane.setPrefSize(500, 200);
Scene helpScene = new Scene(scenePane);
Stage helpStage = new Stage(StageStyle.UTILITY);
helpStage.setTitle("Camera controls help");
helpStage.setScene(helpScene);
helpStage.initOwner(Nomad3DEditor.getInstance().getStage());
double viewWidth = 80;
ImageView mouseLeftView = new ImageView(Nomad3DImporter.createImage("img/mouse_left.png"));
mouseLeftView.setFitWidth(viewWidth);
mouseLeftView.setPreserveRatio(true);
ImageView mouseRightView = new ImageView(Nomad3DImporter.createImage("img/mouse_right.png"));
mouseRightView.setFitWidth(viewWidth);
mouseRightView.setPreserveRatio(true);
ImageView mouseMiddleView = new ImageView(Nomad3DImporter.createImage("img/mouse_middle.png"));
mouseMiddleView.setFitWidth(viewWidth);
mouseMiddleView.setPreserveRatio(true);
ImageView mouseScrollUpView = new ImageView(Nomad3DImporter.createImage("img/mouse_scroll_up.png"));
mouseScrollUpView.setFitWidth(viewWidth);
mouseScrollUpView.setPreserveRatio(true);
ImageView mouseScrollDownView = new ImageView(Nomad3DImporter.createImage("img/mouse_scroll_down.png"));
mouseScrollDownView.setFitWidth(viewWidth);
mouseScrollDownView.setPreserveRatio(true);
scenePane.addRow(0, mouseLeftView, mouseRightView, mouseMiddleView, mouseScrollUpView, mouseScrollDownView);
Label mouseLeftLabel = new Label("Rotate/translate\ncomponents");
GridPane.setHalignment(mouseLeftLabel, HPos.CENTER);
mouseLeftLabel.setTextAlignment(TextAlignment.CENTER);
Label mouseRightLabel = new Label("Translate\ncamera");
GridPane.setHalignment(mouseRightLabel, HPos.CENTER);
mouseRightLabel.setTextAlignment(TextAlignment.CENTER);
Label mouseMiddleLabel = new Label("Rotate\ncamera");
GridPane.setHalignment(mouseMiddleLabel, HPos.CENTER);
mouseMiddleLabel.setTextAlignment(TextAlignment.CENTER);
Label mouseScrollUpLabel = new Label("Zoom in");
GridPane.setHalignment(mouseScrollUpLabel, HPos.CENTER);
mouseScrollUpLabel.setTextAlignment(TextAlignment.CENTER);
Label mouseScrollDownLabel = new Label("Zoom out");
GridPane.setHalignment(mouseScrollDownLabel, HPos.CENTER);
mouseScrollDownLabel.setTextAlignment(TextAlignment.CENTER);
scenePane.addRow(1, mouseLeftLabel, mouseRightLabel, mouseMiddleLabel, mouseScrollUpLabel, mouseScrollDownLabel);
helpStage.show();
});
this.help.getItems().addAll(cameraHelpItem);
this.getMenus().addAll(this.file, this.edit, this.view, this.selection, this.help);
}
private Component selectComponent(String title) {
......
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