mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 19:31:16 +01:00
blowing up EditorToolbar a bit
This commit is contained in:
@@ -153,7 +153,7 @@ public class JavaEditor extends Editor {
|
||||
|
||||
|
||||
public EditorToolbar createToolbar() {
|
||||
return new JavaToolbar(this, base);
|
||||
return new JavaToolbar(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ public class JavaEditor extends Editor {
|
||||
|
||||
|
||||
public JMenu buildSketchMenu() {
|
||||
JMenuItem runItem = Toolkit.newJMenuItem(JavaToolbar.getTitle(JavaToolbar.RUN, false), 'R');
|
||||
JMenuItem runItem = Toolkit.newJMenuItem(Language.text("toolbar.run"), 'R');
|
||||
runItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (isDebuggerEnabled()) {
|
||||
@@ -200,14 +200,14 @@ public class JavaEditor extends Editor {
|
||||
}
|
||||
});
|
||||
|
||||
JMenuItem presentItem = Toolkit.newJMenuItemShift(JavaToolbar.getTitle(JavaToolbar.RUN, true), 'R');
|
||||
JMenuItem presentItem = Toolkit.newJMenuItemShift(Language.text("toolbar.present"), 'R');
|
||||
presentItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
handlePresent();
|
||||
}
|
||||
});
|
||||
|
||||
JMenuItem stopItem = new JMenuItem(JavaToolbar.getTitle(JavaToolbar.STOP, false));
|
||||
JMenuItem stopItem = new JMenuItem(Language.text("toolbar.stop"));
|
||||
stopItem.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (isDebuggerEnabled()) {
|
||||
@@ -1017,7 +1017,8 @@ public class JavaEditor extends Editor {
|
||||
public void run() {
|
||||
prepareRun();
|
||||
try {
|
||||
toolbar.activate(JavaToolbar.RUN);
|
||||
// toolbar.activate(JavaToolbar.RUN);
|
||||
toolbar.activateRun();
|
||||
runtime = jmode.handleRun(sketch, JavaEditor.this);
|
||||
// System.out.println("runtime now " + runtime);
|
||||
} catch (Exception e) {
|
||||
@@ -1033,7 +1034,8 @@ public class JavaEditor extends Editor {
|
||||
public void run() {
|
||||
prepareRun();
|
||||
try {
|
||||
toolbar.activate(JavaToolbar.RUN);
|
||||
// toolbar.activate(JavaToolbar.RUN);
|
||||
toolbar.activateRun();
|
||||
runtime = jmode.handlePresent(sketch, JavaEditor.this);
|
||||
} catch (Exception e) {
|
||||
statusError(e);
|
||||
@@ -1052,7 +1054,8 @@ public class JavaEditor extends Editor {
|
||||
debugger.stopDebug();
|
||||
|
||||
} else {
|
||||
toolbar.activate(JavaToolbar.STOP);
|
||||
// toolbar.activate(JavaToolbar.STOP);
|
||||
toolbar.activateStop();
|
||||
|
||||
try {
|
||||
//jmode.handleStop();
|
||||
@@ -1066,8 +1069,10 @@ public class JavaEditor extends Editor {
|
||||
statusError(e);
|
||||
}
|
||||
|
||||
toolbar.deactivate(JavaToolbar.RUN);
|
||||
toolbar.deactivate(JavaToolbar.STOP);
|
||||
// toolbar.deactivate(JavaToolbar.RUN);
|
||||
// toolbar.deactivate(JavaToolbar.STOP);
|
||||
toolbar.deactivateStop();
|
||||
toolbar.deactivateRun();
|
||||
|
||||
// focus the PDE again after quitting presentation mode [toxi 030903]
|
||||
toFront();
|
||||
@@ -1161,7 +1166,8 @@ public class JavaEditor extends Editor {
|
||||
public void statusError(String what) {
|
||||
super.statusError(what);
|
||||
// new Exception("deactivating RUN").printStackTrace();
|
||||
toolbar.deactivate(JavaToolbar.RUN);
|
||||
// toolbar.deactivate(JavaToolbar.RUN);
|
||||
toolbar.deactivateRun();
|
||||
}
|
||||
|
||||
|
||||
@@ -1946,7 +1952,8 @@ public class JavaEditor extends Editor {
|
||||
|
||||
protected void activateRun() {
|
||||
enableDebug.setEnabled(false);
|
||||
toolbar.activate(JavaToolbar.RUN);
|
||||
// toolbar.activate(JavaToolbar.RUN);
|
||||
toolbar.activateRun();
|
||||
}
|
||||
|
||||
|
||||
@@ -1960,7 +1967,8 @@ public class JavaEditor extends Editor {
|
||||
// if (toolbar instanceof DebugToolbar){
|
||||
// toolbar.deactivate(DebugToolbar.RUN);
|
||||
// } else {
|
||||
toolbar.deactivate(JavaToolbar.RUN);
|
||||
// toolbar.deactivate(JavaToolbar.RUN);
|
||||
toolbar.deactivateRun();
|
||||
enableDebug.setEnabled(true);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -24,12 +24,24 @@ import java.awt.event.MouseEvent;
|
||||
|
||||
//import javax.swing.JPopupMenu;
|
||||
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.app.EditorToolbar;
|
||||
import processing.app.Language;
|
||||
|
||||
|
||||
public class JavaToolbar extends EditorToolbar {
|
||||
|
||||
public JavaToolbar(Editor editor) {
|
||||
super(editor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public class JavaToolbar extends EditorToolbar {
|
||||
static protected final int RUN = 0;
|
||||
static protected final int STOP = 1;
|
||||
@@ -75,4 +87,5 @@ public class JavaToolbar extends EditorToolbar {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -1,40 +0,0 @@
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
Copyright (c) 2012-15 The Processing Foundation
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2
|
||||
as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
package processing.mode.java.tweak;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.mode.java.JavaToolbar;
|
||||
|
||||
public class TweakToolbar extends JavaToolbar {
|
||||
|
||||
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;
|
||||
|
||||
public TweakToolbar(Editor editor, Base base) {
|
||||
super(editor, base);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user