1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Makeup-only: fixed some indentation and file headers

This commit is contained in:
Cristian Maglie 2012-01-02 16:45:01 +01:00
parent 5ad4422fc7
commit 8157ebf25a
3 changed files with 129 additions and 87 deletions

View File

@ -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; package processing.app.debug;
import java.io.File; import java.io.File;
@ -9,36 +32,36 @@ import processing.app.helpers.filefilters.OnlyDirs;
public class TargetPackage { public class TargetPackage {
String name; String name;
File folder; File folder;
Map<String, TargetPlatform> platforms = new HashMap<String, TargetPlatform>(); Map<String, TargetPlatform> platforms = new HashMap<String, TargetPlatform>();
public TargetPackage(String _name, File _folder) { public TargetPackage(String _name, File _folder) {
name = _name; name = _name;
folder = _folder; folder = _folder;
String[] platformsList = folder.list(new OnlyDirs()); String[] platformsList = folder.list(new OnlyDirs());
for (String platformName : platformsList) { for (String platformName : platformsList) {
File platformFolder = new File(folder, platformName); File platformFolder = new File(folder, platformName);
TargetPlatform platform = new TargetPlatform(platformName, platformFolder); TargetPlatform platform = new TargetPlatform(platformName, platformFolder);
platforms.put(platformName, platform); platforms.put(platformName, platform);
} }
} }
public Map<String, TargetPlatform> getPlatforms() { public Map<String, TargetPlatform> getPlatforms() {
return platforms; return platforms;
} }
public Collection<TargetPlatform> platforms() { public Collection<TargetPlatform> platforms() {
return platforms.values(); return platforms.values();
} }
public TargetPlatform get(String platform) { public TargetPlatform get(String platform) {
return platforms.get(platform); return platforms.get(platform);
} }
public String getName() { public String getName() {
return name; return name;
} }
} }

View File

@ -1,7 +1,6 @@
/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ /* -*- 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/ Part of the Arduino project - http://www.arduino.cc/
Copyright (c) 2009 David A. Mellis Copyright (c) 2009 David A. Mellis
@ -22,7 +21,6 @@
$Id$ $Id$
*/ */
package processing.app.debug; package processing.app.debug;
import java.io.File; import java.io.File;
@ -32,71 +30,69 @@ import java.util.Map;
import processing.app.helpers.PreferencesMap; import processing.app.helpers.PreferencesMap;
public class TargetPlatform { public class TargetPlatform {
private String name; private String name;
private File folder; private File folder;
private Map<String, PreferencesMap> boards; private Map<String, PreferencesMap> boards;
private Map<String, PreferencesMap> programmers; private Map<String, PreferencesMap> programmers;
private PreferencesMap platform; private PreferencesMap platform;
public TargetPlatform(String _name, File _folder) { public TargetPlatform(String _name, File _folder) {
System.out.println("TargetPlatform: constructor start, name: " + _name); System.out.println("TargetPlatform: constructor start, name: " + _name);
name = _name; name = _name;
folder = _folder; folder = _folder;
boards = new HashMap<String, PreferencesMap>(); boards = new HashMap<String, PreferencesMap>();
programmers = new HashMap<String, PreferencesMap>(); programmers = new HashMap<String, PreferencesMap>();
platform = new PreferencesMap(); platform = new PreferencesMap();
try { try {
File boardsFile = new File(_folder, "boards.txt"); File boardsFile = new File(_folder, "boards.txt");
if (boardsFile.exists()) { if (boardsFile.exists()) {
PreferencesMap boardPreferences = new PreferencesMap(); PreferencesMap boardPreferences = new PreferencesMap();
boardPreferences.load(boardsFile); boardPreferences.load(boardsFile);
boards = boardPreferences.createFirstLevelMap(); boards = boardPreferences.createFirstLevelMap();
} }
} catch (Exception e) { } catch (Exception e) {
System.err.println("Error loading boards from boards.txt: " + e); System.err.println("Error loading boards from boards.txt: " + e);
} }
try { try {
File platformsFile = new File(_folder, "platforms.txt"); File platformsFile = new File(_folder, "platforms.txt");
if (platformsFile.exists()) if (platformsFile.exists())
platform.load(platformsFile); platform.load(platformsFile);
} catch (Exception e) { } catch (Exception e) {
System.err.println("Error loading platforms from platform.txt: " System.err.println("Error loading platforms from platform.txt: " + e);
+ e); }
}
try { try {
File programmersFile = new File(_folder, "programmers.txt"); File programmersFile = new File(_folder, "programmers.txt");
if (programmersFile.exists()) { if (programmersFile.exists()) {
PreferencesMap prefs = new PreferencesMap(); PreferencesMap prefs = new PreferencesMap();
prefs.load(programmersFile); prefs.load(programmersFile);
programmers = prefs.createFirstLevelMap(); programmers = prefs.createFirstLevelMap();
} }
} catch (Exception e) { } catch (Exception e) {
System.err System.err
.println("Error loading programmers from programmers.txt: " .println("Error loading programmers from programmers.txt: " + e);
+ e); }
} }
}
public String getName() { public String getName() {
return name; return name;
} }
public File getFolder() { public File getFolder() {
return folder; return folder;
} }
public Map<String, PreferencesMap> getBoards() { public Map<String, PreferencesMap> getBoards() {
return boards; return boards;
} }
public Map<String, PreferencesMap> getProgrammers() { public Map<String, PreferencesMap> getProgrammers() {
return programmers; return programmers;
} }
public PreferencesMap getPlatform() { public PreferencesMap getPlatform() {
return platform; return platform;
} }
} }

View File

@ -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; package processing.app.helpers;
import java.util.ArrayList; import java.util.ArrayList;