Source code: com/arranger/jarl/shell/commands/RenderAnimationCommand.java
1 package com.arranger.jarl.shell.commands;
2
3 import com.arranger.jarl.shell.models.JarlContextModel;
4 import com.arranger.jarl.shell.models.JarlAnimationContextModel;
5
6 /**
7 * RenderAnimationCommand created on Apr 21, 2003
8 */
9 public class RenderAnimationCommand extends BaseCommand {
10
11 public String getHelpText() {
12 return "renders an animation series. Usage: renderAnimation [jarlConfig] [outputDir] [prefix]";
13 }
14
15 public String getCommand() {
16 return "renderAnimation";
17 }
18
19 public void invoke(String[] args) throws Exception {
20 //Get JarlContextModel
21 JarlContextModel origJarlContextModel = (JarlContextModel) m_jarlShell.getModel(JarlContextModel.class.getName());
22 if (args.length > 1) {
23 origJarlContextModel.setCurrentConfig(args[1]);
24 }
25 if (args.length > 2) {
26 origJarlContextModel.setCurrentOutputDir(args[2]);
27 }
28 if (args.length > 3) {
29 JarlAnimationContextModel jacm = (JarlAnimationContextModel)m_jarlShell.getModel(JarlAnimationContextModel.class.getName());
30 jacm.setSeriesPrefix(args[3]);
31 }
32
33 //set the current context model & save models
34 m_jarlShell.saveModels();
35
36 //get our own copy with no subscribers
37 JarlAnimationContextModel jacm = (JarlAnimationContextModel) m_jarlShell.createModel(JarlAnimationContextModel.class.getName());
38 m_jarlShell.setModel(jacm);
39
40 jacm.renderAnimation();
41 }
42 }