Package fr.soleil.bossanova

Examples of fr.soleil.bossanova.Bossanova2$BossanovaModelExecutionListener


  public void actionPerformed(ActionEvent e) {
    sequencer.addEmptyStep("");
    StateMachine.getInstance().transitionTo(StateMachine.MODEL_OPEN);

    // Select the new step.
    Bossanova2 bossaNova = BossaNovaReferentComponent.getSingleton()
        .getApplication();
    bossaNova.setSelectedStep(sequencer.getBatch().getStep(0), false);

    MainScreen mainScreen = bossaNova.getMainScreen();
    if (mainScreen != null) {
      mainScreen.enableStepButton();
    }
  }
View Full Code Here


                {
                    try
                    {
                        if(m_bossanova2 == null)
                        {
                            m_bossanova2 = new Bossanova2();
                            if(m_bossanova2 == null)
                                tmpMessage = "Cannot create Bossanova View";
                            else
                            {
                                if(BindingTango.isAwtThread())
View Full Code Here

            putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke("ctrl shift I"));
    }
 
    @Override
  public void actionPerformed(ActionEvent e) {
    Bossanova2 application = BossaNovaReferentComponent.getSingleton().getApplication();
    try {
     
      JTable table = BossaNovaReferentComponent.getSingleton().getApplication().getMainScreen().getBatchViewerPanel().getTable();     
      String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
      JFileChooser fileChooser = new JFileChooser(defaultPath);
      fileChooser.showOpenDialog(application.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)
            BossaNovaReferentComponent.getSingleton().getApplication().setSelectedStep(batch.getStep(0), false);
           
           
            table.getSelectionModel().setSelectionInterval(index+1, index+1);
           
            StateMachine.getInstance().transitionTo(StateMachine.MODEL_OPEN);           
        }
      }
     
    } catch (Exception e1) {
      e1.printStackTrace();
      PopupUtil.showError(application.getMainScreen(), HMIMessages.ERROR_GENERIC, "Didn't work out"
          + e1.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of fr.soleil.bossanova.Bossanova2$BossanovaModelExecutionListener

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.