diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 8b5ddb134..8f03f37db 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -306,7 +306,7 @@ public abstract class Editor extends JFrame implements RunnerListener { contentPain.add(box); // get shift down/up events so we can show the alt version of toolbar buttons - textarea.addKeyListener(toolbar); + //textarea.addKeyListener(toolbar); // end an undo-chunk any time the caret moves unless it's when text is edited textarea.addCaretListener(new CaretListener() { diff --git a/app/src/processing/app/EditorToolbar.java b/app/src/processing/app/EditorToolbar.java index 034553bbf..43345733a 100644 --- a/app/src/processing/app/EditorToolbar.java +++ b/app/src/processing/app/EditorToolbar.java @@ -3,7 +3,8 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2004-13 Ben Fry and Casey Reas + Copyirght (c) 2012-15 The Processing Foundation + Copyright (c) 2004-12 Ben Fry and Casey Reas Copyright (c) 2001-04 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify @@ -22,564 +23,599 @@ package processing.app; -import java.awt.*; -import java.awt.event.*; -import java.awt.image.BufferedImage; -import java.util.ArrayList; +//import java.awt.event.ActionEvent; -import javax.swing.*; -import javax.swing.event.*; +import javax.swing.JPanel; /** * Run/Stop button plus Mode selection */ -public abstract class EditorToolbar extends JComponent implements MouseInputListener, KeyListener { - - /** Width of each toolbar button. */ - static final int BUTTON_WIDTH = 27; - /** Height of each toolbar button. */ -// static final int BUTTON_HEIGHT = 32; - /** The amount of space between groups of buttons on the toolbar. */ - static final int BUTTON_GAP = 5; - /** Size (both width and height) of the buttons in the source image. */ - static final int BUTTON_IMAGE_SIZE = 33; - - static final int INACTIVE = 0; - static final int ROLLOVER = 1; - static final int ACTIVE = 2; - - protected Base base; +public class EditorToolbar extends JPanel { protected Editor editor; + protected Base base; protected Mode mode; - Image offscreen; - int width, height; - - Color bgColor; - boolean hiding; - Color hideColor; - - protected Button rollover; - - Font statusFont; - int statusAscent; - Color statusColor; + EditorButton runButton; + EditorButton stopButton; - boolean shiftPressed; - - // what the mode indicator looks like - Color modeButtonColor; - Font modeTextFont; - int modeTextAscent; - Color modeTextColor; - String modeTitle; - int modeX1, modeY1; - int modeX2, modeY2; - JMenu modeMenu; - protected ArrayList