X added icon to replace the coffee cup

X see if play being highlighted can be implemented again
X   especially important because of speed issues
This commit is contained in:
benfry
2002-08-02 16:27:14 +00:00
parent fbf187e1ac
commit eae67bdb9b
6 changed files with 75 additions and 17 deletions

View File

@@ -673,6 +673,7 @@ public class KjcEngine extends PdeEngine {
} else {
window = new Frame(); // gonna use ugly windows instead
((Frame)window).setResizable(false);
if (PdeBase.icon != null) ((Frame)window).setIconImage(PdeBase.icon);
window.pack(); // to get a peer, size set later, need for insets
window.addWindowListener(new WindowAdapter() {
@@ -749,6 +750,7 @@ public class KjcEngine extends PdeEngine {
window.show();
applet.requestFocus(); // necessary for key events
}
//System.out.println("KJC RUNNING");
running = true;
//need to parse this code to give a decent error message
@@ -803,6 +805,7 @@ public class KjcEngine extends PdeEngine {
public void stop() { // part of PdeEngine
//System.out.println("PdeEngine.stop");
//System.out.println("KJC NOT RUNNING");
running = false;
//System.out.println();

View File

@@ -12,6 +12,7 @@ public class PdeBase implements ActionListener {
static Properties properties;
static Frame frame;
static String encoding;
static Image icon;
boolean errorState;
PdeEditor editor;
@@ -82,6 +83,11 @@ public class PdeBase implements ActionListener {
public PdeBase() {
frame = new Frame(WINDOW_TITLE);
try {
icon = Toolkit.getDefaultToolkit().getImage("lib/icon.gif");
frame.setIconImage(icon);
} catch (Exception e) { } // fail silently
windowListener = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
//System.exit(0);

View File

@@ -63,6 +63,8 @@ public class PdeEditor extends Panel {
Frame frame;
Window presentationWindow;
RunButtonWatcher watcher;
static final int GRID_SIZE = 33;
static final int INSET_SIZE = 5;
@@ -395,6 +397,7 @@ public class PdeEditor extends Panel {
//doStop();
doClose();
running = true;
//System.out.println("RUNNING");
buttons.run();
presenting = present;
@@ -430,6 +433,8 @@ public class PdeEditor extends Panel {
//System.out.println("done iwth engine.start()");
//}
watcher = new RunButtonWatcher();
} catch (PdeException e) {
//state = RUNNER_ERROR;
//forceStop = false;
@@ -450,6 +455,33 @@ public class PdeEditor extends Panel {
//graphics.requestFocus(); // removed for pde
}
class RunButtonWatcher implements Runnable {
Thread thread;
public RunButtonWatcher() {
thread = new Thread(this);
thread.start();
}
public void run() {
while (Thread.currentThread() == thread) {
KjcEngine eng = (KjcEngine)engine;
if ((engine != null) && (eng.applet != null)) {
//System.out.println(eng.applet.finished);
buttons.running(!eng.applet.finished);
//} else {
//System.out.println("still pooping");
}
try {
Thread.sleep(250);
} catch (InterruptedException e) { }
}
}
public void stop() {
thread.stop();
}
}
public void doStop() {
/*
@@ -463,12 +495,14 @@ public class PdeEditor extends Panel {
//System.out.println("stop1");
if (engine != null) engine.stop();
if (watcher != null) watcher.stop();
//System.out.println("stop2");
message(EMPTY);
//System.out.println("stop3");
buttons.clear();
//System.out.println("stop4");
running = false;
//System.out.println("NOT RUNNING");
//System.out.println("stop5");
}
@@ -557,6 +591,7 @@ public class PdeEditor extends Panel {
// local vars prevent sketchName from being set
public void skNew() {
doStop();
checkModified(SK_NEW);
}
@@ -625,6 +660,7 @@ public class PdeEditor extends Panel {
*/
public void skOpen(String path, String name) {
doStop();
checkModified(SK_OPEN, path, name);
}
@@ -807,6 +843,7 @@ public class PdeEditor extends Panel {
public void skSaveAs() {
doStop();
status.edit("Save sketch as...", sketchName);
}
@@ -944,6 +981,7 @@ public class PdeEditor extends Panel {
public void skExport() {
doStop();
message("Exporting for the web...");
File appletDir = new File(sketchDir, "applet");
handleExport(appletDir, sketchName, new File(sketchDir, "data"));
@@ -1172,12 +1210,13 @@ public class PdeEditor extends Panel {
public void doQuit() {
doStop();
//if (!checkModified()) return;
checkModified(DO_QUIT);
}
protected void doQuit2() {
doStop();
//doStop();
// clear out projects that are empty
if (PdeBase.getBoolean("sketchbook.auto_clean", true)) {
@@ -1420,6 +1459,7 @@ public class PdeEditor extends Panel {
// PdeRecorder.stop();
//#endif
running = false;
//System.out.println("NOT RUNNING");
buttons.clearRun();
message("Done.");
}

View File

@@ -417,12 +417,18 @@ public class PdeEditorButtons extends Panel /*implements ActionListener*/ {
public void run() {
if (inactive == null) return;
clear();
setState(0, ACTIVE, true);
//setState(0, ACTIVE, true);
setState(RUN, ACTIVE, true);
}
public void running(boolean yesno) {
setState(RUN, yesno ? ACTIVE : INACTIVE, true);
}
public void clearRun() {
if (inactive == null) return;
setState(0, INACTIVE, true);
//setState(0, INACTIVE, true);
setState(RUN, INACTIVE, true);
}
/*

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 B

View File

@@ -1,10 +1,23 @@
0042
X fixed ArrayIndexOutOfBoundsException in texture use
X added icon to replace the coffee cup
X see if play being highlighted can be implemented again
X especially important because of speed issues
0042 BUGS
X this code is not performing correctly (triangle strip)
X (see example in reference for expected output)
X -> turns out it's correct, but not great
beginShape(TRIANGLE_STRIP);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();
pde
a _ see if play being highlighted can be implemented again
a _ especially important because of speed issues
macosx
a _ arrow keys don't work in the textarea
@@ -17,17 +30,6 @@ a _ document serial a bit more in release notes
a _ how do we encourage/point to updates?
a _ auto updater? check for releases page in menu?
a _ this code is not performing correctly
a _ (see example in reference for expected output)
beginShape(TRIANGLE_STRIP);
vertex(30, 75);
vertex(40, 20);
vertex(50, 75);
vertex(60, 20);
vertex(70, 75);
vertex(80, 20);
vertex(90, 75);
endShape();
@@ -203,6 +205,7 @@ b _ queue for people reporting things externally
b _ bugzilla but simpler
b _ would also be nice for people to be able to vote on features
b _ save serial port on close
b _ probably should doClose() on new/open instead of doStop()
PDE / medium