Пример #1
0
  public TrajectoryComponent(final Model model, MainFrame mainFrame) {
    super(model, mainFrame, new Dataset(model.getVarNames()));
    defaultsSection = ModelDefaults.SCATTER_SECTION;

    controlForm = privateControlForm = new TrajectoryControlForm2(model, this);

    init(
        new TrajectoryManager(this, privateControlForm),
        new TrajectorySM(this),
        controlForm,
        "Trajectory");

    stateMachine.addSensibleItem(autoBoundsMenuItem);
    stateMachine.addSensibleItem(manualBoundsMenuItem);
    stateMachine.addSensibleItem(variationMenuItem);

    stateMachine.addNoRunItem(clearAction);

    stateMachine.addNoRunItem(getTransparencyAction());
    stateMachine.addNoRunItem(getConnectDotsMenuItem());
    stateMachine.addNoRunItem(getBigDotsMenuItem());
    stateMachine.addNoRunItem(getGridLinesMenuItem());

    variationMenuItem.setSelected(false);

    if (model instanceof SimpleMap) {
      getConnectDotsMenuItem().setSelected(false);
    } else if (model instanceof ODE) {
      getConnectDotsMenuItem().setSelected(true);
    }

    stateMachine.parseInput(Input.go);
    finishInit(controlForm);
  }
Пример #2
0
 public void testModel() {
   Model model = null;
   File file = new File("models/simple.lua");
   try {
     model = Lua.newModel(file);
   } catch (ModelException e) {
     e.printStackTrace();
   } catch (IOException e) {
     e.printStackTrace();
   } catch (RuntimeException e) {
     e.printStackTrace();
     throw e;
   }
   System.out.println("name: " + model.getName());
   System.out.println("number of parameters: " + model.getNPar());
   System.out.println("number of variables: " + model.getNVar());
   System.out.println("description: " + model.getDescription());
 }