Commit 435e2e14 authored by Ivan Dages's avatar Ivan Dages
Browse files

editor : refactor

parent dfd1c2f8
......@@ -45,35 +45,38 @@ import fr.ill.ics.cameo.*;
* @author dages
*/
public class Nomad3DEditor extends Application {
private static Nomad3DEditor instance = null;
/** Stage of the application. */
public Stage stage = null;
private Stage stage = null;
/** Scene of the stage, managing the gui. The 3D scene is a descendant of this scene, inserted as a SubScene. */
public Scene scene = null;
private Scene scene = null;
/** Root of the scene (gui). */
public BorderPane pane = null;
private BorderPane pane = null;
/** Current Nomad 3D model. */
public Model model = null;
private Model model = null;
/** Camera used for 3D rendering. */
public Camera camera = null;
private Camera camera = null;
/** Controls managing the camera. */
public CameraControls controls = null;
private CameraControls controls = null;
/** Path to an eventual initial model to load, null otherwise. */
public String initialModelPath = null;
private String initialModelPath = null;
/** Axis builder. */
public AxisBuilder axisBuilder = new AxisBuilder();
private AxisBuilder axisBuilder = new AxisBuilder();
/** Root of the 3D scene. */
public Group root = null;
private Group root = null;
/** 3D scene. */
public SubScene subScene = null;
private SubScene subScene = null;
/**
* Reference to the logger, used to prevent the garbage collector to destroy it.
......@@ -114,6 +117,8 @@ public class Nomad3DEditor extends Application {
@Override
public void start(Stage stage) throws Exception {
instance = this;
try {
Logger logger = Logger.getLogger("nomad-3d");
String logPath = System.getProperty("user.dir") + File.separator + "nomad-3d-editor.log";
......@@ -168,6 +173,102 @@ public class Nomad3DEditor extends Application {
stage.show();
}
/**
* Gets the Nomad 3D editor instance.
* @return The instance
*/
public static Nomad3DEditor getInstance() {
return instance;
}
/**
* Gets the initialModelPath.
* @return The initialModelPath
*/
public String getInitialModelPath() {
return initialModelPath;
}
/**
* Sets the initialModelPath.
* @param initialModelPath The initialModelPath to set
*/
public void setInitialModelPath(String initialModelPath) {
this.initialModelPath = initialModelPath;
}
/**
* Gets the stage.
* @return The stage
*/
public Stage getStage() {
return stage;
}
/**
* Gets the scene.
* @return The scene
*/
public Scene getScene() {
return scene;
}
/**
* Gets the pane.
* @return The pane
*/
public BorderPane getPane() {
return pane;
}
/**
* Gets the model.
* @return The model
*/
public Model getModel() {
return model;
}
/**
* Gets the camera.
* @return The camera
*/
public Camera getCamera() {
return camera;
}
/**
* Gets the controls.
* @return The controls
*/
public CameraControls getControls() {
return controls;
}
/**
* Gets the axisBuilder.
* @return The axisBuilder
*/
public AxisBuilder getAxisBuilder() {
return axisBuilder;
}
/**
* Gets the root.
* @return The root
*/
public Group getRoot() {
return root;
}
/**
* Gets the subScene.
* @return The subScene
*/
public SubScene getSubScene() {
return subScene;
}
/**
* Loads a scene. The model is chosen by the user.
* @return The created scene
......@@ -230,7 +331,7 @@ public class Nomad3DEditor extends Application {
* @return The menu bar
*/
private MenuBar buildMenuBar() {
MenuBar menuBar = new EditorMenuBar(this);
MenuBar menuBar = new EditorMenuBar();
return menuBar;
}
......
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