Skip to content

Commit

Permalink
Signed-off-by: Mullon <[email protected]>
Browse files Browse the repository at this point in the history
  • Loading branch information
mullon-ch committed Sep 14, 2023
1 parent 3046a4a commit 5170070
Show file tree
Hide file tree
Showing 59 changed files with 603 additions and 910 deletions.
Binary file modified .DS_Store
Binary file not shown.
184 changes: 32 additions & 152 deletions RCaNconstructor/src/main/java/fr/cm/Main/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,12 @@ public class Context {

private static String fileName; // le nom du fichier projet
private static String dirName; // le nom du répertoire du fichier projet
// private static File workingDirectory;
private static int firstYear, lastYear;
// etats du systeme
private static String howConnected;
private static boolean started, connectedR, builtR, sampledR;
static double windowWidth = 1500.0, windowHeight = 1000.0;
static double insideMin = 0.2, insideMax = 0.8;
static double windowWidth = 1500.0, windowHeight = 1000.0, insideMin = 0.2, insideMax = 0.8;
static final double radiusComponent = 20.0f, radiusInternalLink = 25.0f;
static String textAreaContent ="";

public static void init() {
firstYear = 4000;
lastYear = -1000;
Expand All @@ -38,174 +34,59 @@ public static void init() {
double screenHeight = rect.getHeight();
setWindowWidth(0.9 * screenWidth);
setWindowHeight(0.9 * screenHeight);

}

public static void initRCaN() {
connectedR = false;
builtR = false;
sampledR = false;
}

// ------------------------------------------------------------------------
public static String getTextAreaContent() {

return textAreaContent;
}

public static void setTextAreaContent(String textAreaContent) {

Context.textAreaContent = textAreaContent;
}
public static String getTextAreaContent() {return textAreaContent;}
public static void setTextAreaContent(String textAreaContent) {Context.textAreaContent = textAreaContent;}
// ------------------------------------------------------------------------
public static boolean isWithWarnings() {

return false;
}

public static String getFileName() {

return fileName;
}

public static boolean isWithWarnings() {return false;}
public static String getFileName() {return fileName;}
public static void setFileName(String fileName) {
Context.fileName = fileName;
}

public static String getDirName() {

return dirName;
}

public static void setDirName(String dirName) {

Context.dirName = dirName;
}
public static String getFullFileName() {
return (Context.dirName + "/" + Context.fileName);
}

public static int getFirstYear() {

return firstYear;
}

public static int getLastYear() {

return lastYear;
}

public static void setFirstYear(int firstYear) {

Context.firstYear = firstYear;
}

public static void setLastYear(int lastYear) {

Context.lastYear = lastYear;
}

public static int getNbYears() {

return lastYear - firstYear + 1;
}

public static String getDirName() {return dirName;}
public static void setDirName(String dirName) {Context.dirName = dirName;}
public static String getFullFileName() {return (Context.dirName + "/" + Context.fileName);}
public static int getFirstYear() {return firstYear;}
public static int getLastYear() {return lastYear;}
public static void setFirstYear(int firstYear) {Context.firstYear = firstYear;}
public static void setLastYear(int lastYear) {Context.lastYear = lastYear;}
public static int getNbYears() {return lastYear - firstYear + 1;}
public static String getHowConnected() {
return howConnected;
}

public static void setHowConnected(String howConnected) {
Context.howConnected = howConnected;
}

public static boolean isConnectedR() {

return connectedR;
}

public static void setConnectedR(boolean connectedR) {

Context.connectedR = connectedR;
}

public static boolean isBuiltR() {

return builtR;
}

public static void setBuiltR(boolean builtR) {

Context.builtR = builtR;
}

public static boolean isSampledR() {

return sampledR;
}

public static void setSampledR(boolean sampledR) {

Context.sampledR = sampledR;
}

public static boolean isStarted() {

return started;
}

public static void setStarted(boolean started) {

Context.started = started;
}

public static double getWindowWidth() {

return windowWidth;
}

public static void setWindowWidth(double w) {

windowWidth = w;
}

public static double getWindowHeight() {

return windowHeight;
}

public static boolean isConnectedR() {return connectedR;}
public static void setConnectedR(boolean connectedR) {Context.connectedR = connectedR;}
public static boolean isBuiltR() {return builtR;}
public static void setBuiltR(boolean builtR) {Context.builtR = builtR;}
public static boolean isSampledR() {return sampledR;}
public static void setSampledR(boolean sampledR) {Context.sampledR = sampledR;}
public static boolean isStarted() {return started;}
public static void setStarted(boolean started) {Context.started = started;}
// ------------------------------------------------------------------------
public static double getWindowWidth() {return windowWidth;}
public static void setWindowWidth(double w) {windowWidth = w;}
public static double getWindowHeight() {return windowHeight;}
public static void setWindowHeight(double h) {
windowHeight = h;
}

public static double getInsideMin() {

return insideMin;
}

public static double getInsideMax() {

return insideMax;
}

public static double getBackgroundWidth() {

return windowWidth;
}

public static double getBackgroundHeight() {

return (0.9 * windowHeight);
}

public static double getRadiusComponent() {

return radiusComponent;
}

public static double getInsideMin() {return insideMin;}
public static double getInsideMax() {return insideMax;}
public static double getBackgroundWidth() {return windowWidth;}
public static double getBackgroundHeight() {return (0.9 * windowHeight);}
public static double getRadiusComponent() {return radiusComponent;}
public static double getRadiusInternalLink() {
return radiusInternalLink;
}

// ------------------------------------------------------------------------
public static String getDate(){
Date date = new Date();
SimpleDateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Expand All @@ -219,6 +100,5 @@ public static List<String> getObservationsYears() {
}
return (liste);
}


// ----------------------------------------------------------------------------------
}
1 change: 0 additions & 1 deletion RCaNconstructor/src/main/java/fr/cm/Main/FirstPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import javafx.scene.image.ImageView;
import javafx.scene.layout.Pane;


public class FirstPage extends Pane {
public FirstPage(){
ImageView imageView = new ImageView();
Expand Down
33 changes: 33 additions & 0 deletions RCaNconstructor/src/main/java/fr/cm/Main/Logg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package fr.cm.Main;

import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;

public class Logg {
static Logger logger = Logger.getLogger("MyLog");
static void createLog(){
FileHandler fileHandler;
try {
// This block configure the logger with handler and formatter
fileHandler = new FileHandler("rCaNlog.txt");
logger.addHandler(fileHandler);
SimpleFormatter formatter = new SimpleFormatter();
fileHandler.setFormatter(formatter);
} catch (SecurityException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

}
public static void addLog(String msg){
try {
logger.info(msg);
} catch (SecurityException e) {
e.printStackTrace();
}
}

}
Loading

0 comments on commit 5170070

Please sign in to comment.