private static boolean init() {      //return true if successful

        database = new PPCDB();
        Vector<Vector<Double>> etalonMatrix;

        ArrayList<DyeParent> dyeParents;
        ArrayList<Dye> dyes = new ArrayList<Dye>();
        ArrayList<Lakk> lakks = new ArrayList<Lakk>();
        ArrayList<Metal> metals = new ArrayList<Metal>();
        ArrayList<Fluo> fluos = new ArrayList<Fluo>();
        Vector<DyePreset> dyePresets = new Vector<DyePreset>();
        Vector<DyeCylinder> dyeCylinders;
        Etalon etalonObj;
        ArrayList<Machine> machines;
        ArrayList<MagnetCylinder> magnetCylinders;
        Vector<Material> materials;


        try {
            dyeParents = database.getDyeParents();
            for (int i = 0; i < dyeParents.size(); i++){
                if (dyeParents.get(i).getClass().equals(Dye.class)){
                    dyes.add((Dye)dyeParents.get(i));
                }else if (dyeParents.get(i).getClass().equals(Lakk.class)){
                    lakks.add((Lakk)dyeParents.get(i));
                }else if (dyeParents.get(i).getClass().equals(Metal.class)){
                    metals.add((Metal)dyeParents.get(i));
                }else if (dyeParents.get(i).getClass().equals(Fluo.class)){
                    fluos.add((Fluo)dyeParents.get(i));
                }
            }
            dyePresets = database.getDyePresets();
            //classifyDyeParents(dyeParents);
            dyeCylinders = database.getDyeCylinders();
            etalonMatrix = database.getEtalon();
            machines = database.getMachines();
            magnetCylinders = database.getMagnetCylinders();
            materials = database.getMaterials();

            machines = database.fillMachineMagCylinders(machines, magnetCylinders);
        } catch (SQLException e) {
            e.printStackTrace();
            return false;
        }

        etalonObj = new Etalon(etalonMatrix);
        calcObj = new Calculator(dyes, dyeCylinders, etalonObj, lakks, machines, magnetCylinders, materials, metals, dyePresets, fluos);

        //dyePresets = new Vector<DyePreset>();                                           //feltölteni adatbázisból

        return true;
    }