Package com.ardublock

Source Code of com.ardublock.Main

package com.ardublock;

import java.awt.event.WindowEvent;
import java.io.IOException;

import javax.swing.JFrame;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import com.ardublock.core.Context;
import com.ardublock.ui.ConsoleFrame;
import com.ardublock.ui.OpenblocksFrame;

public class Main
{
  private OpenblocksFrame openblocksFrame;

  public static void main(String args[]) throws SAXException, IOException, ParserConfigurationException
  {
    Main me = new Main();
    me.startArdublock();
  }
 
  public void startArdublock() throws SAXException, IOException, ParserConfigurationException
  {
    startOpenblocksFrame();
    //startConsoleFrame();
  }
 
  private void startOpenblocksFrame() throws SAXException, IOException, ParserConfigurationException
  {
    openblocksFrame = new OpenblocksFrame();
    openblocksFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Context context = Context.getContext();
    context.setInArduino(false);
    openblocksFrame.setVisible(true);
  }

  public void shutdown()
  {
    openblocksFrame.dispatchEvent(new WindowEvent(openblocksFrame, WindowEvent.WINDOW_CLOSING));
  }
 
  @SuppressWarnings("unused")
  private void startConsoleFrame()
  {
    ConsoleFrame consoleFrame = new ConsoleFrame();
    consoleFrame.setVisible(true);
  }
}
TOP

Related Classes of com.ardublock.Main

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.