/* * Moonlight|3D Copyright (C) 2007 The Moonlight|3D team * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this library; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * Created on Mar 14, 2007 */ package ml.backend.document; import java.util.ArrayList; import ml.core.exceptions.Exception; import ml.core.helper.FileType; public class DocumentFactory implements ml.core.document.DocumentFactory { public boolean canOpenDocument(String filename) { // TODO Auto-generated method stub return true; } public Document createNewDocument() { return new Document(); } public String getTypeName() { return "MoonlightScene"; } public String getDisplayName() { return "Moonlight|3D scene"; } public FileType getFileType() { ArrayList patterns=new ArrayList(); patterns.add("*.ml"); return new FileType("Moonlight|3D scene",patterns); } public Document openDocument(String filename) throws Exception { Document document=new Document(); new FileReader(document,filename).run(); return document; } }