fixed all compile errors, what's next?

This commit is contained in:
benfry
2004-05-16 19:46:14 +00:00
parent f9cb7c759a
commit 14ac186599
6 changed files with 58 additions and 38 deletions

View File

@@ -59,7 +59,9 @@ public class PdeCompiler implements PdeMessageConsumer {
public PdeCompiler() { } // consider this a warning, you werkin soon.
public boolean compile(PdeSketch sketch, String buildPath) {
public boolean compile(PdeSketch sketch, String buildPath)
throws PdeException {
this.sketch = sketch;
this.buildPath = buildPath;
@@ -261,11 +263,10 @@ public class PdeCompiler implements PdeMessageConsumer {
static public String calcBootClassPath() {
if (bootClassPath == null) {
String additional = "";
if (PdeBase.platform == PdeBase.MACOSX) {
additional =
contentsToClassPath(new File("/System/Library/Java/Extensions/"));
} else {
additional = "";
}
bootClassPath = System.getProperty("sun.boot.class.path") + additional;
}

View File

@@ -562,7 +562,7 @@ public class PdeEditor extends JFrame
item = newJMenuItem("Run", 'R');
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doRun(false);
handleRun(false);
}
});
menu.add(item);
@@ -570,7 +570,7 @@ public class PdeEditor extends JFrame
item = newJMenuItem("Present", 'R', true);
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
doRun(true);
handleRun(true);
}
});
menu.add(item);
@@ -945,7 +945,7 @@ public class PdeEditor extends JFrame
}
public void doRun(boolean present) {
public void handleRun(boolean present) {
doClose();
running = true;
buttons.run();

View File

@@ -323,7 +323,7 @@ public class PdeEditorButtons extends JComponent implements MouseInputListener {
if (currentSelection == OPEN) {
if (popup == null) {
//popup = new JPopupMenu();
popup = editor.sketchbook.getPopup();
popup = editor.sketchbook.getPopupMenu();
add(popup);
}
//editor.sketchbook.rebuildPopup(popup);
@@ -337,12 +337,12 @@ public class PdeEditorButtons extends JComponent implements MouseInputListener {
public void mouseReleased(MouseEvent e) {
switch (currentSelection) {
case RUN: editor.doRun(e.isShiftDown()); break;
case RUN: editor.handleRun(e.isShiftDown()); break;
case STOP: setState(RUN, INACTIVE, true); editor.handleStop(); break;
case OPEN: setState(OPEN, INACTIVE, true); break;
case NEW: editor.skNew(); break;
case SAVE: editor.doSave(); break;
case EXPORT: editor.skExport(); break;
case NEW: editor.handleNew(); break;
case SAVE: editor.handleSave2(); break;
case EXPORT: editor.handleExport(); break;
}
currentSelection = -1;
}

View File

@@ -132,7 +132,7 @@ public class PdeEditorHeader extends JComponent /*implements MouseListener*/ {
int y = e.getY();
if ((x > menuLeft) && (x < menuRight)) {
popup.show(this, x, y);
popup.show(PdeEditorHeader.this, x, y);
} else {
for (int i = 0; i < sketch.codeCount; i++) {
@@ -224,7 +224,7 @@ public class PdeEditorHeader extends JComponent /*implements MouseListener*/ {
tabRight[i] = x;
int textLeft = contentLeft + (pieceWidth - textWidth) / 2;
g.setColor(textColor[STATUS]);
g.setColor(textColor[state]);
int baseline = (sizeH + fontAscent) / 2;
//g.drawString(sketch.code[i].name, textLeft, baseline);
g.drawString(text, textLeft, baseline);
@@ -271,9 +271,11 @@ public class PdeEditorHeader extends JComponent /*implements MouseListener*/ {
Unhide >
Reset file list (not needed?)
*/
public JMenu rebuildMenu() {
//public JMenu rebuildMenu() {
public void rebuildMenu() {
if (menu != null) {
menu.removeAll();
} else {
menu = new JMenu();
popup = menu.getPopupMenu();
@@ -327,29 +329,17 @@ public class PdeEditorHeader extends JComponent /*implements MouseListener*/ {
JMenu unhide = new JMenu("Unhide");
ActionListener unhideListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
//System.out.println("unhide " + e);
File from = (File) e.getActionCommand();
String filename = from.getName();
if (!filename.endsWith(".x")) {
System.err.println("error while trying to unhide a file");
} else if (!filename.exists()) {
System.err.println("file no longer exists");
} else {
File to = new File(from.getPath(),
filename.substring(0, filename.length() - 2));
if (!from.renameTo(to)) {
System.err.println("problem while unhiding");
}
}
public void actionPerformed(ActionEvent e) {
sketch.unhide((String) (e.getActionCommand()));
rebuildMenu();
}
};
for (int i = 0; i < hiddenCount; i++) {
item = new JMenuItem(hiddenNames[i]);
item.setActionCommand(hiddenFiles[i]);
for (int i = 0; i < sketch.hiddenCount; i++) {
item = new JMenuItem(sketch.hidden[i].name);
//item.setActionCommand(hiddenFiles[i]);
item.setActionCommand(sketch.hidden[i].name);
item.addActionListener(unhideListener);
hidden.add(item);
unhide.add(item);
}
menu.add(unhide);
@@ -371,7 +361,7 @@ public class PdeEditorHeader extends JComponent /*implements MouseListener*/ {
public void deselectMenu() {
menuVisible = false;
//menuVisible = false; // ??
repaint();
}

View File

@@ -285,7 +285,7 @@ public class PdeEditorStatus extends JPanel implements ActionListener {
int c = event.getKeyChar();
if (c == KeyEvent.VK_ENTER) { // accept the input
editor.skSaveAs2(editField.getText());
editor.handleSaveAs2(editField.getText());
unedit();
event.consume();

View File

@@ -924,7 +924,7 @@ public class PdeSketch {
}
//if (jdkVersionStr.equals("1.3")) { bagelJar = "export13.jar" };
//if (jdkVersionStr.equals("1.4")) { bagelJar = "export14.jar" };
packClassPathIntoZipFile(bagelJar);
packClassPathIntoZipFile(bagelJar, zos);
/*
// add the contents of lib/export to the jar file
@@ -1012,8 +1012,7 @@ public class PdeSketch {
static public void packClassPathIntoZipFile(String path,
ZipOutputStream zos)
throws IOException {
String pieces[] =
BApplet.splitStrings(path, File.pathSeparatorChar);
String pieces[] = BApplet.split(path, File.pathSeparatorChar);
for (int i = 0; i < pieces.length; i++) {
if (pieces[i].length() == 0) continue;
@@ -1135,6 +1134,36 @@ public class PdeSketch {
}
public void unhide(String what) {
//System.out.println("unhide " + e);
File from = null;
for (int i = 0; i < hiddenCount; i++) {
if (hidden[i].name.equals(what)) {
from = hidden[i].file;
}
}
if (from == null) {
System.err.println("could find " + what + " to unhide.");
return;
}
String filename = from.getName();
if (!filename.endsWith(".x")) {
System.err.println("error while trying to unhide a file");
} else if (!from.exists()) {
System.err.println("file no longer exists");
} else {
File to = new File(from.getPath(),
filename.substring(0, filename.length() - 2));
if (!from.renameTo(to)) {
System.err.println("problem while unhiding");
}
}
}
/**
* Returns the path to the sketch folder.
* Used by PdeEditor.handleSaveAs()