diff --git a/app/src/processing/app/debug/TargetPackage.java b/app/src/processing/app/debug/TargetPackage.java index 5fe85e3f8..05d13fbae 100644 --- a/app/src/processing/app/debug/TargetPackage.java +++ b/app/src/processing/app/debug/TargetPackage.java @@ -1,3 +1,26 @@ +/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + TargetPackage - Represents a hardware package + Part of the Arduino project - http://www.arduino.cc/ + + Copyright (c) 2011 Cristian Maglie + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + $Id$ + */ package processing.app.debug; import java.io.File; @@ -9,36 +32,36 @@ import processing.app.helpers.filefilters.OnlyDirs; public class TargetPackage { - String name; - File folder; + String name; + File folder; - Map platforms = new HashMap(); + Map platforms = new HashMap(); - public TargetPackage(String _name, File _folder) { - name = _name; - folder = _folder; + public TargetPackage(String _name, File _folder) { + name = _name; + folder = _folder; - String[] platformsList = folder.list(new OnlyDirs()); - for (String platformName : platformsList) { - File platformFolder = new File(folder, platformName); - TargetPlatform platform = new TargetPlatform(platformName, platformFolder); - platforms.put(platformName, platform); - } - } + String[] platformsList = folder.list(new OnlyDirs()); + for (String platformName : platformsList) { + File platformFolder = new File(folder, platformName); + TargetPlatform platform = new TargetPlatform(platformName, platformFolder); + platforms.put(platformName, platform); + } + } - public Map getPlatforms() { - return platforms; - } + public Map getPlatforms() { + return platforms; + } - public Collection platforms() { - return platforms.values(); - } + public Collection platforms() { + return platforms.values(); + } - public TargetPlatform get(String platform) { - return platforms.get(platform); - } - - public String getName() { - return name; - } + public TargetPlatform get(String platform) { + return platforms.get(platform); + } + + public String getName() { + return name; + } } diff --git a/app/src/processing/app/debug/TargetPlatform.java b/app/src/processing/app/debug/TargetPlatform.java index f504a498d..454ebcf65 100644 --- a/app/src/processing/app/debug/TargetPlatform.java +++ b/app/src/processing/app/debug/TargetPlatform.java @@ -1,7 +1,6 @@ /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - /* - Target - represents a hardware platform + TargetPlatform - Represents a hardware platform Part of the Arduino project - http://www.arduino.cc/ Copyright (c) 2009 David A. Mellis @@ -22,7 +21,6 @@ $Id$ */ - package processing.app.debug; import java.io.File; @@ -32,71 +30,69 @@ import java.util.Map; import processing.app.helpers.PreferencesMap; public class TargetPlatform { - private String name; - private File folder; - private Map boards; - private Map programmers; - private PreferencesMap platform; + private String name; + private File folder; + private Map boards; + private Map programmers; + private PreferencesMap platform; - public TargetPlatform(String _name, File _folder) { - System.out.println("TargetPlatform: constructor start, name: " + _name); - name = _name; - folder = _folder; - boards = new HashMap(); - programmers = new HashMap(); - platform = new PreferencesMap(); + public TargetPlatform(String _name, File _folder) { + System.out.println("TargetPlatform: constructor start, name: " + _name); + name = _name; + folder = _folder; + boards = new HashMap(); + programmers = new HashMap(); + platform = new PreferencesMap(); - try { - File boardsFile = new File(_folder, "boards.txt"); - if (boardsFile.exists()) { - PreferencesMap boardPreferences = new PreferencesMap(); - boardPreferences.load(boardsFile); - boards = boardPreferences.createFirstLevelMap(); - } - } catch (Exception e) { - System.err.println("Error loading boards from boards.txt: " + e); - } + try { + File boardsFile = new File(_folder, "boards.txt"); + if (boardsFile.exists()) { + PreferencesMap boardPreferences = new PreferencesMap(); + boardPreferences.load(boardsFile); + boards = boardPreferences.createFirstLevelMap(); + } + } catch (Exception e) { + System.err.println("Error loading boards from boards.txt: " + e); + } - try { - File platformsFile = new File(_folder, "platforms.txt"); - if (platformsFile.exists()) - platform.load(platformsFile); - } catch (Exception e) { - System.err.println("Error loading platforms from platform.txt: " - + e); - } + try { + File platformsFile = new File(_folder, "platforms.txt"); + if (platformsFile.exists()) + platform.load(platformsFile); + } catch (Exception e) { + System.err.println("Error loading platforms from platform.txt: " + e); + } - try { - File programmersFile = new File(_folder, "programmers.txt"); - if (programmersFile.exists()) { - PreferencesMap prefs = new PreferencesMap(); - prefs.load(programmersFile); - programmers = prefs.createFirstLevelMap(); - } - } catch (Exception e) { - System.err - .println("Error loading programmers from programmers.txt: " - + e); - } - } + try { + File programmersFile = new File(_folder, "programmers.txt"); + if (programmersFile.exists()) { + PreferencesMap prefs = new PreferencesMap(); + prefs.load(programmersFile); + programmers = prefs.createFirstLevelMap(); + } + } catch (Exception e) { + System.err + .println("Error loading programmers from programmers.txt: " + e); + } + } - public String getName() { - return name; - } + public String getName() { + return name; + } - public File getFolder() { - return folder; - } + public File getFolder() { + return folder; + } - public Map getBoards() { - return boards; - } + public Map getBoards() { + return boards; + } - public Map getProgrammers() { - return programmers; - } + public Map getProgrammers() { + return programmers; + } - public PreferencesMap getPlatform() { - return platform; - } + public PreferencesMap getPlatform() { + return platform; + } } diff --git a/app/src/processing/app/helpers/StringReplacer.java b/app/src/processing/app/helpers/StringReplacer.java index 3ae23eaed..52902e13c 100644 --- a/app/src/processing/app/helpers/StringReplacer.java +++ b/app/src/processing/app/helpers/StringReplacer.java @@ -1,3 +1,26 @@ +/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ +/* + StringReplacer - Utility class for expression formatting + Part of the Arduino project - http://www.arduino.cc/ + + Copyright (c) 2011 Cristian Maglie + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + $Id$ + */ package processing.app.helpers; import java.util.ArrayList;