24
24
import processing .app .Messages ;
25
25
import processing .app .Platform ;
26
26
import processing .app .Preferences ;
27
- import processing .app .Util ;
28
27
import processing .app .exec .ProcessHelper ;
29
28
import processing .app .exec .ProcessResult ;
29
+ import processing .app .ui .Toolkit ;
30
30
import processing .core .PApplet ;
31
31
32
32
import javax .swing .*;
51
51
class AndroidSDK {
52
52
public static boolean adbDisabled = false ;
53
53
54
+ final static private int FONT_SIZE = Toolkit .zoom (11 );
55
+ final static private int TEXT_MARGIN = Toolkit .zoom (8 );
56
+ final static private int TEXT_WIDTH = Toolkit .zoom (300 );
57
+
54
58
private final File folder ;
55
59
private final File tools ;
56
60
private final File platforms ;
@@ -71,8 +75,8 @@ class AndroidSDK {
71
75
private static final String MISSING_SDK_MESSAGE =
72
76
"The Android SDK does not appear to be installed, " +
73
77
"because the ANDROID_SDK variable is not set. " +
74
- "If it is installed, click “ Locate SDK path” to select the " +
75
- "location of the SDK, or “ Download SDK” to let " +
78
+ "If it is installed, click \" Locate SDK path\" to select the " +
79
+ "location of the SDK, or \" Download SDK\" to let " +
76
80
"Processing download the SDK automatically.<br><br>" +
77
81
"If you want to download the SDK manually, you can get " +
78
82
"the command line tools from <a href=\" " + SDK_DOWNLOAD_URL + "\" >here</a>. " +
@@ -85,8 +89,8 @@ class AndroidSDK {
85
89
"The Android SDK appears to be installed, " +
86
90
"however the SDK platform for API " + AndroidBuild .TARGET_SDK +
87
91
" was not found. If it is available in a different location, " +
88
- "click “ Locate SDK path” to select the " +
89
- "location of the alternative SDK, or “ Download SDK” to let " +
92
+ "click \" Locate SDK path\" to select the " +
93
+ "location of the alternative SDK, or \" Download SDK\" to let " +
90
94
"Processing download the SDK automatically.<br><br>" +
91
95
"If you want to download the SDK manually, you can get " +
92
96
"the command line tools from <a href=\" " + SDK_DOWNLOAD_URL + "\" >here</a>. " +
@@ -183,20 +187,6 @@ public AndroidSDK(File folder) throws BadSDKException, IOException {
183
187
184
188
path = new File (javaHome , "bin" ).getCanonicalPath () + File .pathSeparator + path ;
185
189
Platform .setenv ("PATH" , path );
186
-
187
-
188
-
189
- // Util.contentsToClassPath()
190
- // path = new File(tools, "lib").getCanonicalPath() + File.pathSeparator + path;
191
-
192
-
193
- // repository-
194
- // sdklib-
195
- // common-
196
- // commons-compress-
197
- // httpcore-
198
- // guava-
199
-
200
190
201
191
checkDebugCertificate ();
202
192
}
@@ -244,7 +234,7 @@ protected void checkDebugCertificate() {
244
234
// System.out.println("Nah, that won't expire until " + date); //timestamp);
245
235
}
246
236
} catch (ParseException pe ) {
247
- System .err .println ("The date “ " + timestamp + "” could not be parsed." );
237
+ System .err .println ("The date “ " + timestamp + "� could not be parsed." );
248
238
System .err .println ("Please report this as a bug so we can fix it." );
249
239
}
250
240
}
@@ -441,8 +431,10 @@ static public int showLocateDialog(Frame editor) {
441
431
// How to show a option dialog containing clickable links:
442
432
// http://stackoverflow.com/questions/8348063/clickable-links-in-joptionpane
443
433
String htmlString = "<html> " +
444
- "<head> <style type=\" text/css\" >" +
445
- "p { font: 11pt \" Lucida Grande\" ; margin-top: 8px; width: 300px }" +
434
+ "<head> <style type=\" text/css\" >" +
435
+ "p { font: " + FONT_SIZE + "pt \" Lucida Grande\" ; " +
436
+ "margin: " + TEXT_MARGIN + "px; " +
437
+ "width: " + TEXT_WIDTH + "px }" +
446
438
"</style> </head>" ;
447
439
String title = "" ;
448
440
if (SDK_LOAD_ERROR == MISSING_SDK ) {
@@ -486,7 +478,9 @@ static public int showDownloadSysImageDialog(Frame editor, boolean wear) {
486
478
String msg = wear ? ANDROID_SYS_IMAGE_WEAR_SECONDARY : ANDROID_SYS_IMAGE_SECONDARY ;
487
479
String htmlString = "<html> " +
488
480
"<head> <style type=\" text/css\" >" +
489
- "p { font: 11pt \" Lucida Grande\" ; margin-top: 8px; width: 300px }" +
481
+ "p { font: " + FONT_SIZE + "pt \" Lucida Grande\" ; " +
482
+ "margin: " + TEXT_MARGIN + "px; " +
483
+ "width: " + TEXT_WIDTH + "px }" +
490
484
"</style> </head>" + "<body> <p>" + msg + "</p> </body> </html>" ;
491
485
JEditorPane pane = new JEditorPane ("text/html" , htmlString );
492
486
pane .addHyperlinkListener (new HyperlinkListener () {
0 commit comments