All Downloads are FREE. Search and download functionalities are using the official Maven repository.

one.empty3.library.FormatSource Maven / Gradle / Ivy

There is a newer version: 2024.5.10
Show newest version
/*
 * Copyright (c) 2023. Manuel Daniel Dahmen
 *
 *
 *    Copyright 2012-2023 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\t

Fichier de rendu: " + png.getName() + "

\n\t\t
");
            pw.write("

Code source

" + s.toString()); pw.write("\n\t\t
\n\t\t\n\t\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\t

Index des fichiers de rendu

"); } 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. } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy