Commit 17614dde authored by legoc's avatar legoc
Browse files

Added logging.properties file

parent 767a084f
# Logging
handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
.level = INFO
package fr.ill.ics.n3d;
import java.io.File;
import java.io.FileInputStream;
import java.util.HashMap;
import java.util.Optional;
import java.util.Properties;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.LogManager;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
......@@ -147,6 +150,12 @@ public class Nomad3DEditor extends Application {
try {
Logger logger = Logger.getLogger("nomad-3d");
logger.setLevel(Level.ALL);
Properties preferences = new Properties();
FileInputStream configFile = new FileInputStream("logging.properties");
preferences.load(configFile);
LogManager.getLogManager().readConfiguration(configFile);
String logPath = System.getProperty("user.dir") + File.separator + "nomad-3d-editor.log";
FileHandler handler = new FileHandler(logPath);
handler.setFormatter(new SimpleFormatter());
......@@ -533,29 +542,37 @@ public class Nomad3DEditor extends Application {
}
});
// Change the selection mode.
this.scene.setOnKeyPressed(event -> {
if (event.isShiftDown() || event.isControlDown() || event.isAltDown()) {
// The shortcut is CTRL + Shift + S or D
if (!event.isShiftDown() && !event.isControlDown()) {
return;
}
if (event.getCode() == KeyCode.S) {
Component.selectOn = !Component.selectOn;
if (Component.selectOn && Component.unselectOn) {
Component.unselectOn = false;
}
}
if (event.getCode() == KeyCode.D) {
Component.unselectOn = !Component.unselectOn;
if (Component.selectOn && Component.unselectOn) {
Component.selectOn = false;
}
}
if (Component.selectOn) {
Cursor cursor = new ImageCursor(Nomad3DImporter.createImage("img/select_cursor.png"));
subScene.setCursor(cursor);
} else if (Component.unselectOn) {
}
else if (Component.unselectOn) {
Cursor cursor = new ImageCursor(Nomad3DImporter.createImage("img/unselect_cursor.png"));
subScene.setCursor(cursor);
} else {
}
else {
subScene.setCursor(Cursor.DEFAULT);
}
});
......
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