Package fr.soleil.bossanova.gui

Examples of fr.soleil.bossanova.gui.MainScreen


    putValue(Action.SHORT_DESCRIPTION, "Save the current batch");
  }

  @Override
  public void actionPerformed(ActionEvent e) {
    MainScreen mainScreen = BossaNovaData.getSingleton().getApplication().getMainScreen();
    try {
      String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
      JFileChooser fileChooser = new JFileChooser(defaultPath);
      fileChooser.showSaveDialog(mainScreen);
      File selectedFile = fileChooser.getSelectedFile();
      if (selectedFile != null) {
        if (selectedFile.exists()) {
          throw new IOException("File already exists " + selectedFile.getName());
        } else {
          BatchManager.saveBatchAs(fileChooser.getSelectedFile());
          BossanovaUserPref.putPref(BossanovaUserPref.BATCH_DIRECTORY, fileChooser.getSelectedFile().getParent());
          // Bug 18267 Displaying current batch name
          mainScreen.displayCurrentBatchName();
        }
      }
    } catch (Exception e1) {
      LOGGER.error("Error saving file", e1);
      PopupUtil.showError(mainScreen, HMIMessages.HMI_ERROR_FILE_SAVE, e1.getMessage());
View Full Code Here


    putValue(Action.SHORT_DESCRIPTION, "Open batch");
  }

    @Override
  public void actionPerformed(ActionEvent e) {
    MainScreen mainScreen = BossaNovaData.getSingleton()
        .getApplication().getMainScreen();
    try {
       
        BatchManager.getSequencer();
            // Bug 17628
        // Offer to save unsaved edits before loading batch
            if( BossaNovaSequencerImpl.getCurrentBatchSaved() ==  false )
            {
                int iSaveBatch =  JOptionPane.showConfirmDialog(mainScreen, "Voulez-vous sauvegarder le batch en cours?", "Modifications non sauvegardees", JOptionPane.YES_NO_OPTION);
                if( iSaveBatch == JOptionPane.YES_OPTION  )
                {
                    String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
                    JFileChooser fileChooser = new JFileChooser(defaultPath);
                    fileChooser.showSaveDialog(mainScreen);
                    File selectedFile = fileChooser.getSelectedFile();
                    if (selectedFile != null) {
                        BatchManager.saveBatchAs(fileChooser.getSelectedFile());
                        BossanovaUserPref.putPref(BossanovaUserPref.BATCH_DIRECTORY, fileChooser.getSelectedFile().getParent());
                    }
                }
            }
            // End Bug 17628

      String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
      JFileChooser fileChooser = new JFileChooser(defaultPath);
      fileChooser.showOpenDialog(mainScreen);
      File selectedFile = fileChooser.getSelectedFile();
      if (selectedFile != null) {
        BatchManager.loadBatch(selectedFile);
          BossanovaUserPref.putPref(BossanovaUserPref.BATCH_DIRECTORY, fileChooser.getSelectedFile().getParent());
                // Bug 18267 Displaying current batch name
          mainScreen.displayCurrentBatchName();
      }
      StateMachine.getInstance().transitionTo(StateMachine.MODEL_OPEN);
    } catch (Exception e1) {
      e1.printStackTrace();
      PopupUtil.showError(mainScreen, HMIMessages.ERROR_GENERIC,
View Full Code Here

        super(HMIMessages.getString(HMIMessages.MENU_SAVE), Icons.getIcon("bossanova.save"));
        putValue(Action.SHORT_DESCRIPTION, "Save the current batch");
    }

    public void actionPerformed(ActionEvent e) {
        MainScreen mainScreen = BossaNovaData.getSingleton().getApplication().getMainScreen();
        try {
            if (BatchManager.getCurrentBatchFile() != null) {
                BatchManager.saveBatch();
            } else {
                String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
View Full Code Here

    init();

    ResourceBundle rb = ResourceBundle.getBundle("fr.soleil.bossanova.resources.application");
    String title = rb.getString("project.name") + " " + rb.getString("project.version") + " " + rb.getString("build.date");

    mainScreen = new MainScreen(title, standAlone);
    if (standAlone) {
      mainScreen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      BatchManager.createNewBatch();
    }
    // Bug 17412
View Full Code Here

    putValue(Action.SHORT_DESCRIPTION, "Open batch");
  }

    @Override
  public void actionPerformed(ActionEvent e) {
    MainScreen mainScreen = BossaNovaData.getSingleton()
        .getApplication().getMainScreen();
    try {
       
        // Bug 17628
        // Offer to save unsaved edits before loading batch
View Full Code Here

    init();

    ResourceBundle rb = ResourceBundle.getBundle("fr.soleil.bossanova.resources.application");
    String title = rb.getString("project.name") + " " + rb.getString("project.version") + " " + rb.getString("build.date");

    mainScreen = new MainScreen(title, standAlone);
    if (standAlone) {
      mainScreen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      BatchManager.createNewBatch();
    }
    // Bug 17412
View Full Code Here

        thread.start();
    }

    // TODO REFACTOR
    private void displayViewComp(Flow flow, Step step) {
        MainScreen mainScreen = BossaNovaReferentComponent.getSingleton().getApplication().getMainScreen();
        // TODO QUICK HACK
        // if (entity instanceof ISpecificBeans) {
        // ISpecificBeans beans = (ISpecificBeans) entity;
        // mainScreen.displayViewComponent(beans.getViewBean(), step);
        // } else {
        mainScreen.displayViewComponent(null, step);
        // }

    }
View Full Code Here

    ResourceBundle rb = ResourceBundle
        .getBundle("fr.soleil.bossanova.resources.application");
    String title = rb.getString("project.name") + " "
        + rb.getString("project.version") + " "
        + rb.getString("build.date");
    mainScreen = new MainScreen(title, standAlone);
    if (standAlone) {
      mainScreen.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      BatchManager.createNewBatch();
    }
    // Bug 17412
View Full Code Here

    putValue(Action.SHORT_DESCRIPTION, "Save the current batch");
  }

    @Override
  public void actionPerformed(ActionEvent e) {
    MainScreen mainScreen = BossaNovaData.getSingleton()
        .getApplication().getMainScreen();
    try {
                        String defaultPath = BossanovaUserPref.getPref(BossanovaUserPref.BATCH_DIRECTORY, System.getProperty("user.home"));
      JFileChooser fileChooser = new JFileChooser(defaultPath);
      fileChooser.showSaveDialog(mainScreen);
      File selectedFile = fileChooser.getSelectedFile();
      if (selectedFile != null) {
        BatchManager.saveBatchAs(fileChooser.getSelectedFile());
          BossanovaUserPref.putPref(BossanovaUserPref.BATCH_DIRECTORY, fileChooser.getSelectedFile().getParent());
          // Bug 18267 Displaying current batch name
          mainScreen.displayCurrentBatchName();
      }

    } catch (Exception e1) {
      e1.printStackTrace();
      PopupUtil.showError(mainScreen, HMIMessages.ERROR_GENERIC,
View Full Code Here

        initSystemProperties();

        try {
            application = new Bossanova2();
            application.initUI(false);
            MainScreen mainScreen = application.getMainScreen();
            add(mainScreen.getContentPane());

            mainScreen.setSize(new Dimension(800, 600));
            setSize(new Dimension(800, 600));
        } catch (Exception e) {
            JXErrorPane.showDialog(e);
        }
    }
View Full Code Here

TOP

Related Classes of fr.soleil.bossanova.gui.MainScreen

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.