File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/processing/mode/android Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 42
42
import processing .app .Platform ;
43
43
import processing .app .SketchException ;
44
44
import processing .app .Util ;
45
+ import processing .app .ui .Toolkit ;
45
46
import processing .core .PApplet ;
46
47
47
48
/**
48
49
* Some utilities.
49
50
*/
50
51
public class AndroidUtil {
52
+ final static private int FONT_SIZE = Toolkit .zoom (11 );
53
+ final static private int TEXT_MARGIN = Toolkit .zoom (8 );
54
+ final static private int TEXT_WIDTH = Toolkit .zoom (300 );
51
55
52
56
// Creates a message dialog, where the text can contain clickable links.
53
57
static public void showMessage (String title , String text ) {
@@ -56,8 +60,10 @@ static public void showMessage(String title, String text) {
56
60
System .out .println (title + ": " + text );
57
61
} else {
58
62
String htmlString = "<html> " +
59
- "<head> <style type=\" text/css\" >" +
60
- "p { font: 11pt \" Lucida Grande\" ; margin-top: 8px; width: 300px }" +
63
+ "<head> <style type=\" text/css\" >" +
64
+ "p { font: " + FONT_SIZE + "pt \" Lucida Grande\" ; " +
65
+ "margin: " + TEXT_MARGIN + "px; " +
66
+ "width: " + TEXT_WIDTH + "px }" +
61
67
"</style> </head>" +
62
68
"<body> <p>" + text + "</p> </body> </html>" ;
63
69
JEditorPane pane = new JEditorPane ("text/html" , htmlString );
You can’t perform that action at this time.
0 commit comments