Package org.jamesii.core.data.model

Examples of org.jamesii.core.data.model.ModelFileWriterFactory


          if (f instanceof ModelFileWriterFactory) {
            list.add((ModelFileWriterFactory) f);
          }
        }

        ModelFileWriterFactory selected = list.get(0);

        if (list.size() > 1) {
          // store model as temporary file
          FactorySelectionDialog<ModelFileWriterFactory> dialog =
              new FactorySelectionDialog<>(null, list, new JLabel(
                  "Select format to use."), "Select Format to store model in",
                  true, new FactoryDescriptionRenderer());

          dialog.setVisible(true);

          if (dialog.isOkButtonPressed()) {
            List<ModelFileWriterFactory> selectedFactories =
                dialog.getSelectedFactories();
            if (selectedFactories != null && selectedFactories.size() > 0) {
              selected = selectedFactories.get(0);
            }
          }
        }

        if (selected != null) {
          File file =
              File.createTempFile("jamesmodel", "." + selected.getFileEnding());
          file.deleteOnExit();

          modelURI = Files.getURIFromFile(file);

          block.addSubBl(IURIHandling.URI, modelURI);
          IModelWriter writer = selected.create(block, SimSystem.getRegistry().createContext());

          writer.write(model, modelURI);
        }
      } catch (Throwable t) {
        modelURI = null;
View Full Code Here

TOP

Related Classes of org.jamesii.core.data.model.ModelFileWriterFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.