one.empty3.library.FormatSource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of empty3-library-3d Show documentation
Show all versions of empty3-library-3d Show documentation
3D rendering engine. Plus modelling. Expected glsl textures 3d and 2d rendering3D primitives, and a lot of scenes' samples to test.+ Game Jogl reworked, Calculator (numbers and vectors). Java code parser implementation starts (<=1.2)
The newest version!
/*
*
* * Copyright (c) 2024. Manuel Daniel Dahmen
* *
* *
* * Copyright 2024 Manuel Daniel Dahmen
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
*
*
*/
/*
Vous êtes libre de :
*/
package one.empty3.library;
import one.empty3.library.core.script.Loader;
import java.io.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
/*__
* @author manuel
*/
public class FormatSource {
public static void chargerStyles(PrintWriter pw) {
pw.write("");
}
public static void format(File i, File o, File png) {
PrintWriter pw = null;
try {
pw = new PrintWriter(o);
Scene s = new Scene();
new Loader().loadIF(i, s);
try {
Logger.getAnonymousLogger().log(Level.INFO, o.getAbsolutePath());
//o.mkdirs();
o.createNewFile();
} catch (IOException ex) {
System.err.println("Erreur en créant le fichier");
Logger.getLogger(FormatSource.class.getName()).log(Level.SEVERE, null, ex);
return;
}
String dirName = i.getName().substring(0, i.getName().lastIndexOf("."));
pw.write("\n\t\n\t\t" + dirName + " \n\t");
chargerStyles(pw);
pw.write("\n\t\n\tFichier de rendu: " + png.getName() + "Menu
\n\t\t");
pw.write("Code source
" + s.toString());
pw.write("\n\t\t
\n\t\t\n\tMenu
\n\t\n");
} catch (IOException ex) {
Logger.getLogger(FormatSource.class.getName()).log(Level.SEVERE, null, ex);
} finally {
pw.close();
}
}
public static void index(ArrayList html, String directory_out) {
PrintWriter pw = null;
try {
File index = new File(directory_out + File.separator + "index.html");
pw = new PrintWriter(index);
pw.write("\n\t\n\t\tModeles \n\t");
chargerStyles(pw);
pw.write("\n\t\n\t\n\tIndex des fichiers de rendu
Menu
");
Iterator fichiersIT = html.iterator();
while (fichiersIT.hasNext()) {
File f = fichiersIT.next();
pw.write("- " + f.getName().substring(0, f.getName().lastIndexOf(".")) + "
\n\t");
}
pw.write("
");
} catch (IOException ex) {
Logger.getLogger(FormatSource.class.getName()).log(Level.SEVERE, null, ex);
} finally {
pw.close();
}
//FileInputStream fis = new FileInputStream(new File("ibiiztetra_logo.png"));
//fis.
}
}