mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
tweak for create font tool, fix the java < 1.3 error message, better
Capture error message
This commit is contained in:
@@ -412,7 +412,7 @@ public class CreateFont extends JFrame {
|
||||
try {
|
||||
Font instance = (Font) table.get(list[selection]);
|
||||
font = instance.deriveFont(Font.PLAIN, fontsize);
|
||||
PFont f = new PFont(font, all ? null : PFont.DEFAULT_CHARSET, smooth);
|
||||
PFont f = new PFont(font, smooth, all ? null : PFont.DEFAULT_CHARSET);
|
||||
|
||||
// make sure the 'data' folder exists
|
||||
if (!targetFolder.exists()) targetFolder.mkdirs();
|
||||
|
||||
+33
-19
@@ -57,7 +57,7 @@ public class PApplet extends Applet
|
||||
* not be <EM>exactly</EM> 1.3 or 1.4. Instead, make sure you're
|
||||
* comparing against 1.3f or 1.4f, which will have the same amount
|
||||
* of error (i.e. 1.40000001). This could just be a double, but
|
||||
* since Processing only uses floats, it's safer to do this,
|
||||
* since Processing only uses floats, it's safer for this to be a float
|
||||
* because there's no good way to specify a double with the preproc.
|
||||
*/
|
||||
public static final float javaVersion =
|
||||
@@ -413,12 +413,6 @@ public class PApplet extends Applet
|
||||
keyEventMethods = new RegisteredMethods();
|
||||
disposeMethods = new RegisteredMethods();
|
||||
|
||||
// create a dummy graphics context
|
||||
size(DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||
//size(INITIAL_WIDTH, INITIAL_HEIGHT);
|
||||
width = 0; // use this to flag whether the width/height are valid
|
||||
height = 0;
|
||||
|
||||
try {
|
||||
getAppletContext();
|
||||
online = true;
|
||||
@@ -426,6 +420,28 @@ public class PApplet extends Applet
|
||||
online = false;
|
||||
}
|
||||
|
||||
if (javaVersion < 1.3f) {
|
||||
addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent e) {
|
||||
link("http://java.com/");
|
||||
}
|
||||
});
|
||||
// no init to do, so don't cause no trouble, boy
|
||||
return;
|
||||
// call this after making the methods to minimize the
|
||||
// number of places needing the javaVersion crap
|
||||
// (also needs to check online first and create empty
|
||||
// stop method register list)
|
||||
}
|
||||
|
||||
// create a dummy graphics context
|
||||
size(DEFAULT_WIDTH, DEFAULT_HEIGHT);
|
||||
//size(INITIAL_WIDTH, INITIAL_HEIGHT);
|
||||
width = 0; // use this to flag whether the width/height are valid
|
||||
height = 0;
|
||||
|
||||
// this is automatically called in applets
|
||||
// though it's here for applications anyway
|
||||
start();
|
||||
}
|
||||
|
||||
@@ -436,8 +452,9 @@ public class PApplet extends Applet
|
||||
* before getting things rolling.
|
||||
*/
|
||||
public void start() {
|
||||
if (thread != null) return;
|
||||
if (javaVersion < 1.3f) return;
|
||||
|
||||
if (thread != null) return;
|
||||
thread = new Thread(this);
|
||||
thread.start();
|
||||
}
|
||||
@@ -847,11 +864,11 @@ public class PApplet extends Applet
|
||||
screen.fillRect(0, 0, size.width, size.height);
|
||||
screen.setColor(Color.white);
|
||||
screen.setFont(new Font("Dialog", Font.PLAIN, 9));
|
||||
screen.drawString("You need to install", 5, 15);
|
||||
screen.drawString("Java 1.3 or later", 5, 25);
|
||||
screen.drawString("to view this content.", 5, 35);
|
||||
screen.drawString("Click here to visit", 5, 50);
|
||||
screen.drawString("java.com and install.", 5, 60);
|
||||
screen.drawString("You need to install", 3, 15);
|
||||
screen.drawString("Java 1.3 or later", 3, 28);
|
||||
screen.drawString("to view this content.", 3, 41);
|
||||
screen.drawString("Click here to visit", 3, 59);
|
||||
screen.drawString("java.com and install.", 3, 72);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1304,9 +1321,6 @@ public class PApplet extends Applet
|
||||
* mousePressed, and mouseEvent will no longer be set.
|
||||
*/
|
||||
public void mousePressed(MouseEvent e) {
|
||||
if (javaVersion < 1.3f) {
|
||||
link("http://java.com/");
|
||||
}
|
||||
checkMouseEvent(e);
|
||||
}
|
||||
|
||||
@@ -1675,13 +1689,13 @@ public class PApplet extends Applet
|
||||
* or whatever you want as your browser, since Linux doesn't
|
||||
* yet have a standard method for launching URLs.
|
||||
*/
|
||||
public void link(String url, String frame) {
|
||||
public void link(String url, String frameTitle) {
|
||||
if (online) {
|
||||
try {
|
||||
if (frame == null) {
|
||||
if (frameTitle == null) {
|
||||
getAppletContext().showDocument(new URL(url));
|
||||
} else {
|
||||
getAppletContext().showDocument(new URL(url), frame);
|
||||
getAppletContext().showDocument(new URL(url), frameTitle);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
+3
-3
@@ -21,9 +21,9 @@ X how can this be shut off for presentations?
|
||||
X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1114027594;start=0
|
||||
X present mode wasn't reading the stop button color
|
||||
X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Suggestions;action=display;num=1116166897;start=0
|
||||
|
||||
_ java 1.3 required message isn't clickable
|
||||
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1117552076
|
||||
X cleaned up the createFont() functions a little
|
||||
X java 1.3 required message isn't clickable
|
||||
X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1117552076
|
||||
|
||||
_ proper api for access to Graphics2D in PGraphics2
|
||||
_ proper/consistent api to access matrices in PGraphics, PGraphics3 et al
|
||||
|
||||
@@ -14,9 +14,9 @@ X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action
|
||||
X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115787397;start=0
|
||||
X wasn't using runner stop button color
|
||||
X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Suggestions;action=display;num=1116166897;start=0
|
||||
X fix up the video crap because nobody reads the faq
|
||||
X and no cameras means that the list comes back null
|
||||
|
||||
_ fix up the video crap because nobody reads the faq
|
||||
_ and no cameras means that the list comes back null
|
||||
_ ctrl-shift-f is both autoformat and find in reference
|
||||
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=WebsiteBugs;action=display;num=1117490025
|
||||
_ make sure gl examples are working properly before release
|
||||
@@ -33,9 +33,17 @@ _ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Syntax;action=displ
|
||||
_ don't allow subfolders inside the sketchbook folder
|
||||
_ once a sketch is found, don't recurse deeper
|
||||
_ same for libraries, cuz this makes a mess
|
||||
|
||||
_ make simple tool for casey to rebuild all the examples at once
|
||||
_ just make it easier to go to the next sketch
|
||||
_ need to rebuild with this release because of 1.3/1.4 issues
|
||||
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=WebsiteBugs;action=display;num=1117258456
|
||||
|
||||
_ some sort of path/classpath tester/fixer app for windows
|
||||
_ that " norton" thing in the path makes things a mess
|
||||
|
||||
_ add a tiny java tester app to the home page
|
||||
|
||||
fixed previously
|
||||
o runtime exceptions have stopped coming through (on pc only?)
|
||||
o test with florian example for the exception stuff
|
||||
@@ -89,10 +97,23 @@ X add notes to float ref about problems with incrementing by +0.0001
|
||||
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
_ make simple tool for casey to rebuild all the examples at once
|
||||
_ just make it easier to go to the next sketch
|
||||
_ need to rebuild with this release because of 1.3/1.4 issues
|
||||
_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=WebsiteBugs;action=display;num=1117258456
|
||||
_ emacs keybindings
|
||||
_ ctrl-space to set selection start
|
||||
_ selection end is just wherever the cursor is after selection set
|
||||
_ esc-w to copy (clears the mark)
|
||||
_ ctrl-w to cut (clears the mark)
|
||||
_ ctrl-y to paste
|
||||
_ ctrl-s to search inline
|
||||
_ ctrl-r to search inline backwards
|
||||
_ esc-% for query replace
|
||||
_ then y for replace, n for no, ! for all
|
||||
_ ctrl-up arrow for next empty line up
|
||||
_ ctrl-down arrow for next empty line down
|
||||
_ ctrl-left arrow for prev word
|
||||
_ ctrl-right arrow for next work
|
||||
_ ctrl-a start of line
|
||||
_ ctrl-e end of line
|
||||
_ home/end are beginning/end of document (not line)
|
||||
|
||||
_ auto-run the javadoc in dist.sh
|
||||
_ doctor a copy of the css file to use p5 defaults
|
||||
|
||||
+17
-5
@@ -89,6 +89,8 @@ public class Capture extends PImage implements Runnable {
|
||||
} catch (QTException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
/*
|
||||
// this doesn't appear to do jack
|
||||
QTRuntimeException.registerHandler(new QTRuntimeHandler() {
|
||||
public void exceptionOccurred(QTRuntimeException e,
|
||||
Object obj, String s, boolean flag) {
|
||||
@@ -96,6 +98,7 @@ public class Capture extends PImage implements Runnable {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +126,7 @@ public class Capture extends PImage implements Runnable {
|
||||
* time a new frame is available from the capture device.
|
||||
*/
|
||||
public Capture(PApplet parent, String name,
|
||||
int requestWidth, int requestHeight, int framerate) {
|
||||
int requestWidth, int requestHeight, int framerate) {
|
||||
this.parent = parent;
|
||||
this.name = name;
|
||||
this.framerate = framerate;
|
||||
@@ -182,7 +185,8 @@ public class Capture extends PImage implements Runnable {
|
||||
// no such method, or an error.. which is fine, just ignore
|
||||
}
|
||||
|
||||
} catch (StdQTException qte) {
|
||||
} catch (QTException qte) {
|
||||
//} catch (StdQTException qte) {
|
||||
//qte.printStackTrace();
|
||||
|
||||
int errorCode = qte.errorCode();
|
||||
@@ -467,9 +471,17 @@ public class Capture extends PImage implements Runnable {
|
||||
grabber.disposeChannel(channel);
|
||||
return listing;
|
||||
|
||||
} catch (QTException e) {
|
||||
e.printStackTrace();
|
||||
} catch (QTException qte) {
|
||||
int errorCode = qte.errorCode();
|
||||
if (errorCode == Errors.couldntGetRequiredComponent) {
|
||||
throw new RuntimeException("Couldn't find any capture devices, " +
|
||||
"check the FAQ for more info.");
|
||||
} else {
|
||||
qte.printStackTrace();
|
||||
throw new RuntimeException("Problem listing capture devices, " +
|
||||
"check the FAQ for more info.");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
//return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user