Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0eb5ba5
Support of embedded images in SVGs, linked images are supported but s…
Nov 24, 2015
d0e016b
Add console hiding button
GKFX Jun 7, 2017
ec8de86
Change Editor status message only from EDT
JakubValtar Apr 24, 2018
eb90025
Print exception message to the console when stack trace is disabled
JakubValtar Apr 24, 2018
67f805a
Add a warning to findFont() when a font isn't found (and the default …
FlorisVO Aug 3, 2018
508cde1
set tessGeo when collecting custom vertex attributes
codeanticode Jan 15, 2019
f05094b
create attribute in setAttrib() functions if does not exist, and also…
codeanticode Jan 15, 2019
f671f16
temporarily ignore IntelliJ files
benfry Jan 17, 2019
7ce606e
update out-of-date Help menu links (fixes #5729)
benfry Jan 17, 2019
9a3fc52
resolve ambiguous import
benfry Jan 17, 2019
ea7ac8c
more notes and updates for recent issues
benfry Jan 17, 2019
50af488
other notes and cleanup
benfry Jan 17, 2019
108f5cc
Merge pull request #5486 from JakubValtar/fix-status-exception
benfry Jan 18, 2019
62ff5d6
Merge pull request #5115 from GKFX/feature-hideconsole
benfry Jan 18, 2019
a2834ef
move to JDK 1.8 instead of 1.6 b/c of Eclipse warnings
benfry Jan 18, 2019
f62b931
remove unnecessary cast
benfry Jan 18, 2019
adaf901
incorporating console collapse button (#5115)
benfry Jan 18, 2019
06666ed
more cleanup; use buttonSize constant instead of sizeH for clarity
benfry Jan 18, 2019
07dfee2
update to Java 8u202
benfry Jan 18, 2019
b3763a8
prevent infinite "sketch disappeared" warnings (fixes #4805)
benfry Jan 18, 2019
d1ce74b
simpler solution for disappearance warning (#4805)
benfry Jan 18, 2019
2e476be
wrapping up #4805 and #4808
benfry Jan 18, 2019
73d5cae
Merge pull request #4168 from poqudrof/master-origin
benfry Jan 18, 2019
d1cb0c8
additional cleanup to SVG code after incorporating #4168
benfry Jan 18, 2019
87a6594
Merge pull request #5605 from FlorisVO/master
benfry Jan 18, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*~
/build/shared/reference.zip

# temporary, until we complete the move to IntelliJ
*.iml
/.idea

# via https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
Expand Down
48 changes: 48 additions & 0 deletions app/src/processing/app/RunnerListenerEdtAdapter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package processing.app;

import java.awt.EventQueue;

public class RunnerListenerEdtAdapter implements RunnerListener {

private RunnerListener wrapped;

public RunnerListenerEdtAdapter(RunnerListener wrapped) {
this.wrapped = wrapped;
}

@Override
public void statusError(String message) {
EventQueue.invokeLater(() -> wrapped.statusError(message));
}

@Override
public void statusError(Exception exception) {
EventQueue.invokeLater(() -> wrapped.statusError(exception));
}

@Override
public void statusNotice(String message) {
EventQueue.invokeLater(() -> wrapped.statusNotice(message));
}

@Override
public void startIndeterminate() {
EventQueue.invokeLater(() -> wrapped.startIndeterminate());
}

@Override
public void stopIndeterminate() {
EventQueue.invokeLater(() -> wrapped.stopIndeterminate());
}

@Override
public void statusHalt() {
EventQueue.invokeLater(() -> wrapped.statusHalt());
}

@Override
public boolean isHalted() {
return wrapped.isHalted();
}
}

44 changes: 27 additions & 17 deletions app/src/processing/app/Sketch.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public class Sketch {
/** Moved out of Editor and into here for cleaner access. */
private boolean untitled;

/** true if we've posted a "sketch disappeared" warning */
private boolean disappearedWarning;

/**
* Used by the command-line version to create a sketch object.
Expand Down Expand Up @@ -123,6 +125,7 @@ protected void load(String path) {
int suffixLength = mode.getDefaultExtension().length() + 1;
name = mainFilename.substring(0, mainFilename.length() - suffixLength);
folder = new File(new File(path).getParent());
disappearedWarning = false;
load();
}

Expand Down Expand Up @@ -1197,6 +1200,7 @@ protected void updateInternal(String sketchName, File sketchFolder) {

name = sketchName;
folder = sketchFolder;
disappearedWarning = false;
codeFolder = new File(folder, "code");
dataFolder = new File(folder, "data");

Expand Down Expand Up @@ -1498,28 +1502,34 @@ public void prepareBuild(File targetFolder) throws SketchException {


/**
* Make sure the sketch hasn't been moved or deleted by some
* nefarious user. If they did, try to re-create it and save.
* Only checks to see if the main folder is still around,
* but not its contents.
* Make sure the sketch hasn't been moved or deleted by a nefarious user.
* If they did, try to re-create it and save. Only checks whether the
* main folder is still around, but not its contents.
*/
public void ensureExistence() {
if (!folder.exists()) {
// Disaster recovery, try to salvage what's there already.
Messages.showWarning(Language.text("ensure_exist.messages.missing_sketch"),
Language.text("ensure_exist.messages.missing_sketch.description"));
try {
folder.mkdirs();
modified = true;
// Avoid an infinite loop if we've already warned about this
// https://github.com/processing/processing/issues/4805
if (!disappearedWarning) {
disappearedWarning = true;

// Disaster recovery, try to salvage what's there already.
Messages.showWarning(Language.text("ensure_exist.messages.missing_sketch"),
Language.text("ensure_exist.messages.missing_sketch.description"));
try {
folder.mkdirs();
modified = true;

for (int i = 0; i < codeCount; i++) {
code[i].save(); // this will force a save
}
calcModified();

for (int i = 0; i < codeCount; i++) {
code[i].save(); // this will force a save
} catch (Exception e) {
// disappearedWarning prevents infinite loop in this scenario
Messages.showWarning(Language.text("ensure_exist.messages.unrecoverable"),
Language.text("ensure_exist.messages.unrecoverable.description"), e);
}
calcModified();

} catch (Exception e) {
Messages.showWarning(Language.text("ensure_exist.messages.unrecoverable"),
Language.text("ensure_exist.messages.unrecoverable.description"), e);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions app/src/processing/app/SketchException.java
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public void hideStackTrace() {
}


public boolean isStackTraceEnabled() {
return showStackTrace;
}


/**
* Nix the java.lang crap out of an exception message
* because it scares the children.
Expand Down
22 changes: 22 additions & 0 deletions app/src/processing/app/ui/Editor.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,17 @@ public BasicSplitPaneDivider createDefaultDivider() {
status = new EditorStatus(this, Editor.this);
return status;
}


@Override
public void finishDraggingTo(int location) {
super.finishDraggingTo(location);
// JSplitPane issue: if you only make the lower component visible at
// the last minute, its minmum size is ignored.
if (location > splitPane.getMaximumDividerLocation()) {
splitPane.setDividerLocation(splitPane.getMaximumDividerLocation());
}
}
});

box.add(splitPane);
Expand Down Expand Up @@ -2900,6 +2911,17 @@ public void statusError(Exception e) {

if (e instanceof SketchException) {
SketchException re = (SketchException) e;

// Make sure something is printed into the console
// Status bar is volatile
if (!re.isStackTraceEnabled()) {
System.err.println(re.getMessage());
}

// Move the cursor to the line before updating the status bar, otherwise
// status message might get hidden by a potential message caused by moving
// the cursor to a line with warning in it

if (re.hasCodeIndex()) {
sketch.setCurrentCode(re.getCodeIndex());
}
Expand Down
Loading