diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index f23dadc18..7a0824b3e 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -197,6 +197,7 @@ public class PApplet implements PConstants { /** * Path to sketch folder. Previously undocumented, made private in 3.0a5 * so that people use the sketchPath() method and it's inited properly. + * Call sketchPath() once to set the default. */ private String sketchPath; // public String sketchPath; diff --git a/core/todo.txt b/core/todo.txt index 2bfa2d722..c28264b18 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -79,6 +79,10 @@ o sketchDisplay() -> 0 for all, or 1, 2, 3... X added --span option X play with improvements to full screen here +_ exitCalled() and exitActual made public by Andres, breaks Python +_ also not API we want to expose, so sort this out +_ destroy() removed, but bring back? is that better than dispose()? +_ Python Mode has a hook for when it's called _ split 'present' and 'full screen'? _ --full-screen causes considerable flicker at this point diff --git a/java/src/processing/mode/java/pdex/JavaTextArea.java b/java/src/processing/mode/java/pdex/JavaTextArea.java index 790363000..33b730239 100644 --- a/java/src/processing/mode/java/pdex/JavaTextArea.java +++ b/java/src/processing/mode/java/pdex/JavaTextArea.java @@ -54,7 +54,7 @@ public class JavaTextArea extends JEditTextArea { protected MouseListener[] mouseListeners; // cached mouselisteners, these are wrapped by MouseHandler // contains line background colors - protected Map lineColors = new HashMap(); + protected Map lineColors = new HashMap(); // [px] space added to the left and right of gutter chars protected int gutterPadding; // = 3; @@ -62,25 +62,25 @@ public class JavaTextArea extends JEditTextArea { protected Color gutterLineColor; // = new Color(233, 233, 233); // color of vertical separation line /// the text marker for highlighting breakpoints in the gutter - public String breakpointMarker = "<>"; + public String breakpointMarker = "<>"; /// the text marker for highlighting the current line in the gutter - public String currentLineMarker = "->"; + public String currentLineMarker = "->"; /// maps line index to gutter text - protected Map gutterText = new HashMap(); + protected Map gutterText = new HashMap(); /// maps line index to gutter text color - protected Map gutterTextColors = new HashMap(); + protected Map gutterTextColors = new HashMap(); protected ErrorCheckerService errorCheckerService; - - + + protected JavaTextAreaPainter getCustomPainter() { return (JavaTextAreaPainter) painter; } - - + + //public JavaTextArea(TextAreaDefaults defaults, InputHandler inputHandler, JavaEditor editor) { //public JavaTextArea(JavaEditor editor) { public JavaTextArea(TextAreaDefaults defaults, JavaEditor editor) { @@ -88,8 +88,8 @@ public class JavaTextArea extends JEditTextArea { //super(defaults, inputHandler); this.editor = editor; - // removed all this since we have the createPainter() method and we - // won't have to remove/re-add the custom painter object [fry 150122] + // removed all this since we have the createPainter() method and we + // won't have to remove/re-add the custom painter object [fry 150122] // // replace the painter: // // first save listeners, these are package-private in JEditTextArea, so not accessible // ComponentListener[] componentListeners = painter.getComponentListeners(); @@ -134,12 +134,12 @@ public class JavaTextArea extends JEditTextArea { interactiveMode = false; addPrevListeners(); } - - + + protected JavaTextAreaPainter createPainter(final TextAreaDefaults defaults) { return new JavaTextAreaPainter(this, defaults); } - + /** * Sets ErrorCheckerService and loads theme for TextArea(XQMode) @@ -153,7 +153,7 @@ public class JavaTextArea extends JEditTextArea { getCustomPainter().setECSandTheme(ecs, mode); } - + /** * Handles KeyEvents for TextArea (code completion begins from here). */ @@ -167,8 +167,8 @@ public class JavaTextArea extends JEditTextArea { return; } } - - } else if (evt.getKeyCode() == KeyEvent.VK_ENTER && + + } else if (evt.getKeyCode() == KeyEvent.VK_ENTER && evt.getID() == KeyEvent.KEY_PRESSED) { if (suggestion != null) { if (suggestion.isVisible()) { @@ -223,14 +223,14 @@ public class JavaTextArea extends JEditTextArea { if (!editor.hasJavaTabs()) { if (evt.getID() == KeyEvent.KEY_TYPED) { processCompletionKeys(evt); - + } else if (Base.isMacOS() && evt.getID() == KeyEvent.KEY_RELEASED) { processControlSpace(evt); } } } - - + + // #2699 - Special case for OS X, where Ctrl-Space is not detected as Key_Typed -_- private void processControlSpace(final KeyEvent event) { if (event.getKeyCode() == KeyEvent.VK_SPACE && event.isControlDown()) { @@ -248,7 +248,7 @@ public class JavaTextArea extends JEditTextArea { } } - + private void processCompletionKeys(final KeyEvent event) { char keyChar = event.getKeyChar(); if (keyChar == KeyEvent.VK_ENTER || @@ -292,7 +292,7 @@ public class JavaTextArea extends JEditTextArea { } } - + /** Kickstart auto-complete suggestions */ private void prepareSuggestions(final KeyEvent evt){ SwingWorker worker = new SwingWorker() { @@ -309,7 +309,7 @@ public class JavaTextArea extends JEditTextArea { worker.execute(); } - + /** * Retrieves the word on which the mouse pointer is present * @param evt - the MouseEvent which triggered this method @@ -503,7 +503,7 @@ public class JavaTextArea extends JEditTextArea { } - + // /** // * Retrieve the total width of the gutter area. // * @return gutter width in pixels @@ -519,7 +519,7 @@ public class JavaTextArea extends JEditTextArea { // return textWidth + 2 * gutterPadding; // } // -// +// // /** // * Retrieve the width of margins applied to the left and right of the gutter // * text. @@ -533,7 +533,7 @@ public class JavaTextArea extends JEditTextArea { // return gutterPadding; // } - + /** * Set the gutter text of a specific line. * @@ -547,7 +547,7 @@ public class JavaTextArea extends JEditTextArea { painter.invalidateLine(lineIdx); } - + /** * Set the gutter text and color of a specific line. * @@ -562,7 +562,7 @@ public class JavaTextArea extends JEditTextArea { gutterTextColors.put(lineIdx, textColor); setGutterText(lineIdx, text); } - + /** * Clear the gutter text of a specific line. @@ -575,7 +575,7 @@ public class JavaTextArea extends JEditTextArea { painter.invalidateLine(lineIdx); } - + /** * Clear all gutter text. */ @@ -597,7 +597,7 @@ public class JavaTextArea extends JEditTextArea { return gutterText.get(lineIdx); } - + /** * Retrieve the gutter text color for a specific line. * @@ -609,7 +609,7 @@ public class JavaTextArea extends JEditTextArea { return gutterTextColors.get(lineIdx); } - + /** * Set the background color of a line. * @@ -634,7 +634,7 @@ public class JavaTextArea extends JEditTextArea { painter.invalidateLine(lineIdx); } - + /** * Clear all line background colors. */ @@ -645,7 +645,7 @@ public class JavaTextArea extends JEditTextArea { lineColors.clear(); } - + /** * Get a lines background color. * @@ -657,7 +657,7 @@ public class JavaTextArea extends JEditTextArea { return lineColors.get(lineIdx); } - + /** * Convert a character offset to a horizontal pixel position inside the text * area. Overridden to take gutter width into account. @@ -673,7 +673,7 @@ public class JavaTextArea extends JEditTextArea { return super._offsetToX(line, offset) + Editor.LEFT_GUTTER; } - + /** * Convert a horizontal pixel position to a character offset. Overridden to * take gutter width into account. @@ -689,7 +689,7 @@ public class JavaTextArea extends JEditTextArea { return super.xToOffset(line, x - Editor.LEFT_GUTTER); } - + /** * Custom mouse handler. Implements double clicking in the gutter area to * toggle breakpoints, sets default cursor (instead of text cursor) in the @@ -796,7 +796,7 @@ public class JavaTextArea extends JEditTextArea { } */ - + /** * Calculates location of caret and displays the suggestion popup at the location. * @@ -805,7 +805,7 @@ public class JavaTextArea extends JEditTextArea { */ protected void showSuggestion(DefaultListModel listModel, String subWord) { hideSuggestion(); - + if (listModel.size() == 0) { Base.log("TextArea: No suggestions to show."); @@ -826,13 +826,13 @@ public class JavaTextArea extends JEditTextArea { if (subWord.length() < 2) { return; } - suggestion = new CompletionPanel(this, position, subWord, + suggestion = new CompletionPanel(this, position, subWord, listModel, location, editor); requestFocusInWindow(); } } - + /** Hides suggestion popup */ public void hideSuggestion() { if (suggestion != null) { diff --git a/todo.txt b/todo.txt index a10773c95..8c9a5bdae 100644 --- a/todo.txt +++ b/todo.txt @@ -28,6 +28,7 @@ X remove code that's moving the sketch path arg later X https://github.com/processing/processing/commit/0a14835e6f5f4766b022e73a8fe562318636727c X the .macosx, .linux, etc prefs should be stripped X only use them on first load, and merge into preferences.txt +X auto-insert after antlr @SuppressWarnings({ "unused", "unchecked", "cast" }) _ install/remove buttons not working in the managers _ https://github.com/processing/processing/issues/3172 @@ -209,6 +210,8 @@ _ https://github.com/processing/processing/issues/2953 _ don't return here, allow contrib types to fail: _ https://github.com/processing/processing/blob/master/app/src/processing/app/contrib/ContributionListing.java#L509 +_ need to handle the 2.x to 3.x sketchbook transition + _ Linux throwing IllegalStateException: Buffers have not been created _ in render() (called from blit) PSurfaceAWT:301 @@ -270,7 +273,6 @@ _ make examples pull/build automatic during dist _ add span screens pref (near the display pref) _ add checkbox for spans to export dialog _ remove "save before running" message -_ auto-insert after antlr @SuppressWarnings({ "unused", "unchecked", "cast" }) from the todo list