This commit is contained in:
codeanticode
2015-10-02 00:11:33 -04:00
19 changed files with 453 additions and 296 deletions
+2 -2
View File
@@ -55,9 +55,9 @@ import processing.data.StringList;
public class Base {
// Added accessors for 0218 because the UpdateCheck class was not properly
// updating the values, due to javac inlining the static final values.
static private final int REVISION = 246;
static private final int REVISION = 247;
/** This might be replaced by main() if there's a lib/version.txt file. */
static private String VERSION_NAME = "0246"; //$NON-NLS-1$
static private String VERSION_NAME = "0247"; //$NON-NLS-1$
/** Set true if this a proper release rather than a numbered revision. */
/** True if heavy debugging error/log messages are enabled */
+43 -34
View File
@@ -39,6 +39,7 @@ import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
@@ -143,44 +144,19 @@ public class Sketch {
codeFolder = new File(folder, "code");
dataFolder = new File(folder, "data");
// get list of files in the sketch folder
String list[] = folder.list();
List<String> filenames = new ArrayList<>();
List<String> extensions = new ArrayList<>();
// reset these because load() may be called after an
// external editor event. (fix for 0099)
codeCount = 0;
getSketchCodeFiles(filenames, extensions);
code = new SketchCode[list.length];
codeCount = filenames.size();
code = new SketchCode[codeCount];
String[] extensions = mode.getExtensions();
for (String filename : list) {
// Ignoring the dot prefix files is especially important to avoid files
// with the ._ prefix on Mac OS X. (You'll see this with Mac files on
// non-HFS drives, i.e. a thumb drive formatted FAT32.)
if (filename.startsWith(".")) continue;
// Don't let some wacko name a directory blah.pde or bling.java.
if (new File(folder, filename).isDirectory()) continue;
// figure out the name without any extension
String base = filename;
// now strip off the .pde and .java extensions
for (String extension : extensions) {
if (base.toLowerCase().endsWith("." + extension)) {
base = base.substring(0, base.length() - (extension.length() + 1));
// Don't allow people to use files with invalid names, since on load,
// it would be otherwise possible to sneak in nasty filenames. [0116]
if (isSanitaryName(base)) {
code[codeCount++] =
new SketchCode(new File(folder, filename), extension);
}
}
}
for (int i = 0; i < codeCount; i++) {
String filename = filenames.get(i);
String extension = extensions.get(i);
code[i] = new SketchCode(new File(folder, filename), extension);
}
// Remove any code that wasn't proper
code = (SketchCode[]) PApplet.subset(code, 0, codeCount);
// move the main class to the first tab
// start at 1, if it's at zero, don't bother
@@ -204,6 +180,39 @@ public class Sketch {
}
public void getSketchCodeFiles(List<String> outFilenames,
List<String> outExtensions) {
// get list of files in the sketch folder
String list[] = folder.list();
for (String filename : list) {
// Ignoring the dot prefix files is especially important to avoid files
// with the ._ prefix on Mac OS X. (You'll see this with Mac files on
// non-HFS drives, i.e. a thumb drive formatted FAT32.)
if (filename.startsWith(".")) continue;
// Don't let some wacko name a directory blah.pde or bling.java.
if (new File(folder, filename).isDirectory()) continue;
// figure out the name without any extension
String base = filename;
// now strip off the .pde and .java extensions
for (String extension : mode.getExtensions()) {
if (base.toLowerCase().endsWith("." + extension)) {
base = base.substring(0, base.length() - (extension.length() + 1));
// Don't allow people to use files with invalid names, since on load,
// it would be otherwise possible to sneak in nasty filenames. [0116]
if (isSanitaryName(base)) {
if (outFilenames != null) outFilenames.add(filename);
if (outExtensions != null) outExtensions.add(extension);
}
}
}
}
}
/**
* Reload the current sketch. Used to update the text area when
* an external editor is in use.
+15 -11
View File
@@ -23,6 +23,7 @@
package processing.app;
import java.io.*;
import java.nio.file.Files;
import java.util.Enumeration;
import java.util.Vector;
import java.util.zip.*;
@@ -301,7 +302,7 @@ public class Util {
/**
* Remove all files in a directory and the directory itself.
* Prints error messages with failed filenames.
* Prints error messages with failed filenames. Does not follow symlinks.
*/
static public boolean removeDir(File dir) {
return removeDir(dir, true);
@@ -310,22 +311,25 @@ public class Util {
/**
* Remove all files in a directory and the directory itself.
* Optinally prints error messages with failed filenames.
* Does not follow symlinks.
*/
static public boolean removeDir(File dir, boolean printErrorMessages) {
if (!dir.exists()) return true;
boolean result = true;
File[] files = dir.listFiles();
if (files != null) {
for (File child : files) {
if (child.isFile()) {
boolean deleted = child.delete();
if (!deleted && printErrorMessages) {
System.err.println("Could not delete " + child.getAbsolutePath());
if (!Files.isSymbolicLink(dir.toPath())) {
File[] files = dir.listFiles();
if (files != null) {
for (File child : files) {
if (child.isFile()) {
boolean deleted = child.delete();
if (!deleted && printErrorMessages) {
System.err.println("Could not delete " + child.getAbsolutePath());
}
result &= deleted;
} else if (child.isDirectory()) {
result &= removeDir(child, printErrorMessages);
}
result &= deleted;
} else if (child.isDirectory()) {
result &= removeDir(child, printErrorMessages);
}
}
}
@@ -585,6 +585,11 @@ public class ContributionListing {
count++;
}
}
for (ExamplesContribution ec : base.getExampleContribs()) {
if (hasUpdates(ec)) {
count++;
}
}
return count;
}
+32 -8
View File
@@ -26,13 +26,18 @@ import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Window;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import javax.swing.ImageIcon;
import processing.app.Base;
import processing.app.Platform;
public class About extends Window {
@@ -65,23 +70,42 @@ public class About extends Window {
}
});
addKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
System.out.println(e);
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
dispose();
}
}
});
// Dimension screen = Toolkit.getScreenSize();
// setBounds((screen.width-width)/2, (screen.height-height)/2, width, height);
setLocationRelativeTo(null);
setSize(width, height);
// setLocationRelativeTo(null);
setLocationRelativeTo(frame);
setVisible(true);
requestFocus();
}
public void paint(Graphics g) {
// Graphics2D g2 = Toolkit.prepareGraphics(g);
// g2.scale(0.5, 0.5);
Graphics2D g2 = (Graphics2D) g;
// OS X looks better doing its own thing, Windows and Linux need AA
g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
Platform.isMacOS() ?
RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT :
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.drawImage(icon.getImage(), 0, 0, width, height, null);
// g.setColor(Color.ORANGE);
// g.fillRect(0, 0, width, height);
// Graphics2D g2 = (Graphics2D) g;
// g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
// RenderingHints.VALUE_TEXT_ANTIALIAS_OFF);
g.setFont(Toolkit.getSansFont(Font.PLAIN, 10));
//g.setFont(new Font("SansSerif", Font.PLAIN, 10)); //$NON-NLS-1$
g.setColor(Color.white);
g.setFont(Toolkit.getSansFont(12, Font.PLAIN));
g.setColor(Color.WHITE);
g.drawString(Base.getVersionName(), 26, 29);
}
}
+6 -14
View File
@@ -5,7 +5,6 @@ import java.awt.Frame;
import java.awt.event.WindowEvent;
import java.awt.event.WindowFocusListener;
import java.io.File;
import java.io.FilenameFilter;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
@@ -79,19 +78,12 @@ public class ChangeDetector implements WindowFocusListener {
private boolean checkFileCount() {
// check file count first
File sketchFolder = sketch.getFolder();
File[] sketchFiles = sketchFolder.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String filename) {
for (String ext : editor.getMode().getExtensions()) {
if (filename.toLowerCase().endsWith(ext.toLowerCase())) {
return true;
}
}
return false;
}
});
int fileCount = sketchFiles.length;
List<String> filenames = new ArrayList<>();
sketch.getSketchCodeFiles(filenames, null);
int fileCount = filenames.size();
// Was considering keeping track of the last "known" number of files
// (instead of using sketch.getCodeCount() here) in case the user
+11 -2
View File
@@ -73,7 +73,7 @@ public class EditorFooter extends Box {
Color[] tabColor = new Color[2];
Color updateColor;
int updateLeft, updateRight;
int updateLeft;
Editor editor;
@@ -87,6 +87,7 @@ public class EditorFooter extends Box {
int imageW, imageH;
Image gradient;
Color bgColor;
JPanel cardPanel;
CardLayout cardLayout;
@@ -172,6 +173,11 @@ public class EditorFooter extends Box {
updateColor = mode.getColor("footer.updates.color");
gradient = mode.makeGradient("footer", 400, HIGH);
// Set the default background color in case the window size reported
// incorrectly by the OS, or we miss an update event of some kind
// https://github.com/processing/processing/issues/3919
bgColor = mode.getColor("footer.gradient.bottom");
setBackground(bgColor);
}
@@ -191,7 +197,7 @@ public class EditorFooter extends Box {
repaint();
}
}
if (x > updateLeft) {
if (updateCount > 0 && x > updateLeft) {
ContributionManager.openUpdates();
}
}
@@ -293,6 +299,9 @@ public class EditorFooter extends Box {
final String updateLabel = "Updates";
String updatesStr = "" + updateCount;
double countWidth = font.getStringBounds(updatesStr, frc).getWidth();
if (fontAscent > countWidth) {
countWidth = fontAscent;
}
float diameter = (float) (countWidth * 1.65f);
float ex = getWidth() - Editor.RIGHT_GUTTER - diameter;
float ey = (getHeight() - diameter) / 2;
+1 -1
View File
@@ -393,9 +393,9 @@
<fileset dir="${examples.dir}" />
</copy>
<!-- removed ignoreerrors="true" for 3.0 release process -->
<get src="http://download.processing.org/reference.zip"
dest="../java/reference.zip"
ignoreerrors="true"
usetimestamp="true" />
<unzip dest="${target.path}/modes/java"
+109
View File
@@ -1,3 +1,112 @@
PROCESSING 3.0 (REV 0246) - 30 September 2015, 3pm ET
This one is huge.
This document covers (in detail) the individual changes between releases.
For an overview abut what's new, different, and exceptional in 3.0, read:
https://github.com/processing/processing/wiki/Changes-in-3.0
Most of the changes from the previous beta involve the final beautification
of the GUI, and the beatification of the error checker and auto-completion
features.
[ gui updates and fixes ]
+ "Saving" messages never clear on "Save As"
https://github.com/processing/processing/issues/3861
+ Show number of updates available in the footer
https://github.com/processing/processing/issues/3518
https://github.com/processing/processing/pull/3896
https://github.com/processing/processing/pull/3901
+ Click the "Updates" item in the footer to open the Contribution Manager
+ Make breakpoints more prominent
https://github.com/processing/processing/issues/3307
+ Implement the side gradient on the Editor
+ Replace startup/about screen (1x and 2x versions)
https://github.com/processing/processing/issues/3665
+ Implement splash screen on OS X. Shout out to this article:
http://www.randelshofer.ch/oop/javasplash/javasplash.html
+ Make the left edge of the Console match the Error List
https://github.com/processing/processing/issues/3904
+ Windows suggests "Documents" as a new location for the 3.0 sketchbook
https://github.com/processing/processing/issues/3920
[ errors and warnings: the checking and completion story ]
+ error checker/suggestions fixes
https://github.com/processing/processing/pull/3871
https://github.com/processing/processing/pull/3879
+ Hide useless error in error checker
https://github.com/processing/processing/pull/3887
+ Error checker updates for toggle and listeners
https://github.com/processing/processing/pull/3915
+ If fewer lines in sketch than can be shown in window, show ticks adjacent
https://github.com/processing/processing/pull/3903
+ Distinguish errors and warnings in the error list
https://github.com/processing/processing/issues/3406
+ Clicking an error or warning should give the focus back to the editor
https://github.com/processing/processing/pull/3905
+ Fix placement and visual design when showing error on hover
https://github.com/processing/processing/issues/3173
+ Fix the design of the completions window, new icons, etc
https://github.com/processing/processing/issues/3906
+ Update status error/warning when changing the line
https://github.com/processing/processing/pull/3907
[ contribution manager ]
+ Contributions filter ignored after clicking Install
https://github.com/processing/processing/issues/3826
https://github.com/processing/processing/pull/3872
https://github.com/processing/processing/pull/3883
+ Exception in thread "Contribution List Downloader"
https://github.com/processing/processing/issues/3882
https://github.com/processing/processing/pull/3884
+ Grab bag of Contribution Manager fixes
https://github.com/processing/processing/issues/3895
https://github.com/processing/processing/pull/3897
+ ArrayIndexOutOfBoundsException freak out when clicking the header line
[ plumbing ]
+ Fix nasty file counting problem in the change detector
https://github.com/processing/processing/pull/3917
https://github.com/processing/processing/issues/3898
https://github.com/processing/processing/issues/3387
+ Clean up delete dir function
https://github.com/processing/processing/pull/3910
+ Don't follow symlinks when deleting directories
https://github.com/processing/processing/pull/3916
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 3.0b7 (REV 0245) - 22 September 2015
It's 8:57pm and Jakub and Ben are still holed up at Fathom's studio in Boston.
+35
View File
@@ -1,3 +1,38 @@
0246 the papal visit (3.0)
X implement high-performance/async image saving
X Use PBOs for async texture copy
X https://github.com/processing/processing/issues/3569
X https://github.com/processing/processing/pull/3863
X https://github.com/processing/processing/pull/3869
X Textures disappearing in beta 7 (might be WeakReference regression)
X https://github.com/processing/processing/issues/3858
X https://github.com/processing/processing/pull/3874
X https://github.com/processing/processing/pull/3875
X Convert all documented hacky keys in OpenGL
X https://github.com/processing/processing/pull/3888
X Frame size displays incorrectly if surface.setResizable(true)
X https://github.com/processing/processing/issues/3868
X https://github.com/processing/processing/pull/3880
X displayWidth, displayHeight, full screen, display number
X https://github.com/processing/processing/pull/3893
X https://github.com/processing/processing/issues/3865
X OpenGL with fullScreen() always opens on default display
X https://github.com/processing/processing/issues/3889
X https://github.com/processing/processing/issues/3797
X https://github.com/processing/processing/pull/3892
cleaning
o move AWT image loading into PImageAWT
o look into how GL and FX will handle from there
o run only the necessary pieces on the EDT
o in part because FX doesn't even use the EDT
o re-check the Linux frame visibility stuff
X cleaned most of this as far as we can go
o Ubuntu Unity prevents full screen from working properly
X https://github.com/processing/processing/issues/3158
X can't fix; upstream problem, added to the wiki
0245 core (3.0b7)
X surface.setLocation(x,y) not working with the default renderer
X https://github.com/processing/processing/issues/3821
+1 -1
View File
@@ -6408,7 +6408,7 @@ public class PApplet implements PConstants {
fileChooser.setDialogTitle(prompt);
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
if (defaultSelection != null) {
fileChooser.setSelectedFile(defaultSelection);
fileChooser.setCurrentDirectory(defaultSelection);
}
int result = fileChooser.showOpenDialog(parentFrame);
+7 -45
View File
@@ -1,33 +1,4 @@
0246 the papal visit
X implement high-performance/async image saving
X Use PBOs for async texture copy
X https://github.com/processing/processing/issues/3569
X https://github.com/processing/processing/pull/3863
X https://github.com/processing/processing/pull/3869
X Textures disappearing in beta 7 (might be WeakReference regression)
X https://github.com/processing/processing/issues/3858
X https://github.com/processing/processing/pull/3874
X https://github.com/processing/processing/pull/3875
X Convert all documented hacky keys in OpenGL
X https://github.com/processing/processing/pull/3888
X Frame size displays incorrectly if surface.setResizable(true)
X https://github.com/processing/processing/issues/3868
X https://github.com/processing/processing/pull/3880
X displayWidth, displayHeight, full screen, display number
X https://github.com/processing/processing/pull/3893
X https://github.com/processing/processing/issues/3865
X OpenGL with fullScreen() always opens on default display
X https://github.com/processing/processing/issues/3889
X https://github.com/processing/processing/issues/3797
X https://github.com/processing/processing/pull/3892
cleaning
o move AWT image loading into PImageAWT
o look into how GL and FX will handle from there
o run only the necessary pieces on the EDT
o in part because FX doesn't even use the EDT
o re-check the Linux frame visibility stuff
X cleaned most of this as far as we can go
0247 (3.0.1)
known
@@ -35,9 +6,11 @@ _ window must close when using file dialogs with OpenGL on Windows
_ https://github.com/processing/processing/issues/3831
_ P2D and P3D windows behave strangely when larger than the screen size
_ https://github.com/processing/processing/issues/3401
_ window loses focus after maximizing
_ https://github.com/processing/processing/issues/3339
3.0 final
misc
_ move blending calculations from PImage into PGraphics
_ tricky because that means moving blend_resize() as well
_ and should that live in PGraphics or be its own class or ??
@@ -54,6 +27,7 @@ _ SVG only exports last frame
_ possibly because Java2D is disposing the Graphics2D in between?
_ https://github.com/processing/processing/issues/3753
javafx
_ do we really need setTextFont/Size when we already have Impl?
_ need keyPressed() to do lower and upper case
@@ -83,19 +57,8 @@ _ javafx not supported with ARM (so we're screwed on raspberry pi)
_ https://www.linkedin.com/pulse/oracle-just-removed-javafx-support-arm-jan-snelders
opengl
_ Use PBOs for async texture copy
_ https://github.com/processing/processing/issues/3569
_ filter(PShader) broken in HiDPI mode
_ https://github.com/processing/processing/issues/3577
_ hard crash at 1920x1080, mirrored, Casey's GT 650M 1GB
_ window loses focus after maximizing
_ https://github.com/processing/processing/issues/3339
_ Implement standard cursor types in OpenGL
_ https://github.com/processing/processing/issues/3554
opengl questions
_ hard crash at 1920x1080, mirrored, Casey's GT 650M 1GB
_ issues with how JOGL handles window layout/sizing
_ https://github.com/processing/processing/issues/3401
_ exitCalled() and exitActual made public by Andres, breaks Python
@@ -117,8 +80,6 @@ _ AMD Radeon HD 6770M was in the Oracle bug report
_ https://github.com/processing/processing/issues/2186
_ https://bugs.openjdk.java.net/browse/JDK-8027391
_ test with JG's 13" retina laptop
_ Ubuntu Unity prevents full screen from working properly
_ https://github.com/processing/processing/issues/3158
graphics
@@ -658,6 +619,7 @@ _ getInt() on categorial to return index?
_ getCategories() and getCategory() methods to query names?
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
+111
View File
@@ -1,3 +1,114 @@
0246 the holy land (3.0)
X "Saving" messages never clear on "Save As"
X https://github.com/processing/processing/issues/3861
X error checker/suggestions fixes
X https://github.com/processing/processing/pull/3871
X https://github.com/processing/processing/pull/3879
X contributions filter is ignored after clicking Install
X https://github.com/processing/processing/issues/3826
X https://github.com/processing/processing/pull/3872
X https://github.com/processing/processing/pull/3883
X Exception in thread "Contribution List Downloader"
X https://github.com/processing/processing/issues/3882
X https://github.com/processing/processing/pull/3884
X Hide useless error in error checker
X https://github.com/processing/processing/pull/3887
X grab bag of CM work from Jakub
X https://github.com/processing/processing/issues/3895
X https://github.com/processing/processing/pull/3897
X Clean up delete dir function
X https://github.com/processing/processing/pull/3910
X don't follow symlinks when deleting directories
X https://github.com/processing/processing/pull/3916
X show number of updates available in the footer
X https://github.com/processing/processing/issues/3518
X https://github.com/processing/processing/pull/3896
X https://github.com/processing/processing/pull/3901
o total number of updates available is not correct? (may be fixed)
o ArrayIndexOutOfBoundsException freak out when clicking the header line
o think this was on name, with libraries, but not sure
X should be fixed with the updates from Jakub
X error checker updates for toggle and listeners
X https://github.com/processing/processing/pull/3915
X file file counting in the change detector
X https://github.com/processing/processing/pull/3917
X https://github.com/processing/processing/issues/3898
X https://github.com/processing/processing/issues/3387
X Windows suggests "Documents" as a new location for the 3.0 sketchbook
X maybe prevent users from accepting that?
X https://github.com/processing/processing/issues/3920
gui
X distinguish errors and warnings
X https://github.com/processing/processing/issues/3406
X make breakpoints more prominent
X https://github.com/processing/processing/issues/3307 (comp is set)
X clean up statusMessage() inside JavaEditor
o do we want to bring back the delays?
X implement side gradient on the editor
X if fewer lines in sketch than can be shown in window, show ticks adjacent
X error/warning location is awkward when no scroll bar is in use
X when only one screen-full, show ticks at exact location
X simpler/less confusing to not show at all?
X MarkerColumn.recalculateMarkerPositions()
X https://github.com/processing/processing/pull/3903
X Update status error/warning when changing the line
X https://github.com/processing/processing/pull/3907
X Update status error/warning when changing the line
X when moving away from an error/warning line, de-select it below
X selecting a warning should also show the warning in the status area
X https://github.com/processing/processing/pull/3907
X clicking an error or warning should give the focus back to the editor
X https://github.com/processing/processing/pull/3905
X replace startup/about screen (1x and 2x versions)
X change 'alpha' to correct name
X also change the revision in the "about processing" dialog
X https://github.com/processing/processing/issues/3665
X implement splash screen on OS X
X http://www.randelshofer.ch/oop/javasplash/javasplash.html
X also implement special retina version
X Fix placement and visual design when showing error on hover
X https://github.com/processing/processing/issues/3173
X implement custom tooltip for error/warning hover
X applies to both MarkerColumn and JavaTextAreaPainter
X make gutter of console match error list
X https://github.com/processing/processing/issues/3904
o bring back the # of updates on the update tab
o use this instead of the 'icon' stuff?
o or in addition, since only the 'updates' tab has it
X https://github.com/processing/processing/issues/3855
X for updates available, have it be clickable to open the manager
X fix the design of the completions window
X remove extra border around the outside
X change font
X add 2x version of the icons
X change selection highlight color
o put some margin around it
X https://github.com/processing/processing/issues/3906
X completion panel
X what should the background color be?
X test fg/bg color on other operating systems
J fix icon sizes/design
X set a better minimum size for the number of updates available
earlier/cleaning
X list with contrib types separated is really wonky
o do we keep the list?
o does it even work for different contrib types?
X cleaned this up in the last release
X remove the dated releases from download.processing.org
X new Android release (EditorButton constructor changed)
o JavaEditor has several null colors, remove color support
o once the design is complete and we for sure do not need color
X remove deprecated methods
X do the right thing on passing around List vs ArrayList and others
o wonder if "Save As" is causing the problems with auto-reload
X found and fixed
X look at the sound library https://github.com/wirsing/ProcessingSound
o sound is not yet supported on Windows
X implement the new gui
0245 (3.0b7)
X add jar files from 'code' folder to the library path
X Code editor wrongly detects errors for libraries in code folder
+19 -3
View File
@@ -140,8 +140,15 @@ public class JavaEditor extends Editor {
hasJavaTabs = checkForJavaTabs();
//initializeErrorChecker();
errorCheckerService = new ErrorCheckerService(this);
errorCheckerService.start();
{ // Init error checker
errorCheckerService = new ErrorCheckerService(this);
Document currentDocument = currentDocument();
if (currentDocument != null) {
errorCheckerService.addListener(currentDocument);
}
errorCheckerService.start();
errorCheckerService.request();
}
// hack to add a JPanel to the right-hand side of the text area
JPanel textAndError = new JPanel();
@@ -2330,10 +2337,18 @@ public class JavaEditor extends Editor {
*/
@Override
public void setCode(SketchCode code) {
Document oldDoc = code.getDocument();
//System.out.println("tab switch: " + code.getFileName());
// set the new document in the textarea, etc. need to do this first
super.setCode(code);
Document newDoc = code.getDocument();
if (oldDoc != newDoc && errorCheckerService != null) {
errorCheckerService.addListener(newDoc);
}
// set line background colors for tab
final JavaTextArea ta = getJavaTextArea();
// can be null when setCode is called the first time (in constructor)
@@ -2729,13 +2744,14 @@ public class JavaEditor extends Editor {
}
@Override
protected void applyPreferences() {
super.applyPreferences();
if (jmode != null) {
jmode.loadPreferences();
Messages.log("Applying prefs");
// trigger it once to refresh UI
errorCheckerService.request();
errorCheckerService.handleErrorCheckingToggle();
}
}
@@ -465,10 +465,10 @@ public class VariableInspector extends JDialog {
*/
class OutlineRenderer implements RenderDataProvider {
Icon[][] icons;
static final int ICON_SIZE = 16; // icon size (square, size=width=height)
static final int ICON_SIZE = 16;
OutlineRenderer() {
icons = loadIcons("theme/var-icons.gif");
icons = loadIcons("theme/variables-1x.png");
}
/**
@@ -265,10 +265,6 @@ public class CompletionPanel {
}
/**
* Dynamic width of completion panel
* @return - width
*/
private int calcWidth() {
int maxWidth = 300;
float min = 0;
@@ -62,7 +62,6 @@ import processing.app.Preferences;
import processing.app.Sketch;
import processing.app.SketchCode;
import processing.app.Util;
import processing.app.syntax.SyntaxDocument;
import processing.app.ui.Editor;
import processing.app.ui.EditorStatus;
import processing.app.ui.ErrorTable;
@@ -235,7 +234,6 @@ public class ErrorCheckerService {
astGenerator = new ASTGenerator(this);
errorMsgSimplifier = new ErrorMessageSimplifier();
tempErrorLog = new TreeMap<>();
sketchChangedListener = new SketchChangedListener();
// for (final SketchCode sc : editor.getSketch().getCode()) {
// sc.getDocument().addDocumentListener(sketchChangedListener);
// }
@@ -251,8 +249,7 @@ public class ErrorCheckerService {
private Thread errorCheckerThread;
private BlockingQueue<Boolean> requestQueue = new ArrayBlockingQueue<>(1);
private ScheduledExecutorService scheduler =
Executors.newSingleThreadScheduledExecutor();
private ScheduledExecutorService scheduler;
volatile ScheduledFuture<?> scheduledUiUpdate = null;
volatile long nextUiUpdate = 0;
@@ -275,7 +272,6 @@ public class ErrorCheckerService {
astGenerator.buildAST(lastCodeCheckResult.sourceCode,
lastCodeCheckResult.compilationUnit);
}
handleErrorCheckingToggle();
while (running) {
try {
@@ -288,16 +284,16 @@ public class ErrorCheckerService {
try {
Messages.log("Starting error check");
lastCodeCheckResult = checkCode();
CodeCheckResult result = checkCode();
if (!JavaMode.errorCheckEnabled) {
lastCodeCheckResult.problems.clear();
Messages.log("Error Check disabled, so not updating UI.");
}
checkForMissingImports();
lastCodeCheckResult = result;
updateSketchCodeListeners();
checkForMissingImports(lastCodeCheckResult);
if (JavaMode.errorCheckEnabled) {
if (scheduledUiUpdate != null) {
@@ -320,7 +316,6 @@ public class ErrorCheckerService {
editor.updateErrorBar(result.problems);
editor.getTextArea().repaint();
editor.updateErrorToggle(result.containsErrors);
updateSketchCodeListeners();
}
});
}
@@ -350,6 +345,7 @@ public class ErrorCheckerService {
public void start() {
scheduler = Executors.newSingleThreadScheduledExecutor();
errorCheckerThread = new Thread(mainLoop);
errorCheckerThread.start();
}
@@ -358,6 +354,9 @@ public class ErrorCheckerService {
cancel();
running = false;
errorCheckerThread.interrupt();
if (scheduler != null) {
scheduler.shutdownNow();
}
}
@@ -376,35 +375,15 @@ public class ErrorCheckerService {
}
protected void updateSketchCodeListeners() {
for (SketchCode sc : editor.getSketch().getCode()) {
SyntaxDocument doc = (SyntaxDocument) sc.getDocument();
if (!hasSketchChangedListener(doc)) {
doc.addDocumentListener(sketchChangedListener);
}
}
public void addListener(Document doc) {
doc.addDocumentListener(sketchChangedListener);
}
boolean hasSketchChangedListener(SyntaxDocument doc) {
if (doc != null && doc.getDocumentListeners() != null) {
for (DocumentListener dl : doc.getDocumentListeners()) {
if (dl.equals(sketchChangedListener)) {
return true;
}
}
}
return false;
}
protected void checkForMissingImports() {
// Atomic access
CodeCheckResult lastCodeCheckResult = this.lastCodeCheckResult;
protected void checkForMissingImports(CodeCheckResult result) {
if (Preferences.getBoolean(JavaMode.SUGGEST_IMPORTS_PREF)) {
for (Problem p : lastCodeCheckResult.problems) {
if(p.getIProblem().getID() == IProblem.UndefinedType) {
for (Problem p : result.problems) {
if (p.getIProblem().getID() == IProblem.UndefinedType) {
String args[] = p.getIProblem().getArguments();
if (args.length > 0) {
String missingClass = args[0];
@@ -424,37 +403,22 @@ public class ErrorCheckerService {
}
protected SketchChangedListener sketchChangedListener;
protected class SketchChangedListener implements DocumentListener{
private SketchChangedListener(){
}
protected final DocumentListener sketchChangedListener = new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
if (JavaMode.errorCheckEnabled) {
request();
//log("doc insert update, man error check..");
}
if (JavaMode.errorCheckEnabled) request();
}
@Override
public void removeUpdate(DocumentEvent e) {
if (JavaMode.errorCheckEnabled){
request();
//log("doc remove update, man error check..");
}
if (JavaMode.errorCheckEnabled) request();
}
@Override
public void changedUpdate(DocumentEvent e) {
if (JavaMode.errorCheckEnabled){
request();
//log("doc changed update, man error check..");
}
if (JavaMode.errorCheckEnabled) request();
}
}
};
public static class CodeCheckResult {
@@ -1556,10 +1520,10 @@ public class ErrorCheckerService {
return new String(p2, 0, index);
}
public void handleErrorCheckingToggle() {
if (!JavaMode.errorCheckEnabled) {
Messages.log(editor.getSketch().getName() + " Error Checker paused.");
//editor.clearErrorPoints();
Messages.log(editor.getSketch().getName() + " Error Checker disabled.");
editor.getErrorPoints().clear();
lastCodeCheckResult.problems.clear();
updateErrorTable(Collections.<Problem>emptyList());
@@ -1567,7 +1531,7 @@ public class ErrorCheckerService {
editor.getTextArea().repaint();
editor.repaintErrorBar();
} else {
Messages.log(editor.getSketch().getName() + " Error Checker resumed.");
Messages.log(editor.getSketch().getName() + " Error Checker enabled.");
request();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

+33 -112
View File
@@ -1,89 +1,8 @@
0246 the holy land
X "Saving" messages never clear on "Save As"
X https://github.com/processing/processing/issues/3861
X error checker/suggestions fixes
X https://github.com/processing/processing/pull/3871
X https://github.com/processing/processing/pull/3879
X contributions filter is ignored after clicking Install
X https://github.com/processing/processing/issues/3826
X https://github.com/processing/processing/pull/3872
X https://github.com/processing/processing/pull/3883
X Exception in thread "Contribution List Downloader"
X https://github.com/processing/processing/issues/3882
X https://github.com/processing/processing/pull/3884
X Hide useless error in error checker
X https://github.com/processing/processing/pull/3887
X grab bag of CM work from Jakub
X https://github.com/processing/processing/issues/3895
X https://github.com/processing/processing/pull/3897
X Clean up delete dir function
X https://github.com/processing/processing/pull/3910
X show number of updates available in the footer
X https://github.com/processing/processing/issues/3518
X https://github.com/processing/processing/pull/3896
X https://github.com/processing/processing/pull/3901
o total number of updates available is not correct? (may be fixed)
o ArrayIndexOutOfBoundsException freak out when clicking the header line
o think this was on name, with libraries, but not sure
X should be fixed with the updates from Jakub
0247 (3.0.1)
gui
X distinguish errors and warnings
X https://github.com/processing/processing/issues/3406
X make breakpoints more prominent
X https://github.com/processing/processing/issues/3307 (comp is set)
X clean up statusMessage() inside JavaEditor
o do we want to bring back the delays?
X implement side gradient on the editor
X if fewer lines in sketch than can be shown in window, show ticks adjacent
X error/warning location is awkward when no scroll bar is in use
X when only one screen-full, show ticks at exact location
X simpler/less confusing to not show at all?
X MarkerColumn.recalculateMarkerPositions()
X https://github.com/processing/processing/pull/3903
X Update status error/warning when changing the line
X https://github.com/processing/processing/pull/3907
X Update status error/warning when changing the line
X when moving away from an error/warning line, de-select it below
X selecting a warning should also show the warning in the status area
X https://github.com/processing/processing/pull/3907
X clicking an error or warning should give the focus back to the editor
X https://github.com/processing/processing/pull/3905
X replace startup/about screen (1x and 2x versions)
X change 'alpha' to correct name
X also change the revision in the "about processing" dialog
X https://github.com/processing/processing/issues/3665
X implement splash screen on OS X
X http://www.randelshofer.ch/oop/javasplash/javasplash.html
X also implement special retina version
X Fix placement and visual design when showing error on hover
X https://github.com/processing/processing/issues/3173
X implement custom tooltip for error/warning hover
X applies to both MarkerColumn and JavaTextAreaPainter
X make gutter of console match error list
X https://github.com/processing/processing/issues/3904
o bring back the # of updates on the update tab
o use this instead of the 'icon' stuff?
o or in addition, since only the 'updates' tab has it
X https://github.com/processing/processing/issues/3855
X for updates available, have it be clickable to open the manager
X fix the design of the completions window
X remove extra border around the outside
X change font
X add 2x version of the icons
X change selection highlight color
o put some margin around it
X https://github.com/processing/processing/issues/3906
earlier/cleaning
X list with contrib types separated is really wonky
o do we keep the list?
o does it even work for different contrib types?
X cleaned this up in the last release
X remove the dated releases from download.processing.org
X new Android release (EditorButton constructor changed)
o JavaEditor has several null colors, remove color support
o once the design is complete and we for sure do not need color
jakub
X Include Example packs into update count
X https://github.com/processing/processing/pull/3932
known issues
@@ -96,19 +15,30 @@ _ http://www.excelsiorjet.com/kb/35/howto-create-a-single-exe-from-your-java-a
_ mouse events (i.e. toggle breakpoint) seem to be firing twice
3.0 final
_ https://github.com/processing/processing/milestones/3.0%20final
_ completion panel
X what should the background color be?
_ test fg/bg color on other operating systems
_ fix icon sizes/design
3.0.1
_ https://github.com/processing/processing/milestones/3.0.1
_ error checkers/suggestions not including the library path
_ https://github.com/processing/processing/issues/3924
_ import suggestions box needs design review
_ https://github.com/processing/processing/issues/3407
_ update CM entries when sketchbook location changes
_ https://github.com/processing/processing/issues/3927
run/debug
_ debugger deadlocks when choosing "Step Into" on println()
_ https://github.com/processing/processing/issues/3923
_ Tweak Mode sometimes freezes while running, require a force quit
_ https://github.com/processing/processing/issues/3928
gui
_ fix background color for selected lines in VariableInspector
_ https://github.com/processing/processing/issues/3925
_ implement 2x versions of the icons for the debugger window/variable inspector
_ https://github.com/processing/processing/issues/3921
_ different design of squiggly line
_ easy to do inside JavaTextAreaPainter.paintSquiggle()
gui / post 3.0
_ build custom scroll bar since the OS versions are so ugly
_ see notes in the 'dialogs' section below, implement our own option panes?
_ tiny trail of dots when moving the selection bar up/down on retina
@@ -149,9 +79,11 @@ _ https://github.com/processing/processing/issues/2886
pde/build
_ Editor objects are staying in memory
_ https://github.com/processing/processing/issues/3930
_ unsupported java version when trying ant run with 7u65
_ no helpful message about how to automatically download 8u51
_ ignore-tools in build.xml not being called for some reason
_ can't install processing-java into /usr/bin with El Capitan
_ https://github.com/processing/processing/issues/3497
_ when variables used in size(), getting exceptions instead of any warning
_ https://github.com/processing/processing/issues/3311
_ crashed on startup w/ JavaScript mode as default b/c PdeKeyListener not found
@@ -169,11 +101,11 @@ _ update license info to state gplv2 not v3
_ run through that online license checker
_ save() and saveAs() need to be refactored
_ https://github.com/processing/processing/issues/3843
breakage
_ remove deprecated methods
_ do the right thing on passing around List vs ArrayList and others
_ clean out the repo
_ https://github.com/processing/processing/issues/1898
_ search the source for 'applet' references (i.e. SVG docs)
_ update list of optional JRE files
_ https://github.com/processing/processing/issues/3288
_ PreferencesFrame is a misnomer (not a frame itself)
_ change to PreferencesDialog, and make it a dialog?
_ move Library to LibraryContribution and into contrib?
@@ -183,23 +115,12 @@ from the todo list
_ reas: comments go nasty when auto-formatted
_ reas: code coloring sometimes disappears
_ me: undo not in the correct location
_ implement the new gui
_ drop XP support (but improve Windows 8 support? ouch)
_ improve error message when creating a tab with the same name
_ right now it's generic, based on "a file exists"
_ don't allow users to create 'blah.java' when 'blah.pde' already in sketch
3.0 beta/final
_ wonder if "Save As" is causing the problems with auto-reload
_ look at the sound library https://github.com/wirsing/ProcessingSound
_ sound is not yet supported on Windows
_ clean out the repo
_ https://github.com/processing/processing/issues/1898
_ search the source for 'applet' references (i.e. SVG docs)
_ update list of option JRE files
_ https://github.com/processing/processing/issues/3288
sketchbook
_ Mode.rebuildLibraryList() called too many times on startup?