mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-10 21:24:12 +01:00
Removed self class references from Base.
This commit is contained in:
parent
b278c19a2a
commit
22be22a5a7
@ -205,8 +205,8 @@ public class Base {
|
|||||||
try {
|
try {
|
||||||
Class.forName("com.sun.jdi.VirtualMachine");
|
Class.forName("com.sun.jdi.VirtualMachine");
|
||||||
} catch (ClassNotFoundException cnfe) {
|
} catch (ClassNotFoundException cnfe) {
|
||||||
Base.showPlatforms();
|
showPlatforms();
|
||||||
Base.showError(_("Please install JDK 1.5 or later"),
|
showError(_("Please install JDK 1.5 or later"),
|
||||||
_("Arduino requires a full JDK (not just a JRE)\n" +
|
_("Arduino requires a full JDK (not just a JRE)\n" +
|
||||||
"to run. Please install JDK 1.5 or later.\n" +
|
"to run. Please install JDK 1.5 or later.\n" +
|
||||||
"More information can be found in the reference."), cnfe);
|
"More information can be found in the reference."), cnfe);
|
||||||
@ -238,9 +238,9 @@ public class Base {
|
|||||||
if (BaseNoGui.getPortableFolder() != null)
|
if (BaseNoGui.getPortableFolder() != null)
|
||||||
sketchbookFolder = new File(BaseNoGui.getPortableFolder(), sketchbookPath);
|
sketchbookFolder = new File(BaseNoGui.getPortableFolder(), sketchbookPath);
|
||||||
else
|
else
|
||||||
sketchbookFolder = Base.absoluteFile(sketchbookPath);
|
sketchbookFolder = absoluteFile(sketchbookPath);
|
||||||
if (!sketchbookFolder.exists()) {
|
if (!sketchbookFolder.exists()) {
|
||||||
Base.showWarning(_("Sketchbook folder disappeared"),
|
showWarning(_("Sketchbook folder disappeared"),
|
||||||
_("The sketchbook folder no longer exists.\n" +
|
_("The sketchbook folder no longer exists.\n" +
|
||||||
"Arduino will switch to the default sketchbook\n" +
|
"Arduino will switch to the default sketchbook\n" +
|
||||||
"location, and create a new sketchbook folder if\n" +
|
"location, and create a new sketchbook folder if\n" +
|
||||||
@ -330,7 +330,7 @@ public class Base {
|
|||||||
i++;
|
i++;
|
||||||
if (i >= args.length)
|
if (i >= args.length)
|
||||||
showError(null, _("Argument required for --port"), 3);
|
showError(null, _("Argument required for --port"), 3);
|
||||||
Base.selectSerialPort(args[i]);
|
selectSerialPort(args[i]);
|
||||||
if (action == ACTION.GUI)
|
if (action == ACTION.GUI)
|
||||||
action = ACTION.NOOP;
|
action = ACTION.NOOP;
|
||||||
continue;
|
continue;
|
||||||
@ -764,12 +764,12 @@ public class Base {
|
|||||||
if (index == 26) {
|
if (index == 26) {
|
||||||
// In 0159, avoid running past z by sending people outdoors.
|
// In 0159, avoid running past z by sending people outdoors.
|
||||||
if (!breakTime) {
|
if (!breakTime) {
|
||||||
Base.showWarning(_("Time for a Break"),
|
showWarning(_("Time for a Break"),
|
||||||
_("You've reached the limit for auto naming of new sketches\n" +
|
_("You've reached the limit for auto naming of new sketches\n" +
|
||||||
"for the day. How about going for a walk instead?"), null);
|
"for the day. How about going for a walk instead?"), null);
|
||||||
breakTime = true;
|
breakTime = true;
|
||||||
} else {
|
} else {
|
||||||
Base.showWarning(_("Sunshine"),
|
showWarning(_("Sunshine"),
|
||||||
_("No really, time for some fresh air for you."), null);
|
_("No really, time for some fresh air for you."), null);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -869,7 +869,7 @@ public class Base {
|
|||||||
*/
|
*/
|
||||||
public void handleOpenPrompt() throws Exception {
|
public void handleOpenPrompt() throws Exception {
|
||||||
// get the frontmost window frame for placing file dialog
|
// get the frontmost window frame for placing file dialog
|
||||||
JFileChooser fd = new JFileChooser(Preferences.get("last.folder", Base.getSketchbookFolder().getAbsolutePath()));
|
JFileChooser fd = new JFileChooser(Preferences.get("last.folder", getSketchbookFolder().getAbsolutePath()));
|
||||||
fd.setDialogTitle(_("Open an Arduino sketch..."));
|
fd.setDialogTitle(_("Open an Arduino sketch..."));
|
||||||
fd.setFileSelectionMode(JFileChooser.FILES_ONLY);
|
fd.setFileSelectionMode(JFileChooser.FILES_ONLY);
|
||||||
fd.setFileFilter(new FileNameExtensionFilter(_("Sketches (*.ino, *.pde)"), "ino", "pde"));
|
fd.setFileFilter(new FileNameExtensionFilter(_("Sketches (*.ino, *.pde)"), "ino", "pde"));
|
||||||
@ -1291,7 +1291,7 @@ public class Base {
|
|||||||
String core = getBoardPreferences().get("build.core");
|
String core = getBoardPreferences().get("build.core");
|
||||||
if (core.contains(":")) {
|
if (core.contains(":")) {
|
||||||
String referencedCore = core.split(":")[0];
|
String referencedCore = core.split(":")[0];
|
||||||
TargetPlatform referencedPlatform = Base.getTargetPlatform(referencedCore, targetPlatform.getId());
|
TargetPlatform referencedPlatform = getTargetPlatform(referencedCore, targetPlatform.getId());
|
||||||
if (referencedPlatform != null) {
|
if (referencedPlatform != null) {
|
||||||
File referencedPlatformFolder = referencedPlatform.getFolder();
|
File referencedPlatformFolder = referencedPlatform.getFolder();
|
||||||
librariesFolders.add(new File(referencedPlatformFolder, "libraries"));
|
librariesFolders.add(new File(referencedPlatformFolder, "libraries"));
|
||||||
@ -1684,7 +1684,7 @@ public class Base {
|
|||||||
+ "and it cannot start with a number).\n"
|
+ "and it cannot start with a number).\n"
|
||||||
+ "To get rid of this message, remove the sketch from\n"
|
+ "To get rid of this message, remove the sketch from\n"
|
||||||
+ "{1}"), name, entry.getAbsolutePath());
|
+ "{1}"), name, entry.getAbsolutePath());
|
||||||
Base.showMessage(_("Ignoring sketch with bad name"), complaining);
|
showMessage(_("Ignoring sketch with bad name"), complaining);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1764,7 +1764,7 @@ public class Base {
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public void handleAbout() {
|
public void handleAbout() {
|
||||||
final Image image = Base.getLibImage("about.jpg", activeEditor);
|
final Image image = getLibImage("about.jpg", activeEditor);
|
||||||
final Window window = new Window(activeEditor) {
|
final Window window = new Window(activeEditor) {
|
||||||
public void paint(Graphics g) {
|
public void paint(Graphics g) {
|
||||||
g.drawImage(image, 0, 0, null);
|
g.drawImage(image, 0, 0, null);
|
||||||
@ -1775,7 +1775,7 @@ public class Base {
|
|||||||
|
|
||||||
g.setFont(new Font("SansSerif", Font.PLAIN, 11));
|
g.setFont(new Font("SansSerif", Font.PLAIN, 11));
|
||||||
g.setColor(Color.white);
|
g.setColor(Color.white);
|
||||||
g.drawString(Base.VERSION_NAME, 50, 30);
|
g.drawString(VERSION_NAME, 50, 30);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
window.addMouseListener(new MouseAdapter() {
|
window.addMouseListener(new MouseAdapter() {
|
||||||
@ -1876,7 +1876,7 @@ public class Base {
|
|||||||
if (buildFolder == null) {
|
if (buildFolder == null) {
|
||||||
String buildPath = Preferences.get("build.path");
|
String buildPath = Preferences.get("build.path");
|
||||||
if (buildPath != null) {
|
if (buildPath != null) {
|
||||||
buildFolder = Base.absoluteFile(buildPath);
|
buildFolder = absoluteFile(buildPath);
|
||||||
if (!buildFolder.exists())
|
if (!buildFolder.exists())
|
||||||
buildFolder.mkdirs();
|
buildFolder.mkdirs();
|
||||||
} else {
|
} else {
|
||||||
@ -2084,7 +2084,7 @@ public class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String prompt = _("Select (or create new) folder for sketches...");
|
String prompt = _("Select (or create new) folder for sketches...");
|
||||||
folder = Base.selectFolder(prompt, null, null);
|
folder = selectFolder(prompt, null, null);
|
||||||
if (folder == null) {
|
if (folder == null) {
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
@ -2212,18 +2212,18 @@ public class Base {
|
|||||||
|
|
||||||
|
|
||||||
static public void showReference(String filename) {
|
static public void showReference(String filename) {
|
||||||
File referenceFolder = Base.getContentFile("reference");
|
File referenceFolder = getContentFile("reference");
|
||||||
File referenceFile = new File(referenceFolder, filename);
|
File referenceFile = new File(referenceFolder, filename);
|
||||||
openURL(referenceFile.getAbsolutePath());
|
openURL(referenceFile.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
static public void showGettingStarted() {
|
static public void showGettingStarted() {
|
||||||
if (OSUtils.isMacOS()) {
|
if (OSUtils.isMacOS()) {
|
||||||
Base.showReference(_("Guide_MacOSX.html"));
|
showReference(_("Guide_MacOSX.html"));
|
||||||
} else if (OSUtils.isWindows()) {
|
} else if (OSUtils.isWindows()) {
|
||||||
Base.showReference(_("Guide_Windows.html"));
|
showReference(_("Guide_Windows.html"));
|
||||||
} else {
|
} else {
|
||||||
Base.openURL(_("http://www.arduino.cc/playground/Learning/Linux"));
|
openURL(_("http://www.arduino.cc/playground/Learning/Linux"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user