Package fr.soleil.bossanova.model

Examples of fr.soleil.bossanova.model.Batch


  public static void loadBatch(File file) throws IOException {
    currentBatchFile = file;
    FileReader reader = null;
    try {
      reader = new FileReader(file);
      Batch batch = (Batch) xmlStreamer.fromXML(reader);
      sequencer.setBatch(batch);
      // DBA Need to create director when loading a batch
      sequencer.checkBatchSteps();
//      sequencer.createBatchDirector();
      BossaNovaSequencerImpl.setCurrentBatchSaved(true);
View Full Code Here


  public static Batch readBatchFile(File file) throws IOException {
    FileReader reader = null;

    try {
      reader = new FileReader(file);
      Batch batch = (Batch) xmlStreamer.fromXML(reader);
      return batch;
    } catch (IOException e) {
            // Bug 18567
      LoggerFactory.getLogger("BatchManager").error(e.getMessage(), e);
      throw e;
View Full Code Here

  protected Color getDefaultBackgroundColor(int row, boolean isSelected) {
    Color result = super.getDefaultBackgroundColor(row, isSelected);
    if (sequencer.getCurrentRunningStepIndex() == row) {
      result = GUIConstants.RUNNING_COLOR;
    }
    Batch batch = sequencer.getBatch();
    if (batch != null){
      Step step = batch.getStep(row);
      if (step != null){
        if (!step.isEnable()){
          result = GUIConstants.DISABLE_COLOR;
        }
        if (step.isOnFault()){
View Full Code Here

      JTable table = BossaNovaData.getSingleton().getApplication().getMainScreen().getBatchViewerPanel().getTable();     
      String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
      JFileChooser fileChooser = new JFileChooser(defaultPath);
      fileChooser.showOpenDialog(BossaNovaData.getSingleton().getApplication().getMainScreen());
      File selectedFile = fileChooser.getSelectedFile();
      Batch batch = null;
      if (selectedFile != null) {
        batch = BatchManager.readBatchFile(selectedFile);
        int index = table.getSelectedRow();
       
        // if no step were selected we import the batch in the end of the current batch
        // if the current batch is empty we import the batch content in the current batch in the begin
        if(index < 0 || index == table.getRowCount())
        {
          index = table.getRowCount() - 1;
        }
       
        if (batch.getSteps()!=null && batch.getSteps().size()>0) {
          sequencer.insertStepsAt(batch.getSteps(),index+1);
            // We select the new step.
          if(batch.getSteps().size() > 0)
            BossaNovaData.getSingleton().getApplication().setSelectedStep(0,batch.getStep(0));
           
           
            table.getSelectionModel().setSelectionInterval(index+1, index+1);
           
            StateMachine.getInstance().transitionTo(StateMachine.MODEL_OPEN);           
View Full Code Here

    Color result;
    result = super.getDefaultBackgroundColor(row, isSelected);
    if (sequencer.getCurrentRunningStepIndex() == row) {
      result = GUIConstants.RUNNING_COLOR;
    }
    Batch batch = sequencer.getBatch();
    if (batch != null){
      Step step = batch.getStep(row);
      if (step != null){
        if (!step.isEnable()){
          result = GUIConstants.DISABLE_COLOR;
        }
        if (step.isOnFault()){
View Full Code Here

    synthesis.setSize(600, 600);

  }

  public void actionPerformed(ActionEvent e) {
    Batch batch = sequencer.getBatch();
    String url = null;
    try {
      url = GenerateBatchSynthesis.getSynthesis(batch);
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

  // --------------------------------------------------------------------------
  // CONSTRUCTOR
  // --------------------------------------------------------------------------
  public BossaNovaSequencerImpl() {
    super();
    batch = new Batch();
    executionListeners = new ArrayList<ExecutionListener>();
  }
View Full Code Here

  // --------------------------------------------------------------------------
  // BATCH CONSTRUCTION
  // --------------------------------------------------------------------------
  @Override
  public void cleanAll() {
    this.batch = new Batch();
    BossaNovaData.getSingleton().getApplication().setSelectedStep(0,null);
    setChangedAndNotify();
  }
View Full Code Here

      JTable table = BossaNovaData.getSingleton().getApplication().getMainScreen().getBatchViewerPanel().getTable();     
      String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
      JFileChooser fileChooser = new JFileChooser(defaultPath);
      fileChooser.showOpenDialog(BossaNovaData.getSingleton().getApplication().getMainScreen());
      File selectedFile = fileChooser.getSelectedFile();
      Batch batch = null;
      if (selectedFile != null) {
        batch = BatchManager.readBatchFile(selectedFile);
        int index = table.getSelectedRow();
       
        // if no step were selected we import the batch in the end of the current batch
        // if the current batch is empty we import the batch content in the current batch in the begin
        if(index < 0 || index == table.getRowCount())
        {
          index = table.getRowCount() - 1;
        }
       
        if (batch.getSteps()!=null && batch.getSteps().size()>0) {
          sequencer.insertStepsAt(batch.getSteps(),index+1);
            // We select the new step.
          if(batch.getSteps().size() > 0)
            BossaNovaData.getSingleton().getApplication().setSelectedStep(0,batch.getStep(0));
           
           
            table.getSelectionModel().setSelectionInterval(index+1, index+1);
           
            StateMachine.getInstance().transitionTo(StateMachine.MODEL_OPEN);           
View Full Code Here

    // --------------------------------------------------------------------------
    // CONSTRUCTOR
    // --------------------------------------------------------------------------
    public BossaNovaSequencerImpl(Bossanova2 application) {
        super();
        batch = new Batch();
        executionListeners = new ArrayList<ExecutionListener>();
        originalDirectors = new HashMap<Step, Director>();
        this.application = application;
    }
View Full Code Here

TOP

Related Classes of fr.soleil.bossanova.model.Batch

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.