mirror of
https://github.com/processing/processing4.git
synced 2026-02-16 11:55:38 +01:00
bringing android mode up to date, tweaking java mode
This commit is contained in:
@@ -31,22 +31,22 @@ import processing.app.EditorToolbar;
|
||||
|
||||
public class JavaToolbar extends EditorToolbar {
|
||||
/** Rollover titles for each button. */
|
||||
static final String title[] = {
|
||||
"Run", "Stop", "New", "Open", "Save", "Export"
|
||||
};
|
||||
// static final String title[] = {
|
||||
// "Run", "Stop", "New", "Open", "Save", "Export"
|
||||
// };
|
||||
|
||||
/** Titles for each button when the shift key is pressed. */
|
||||
static final String titleShift[] = {
|
||||
"Present", "Stop", "New Editor Window", "Open in Another Window", "Save", "Export to Application"
|
||||
};
|
||||
|
||||
static final int RUN = 0;
|
||||
static final int STOP = 1;
|
||||
// static final String titleShift[] = {
|
||||
// "Present", "Stop", "New Editor Window", "Open in Another Window", "Save", "Export to Application"
|
||||
// };
|
||||
|
||||
static final int NEW = 2;
|
||||
static final int OPEN = 3;
|
||||
static final int SAVE = 4;
|
||||
static final int EXPORT = 5;
|
||||
static protected final int RUN = 0;
|
||||
static protected final int STOP = 1;
|
||||
|
||||
static protected final int NEW = 2;
|
||||
static protected final int OPEN = 3;
|
||||
static protected final int SAVE = 4;
|
||||
static protected final int EXPORT = 5;
|
||||
|
||||
// JPopupMenu popup;
|
||||
// JMenu menu;
|
||||
@@ -57,9 +57,22 @@ public class JavaToolbar extends EditorToolbar {
|
||||
|
||||
Image[][] images = loadImages();
|
||||
for (int i = 0; i < 6; i++) {
|
||||
addButton(title[i], titleShift[i], images[i], i == NEW);
|
||||
addButton(getTitle(i, false), getTitle(i, true), images[i], i == NEW);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static public String getTitle(int index, boolean shift) {
|
||||
switch (index) {
|
||||
case RUN: return shift ? "Run" : "Present";
|
||||
case STOP: return "Stop";
|
||||
case NEW: return shift ? "New" : "New Editor Window";
|
||||
case OPEN: return shift ? "Open" : "Open in Another Window";
|
||||
case SAVE: return "Save";
|
||||
case EXPORT: return shift ? "Export Applet" : "Export Application";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void handlePressed(MouseEvent e, int sel) {
|
||||
@@ -100,9 +113,9 @@ public class JavaToolbar extends EditorToolbar {
|
||||
|
||||
case EXPORT:
|
||||
if (shift) {
|
||||
jeditor.handleExportApplication();
|
||||
jeditor.handleExportPackage();
|
||||
} else {
|
||||
jeditor.handleExportApplet();
|
||||
jeditor.handleExportProject();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user