Package com.ardublock.core

Examples of com.ardublock.core.Context


 
  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);
  }
View Full Code Here


  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    WireReadBlock.setupWireEnvironment(translator);
 
    String ret = "";
    Context context = Context.getContext();
    if (context.getArduinoVersionString().equals(Context.ARDUINO_VERSION_UNKNOWN))
    {
      ret += "//Unable to detect your Arduino version, using 1.0 in default\n";
    }
   
    ret += "__ardublockI2cWriteDataOne( ";
View Full Code Here

  public String toCode() throws SocketNullException, SubroutineNotDeclaredException
  {
    WireReadBlock.setupWireEnvironment(translator);
 
    String ret = "";
    Context context = Context.getContext();
    if (context.getArduinoVersionString().equals(Context.ARDUINO_VERSION_UNKNOWN))
    {
      ret += "//Unable to dectect your Arduino version, using 1.0 in default\n";
    }
   
    ret += "\t__ardublockI2cWriteData( ";
View Full Code Here

    if (ArduBlockTool.editor == null )
    {
      ArduBlockTool.editor = editor;
      ArduBlockTool.openblocksFrame = new ArduBlockToolFrame();
      ArduBlockTool.openblocksFrame.addListener(this);
      Context context = Context.getContext();
      String arduinoVersion = this.getArduinoVersion();
      context.setInArduino(true);
      context.setArduinoVersionString(arduinoVersion);
      context.setEditor(editor);
      System.out.println("Arduino Version: " + arduinoVersion);
    }
  }
View Full Code Here

    ArduBlockTool.editor.handleExport(false);
  }
 
  private String getArduinoVersion()
  {
    Context context = Context.getContext();
    File versionFile = context.getArduinoFile("lib/version.txt");
    if (versionFile.exists())
    {
      try
      {
        InputStream is = new FileInputStream(versionFile);
View Full Code Here

    initOpenBlocks();
  }
 
  private void initOpenBlocks()
  {
    final Context context = Context.getContext();
   
    /*
    WorkspaceController workspaceController = context.getWorkspaceController();
    JComponent workspaceComponent = workspaceController.getWorkspacePanel();
    */
   
    final Workspace workspace = context.getWorkspace();
   
    // WTF I can't add worksapcelistener by workspace contrller
    workspace.addWorkspaceListener(new ArdublockWorkspaceListener(this));
   
    JPanel buttons = new JPanel();
    buttons.setLayout(new FlowLayout());
    JButton newButton = new JButton(uiMessageBundle.getString("ardublock.ui.new"));
    newButton.addActionListener(new NewButtonListener(this));
    JButton saveButton = new JButton(uiMessageBundle.getString("ardublock.ui.save"));
    saveButton.addActionListener(new SaveButtonListener(this));
    JButton saveAsButton = new JButton(uiMessageBundle.getString("ardublock.ui.saveAs"));
    saveAsButton.addActionListener(new SaveAsButtonListener(this));
    JButton openButton = new JButton(uiMessageBundle.getString("ardublock.ui.load"));
    openButton.addActionListener(new OpenButtonListener(this));
    JButton generateButton = new JButton(uiMessageBundle.getString("ardublock.ui.upload"));
    generateButton.addActionListener(new GenerateCodeButtonListener(this, context));
    JButton serialMonitorButton = new JButton(uiMessageBundle.getString("ardublock.ui.serialMonitor"));
    serialMonitorButton.addActionListener(new ActionListener () {
      public void actionPerformed(ActionEvent e) {
        context.getEditor().handleSerial();
      }
    });
    JButton saveImageButton = new JButton(uiMessageBundle.getString("ardublock.ui.saveImage"));
    saveImageButton.addActionListener(new ActionListener () {
      public void actionPerformed(ActionEvent e) {
View Full Code Here

  {
    setupSDEnvironment(translator);
   
    String ret = "";
   
    Context context = Context.getContext();
    if (context.getArduinoVersionString().equals(Context.ARDUINO_VERSION_UNKNOWN))
    {
      ret += "//Unable to detect your Arduino version, using 1.0 in default\n";
    }
   
    TranslatorBlock t1 = getRequiredTranslatorBlockAtSocket(0);
View Full Code Here

  {
    SDWriteNumberBlock.setupSDEnvironment(translator);
   
    String ret = "";
   
    Context context = Context.getContext();
    if (context.getArduinoVersionString().equals(Context.ARDUINO_VERSION_UNKNOWN))
    {
      ret += "//Unable to detect your Arduino version, using 1.0 in default\n";
    }
   
    TranslatorBlock t1 = getRequiredTranslatorBlockAtSocket(0);
View Full Code Here

  {
    SDWriteNumberBlock.setupSDEnvironment(translator);
   
    String ret = "";
   
    Context context = Context.getContext();
    if (context.getArduinoVersionString().equals(Context.ARDUINO_VERSION_UNKNOWN))
    {
      ret += "//Unable to detect your Arduino version, using 1.0 in default\n";
    }
   
    TranslatorBlock t1 = getRequiredTranslatorBlockAtSocket(0);
View Full Code Here

  {
    setupWireEnvironment(translator);
   
    String ret = "";
   
    Context context = Context.getContext();
    if (context.getArduinoVersionString().equals(Context.ARDUINO_VERSION_UNKNOWN))
    {
      ret += "//Unable to dectect your Arduino version, using 1.0 in default\n";
    }
    ret += "__ardublockI2cReadData( ";
    TranslatorBlock tb = this.getRequiredTranslatorBlockAtSocket(0);
View Full Code Here

TOP

Related Classes of com.ardublock.core.Context

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.