Package easysm.boundaries

Source Code of easysm.boundaries.EasySM

package easysm.boundaries;

import javax.swing.JOptionPane;

import easysm.Constants;
import easysm.boundaries.components.EasySMFrame;
import easysm.boundaries.components.OkMessage;
import easysm.datatypes.Name;
import easysm.datatypes.information.ProjectInfo;
import easysm.executors.Main;

/**
* @author FourCheeses Software Solutions
*/
public class EasySM extends BaseBoundary
{
  private EasySMFrame frame;
  private UpdateProject updateProject;
 
  public EasySM(Main main, UpdateProject updateProject)
  {
    super(main);
    this.updateProject = updateProject;
    frame = new EasySMFrame(this);
    frame.setVisible(true);
  }
 
  /*
   *
   * Properties
   *
   */
 
  public UpdateProject updateProject()
  {
    return updateProject;
  }

  /**
   * Called by Launcher.main(), returns the frame containing the UI.
   *
   * @return A JFrame with the UI.
   */
  public EasySMFrame getFrame()
  {
    return frame;
  }
 
  /*
   *
   * Operations called by Main
   *
   */
 
  @Override
  public void info(String msg)
  {
    OkMessage.Show(msg);
  }
 
  @Override
  public void error(String msg)
  {
    JOptionPane.showMessageDialog(frame, msg, Constants.ERROR_DIALOG_TITLE, JOptionPane.ERROR_MESSAGE);
    frame.setError();
  }
 
  /*
   *
   * Operations called by the GUI
   *
   */

  public void newProject(Name name, String author, String version)
  {
    main().doNewProject(new ProjectInfo(name, author, version));
  }

  public void openProject(String filename)
  {
    main().doOpenProject(filename);
  }
 
  public void saveProject()
  {
    main().doSaveProject();
  }

  public void closeProject()
  {
    main().doCloseProject();
  }
}
TOP

Related Classes of easysm.boundaries.EasySM

TOP
Copyright © 2018 www.massapi.com. 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.