mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Bring in upstream changes from 'master'
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Files which should always be normalized and converted
|
||||
# to native line endings on checkout.
|
||||
*.java text
|
||||
*.pde text
|
||||
|
||||
# Files that will always have CRLF line endings on checkout.
|
||||
*.bat eol=crlf
|
||||
build/macosx/jAppleMenuBar.url eol=crlf
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
|
||||
Box rangeBox = new Box(BoxLayout.Y_AXIS);
|
||||
rangeBox.setAlignmentY(0);
|
||||
rangeBox.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
|
||||
rangeBox.add(range.getCanvas());
|
||||
rangeBox.add(range);
|
||||
box.add(rangeBox);
|
||||
box.add(Box.createHorizontalStrut(10));
|
||||
|
||||
@@ -88,7 +88,7 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
|
||||
Box sliderBox = new Box(BoxLayout.Y_AXIS);
|
||||
sliderBox.setAlignmentY(0);
|
||||
sliderBox.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
|
||||
sliderBox.add(slider.getCanvas());
|
||||
sliderBox.add(slider);
|
||||
box.add(sliderBox);
|
||||
box.add(Box.createHorizontalStrut(10));
|
||||
|
||||
@@ -106,10 +106,6 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
|
||||
|
||||
window.pack();
|
||||
window.setResizable(false);
|
||||
|
||||
// initialize once the components exist
|
||||
range.init();
|
||||
slider.init();
|
||||
|
||||
// Dimension size = getSize();
|
||||
// Dimension screen = Toolkit.getScreenSize();
|
||||
@@ -236,8 +232,8 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
|
||||
updateRGB(Integer.parseInt(str, 16));
|
||||
updateHSB();
|
||||
}
|
||||
range.redraw();
|
||||
slider.redraw();
|
||||
range.repaint();
|
||||
slider.repaint();
|
||||
//colorPanel.setBackground(new Color(red, green, blue));
|
||||
colorPanel.repaint();
|
||||
updating = false;
|
||||
@@ -486,58 +482,46 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
|
||||
}
|
||||
|
||||
|
||||
public class ColorRange extends PApplet {
|
||||
public class ColorRange extends JComponent {
|
||||
|
||||
static final int WIDE = 256;
|
||||
static final int HIGH = 256;
|
||||
static final int WIDTH = 256;
|
||||
static final int HEIGHT = 256;
|
||||
|
||||
int lastX, lastY;
|
||||
private int lastX, lastY;
|
||||
|
||||
public ColorRange() {
|
||||
addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
updateMouse(e);
|
||||
}
|
||||
});
|
||||
|
||||
public int sketchWidth() {
|
||||
return WIDE;
|
||||
}
|
||||
|
||||
public int sketchHeight() {
|
||||
return HIGH;
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
noLoop();
|
||||
addMouseMotionListener(new MouseMotionAdapter() {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
updateMouse(e);
|
||||
}
|
||||
});
|
||||
|
||||
colorMode(HSB, 360, 256, 256);
|
||||
noFill();
|
||||
rectMode(CENTER);
|
||||
addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
super.keyPressed(e);
|
||||
|
||||
loadPixels();
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
if (width == WIDE && height == HIGH) {
|
||||
int index = 0;
|
||||
for (int j = 0; j < 256; j++) {
|
||||
for (int i = 0; i < 256; i++) {
|
||||
pixels[index++] = color(hue, i, 255 - j);
|
||||
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
ColorChooser.this.hide();
|
||||
}
|
||||
}
|
||||
|
||||
updatePixels();
|
||||
stroke((brightness > 50) ? 0 : 255);
|
||||
rect(lastX, lastY, 9, 9);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void mousePressed() {
|
||||
updateMouse();
|
||||
}
|
||||
private void updateMouse(MouseEvent e) {
|
||||
int mouseX = e.getX();
|
||||
int mouseY = e.getY();
|
||||
|
||||
public void mouseDragged() {
|
||||
updateMouse();
|
||||
}
|
||||
|
||||
public void updateMouse() {
|
||||
if ((mouseX >= 0) && (mouseX < 256) &&
|
||||
(mouseY >= 0) && (mouseY < 256)) {
|
||||
if ((mouseX >= 0) && (mouseX < WIDTH) &&
|
||||
(mouseY >= 0) && (mouseY < HEIGHT)) {
|
||||
int nsaturation = (int) (100 * (mouseX / 255.0f));
|
||||
int nbrightness = 100 - ((int) (100 * (mouseY / 255.0f)));
|
||||
saturationField.setText(String.valueOf(nsaturation));
|
||||
@@ -548,102 +532,105 @@ public class ColorChooser { //extends JFrame implements DocumentListener {
|
||||
}
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return new Dimension(WIDE, HIGH);
|
||||
}
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
public Dimension getMinimumSize() {
|
||||
return new Dimension(WIDE, HIGH);
|
||||
}
|
||||
|
||||
public Dimension getMaximumSize() {
|
||||
return new Dimension(WIDE, HIGH);
|
||||
}
|
||||
|
||||
public void keyPressed() {
|
||||
if (key == ESC) {
|
||||
ColorChooser.this.hide();
|
||||
// don't quit out of processing
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1006
|
||||
key = 0;
|
||||
for (int j = 0; j < WIDTH; j++) {
|
||||
for (int i = 0; i < HEIGHT; i++) {
|
||||
g.setColor(Color.getHSBColor(hue / 360f, i / 256f, (255 - j) / 256f));
|
||||
g.fillRect(i, j, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
g.setColor((brightness > 50) ? Color.BLACK : Color.WHITE);
|
||||
g.drawRect(lastX - 5, lastY - 5, 10, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
return new Dimension(WIDTH, HEIGHT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getMaximumSize() {
|
||||
return getPreferredSize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class ColorSlider extends PApplet {
|
||||
public class ColorSlider extends JComponent {
|
||||
|
||||
static final int WIDE = 20;
|
||||
static final int HIGH = 256;
|
||||
static final int WIDTH = 20;
|
||||
static final int HEIGHT = 256;
|
||||
|
||||
public int sketchWidth() {
|
||||
return WIDE;
|
||||
}
|
||||
|
||||
public int sketchHeight() {
|
||||
return HIGH;
|
||||
}
|
||||
|
||||
public void setup() {
|
||||
colorMode(HSB, 255, 100, 100);
|
||||
noLoop();
|
||||
loadPixels();
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
// if ((g == null) || (g.pixels == null)) return;
|
||||
if ((width != WIDE) || (height < HIGH)) {
|
||||
//System.out.println("bad size " + width + " " + height);
|
||||
return;
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
int sel = 255 - (int) (255 * (hue / 359f));
|
||||
for (int j = 0; j < 256; j++) {
|
||||
int c = color(255 - j, 100, 100);
|
||||
if (j == sel) c = 0xFF000000;
|
||||
for (int i = 0; i < WIDE; i++) {
|
||||
g.pixels[index++] = c;
|
||||
public ColorSlider() {
|
||||
addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
public void mousePressed(MouseEvent e) {
|
||||
updateMouse(e);
|
||||
}
|
||||
}
|
||||
updatePixels();
|
||||
});
|
||||
|
||||
addMouseMotionListener(new MouseMotionAdapter() {
|
||||
@Override
|
||||
public void mouseDragged(MouseEvent e) {
|
||||
updateMouse(e);
|
||||
}
|
||||
});
|
||||
|
||||
addKeyListener(new KeyAdapter() {
|
||||
@Override
|
||||
public void keyPressed(KeyEvent e) {
|
||||
super.keyPressed(e);
|
||||
|
||||
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
ColorChooser.this.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void mousePressed() {
|
||||
updateMouse();
|
||||
}
|
||||
private void updateMouse(MouseEvent e) {
|
||||
int mouseX = e.getX();
|
||||
int mouseY = e.getY();
|
||||
|
||||
public void mouseDragged() {
|
||||
updateMouse();
|
||||
}
|
||||
|
||||
public void updateMouse() {
|
||||
if ((mouseX >= 0) && (mouseX < 256) &&
|
||||
(mouseY >= 0) && (mouseY < 256)) {
|
||||
if ((mouseX >= 0) && (mouseX < WIDTH) &&
|
||||
(mouseY >= 0) && (mouseY < HEIGHT)) {
|
||||
int nhue = 359 - (int) (359 * (mouseY / 255.0f));
|
||||
hueField.setText(String.valueOf(nhue));
|
||||
}
|
||||
}
|
||||
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
int sel = 255 - (int) (255 * (hue / 359.0));
|
||||
for (int j = 0; j < HEIGHT; j++) {
|
||||
Color color = Color.getHSBColor((255 - j) / 256f, 1, 1);
|
||||
if (j == sel) {
|
||||
color = Color.BLACK;
|
||||
}
|
||||
g.setColor(color);
|
||||
g.drawRect(0, j, WIDTH, 1);
|
||||
}
|
||||
}
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
return new Dimension(WIDE, HIGH);
|
||||
return new Dimension(WIDTH, HEIGHT);
|
||||
}
|
||||
|
||||
public Dimension getMinimumSize() {
|
||||
return new Dimension(WIDE, HIGH);
|
||||
return getPreferredSize();
|
||||
}
|
||||
|
||||
public Dimension getMaximumSize() {
|
||||
return new Dimension(WIDE, HIGH);
|
||||
}
|
||||
|
||||
public void keyPressed() {
|
||||
if (key == ESC) {
|
||||
ColorChooser.this.hide();
|
||||
// don't quit out of processing
|
||||
// http://dev.processing.org/bugs/show_bug.cgi?id=1006
|
||||
key = 0;
|
||||
}
|
||||
return getPreferredSize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,231 +1,231 @@
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2013 The Processing Foundation
|
||||
Copyright (c) 2011-12 Ben Fry and Casey Reas
|
||||
|
||||
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.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import processing.core.PApplet;
|
||||
|
||||
|
||||
abstract public class Contribution {
|
||||
static final String SPECIAL_CATEGORY_NAME = "Starred";
|
||||
static final List validCategories =
|
||||
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
|
||||
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
|
||||
"Utilities", "Video & Vision", "Other");
|
||||
|
||||
//protected String category; // "Sound"
|
||||
protected List<String> categories; // "Sound", "Typography"
|
||||
protected String name; // "pdf" or "PDF Export"
|
||||
protected String authorList; // Ben Fry
|
||||
protected String url; // http://processing.org
|
||||
protected String sentence; // Write graphics to PDF files.
|
||||
protected String paragraph; // <paragraph length description for site>
|
||||
protected int version; // 102
|
||||
protected String prettyVersion; // "1.0.2"
|
||||
protected long lastUpdated; // 1402805757
|
||||
protected int minRevision; // 0
|
||||
protected int maxRevision; // 227
|
||||
|
||||
|
||||
// "Sound"
|
||||
// public String getCategory() {
|
||||
// return category;
|
||||
// }
|
||||
|
||||
|
||||
// "Sound", "Utilities"... see valid list in ContributionListing
|
||||
protected List<String> getCategories() {
|
||||
return categories;
|
||||
}
|
||||
|
||||
|
||||
protected String getCategoryStr() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String category : categories) {
|
||||
sb.append(category);
|
||||
sb.append(',');
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1); // delete last comma
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
protected boolean hasCategory(String category) {
|
||||
if (category != null) {
|
||||
for (String c : categories) {
|
||||
if (category.equalsIgnoreCase(c)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// "pdf" or "PDF Export"
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
// "[Ben Fry](http://benfry.com/)"
|
||||
public String getAuthorList() {
|
||||
return authorList;
|
||||
}
|
||||
|
||||
|
||||
// "http://processing.org"
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
// "Write graphics to PDF files."
|
||||
public String getSentence() {
|
||||
return sentence;
|
||||
}
|
||||
|
||||
|
||||
// <paragraph length description for site>
|
||||
public String getParagraph() {
|
||||
return paragraph;
|
||||
}
|
||||
|
||||
|
||||
// 102
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
// "1.0.2"
|
||||
public String getPrettyVersion() {
|
||||
return prettyVersion;
|
||||
}
|
||||
|
||||
// 1402805757
|
||||
public long getLastUpdated() {
|
||||
return lastUpdated;
|
||||
}
|
||||
|
||||
// 0
|
||||
public int getMinRevision() {
|
||||
return minRevision;
|
||||
}
|
||||
|
||||
// 227
|
||||
public int getMaxRevision() {
|
||||
return maxRevision;
|
||||
}
|
||||
|
||||
|
||||
public boolean isCompatible(int versionNum) {
|
||||
return ((maxRevision == 0 || versionNum < maxRevision) && versionNum > minRevision);
|
||||
}
|
||||
|
||||
|
||||
abstract public ContributionType getType();
|
||||
|
||||
|
||||
public String getTypeName() {
|
||||
return getType().toString();
|
||||
}
|
||||
|
||||
|
||||
abstract public boolean isInstalled();
|
||||
|
||||
|
||||
// /**
|
||||
// * Returns true if the type of contribution requires the PDE to restart
|
||||
// * when being added or removed.
|
||||
// */
|
||||
// public boolean requiresRestart() {
|
||||
// return getType() == ContributionType.TOOL || getType() == ContributionType.MODE;
|
||||
// }
|
||||
|
||||
|
||||
boolean isRestartFlagged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/** Overridden by LocalContribution. */
|
||||
boolean isDeletionFlagged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
boolean isUpdateFlagged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the contribution is a starred/recommended contribution, or
|
||||
* is by the Processing Foundation.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isSpecial() {
|
||||
try {
|
||||
return (authorList.indexOf("The Processing Foundation") != -1 ||
|
||||
categories.contains(SPECIAL_CATEGORY_NAME));
|
||||
} catch (NullPointerException npe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return a single element list with "Unknown" as the category.
|
||||
*/
|
||||
static List<String> defaultCategory() {
|
||||
List<String> outgoing = new ArrayList<String>();
|
||||
outgoing.add("Unknown");
|
||||
return outgoing;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the list of categories that this contribution is part of
|
||||
* (e.g. "Typography / Geometry"). "Unknown" if the category null.
|
||||
*/
|
||||
static List<String> parseCategories(String categoryStr) {
|
||||
List<String> outgoing = new ArrayList<String>();
|
||||
|
||||
if (categoryStr != null) {
|
||||
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
|
||||
for (String category : listing) {
|
||||
if (validCategories.contains(category)) {
|
||||
outgoing.add(category);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (outgoing.size() == 0) {
|
||||
return defaultCategory();
|
||||
}
|
||||
return outgoing;
|
||||
}
|
||||
}
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2013 The Processing Foundation
|
||||
Copyright (c) 2011-12 Ben Fry and Casey Reas
|
||||
|
||||
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.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import processing.core.PApplet;
|
||||
|
||||
|
||||
abstract public class Contribution {
|
||||
static final String SPECIAL_CATEGORY_NAME = "Starred";
|
||||
static final List validCategories =
|
||||
Arrays.asList("3D", "Animation", "Data", "Geometry", "GUI", "Hardware",
|
||||
"I/O", "Math", "Simulation", "Sound", SPECIAL_CATEGORY_NAME, "Typography",
|
||||
"Utilities", "Video & Vision", "Other");
|
||||
|
||||
//protected String category; // "Sound"
|
||||
protected List<String> categories; // "Sound", "Typography"
|
||||
protected String name; // "pdf" or "PDF Export"
|
||||
protected String authorList; // Ben Fry
|
||||
protected String url; // http://processing.org
|
||||
protected String sentence; // Write graphics to PDF files.
|
||||
protected String paragraph; // <paragraph length description for site>
|
||||
protected int version; // 102
|
||||
protected String prettyVersion; // "1.0.2"
|
||||
protected long lastUpdated; // 1402805757
|
||||
protected int minRevision; // 0
|
||||
protected int maxRevision; // 227
|
||||
|
||||
|
||||
// "Sound"
|
||||
// public String getCategory() {
|
||||
// return category;
|
||||
// }
|
||||
|
||||
|
||||
// "Sound", "Utilities"... see valid list in ContributionListing
|
||||
protected List<String> getCategories() {
|
||||
return categories;
|
||||
}
|
||||
|
||||
|
||||
protected String getCategoryStr() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String category : categories) {
|
||||
sb.append(category);
|
||||
sb.append(',');
|
||||
}
|
||||
sb.deleteCharAt(sb.length()-1); // delete last comma
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
protected boolean hasCategory(String category) {
|
||||
if (category != null) {
|
||||
for (String c : categories) {
|
||||
if (category.equalsIgnoreCase(c)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// "pdf" or "PDF Export"
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
// "[Ben Fry](http://benfry.com/)"
|
||||
public String getAuthorList() {
|
||||
return authorList;
|
||||
}
|
||||
|
||||
|
||||
// "http://processing.org"
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
// "Write graphics to PDF files."
|
||||
public String getSentence() {
|
||||
return sentence;
|
||||
}
|
||||
|
||||
|
||||
// <paragraph length description for site>
|
||||
public String getParagraph() {
|
||||
return paragraph;
|
||||
}
|
||||
|
||||
|
||||
// 102
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
// "1.0.2"
|
||||
public String getPrettyVersion() {
|
||||
return prettyVersion;
|
||||
}
|
||||
|
||||
// 1402805757
|
||||
public long getLastUpdated() {
|
||||
return lastUpdated;
|
||||
}
|
||||
|
||||
// 0
|
||||
public int getMinRevision() {
|
||||
return minRevision;
|
||||
}
|
||||
|
||||
// 227
|
||||
public int getMaxRevision() {
|
||||
return maxRevision;
|
||||
}
|
||||
|
||||
|
||||
public boolean isCompatible(int versionNum) {
|
||||
return ((maxRevision == 0 || versionNum < maxRevision) && versionNum > minRevision);
|
||||
}
|
||||
|
||||
|
||||
abstract public ContributionType getType();
|
||||
|
||||
|
||||
public String getTypeName() {
|
||||
return getType().toString();
|
||||
}
|
||||
|
||||
|
||||
abstract public boolean isInstalled();
|
||||
|
||||
|
||||
// /**
|
||||
// * Returns true if the type of contribution requires the PDE to restart
|
||||
// * when being added or removed.
|
||||
// */
|
||||
// public boolean requiresRestart() {
|
||||
// return getType() == ContributionType.TOOL || getType() == ContributionType.MODE;
|
||||
// }
|
||||
|
||||
|
||||
boolean isRestartFlagged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/** Overridden by LocalContribution. */
|
||||
boolean isDeletionFlagged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
boolean isUpdateFlagged() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns true if the contribution is a starred/recommended contribution, or
|
||||
* is by the Processing Foundation.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isSpecial() {
|
||||
try {
|
||||
return (authorList.indexOf("The Processing Foundation") != -1 ||
|
||||
categories.contains(SPECIAL_CATEGORY_NAME));
|
||||
} catch (NullPointerException npe) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return a single element list with "Unknown" as the category.
|
||||
*/
|
||||
static List<String> defaultCategory() {
|
||||
List<String> outgoing = new ArrayList<String>();
|
||||
outgoing.add("Unknown");
|
||||
return outgoing;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the list of categories that this contribution is part of
|
||||
* (e.g. "Typography / Geometry"). "Unknown" if the category null.
|
||||
*/
|
||||
static List<String> parseCategories(String categoryStr) {
|
||||
List<String> outgoing = new ArrayList<String>();
|
||||
|
||||
if (categoryStr != null) {
|
||||
String[] listing = PApplet.trim(PApplet.split(categoryStr, ','));
|
||||
for (String category : listing) {
|
||||
if (validCategories.contains(category)) {
|
||||
outgoing.add(category);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (outgoing.size() == 0) {
|
||||
return defaultCategory();
|
||||
}
|
||||
return outgoing;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,176 +1,176 @@
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2013 The Processing Foundation
|
||||
Copyright (c) 2011-12 Ben Fry and Casey Reas
|
||||
|
||||
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.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.*;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Mode;
|
||||
|
||||
|
||||
public class ModeContribution extends LocalContribution {
|
||||
private Mode mode;
|
||||
|
||||
|
||||
static public ModeContribution load(Base base, File folder) {
|
||||
return load(base, folder, null);
|
||||
}
|
||||
|
||||
|
||||
static public ModeContribution load(Base base, File folder,
|
||||
String searchName) {
|
||||
try {
|
||||
return new ModeContribution(base, folder, searchName);
|
||||
|
||||
} catch (IgnorableException ig) {
|
||||
Base.log(ig.getMessage());
|
||||
|
||||
} catch (Throwable err) {
|
||||
// Throwable to catch Exceptions or UnsupportedClassVersionError et al
|
||||
if (searchName == null) {
|
||||
err.printStackTrace();
|
||||
} else {
|
||||
// For the built-in modes, don't print the exception, just log it
|
||||
// for debugging. This should be impossible for most users to reach,
|
||||
// but it helps us load experimental mode when it's available.
|
||||
Base.log("ModeContribution.load() failed for " + searchName, err);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param base the base object that this will be tied to
|
||||
* @param folder location inside the sketchbook modes folder or contrib
|
||||
* @param className name of class and full package, or null to use default
|
||||
* @throws Exception
|
||||
*/
|
||||
private ModeContribution(Base base, File folder,
|
||||
String className) throws Exception {
|
||||
super(folder);
|
||||
|
||||
className = initLoader(className);
|
||||
if (className != null) {
|
||||
Class<?> modeClass = loader.loadClass(className);
|
||||
Constructor con = modeClass.getConstructor(Base.class, File.class);
|
||||
mode = (Mode) con.newInstance(base, folder);
|
||||
mode.setClassLoader(loader);
|
||||
if (base != null) {
|
||||
mode.setupGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to close the ClassLoader so that the archives are no longer "locked"
|
||||
* and a mode can be removed without restart.
|
||||
*/
|
||||
public void clearClassLoader(Base base) {
|
||||
|
||||
ArrayList<ModeContribution> contribModes = base.getModeContribs();
|
||||
int botherToRemove = contribModes.indexOf(this);
|
||||
if (botherToRemove != -1) { // The poor thing isn't even loaded, and we're trying to remove it...
|
||||
contribModes.remove(botherToRemove);
|
||||
|
||||
try {
|
||||
((URLClassLoader) loader).close();
|
||||
// The typecast should be safe, since the only case when loader is not of
|
||||
// type URLClassLoader is when no archives were found in the first
|
||||
// place...
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public void loadMissing(Base base) {
|
||||
File modesFolder = Base.getSketchbookModesFolder();
|
||||
ArrayList<ModeContribution> contribModes = base.getModeContribs();
|
||||
|
||||
HashMap<File, ModeContribution> existing = new HashMap<File, ModeContribution>();
|
||||
for (ModeContribution contrib : contribModes) {
|
||||
existing.put(contrib.getFolder(), contrib);
|
||||
}
|
||||
File[] potential = ContributionType.MODE.listCandidates(modesFolder);
|
||||
// If modesFolder does not exist or is inaccessible (folks might like to
|
||||
// mess with folders then report it as a bug) 'potential' will be null.
|
||||
if (potential != null) {
|
||||
for (File folder : potential) {
|
||||
if (!existing.containsKey(folder)) {
|
||||
try {
|
||||
contribModes.add(new ModeContribution(base, folder, null));
|
||||
} catch (IgnorableException ig) {
|
||||
Base.log(ig.getMessage());
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This allows you to build and test your Mode code from Eclipse.
|
||||
// -Dusemode=com.foo.FrobMode:/path/to/FrobMode
|
||||
final String useMode = System.getProperty("usemode");
|
||||
if (useMode != null) {
|
||||
final String[] modeInfo = useMode.split(":", 2);
|
||||
final String modeClass = modeInfo[0];
|
||||
final String modeResourcePath = modeInfo[1];
|
||||
System.out.println("Attempting to load " + modeClass + " with resources at " + modeResourcePath);
|
||||
contribModes.add(ModeContribution.load(base, new File(modeResourcePath), modeClass));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Mode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
public ContributionType getType() {
|
||||
return ContributionType.MODE;
|
||||
}
|
||||
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || !(o instanceof ModeContribution)) {
|
||||
return false;
|
||||
}
|
||||
ModeContribution other = (ModeContribution) o;
|
||||
return loader.equals(other.loader) && mode.equals(other.getMode());
|
||||
}
|
||||
|
||||
|
||||
// static protected List<File> discover(File folder) {
|
||||
// File[] folders = listCandidates(folder, "mode");
|
||||
// if (folders == null) {
|
||||
// return new ArrayList<File>();
|
||||
// } else {
|
||||
// return Arrays.asList(folders);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2013 The Processing Foundation
|
||||
Copyright (c) 2011-12 Ben Fry and Casey Reas
|
||||
|
||||
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.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.*;
|
||||
|
||||
import processing.app.Base;
|
||||
import processing.app.Mode;
|
||||
|
||||
|
||||
public class ModeContribution extends LocalContribution {
|
||||
private Mode mode;
|
||||
|
||||
|
||||
static public ModeContribution load(Base base, File folder) {
|
||||
return load(base, folder, null);
|
||||
}
|
||||
|
||||
|
||||
static public ModeContribution load(Base base, File folder,
|
||||
String searchName) {
|
||||
try {
|
||||
return new ModeContribution(base, folder, searchName);
|
||||
|
||||
} catch (IgnorableException ig) {
|
||||
Base.log(ig.getMessage());
|
||||
|
||||
} catch (Throwable err) {
|
||||
// Throwable to catch Exceptions or UnsupportedClassVersionError et al
|
||||
if (searchName == null) {
|
||||
err.printStackTrace();
|
||||
} else {
|
||||
// For the built-in modes, don't print the exception, just log it
|
||||
// for debugging. This should be impossible for most users to reach,
|
||||
// but it helps us load experimental mode when it's available.
|
||||
Base.log("ModeContribution.load() failed for " + searchName, err);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param base the base object that this will be tied to
|
||||
* @param folder location inside the sketchbook modes folder or contrib
|
||||
* @param className name of class and full package, or null to use default
|
||||
* @throws Exception
|
||||
*/
|
||||
private ModeContribution(Base base, File folder,
|
||||
String className) throws Exception {
|
||||
super(folder);
|
||||
|
||||
className = initLoader(className);
|
||||
if (className != null) {
|
||||
Class<?> modeClass = loader.loadClass(className);
|
||||
Constructor con = modeClass.getConstructor(Base.class, File.class);
|
||||
mode = (Mode) con.newInstance(base, folder);
|
||||
mode.setClassLoader(loader);
|
||||
if (base != null) {
|
||||
mode.setupGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to close the ClassLoader so that the archives are no longer "locked"
|
||||
* and a mode can be removed without restart.
|
||||
*/
|
||||
public void clearClassLoader(Base base) {
|
||||
|
||||
ArrayList<ModeContribution> contribModes = base.getModeContribs();
|
||||
int botherToRemove = contribModes.indexOf(this);
|
||||
if (botherToRemove != -1) { // The poor thing isn't even loaded, and we're trying to remove it...
|
||||
contribModes.remove(botherToRemove);
|
||||
|
||||
try {
|
||||
((URLClassLoader) loader).close();
|
||||
// The typecast should be safe, since the only case when loader is not of
|
||||
// type URLClassLoader is when no archives were found in the first
|
||||
// place...
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static public void loadMissing(Base base) {
|
||||
File modesFolder = Base.getSketchbookModesFolder();
|
||||
ArrayList<ModeContribution> contribModes = base.getModeContribs();
|
||||
|
||||
HashMap<File, ModeContribution> existing = new HashMap<File, ModeContribution>();
|
||||
for (ModeContribution contrib : contribModes) {
|
||||
existing.put(contrib.getFolder(), contrib);
|
||||
}
|
||||
File[] potential = ContributionType.MODE.listCandidates(modesFolder);
|
||||
// If modesFolder does not exist or is inaccessible (folks might like to
|
||||
// mess with folders then report it as a bug) 'potential' will be null.
|
||||
if (potential != null) {
|
||||
for (File folder : potential) {
|
||||
if (!existing.containsKey(folder)) {
|
||||
try {
|
||||
contribModes.add(new ModeContribution(base, folder, null));
|
||||
} catch (IgnorableException ig) {
|
||||
Base.log(ig.getMessage());
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This allows you to build and test your Mode code from Eclipse.
|
||||
// -Dusemode=com.foo.FrobMode:/path/to/FrobMode
|
||||
final String useMode = System.getProperty("usemode");
|
||||
if (useMode != null) {
|
||||
final String[] modeInfo = useMode.split(":", 2);
|
||||
final String modeClass = modeInfo[0];
|
||||
final String modeResourcePath = modeInfo[1];
|
||||
System.out.println("Attempting to load " + modeClass + " with resources at " + modeResourcePath);
|
||||
contribModes.add(ModeContribution.load(base, new File(modeResourcePath), modeClass));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Mode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
public ContributionType getType() {
|
||||
return ContributionType.MODE;
|
||||
}
|
||||
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (o == null || !(o instanceof ModeContribution)) {
|
||||
return false;
|
||||
}
|
||||
ModeContribution other = (ModeContribution) o;
|
||||
return loader.equals(other.loader) && mode.equals(other.getMode());
|
||||
}
|
||||
|
||||
|
||||
// static protected List<File> discover(File folder) {
|
||||
// File[] folders = listCandidates(folder, "mode");
|
||||
// if (folders == null) {
|
||||
// return new ArrayList<File>();
|
||||
// } else {
|
||||
// return Arrays.asList(folders);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -1,182 +1,182 @@
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2013 The Processing Foundation
|
||||
Copyright (c) 2011-12 Ben Fry and Casey Reas
|
||||
|
||||
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.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URLClassLoader;
|
||||
//import java.net.*;
|
||||
import java.util.*;
|
||||
|
||||
import processing.app.Base;
|
||||
//import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.app.tools.Tool;
|
||||
|
||||
|
||||
public class ToolContribution extends LocalContribution implements Tool {
|
||||
private Tool tool;
|
||||
|
||||
private File referenceFile; // shortname/reference/index.html
|
||||
|
||||
static public ToolContribution load(File folder) {
|
||||
try {
|
||||
return new ToolContribution(folder);
|
||||
} catch (IgnorableException ig) {
|
||||
Base.log(ig.getMessage());
|
||||
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
||||
|
||||
/*
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Copyright (c) 2013 The Processing Foundation
|
||||
Copyright (c) 2011-12 Ben Fry and Casey Reas
|
||||
|
||||
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.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
package processing.app.contrib;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.URLClassLoader;
|
||||
//import java.net.*;
|
||||
import java.util.*;
|
||||
|
||||
import processing.app.Base;
|
||||
//import processing.app.Base;
|
||||
import processing.app.Editor;
|
||||
import processing.app.tools.Tool;
|
||||
|
||||
|
||||
public class ToolContribution extends LocalContribution implements Tool {
|
||||
private Tool tool;
|
||||
|
||||
private File referenceFile; // shortname/reference/index.html
|
||||
|
||||
static public ToolContribution load(File folder) {
|
||||
try {
|
||||
return new ToolContribution(folder);
|
||||
} catch (IgnorableException ig) {
|
||||
Base.log(ig.getMessage());
|
||||
|
||||
} catch (VerifyError ve) { // incompatible
|
||||
// avoid the excessive error spew that happens here
|
||||
|
||||
} catch (Throwable e) { // unknown error
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private ToolContribution(File folder) throws Throwable {
|
||||
super(folder);
|
||||
|
||||
String className = initLoader(null);
|
||||
if (className != null) {
|
||||
Class<?> toolClass = loader.loadClass(className);
|
||||
tool = (Tool) toolClass.newInstance();
|
||||
}
|
||||
|
||||
referenceFile = new File(folder, "reference/index.html");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to close the ClassLoader so that the archives are no longer "locked" and
|
||||
* a tool can be removed without restart.
|
||||
*/
|
||||
public void clearClassLoader(Base base) {
|
||||
try {
|
||||
((URLClassLoader) this.loader).close();
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
Iterator<Editor> editorIter = base.getEditors().iterator();
|
||||
while (editorIter.hasNext()) {
|
||||
Editor editor = editorIter.next();
|
||||
ArrayList<ToolContribution> contribTools = editor.contribTools;
|
||||
for (ToolContribution toolContrib : contribTools)
|
||||
if (toolContrib.getName().equals(this.name)) {
|
||||
try {
|
||||
((URLClassLoader) toolContrib.loader).close();
|
||||
editor.contribTools.remove(toolContrib);
|
||||
break;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// base.getActiveEditor().rebuildToolMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static protected List<File> discover(File folder) {
|
||||
// File[] folders = listCandidates(folder, "tool");
|
||||
// if (folders == null) {
|
||||
// return new ArrayList<File>();
|
||||
// } else {
|
||||
// return Arrays.asList(folders);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
static public ArrayList<ToolContribution> loadAll(File toolsFolder) {
|
||||
File[] list = ContributionType.TOOL.listCandidates(toolsFolder);
|
||||
ArrayList<ToolContribution> outgoing = new ArrayList<ToolContribution>();
|
||||
// If toolsFolder does not exist or is inaccessible (stranger things have
|
||||
// happened, and are reported as bugs) list will come back null.
|
||||
if (list != null) {
|
||||
for (File folder : list) {
|
||||
try {
|
||||
ToolContribution tc = load(folder);
|
||||
if (tc != null) {
|
||||
outgoing.add(tc);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return outgoing;
|
||||
}
|
||||
|
||||
|
||||
// Editor editor; // used to send error messages
|
||||
|
||||
public void init(Editor editor) {
|
||||
// try {
|
||||
// this.editor = editor;
|
||||
tool.init(editor);
|
||||
// } catch (NoSuchMethodError nsme) {
|
||||
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
|
||||
// nsme.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
// try {
|
||||
tool.run();
|
||||
// } catch (NoSuchMethodError nsme) {
|
||||
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
|
||||
// nsme.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public String getMenuTitle() {
|
||||
return tool.getMenuTitle();
|
||||
}
|
||||
|
||||
|
||||
public ContributionType getType() {
|
||||
return ContributionType.TOOL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the object stored in the referenceFile field, which contains an
|
||||
* instance of the file object representing the index file of the reference
|
||||
*
|
||||
* @return referenceFile
|
||||
*/
|
||||
public File getReferenceIndexFile() {
|
||||
return referenceFile;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests whether the reference's index file indicated by referenceFile exists.
|
||||
*
|
||||
* @return true if and only if the file denoted by referenceFile exists; false
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean hasReference() {
|
||||
return referenceFile.exists();
|
||||
}
|
||||
super(folder);
|
||||
|
||||
String className = initLoader(null);
|
||||
if (className != null) {
|
||||
Class<?> toolClass = loader.loadClass(className);
|
||||
tool = (Tool) toolClass.newInstance();
|
||||
}
|
||||
|
||||
referenceFile = new File(folder, "reference/index.html");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Method to close the ClassLoader so that the archives are no longer "locked" and
|
||||
* a tool can be removed without restart.
|
||||
*/
|
||||
public void clearClassLoader(Base base) {
|
||||
try {
|
||||
((URLClassLoader) this.loader).close();
|
||||
} catch (IOException e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
Iterator<Editor> editorIter = base.getEditors().iterator();
|
||||
while (editorIter.hasNext()) {
|
||||
Editor editor = editorIter.next();
|
||||
ArrayList<ToolContribution> contribTools = editor.contribTools;
|
||||
for (ToolContribution toolContrib : contribTools)
|
||||
if (toolContrib.getName().equals(this.name)) {
|
||||
try {
|
||||
((URLClassLoader) toolContrib.loader).close();
|
||||
editor.contribTools.remove(toolContrib);
|
||||
break;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// base.getActiveEditor().rebuildToolMenu();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// static protected List<File> discover(File folder) {
|
||||
// File[] folders = listCandidates(folder, "tool");
|
||||
// if (folders == null) {
|
||||
// return new ArrayList<File>();
|
||||
// } else {
|
||||
// return Arrays.asList(folders);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
static public ArrayList<ToolContribution> loadAll(File toolsFolder) {
|
||||
File[] list = ContributionType.TOOL.listCandidates(toolsFolder);
|
||||
ArrayList<ToolContribution> outgoing = new ArrayList<ToolContribution>();
|
||||
// If toolsFolder does not exist or is inaccessible (stranger things have
|
||||
// happened, and are reported as bugs) list will come back null.
|
||||
if (list != null) {
|
||||
for (File folder : list) {
|
||||
try {
|
||||
ToolContribution tc = load(folder);
|
||||
if (tc != null) {
|
||||
outgoing.add(tc);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return outgoing;
|
||||
}
|
||||
|
||||
|
||||
// Editor editor; // used to send error messages
|
||||
|
||||
public void init(Editor editor) {
|
||||
// try {
|
||||
// this.editor = editor;
|
||||
tool.init(editor);
|
||||
// } catch (NoSuchMethodError nsme) {
|
||||
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
|
||||
// nsme.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
// try {
|
||||
tool.run();
|
||||
// } catch (NoSuchMethodError nsme) {
|
||||
// editor.statusError(tool.getMenuTitle() + " is not compatible with this version of Processing");
|
||||
// nsme.printStackTrace();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
public String getMenuTitle() {
|
||||
return tool.getMenuTitle();
|
||||
}
|
||||
|
||||
|
||||
public ContributionType getType() {
|
||||
return ContributionType.TOOL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the object stored in the referenceFile field, which contains an
|
||||
* instance of the file object representing the index file of the reference
|
||||
*
|
||||
* @return referenceFile
|
||||
*/
|
||||
public File getReferenceIndexFile() {
|
||||
return referenceFile;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests whether the reference's index file indicated by referenceFile exists.
|
||||
*
|
||||
* @return true if and only if the file denoted by referenceFile exists; false
|
||||
* otherwise.
|
||||
*/
|
||||
public boolean hasReference() {
|
||||
return referenceFile.exists();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,394 +1,394 @@
|
||||
/* -*- mode: antlr; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
header {
|
||||
package processing.mode.java.preproc;
|
||||
}
|
||||
|
||||
class PdeRecognizer extends JavaRecognizer;
|
||||
|
||||
options {
|
||||
importVocab = Java;
|
||||
exportVocab = PdePartial;
|
||||
|
||||
//codeGenMakeSwitchThreshold=10; // this is set high for debugging
|
||||
//codeGenBitsetTestThreshold=10; // this is set high for debugging
|
||||
|
||||
// developers may to want to set this to true for better
|
||||
// debugging messages, however, doing so disables highlighting errors
|
||||
// in the editor.
|
||||
defaultErrorHandler = false; //true;
|
||||
}
|
||||
|
||||
tokens {
|
||||
CONSTRUCTOR_CAST; EMPTY_FIELD;
|
||||
}
|
||||
|
||||
{
|
||||
// this clause copied from java15.g! ANTLR does not copy this
|
||||
// section from the super grammar.
|
||||
/**
|
||||
* Counts the number of LT seen in the typeArguments production.
|
||||
* It is used in semantic predicates to ensure we have seen
|
||||
* enough closing '>' characters; which actually may have been
|
||||
* either GT, SR or BSR tokens.
|
||||
*/
|
||||
private int ltCounter = 0;
|
||||
|
||||
private PdePreprocessor pp;
|
||||
public PdeRecognizer(final PdePreprocessor pp, final TokenStream ts) {
|
||||
this(ts);
|
||||
this.pp = pp;
|
||||
}
|
||||
|
||||
private void mixed() throws RecognitionException, TokenStreamException {
|
||||
throw new RecognitionException("It looks like you're mixing \"active\" and \"static\" modes.",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}
|
||||
}
|
||||
|
||||
pdeProgram
|
||||
:
|
||||
// Some programs can be equally well interpreted as STATIC or ACTIVE;
|
||||
// this forces the parser to prefer the STATIC interpretation.
|
||||
(staticProgram) => staticProgram
|
||||
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
|
||||
|
||||
| (activeProgram) => activeProgram
|
||||
{ pp.setMode(PdePreprocessor.Mode.ACTIVE); }
|
||||
|
||||
| staticProgram
|
||||
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
|
||||
;
|
||||
|
||||
// advanced mode is really just a normal java file
|
||||
javaProgram
|
||||
: compilationUnit
|
||||
;
|
||||
|
||||
activeProgram
|
||||
: (
|
||||
(IDENT LPAREN) => IDENT LPAREN { mixed(); }
|
||||
| possiblyEmptyField
|
||||
)+ EOF!
|
||||
;
|
||||
|
||||
staticProgram
|
||||
: (
|
||||
statement
|
||||
)* EOF!
|
||||
;
|
||||
|
||||
// copy of the java.g rule with WEBCOLOR_LITERAL added
|
||||
constant
|
||||
: NUM_INT
|
||||
| CHAR_LITERAL
|
||||
| STRING_LITERAL
|
||||
| NUM_FLOAT
|
||||
| NUM_LONG
|
||||
| NUM_DOUBLE
|
||||
| webcolor_literal
|
||||
;
|
||||
|
||||
// fix bug http://dev.processing.org/bugs/show_bug.cgi?id=1519
|
||||
// by altering a syntactic predicate whose sole purpose is to
|
||||
// emit a useless error with no line numbers.
|
||||
// These are from Java15.g, with a few lines edited to make nice errors.
|
||||
|
||||
// Type arguments to a class or interface type
|
||||
typeArguments
|
||||
{int currentLtLevel = 0;}
|
||||
:
|
||||
{currentLtLevel = ltCounter;}
|
||||
LT! {ltCounter++;}
|
||||
typeArgument
|
||||
(options{greedy=true;}: // match as many as possible
|
||||
{if (! (inputState.guessing !=0 || ltCounter == currentLtLevel + 1)) {
|
||||
throw new RecognitionException("Maybe too many > characters?",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}}
|
||||
COMMA! typeArgument
|
||||
)*
|
||||
|
||||
( // turn warning off since Antlr generates the right code,
|
||||
// plus we have our semantic predicate below
|
||||
options{generateAmbigWarnings=false;}:
|
||||
typeArgumentsOrParametersEnd
|
||||
)?
|
||||
|
||||
// make sure we have gobbled up enough '>' characters
|
||||
// if we are at the "top level" of nested typeArgument productions
|
||||
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
|
||||
throw new RecognitionException("Maybe too many > characters?",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}}
|
||||
|
||||
{#typeArguments = #(#[TYPE_ARGUMENTS, "TYPE_ARGUMENTS"], #typeArguments);}
|
||||
;
|
||||
|
||||
typeParameters
|
||||
{int currentLtLevel = 0;}
|
||||
:
|
||||
{currentLtLevel = ltCounter;}
|
||||
LT! {ltCounter++;}
|
||||
typeParameter (COMMA! typeParameter)*
|
||||
(typeArgumentsOrParametersEnd)?
|
||||
|
||||
// make sure we have gobbled up enough '>' characters
|
||||
// if we are at the "top level" of nested typeArgument productions
|
||||
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
|
||||
throw new RecognitionException("Maybe too many > characters?",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}}
|
||||
|
||||
{#typeParameters = #(#[TYPE_PARAMETERS, "TYPE_PARAMETERS"], #typeParameters);}
|
||||
;
|
||||
|
||||
|
||||
// this gobbles up *some* amount of '>' characters, and counts how many
|
||||
// it gobbled.
|
||||
protected typeArgumentsOrParametersEnd
|
||||
: GT! {ltCounter-=1;}
|
||||
| SR! {ltCounter-=2;}
|
||||
| BSR! {ltCounter-=3;}
|
||||
;
|
||||
|
||||
// of the form #cc008f in PDE
|
||||
webcolor_literal
|
||||
: w:WEBCOLOR_LITERAL
|
||||
{ if (! (processing.app.Preferences.getBoolean("preproc.web_colors")
|
||||
&&
|
||||
w.getText().length() == 6)) {
|
||||
throw new RecognitionException("Web colors must be exactly 6 hex digits. This looks like " + w.getText().length() + ".",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}} // must be exactly 6 hex digits
|
||||
;
|
||||
|
||||
// copy of the java.g builtInType rule
|
||||
builtInConsCastType
|
||||
: "void"
|
||||
| "boolean"
|
||||
| "byte"
|
||||
| "char"
|
||||
| "short"
|
||||
| "int"
|
||||
| "float"
|
||||
| "long"
|
||||
| "double"
|
||||
;
|
||||
|
||||
// our types include the java types and "color". this is separated into two
|
||||
// rules so that constructor casts can just use the original typelist, since
|
||||
// we don't want to support the color type as a constructor cast.
|
||||
//
|
||||
builtInType
|
||||
: builtInConsCastType
|
||||
| "color" // aliased to an int in PDE
|
||||
{ processing.app.Preferences.getBoolean("preproc.color_datatype") }?
|
||||
;
|
||||
|
||||
// constructor style casts.
|
||||
constructorCast!
|
||||
: t:consCastTypeSpec[true]
|
||||
LPAREN!
|
||||
e:expression
|
||||
RPAREN!
|
||||
// if this is a string literal, make sure the type we're trying to cast
|
||||
// to is one of the supported ones
|
||||
//
|
||||
{ (#e == null) ||
|
||||
( (#e.getType() != STRING_LITERAL) ||
|
||||
( #t.getType() == LITERAL_boolean ||
|
||||
#t.getType() == LITERAL_double ||
|
||||
#t.getType() == LITERAL_float ||
|
||||
#t.getType() == LITERAL_int ||
|
||||
#t.getType() == LITERAL_long ||
|
||||
#t.getType() == LITERAL_short )) }?
|
||||
// create the node
|
||||
//
|
||||
{#constructorCast = #(#[CONSTRUCTOR_CAST,"CONSTRUCTOR_CAST"], t, e);}
|
||||
;
|
||||
|
||||
// A list of types that be used as the destination type in a constructor-style
|
||||
// cast. Ideally, this would include all class types, not just "String".
|
||||
// Unfortunately, it's not possible to tell whether Foo(5) is supposed to be
|
||||
// a method call or a constructor cast without have a table of all valid
|
||||
// types or methods, which requires semantic analysis (eg processing of import
|
||||
// statements). So we accept the set of built-in types plus "String".
|
||||
//
|
||||
consCastTypeSpec[boolean addImagNode]
|
||||
// : stringTypeSpec[addImagNode]
|
||||
// | builtInConsCastTypeSpec[addImagNode]
|
||||
: builtInConsCastTypeSpec[addImagNode]
|
||||
// trying to remove String() cast [fry]
|
||||
;
|
||||
|
||||
//stringTypeSpec[boolean addImagNode]
|
||||
// : id:IDENT { #id.getText().equals("String") }?
|
||||
// {
|
||||
// if ( addImagNode ) {
|
||||
// #stringTypeSpec = #(#[TYPE,"TYPE"],
|
||||
// #stringTypeSpec);
|
||||
// }
|
||||
// }
|
||||
// ;
|
||||
|
||||
builtInConsCastTypeSpec[boolean addImagNode]
|
||||
: builtInConsCastType
|
||||
{
|
||||
if ( addImagNode ) {
|
||||
#builtInConsCastTypeSpec = #(#[TYPE,"TYPE"],
|
||||
#builtInConsCastTypeSpec);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
// Since "color" tokens are lexed as LITERAL_color now, we need to have a rule
|
||||
// that can generate a method call from an expression that starts with this
|
||||
// token
|
||||
//
|
||||
colorMethodCall
|
||||
: c:"color" {#c.setType(IDENT);} // this would default to LITERAL_color
|
||||
lp:LPAREN^ {#lp.setType(METHOD_CALL);}
|
||||
argList
|
||||
RPAREN!
|
||||
;
|
||||
|
||||
// copy of the java.g rule with added constructorCast and colorMethodCall
|
||||
// alternatives
|
||||
primaryExpression
|
||||
: (consCastTypeSpec[false] LPAREN) => constructorCast
|
||||
{ processing.app.Preferences.getBoolean("preproc.enhanced_casting") }?
|
||||
| identPrimary ( options {greedy=true;} : DOT^ "class" )?
|
||||
| constant
|
||||
| "true"
|
||||
| "false"
|
||||
| "null"
|
||||
| newExpression
|
||||
| "this"
|
||||
| "super"
|
||||
| LPAREN! assignmentExpression RPAREN!
|
||||
| colorMethodCall
|
||||
// look for int.class and int[].class
|
||||
| builtInType
|
||||
( lbt:LBRACK^ {#lbt.setType(ARRAY_DECLARATOR);} RBRACK! )*
|
||||
DOT^ "class"
|
||||
;
|
||||
|
||||
// the below variable rule hacks are needed so that it's possible for the
|
||||
// emitter to correctly output variable declarations of the form "float a, b"
|
||||
// from the AST. This means that our AST has a somewhat different form in
|
||||
// these rules than the java one does, and this new form may have its own
|
||||
// semantic issues. But it seems to fix the comma declaration issues.
|
||||
//
|
||||
variableDefinitions![AST mods, AST t]
|
||||
: vd:variableDeclarator[getASTFactory().dupTree(mods),
|
||||
getASTFactory().dupTree(t)]
|
||||
{#variableDefinitions = #(#[VARIABLE_DEF,"VARIABLE_DEF"], mods,
|
||||
t, vd);}
|
||||
;
|
||||
variableDeclarator[AST mods, AST t]
|
||||
: ( id:IDENT (lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK!)*
|
||||
v:varInitializer (COMMA!)? )+
|
||||
;
|
||||
|
||||
// java.g builds syntax trees with an inconsistent structure. override one of
|
||||
// the rules there to fix this.
|
||||
//
|
||||
explicitConstructorInvocation!
|
||||
: (typeArguments)?
|
||||
t:"this" LPAREN a1:argList RPAREN SEMI
|
||||
{#explicitConstructorInvocation = #(#[CTOR_CALL, "CTOR_CALL"],
|
||||
#t, #a1);}
|
||||
| s:"super" LPAREN a2:argList RPAREN SEMI
|
||||
{#explicitConstructorInvocation = #(#[SUPER_CTOR_CALL,
|
||||
"SUPER_CTOR_CALL"],
|
||||
#s, #a2);}
|
||||
;
|
||||
|
||||
// quick-n-dirty hack to the get the advanced class name. we should
|
||||
// really be getting it from the AST and not forking this rule from
|
||||
// the java.g copy at all. Since this is a recursive descent parser, we get
|
||||
// the last class name in the file so that we don't end up with the classname
|
||||
// of an inner class. If there is more than one "outer" class in a file,
|
||||
// this heuristic will fail.
|
||||
//
|
||||
classDefinition![AST modifiers]
|
||||
: "class" i:IDENT
|
||||
// it _might_ have type paramaters
|
||||
(tp:typeParameters)?
|
||||
// it _might_ have a superclass...
|
||||
sc:superClassClause
|
||||
// it might implement some interfaces...
|
||||
ic:implementsClause
|
||||
// now parse the body of the class
|
||||
cb:classBlock
|
||||
{#classDefinition = #(#[CLASS_DEF,"CLASS_DEF"],
|
||||
modifiers,i,tp,sc,ic,cb);
|
||||
pp.setAdvClassName(i.getText());}
|
||||
;
|
||||
|
||||
possiblyEmptyField
|
||||
: classField
|
||||
| s:SEMI {#s.setType(EMPTY_FIELD);}
|
||||
;
|
||||
|
||||
class PdeLexer extends JavaLexer;
|
||||
|
||||
options {
|
||||
importVocab=PdePartial;
|
||||
exportVocab=Pde;
|
||||
}
|
||||
|
||||
// We need to preserve whitespace and commentary instead of ignoring
|
||||
// like the supergrammar does. Otherwise Jikes won't be able to give
|
||||
// us error messages that point to the equivalent PDE code.
|
||||
|
||||
// WS, SL_COMMENT, ML_COMMENT are copies of the original productions,
|
||||
// but with the SKIP assigment removed.
|
||||
|
||||
WS : ( ' '
|
||||
| '\t'
|
||||
| '\f'
|
||||
// handle newlines
|
||||
| ( options {generateAmbigWarnings=false;}
|
||||
: "\r\n" // Evil DOS
|
||||
| '\r' // Macintosh
|
||||
| '\n' // Unix (the right way)
|
||||
)
|
||||
{ newline(); }
|
||||
)+
|
||||
;
|
||||
|
||||
// Single-line comments
|
||||
SL_COMMENT
|
||||
: "//"
|
||||
(~('\n'|'\r'))* ('\n'|'\r'('\n')?)
|
||||
{newline();}
|
||||
;
|
||||
|
||||
// multiple-line comments
|
||||
ML_COMMENT
|
||||
: "/*"
|
||||
( /* '\r' '\n' can be matched in one alternative or by matching
|
||||
'\r' in one iteration and '\n' in another. I am trying to
|
||||
handle any flavor of newline that comes in, but the language
|
||||
that allows both "\r\n" and "\r" and "\n" to all be valid
|
||||
newline is ambiguous. Consequently, the resulting grammar
|
||||
must be ambiguous. I'm shutting this warning off.
|
||||
*/
|
||||
options {
|
||||
generateAmbigWarnings=false;
|
||||
}
|
||||
:
|
||||
{ LA(2)!='/' }? '*'
|
||||
| '\r' '\n' {newline();}
|
||||
| '\r' {newline();}
|
||||
| '\n' {newline();}
|
||||
| ~('*'|'\n'|'\r')
|
||||
)*
|
||||
"*/"
|
||||
;
|
||||
|
||||
WEBCOLOR_LITERAL
|
||||
: '#'! (HEX_DIGIT)+
|
||||
;
|
||||
|
||||
/* -*- mode: antlr; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
header {
|
||||
package processing.mode.java.preproc;
|
||||
}
|
||||
|
||||
class PdeRecognizer extends JavaRecognizer;
|
||||
|
||||
options {
|
||||
importVocab = Java;
|
||||
exportVocab = PdePartial;
|
||||
|
||||
//codeGenMakeSwitchThreshold=10; // this is set high for debugging
|
||||
//codeGenBitsetTestThreshold=10; // this is set high for debugging
|
||||
|
||||
// developers may to want to set this to true for better
|
||||
// debugging messages, however, doing so disables highlighting errors
|
||||
// in the editor.
|
||||
defaultErrorHandler = false; //true;
|
||||
}
|
||||
|
||||
tokens {
|
||||
CONSTRUCTOR_CAST; EMPTY_FIELD;
|
||||
}
|
||||
|
||||
{
|
||||
// this clause copied from java15.g! ANTLR does not copy this
|
||||
// section from the super grammar.
|
||||
/**
|
||||
* Counts the number of LT seen in the typeArguments production.
|
||||
* It is used in semantic predicates to ensure we have seen
|
||||
* enough closing '>' characters; which actually may have been
|
||||
* either GT, SR or BSR tokens.
|
||||
*/
|
||||
private int ltCounter = 0;
|
||||
|
||||
private PdePreprocessor pp;
|
||||
public PdeRecognizer(final PdePreprocessor pp, final TokenStream ts) {
|
||||
this(ts);
|
||||
this.pp = pp;
|
||||
}
|
||||
|
||||
private void mixed() throws RecognitionException, TokenStreamException {
|
||||
throw new RecognitionException("It looks like you're mixing \"active\" and \"static\" modes.",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}
|
||||
}
|
||||
|
||||
pdeProgram
|
||||
:
|
||||
// Some programs can be equally well interpreted as STATIC or ACTIVE;
|
||||
// this forces the parser to prefer the STATIC interpretation.
|
||||
(staticProgram) => staticProgram
|
||||
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
|
||||
|
||||
| (activeProgram) => activeProgram
|
||||
{ pp.setMode(PdePreprocessor.Mode.ACTIVE); }
|
||||
|
||||
| staticProgram
|
||||
{ pp.setMode(PdePreprocessor.Mode.STATIC); }
|
||||
;
|
||||
|
||||
// advanced mode is really just a normal java file
|
||||
javaProgram
|
||||
: compilationUnit
|
||||
;
|
||||
|
||||
activeProgram
|
||||
: (
|
||||
(IDENT LPAREN) => IDENT LPAREN { mixed(); }
|
||||
| possiblyEmptyField
|
||||
)+ EOF!
|
||||
;
|
||||
|
||||
staticProgram
|
||||
: (
|
||||
statement
|
||||
)* EOF!
|
||||
;
|
||||
|
||||
// copy of the java.g rule with WEBCOLOR_LITERAL added
|
||||
constant
|
||||
: NUM_INT
|
||||
| CHAR_LITERAL
|
||||
| STRING_LITERAL
|
||||
| NUM_FLOAT
|
||||
| NUM_LONG
|
||||
| NUM_DOUBLE
|
||||
| webcolor_literal
|
||||
;
|
||||
|
||||
// fix bug http://dev.processing.org/bugs/show_bug.cgi?id=1519
|
||||
// by altering a syntactic predicate whose sole purpose is to
|
||||
// emit a useless error with no line numbers.
|
||||
// These are from Java15.g, with a few lines edited to make nice errors.
|
||||
|
||||
// Type arguments to a class or interface type
|
||||
typeArguments
|
||||
{int currentLtLevel = 0;}
|
||||
:
|
||||
{currentLtLevel = ltCounter;}
|
||||
LT! {ltCounter++;}
|
||||
typeArgument
|
||||
(options{greedy=true;}: // match as many as possible
|
||||
{if (! (inputState.guessing !=0 || ltCounter == currentLtLevel + 1)) {
|
||||
throw new RecognitionException("Maybe too many > characters?",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}}
|
||||
COMMA! typeArgument
|
||||
)*
|
||||
|
||||
( // turn warning off since Antlr generates the right code,
|
||||
// plus we have our semantic predicate below
|
||||
options{generateAmbigWarnings=false;}:
|
||||
typeArgumentsOrParametersEnd
|
||||
)?
|
||||
|
||||
// make sure we have gobbled up enough '>' characters
|
||||
// if we are at the "top level" of nested typeArgument productions
|
||||
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
|
||||
throw new RecognitionException("Maybe too many > characters?",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}}
|
||||
|
||||
{#typeArguments = #(#[TYPE_ARGUMENTS, "TYPE_ARGUMENTS"], #typeArguments);}
|
||||
;
|
||||
|
||||
typeParameters
|
||||
{int currentLtLevel = 0;}
|
||||
:
|
||||
{currentLtLevel = ltCounter;}
|
||||
LT! {ltCounter++;}
|
||||
typeParameter (COMMA! typeParameter)*
|
||||
(typeArgumentsOrParametersEnd)?
|
||||
|
||||
// make sure we have gobbled up enough '>' characters
|
||||
// if we are at the "top level" of nested typeArgument productions
|
||||
{if (! ((currentLtLevel != 0) || ltCounter == currentLtLevel)) {
|
||||
throw new RecognitionException("Maybe too many > characters?",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}}
|
||||
|
||||
{#typeParameters = #(#[TYPE_PARAMETERS, "TYPE_PARAMETERS"], #typeParameters);}
|
||||
;
|
||||
|
||||
|
||||
// this gobbles up *some* amount of '>' characters, and counts how many
|
||||
// it gobbled.
|
||||
protected typeArgumentsOrParametersEnd
|
||||
: GT! {ltCounter-=1;}
|
||||
| SR! {ltCounter-=2;}
|
||||
| BSR! {ltCounter-=3;}
|
||||
;
|
||||
|
||||
// of the form #cc008f in PDE
|
||||
webcolor_literal
|
||||
: w:WEBCOLOR_LITERAL
|
||||
{ if (! (processing.app.Preferences.getBoolean("preproc.web_colors")
|
||||
&&
|
||||
w.getText().length() == 6)) {
|
||||
throw new RecognitionException("Web colors must be exactly 6 hex digits. This looks like " + w.getText().length() + ".",
|
||||
getFilename(), LT(1).getLine(), LT(1).getColumn());
|
||||
}} // must be exactly 6 hex digits
|
||||
;
|
||||
|
||||
// copy of the java.g builtInType rule
|
||||
builtInConsCastType
|
||||
: "void"
|
||||
| "boolean"
|
||||
| "byte"
|
||||
| "char"
|
||||
| "short"
|
||||
| "int"
|
||||
| "float"
|
||||
| "long"
|
||||
| "double"
|
||||
;
|
||||
|
||||
// our types include the java types and "color". this is separated into two
|
||||
// rules so that constructor casts can just use the original typelist, since
|
||||
// we don't want to support the color type as a constructor cast.
|
||||
//
|
||||
builtInType
|
||||
: builtInConsCastType
|
||||
| "color" // aliased to an int in PDE
|
||||
{ processing.app.Preferences.getBoolean("preproc.color_datatype") }?
|
||||
;
|
||||
|
||||
// constructor style casts.
|
||||
constructorCast!
|
||||
: t:consCastTypeSpec[true]
|
||||
LPAREN!
|
||||
e:expression
|
||||
RPAREN!
|
||||
// if this is a string literal, make sure the type we're trying to cast
|
||||
// to is one of the supported ones
|
||||
//
|
||||
{ (#e == null) ||
|
||||
( (#e.getType() != STRING_LITERAL) ||
|
||||
( #t.getType() == LITERAL_boolean ||
|
||||
#t.getType() == LITERAL_double ||
|
||||
#t.getType() == LITERAL_float ||
|
||||
#t.getType() == LITERAL_int ||
|
||||
#t.getType() == LITERAL_long ||
|
||||
#t.getType() == LITERAL_short )) }?
|
||||
// create the node
|
||||
//
|
||||
{#constructorCast = #(#[CONSTRUCTOR_CAST,"CONSTRUCTOR_CAST"], t, e);}
|
||||
;
|
||||
|
||||
// A list of types that be used as the destination type in a constructor-style
|
||||
// cast. Ideally, this would include all class types, not just "String".
|
||||
// Unfortunately, it's not possible to tell whether Foo(5) is supposed to be
|
||||
// a method call or a constructor cast without have a table of all valid
|
||||
// types or methods, which requires semantic analysis (eg processing of import
|
||||
// statements). So we accept the set of built-in types plus "String".
|
||||
//
|
||||
consCastTypeSpec[boolean addImagNode]
|
||||
// : stringTypeSpec[addImagNode]
|
||||
// | builtInConsCastTypeSpec[addImagNode]
|
||||
: builtInConsCastTypeSpec[addImagNode]
|
||||
// trying to remove String() cast [fry]
|
||||
;
|
||||
|
||||
//stringTypeSpec[boolean addImagNode]
|
||||
// : id:IDENT { #id.getText().equals("String") }?
|
||||
// {
|
||||
// if ( addImagNode ) {
|
||||
// #stringTypeSpec = #(#[TYPE,"TYPE"],
|
||||
// #stringTypeSpec);
|
||||
// }
|
||||
// }
|
||||
// ;
|
||||
|
||||
builtInConsCastTypeSpec[boolean addImagNode]
|
||||
: builtInConsCastType
|
||||
{
|
||||
if ( addImagNode ) {
|
||||
#builtInConsCastTypeSpec = #(#[TYPE,"TYPE"],
|
||||
#builtInConsCastTypeSpec);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
// Since "color" tokens are lexed as LITERAL_color now, we need to have a rule
|
||||
// that can generate a method call from an expression that starts with this
|
||||
// token
|
||||
//
|
||||
colorMethodCall
|
||||
: c:"color" {#c.setType(IDENT);} // this would default to LITERAL_color
|
||||
lp:LPAREN^ {#lp.setType(METHOD_CALL);}
|
||||
argList
|
||||
RPAREN!
|
||||
;
|
||||
|
||||
// copy of the java.g rule with added constructorCast and colorMethodCall
|
||||
// alternatives
|
||||
primaryExpression
|
||||
: (consCastTypeSpec[false] LPAREN) => constructorCast
|
||||
{ processing.app.Preferences.getBoolean("preproc.enhanced_casting") }?
|
||||
| identPrimary ( options {greedy=true;} : DOT^ "class" )?
|
||||
| constant
|
||||
| "true"
|
||||
| "false"
|
||||
| "null"
|
||||
| newExpression
|
||||
| "this"
|
||||
| "super"
|
||||
| LPAREN! assignmentExpression RPAREN!
|
||||
| colorMethodCall
|
||||
// look for int.class and int[].class
|
||||
| builtInType
|
||||
( lbt:LBRACK^ {#lbt.setType(ARRAY_DECLARATOR);} RBRACK! )*
|
||||
DOT^ "class"
|
||||
;
|
||||
|
||||
// the below variable rule hacks are needed so that it's possible for the
|
||||
// emitter to correctly output variable declarations of the form "float a, b"
|
||||
// from the AST. This means that our AST has a somewhat different form in
|
||||
// these rules than the java one does, and this new form may have its own
|
||||
// semantic issues. But it seems to fix the comma declaration issues.
|
||||
//
|
||||
variableDefinitions![AST mods, AST t]
|
||||
: vd:variableDeclarator[getASTFactory().dupTree(mods),
|
||||
getASTFactory().dupTree(t)]
|
||||
{#variableDefinitions = #(#[VARIABLE_DEF,"VARIABLE_DEF"], mods,
|
||||
t, vd);}
|
||||
;
|
||||
variableDeclarator[AST mods, AST t]
|
||||
: ( id:IDENT (lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK!)*
|
||||
v:varInitializer (COMMA!)? )+
|
||||
;
|
||||
|
||||
// java.g builds syntax trees with an inconsistent structure. override one of
|
||||
// the rules there to fix this.
|
||||
//
|
||||
explicitConstructorInvocation!
|
||||
: (typeArguments)?
|
||||
t:"this" LPAREN a1:argList RPAREN SEMI
|
||||
{#explicitConstructorInvocation = #(#[CTOR_CALL, "CTOR_CALL"],
|
||||
#t, #a1);}
|
||||
| s:"super" LPAREN a2:argList RPAREN SEMI
|
||||
{#explicitConstructorInvocation = #(#[SUPER_CTOR_CALL,
|
||||
"SUPER_CTOR_CALL"],
|
||||
#s, #a2);}
|
||||
;
|
||||
|
||||
// quick-n-dirty hack to the get the advanced class name. we should
|
||||
// really be getting it from the AST and not forking this rule from
|
||||
// the java.g copy at all. Since this is a recursive descent parser, we get
|
||||
// the last class name in the file so that we don't end up with the classname
|
||||
// of an inner class. If there is more than one "outer" class in a file,
|
||||
// this heuristic will fail.
|
||||
//
|
||||
classDefinition![AST modifiers]
|
||||
: "class" i:IDENT
|
||||
// it _might_ have type paramaters
|
||||
(tp:typeParameters)?
|
||||
// it _might_ have a superclass...
|
||||
sc:superClassClause
|
||||
// it might implement some interfaces...
|
||||
ic:implementsClause
|
||||
// now parse the body of the class
|
||||
cb:classBlock
|
||||
{#classDefinition = #(#[CLASS_DEF,"CLASS_DEF"],
|
||||
modifiers,i,tp,sc,ic,cb);
|
||||
pp.setAdvClassName(i.getText());}
|
||||
;
|
||||
|
||||
possiblyEmptyField
|
||||
: classField
|
||||
| s:SEMI {#s.setType(EMPTY_FIELD);}
|
||||
;
|
||||
|
||||
class PdeLexer extends JavaLexer;
|
||||
|
||||
options {
|
||||
importVocab=PdePartial;
|
||||
exportVocab=Pde;
|
||||
}
|
||||
|
||||
// We need to preserve whitespace and commentary instead of ignoring
|
||||
// like the supergrammar does. Otherwise Jikes won't be able to give
|
||||
// us error messages that point to the equivalent PDE code.
|
||||
|
||||
// WS, SL_COMMENT, ML_COMMENT are copies of the original productions,
|
||||
// but with the SKIP assigment removed.
|
||||
|
||||
WS : ( ' '
|
||||
| '\t'
|
||||
| '\f'
|
||||
// handle newlines
|
||||
| ( options {generateAmbigWarnings=false;}
|
||||
: "\r\n" // Evil DOS
|
||||
| '\r' // Macintosh
|
||||
| '\n' // Unix (the right way)
|
||||
)
|
||||
{ newline(); }
|
||||
)+
|
||||
;
|
||||
|
||||
// Single-line comments
|
||||
SL_COMMENT
|
||||
: "//"
|
||||
(~('\n'|'\r'))* ('\n'|'\r'('\n')?)
|
||||
{newline();}
|
||||
;
|
||||
|
||||
// multiple-line comments
|
||||
ML_COMMENT
|
||||
: "/*"
|
||||
( /* '\r' '\n' can be matched in one alternative or by matching
|
||||
'\r' in one iteration and '\n' in another. I am trying to
|
||||
handle any flavor of newline that comes in, but the language
|
||||
that allows both "\r\n" and "\r" and "\n" to all be valid
|
||||
newline is ambiguous. Consequently, the resulting grammar
|
||||
must be ambiguous. I'm shutting this warning off.
|
||||
*/
|
||||
options {
|
||||
generateAmbigWarnings=false;
|
||||
}
|
||||
:
|
||||
{ LA(2)!='/' }? '*'
|
||||
| '\r' '\n' {newline();}
|
||||
| '\r' {newline();}
|
||||
| '\n' {newline();}
|
||||
| ~('*'|'\n'|'\r')
|
||||
)*
|
||||
"*/"
|
||||
;
|
||||
|
||||
WEBCOLOR_LITERAL
|
||||
: '#'! (HEX_DIGIT)+
|
||||
;
|
||||
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1064 extends PApplet {
|
||||
public void setup() {
|
||||
// import ";
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1064" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1064 extends PApplet {
|
||||
public void setup() {
|
||||
// import ";
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1064" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,41 +1,41 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug136 extends PApplet {
|
||||
|
||||
|
||||
java.util.List alist = Collections.synchronizedList(new ArrayList());
|
||||
|
||||
public void setup() {
|
||||
size(400, 200);
|
||||
alist.add("hello");
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
rect(width/4, height/4, width/2, height/2);
|
||||
synchronized(alist) {
|
||||
alist.get(0);
|
||||
}
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug136" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug136 extends PApplet {
|
||||
|
||||
|
||||
java.util.List alist = Collections.synchronizedList(new ArrayList());
|
||||
|
||||
public void setup() {
|
||||
size(400, 200);
|
||||
alist.add("hello");
|
||||
}
|
||||
|
||||
public void draw() {
|
||||
rect(width/4, height/4, width/2, height/2);
|
||||
synchronized(alist) {
|
||||
alist.get(0);
|
||||
}
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug136" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1362 extends PApplet {
|
||||
public void setup() {
|
||||
if (true) {} else { new String(); }
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1362" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1362 extends PApplet {
|
||||
public void setup() {
|
||||
if (true) {} else { new String(); }
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1362" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1442 extends PApplet {
|
||||
|
||||
public float a() {
|
||||
return 1.0f;
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1442" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1442 extends PApplet {
|
||||
|
||||
public float a() {
|
||||
return 1.0f;
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1442" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1511 extends PApplet {
|
||||
public void setup() {
|
||||
// \u00df
|
||||
|
||||
/**
|
||||
* a
|
||||
*/
|
||||
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1511" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1511 extends PApplet {
|
||||
public void setup() {
|
||||
// \u00df
|
||||
|
||||
/**
|
||||
* a
|
||||
*/
|
||||
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1511" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1512 extends PApplet {
|
||||
public void setup() {
|
||||
println("oi/*");
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1512" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1512 extends PApplet {
|
||||
public void setup() {
|
||||
println("oi/*");
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1512" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1514a extends PApplet {
|
||||
public void setup() {
|
||||
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9\u00e9
|
||||
//----------------------------------------------------------------
|
||||
//--- IMPORTS
|
||||
//----------------------------------------------------------------
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1514a" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1514a extends PApplet {
|
||||
public void setup() {
|
||||
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9\u00e9
|
||||
//----------------------------------------------------------------
|
||||
//--- IMPORTS
|
||||
//----------------------------------------------------------------
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1514a" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1514b extends PApplet {
|
||||
public void setup() {
|
||||
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9
|
||||
//----------------------------------------------------------------
|
||||
//--- IMPORTS
|
||||
//----------------------------------------------------------------
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1514b" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.io.StringWriter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1514b extends PApplet {
|
||||
public void setup() {
|
||||
//----- \u00e8\u00e9\u00e9\u00e8\u00e8\u00e9\u00e9\u00e9\u00e0\u00e9\u00e9\u00e8\u00e9''\u00e9\u00e9
|
||||
//----------------------------------------------------------------
|
||||
//--- IMPORTS
|
||||
//----------------------------------------------------------------
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1514b" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1515 extends PApplet {
|
||||
|
||||
// a class definition that does something with things that extend PApplet
|
||||
class Heythere<T extends PApplet>{
|
||||
}
|
||||
|
||||
// method definition which can do things with papplet
|
||||
public <T extends PApplet> void doSomething( T thing ){
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1515" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1515 extends PApplet {
|
||||
|
||||
// a class definition that does something with things that extend PApplet
|
||||
class Heythere<T extends PApplet>{
|
||||
}
|
||||
|
||||
// method definition which can do things with papplet
|
||||
public <T extends PApplet> void doSomething( T thing ){
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1515" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1516 extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
|
||||
Comparator<String> comparator = new Comparator<String>()
|
||||
{
|
||||
public int compare(final String value0, final String value1)
|
||||
{
|
||||
return value0.compareTo(value1);
|
||||
}
|
||||
};
|
||||
|
||||
Collections.sort(list, comparator);
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1516" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1516 extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
|
||||
Comparator<String> comparator = new Comparator<String>()
|
||||
{
|
||||
public int compare(final String value0, final String value1)
|
||||
{
|
||||
return value0.compareTo(value1);
|
||||
}
|
||||
};
|
||||
|
||||
Collections.sort(list, comparator);
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1516" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1517 extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Comparator<String> comparator = new Comparator<String>()
|
||||
{
|
||||
public int compare(final String value0, final String value1)
|
||||
{
|
||||
return value0.compareTo(value1);
|
||||
}
|
||||
};
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
|
||||
Collections.sort(list, comparator);
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1517" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1517 extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Comparator<String> comparator = new Comparator<String>()
|
||||
{
|
||||
public int compare(final String value0, final String value1)
|
||||
{
|
||||
return value0.compareTo(value1);
|
||||
}
|
||||
};
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
|
||||
Collections.sort(list, comparator);
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1517" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1518a extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
|
||||
binarySearch(list, "bar");
|
||||
}
|
||||
|
||||
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
|
||||
key) {
|
||||
return 0;
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1518a" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1518a extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
|
||||
binarySearch(list, "bar");
|
||||
}
|
||||
|
||||
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
|
||||
key) {
|
||||
return 0;
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1518a" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1518b extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
}
|
||||
|
||||
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
|
||||
key) {
|
||||
return 0;
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1518b" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug1518b extends PApplet {
|
||||
|
||||
|
||||
|
||||
|
||||
public void setup()
|
||||
{
|
||||
List<String> list = new ArrayList<String>();
|
||||
list.add("foo");
|
||||
list.add("bar");
|
||||
list.add("baz");
|
||||
}
|
||||
|
||||
static <T> int binarySearch(List<? extends Comparable<? super T>> list, T
|
||||
key) {
|
||||
return 0;
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug1518b" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug281 extends PApplet {
|
||||
public void setup() {
|
||||
if ( "monopoly".charAt( 3 ) == '(' )
|
||||
{
|
||||
println("parcheesi");
|
||||
}
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug281" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug281 extends PApplet {
|
||||
public void setup() {
|
||||
if ( "monopoly".charAt( 3 ) == '(' )
|
||||
{
|
||||
println("parcheesi");
|
||||
}
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug281" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.applet.Applet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug481 extends PApplet {
|
||||
public void setup() {
|
||||
|
||||
Class[] abc = new Class[]{Applet.class};
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug481" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.applet.Applet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug481 extends PApplet {
|
||||
public void setup() {
|
||||
|
||||
Class[] abc = new Class[]{Applet.class};
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug481" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,70 +1,70 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import static java.lang.Math.tanh;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.List;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug598 extends PApplet {
|
||||
|
||||
// java 5 torture test
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static Comparator<String> rotarapmoc = new Comparator<String>() {
|
||||
public int compare(final String o1, final String o2)
|
||||
{
|
||||
return o1.charAt(o1.length() - 1) - o2.charAt(o2.length() - 1);
|
||||
}
|
||||
};
|
||||
|
||||
final <T> void printClass(T t) {
|
||||
println(t.getClass());
|
||||
}
|
||||
public final List<String> sortem(final String... strings) {
|
||||
Arrays.sort(strings, rotarapmoc);
|
||||
return Arrays.asList(strings);
|
||||
}
|
||||
|
||||
final Map<String, Collection<Integer>>
|
||||
charlesDeGaulle = new HashMap<String, Collection<Integer>>();
|
||||
|
||||
public void setup() {
|
||||
charlesDeGaulle.put("banana", new HashSet<Integer>());
|
||||
charlesDeGaulle.get("banana").add(0);
|
||||
System.out.println(sortem("aztec", "maya", "spanish", "portuguese"));
|
||||
printClass(12.d);
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug598" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import static java.lang.Math.tanh;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.List;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug598 extends PApplet {
|
||||
|
||||
// java 5 torture test
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private static Comparator<String> rotarapmoc = new Comparator<String>() {
|
||||
public int compare(final String o1, final String o2)
|
||||
{
|
||||
return o1.charAt(o1.length() - 1) - o2.charAt(o2.length() - 1);
|
||||
}
|
||||
};
|
||||
|
||||
final <T> void printClass(T t) {
|
||||
println(t.getClass());
|
||||
}
|
||||
public final List<String> sortem(final String... strings) {
|
||||
Arrays.sort(strings, rotarapmoc);
|
||||
return Arrays.asList(strings);
|
||||
}
|
||||
|
||||
final Map<String, Collection<Integer>>
|
||||
charlesDeGaulle = new HashMap<String, Collection<Integer>>();
|
||||
|
||||
public void setup() {
|
||||
charlesDeGaulle.put("banana", new HashSet<Integer>());
|
||||
charlesDeGaulle.get("banana").add(0);
|
||||
System.out.println(sortem("aztec", "maya", "spanish", "portuguese"));
|
||||
printClass(12.d);
|
||||
}
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug598" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug5a extends PApplet {
|
||||
public void setup() {
|
||||
println("The next line should not cause a failure.");
|
||||
// no newline after me
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug5a" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug5a extends PApplet {
|
||||
public void setup() {
|
||||
println("The next line should not cause a failure.");
|
||||
// no newline after me
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug5a" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug5b extends PApplet {
|
||||
public void setup() {
|
||||
println("The next line should not cause a failure.");
|
||||
/* no newline after me */
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug5b" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
import processing.core.*;
|
||||
import processing.data.*;
|
||||
import processing.event.*;
|
||||
import processing.opengl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.ArrayList;
|
||||
import java.io.File;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class bug5b extends PApplet {
|
||||
public void setup() {
|
||||
println("The next line should not cause a failure.");
|
||||
/* no newline after me */
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "bug5b" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -759,7 +759,7 @@
|
||||
</echo>
|
||||
</target>
|
||||
|
||||
<target name="deb" depends="linux-dist"
|
||||
<target name="deb" depends="dist"
|
||||
description="Build .deb of linux version">
|
||||
|
||||
<!-- start with a clean debian folder -->
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
[InternetShortcut]
|
||||
URL=https://github.com/kritzikratzi/jAppleMenuBar
|
||||
[InternetShortcut]
|
||||
URL=https://github.com/kritzikratzi/jAppleMenuBar
|
||||
|
||||
@@ -1,93 +1,93 @@
|
||||
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
|
||||
@echo off
|
||||
|
||||
.\java\bin\java -cp lib/pde.jar;core/library/core.jar;lib/jna.jar;lib/antlr.jar;lib/ant.jar;lib/ant-launcher.jar;lib/org-netbeans-swing-outline.jar;lib/com.ibm.icu_4.4.2.v20110823.jar;lib/jdi.jar;lib/jdimodel.jar;lib/org.eclipse.osgi_3.8.1.v20120830-144521.jar processing.app.Base
|
||||
@@ -20,6 +20,9 @@ We're removing `Applet` as the base class for `PApplet` and redoing the entire r
|
||||
1. One downside is that you'll no longer be able to just drop a Processing sketch into other Java code, because `PApplet` will no longer subclass `Applet` (and therefore, `Component`). This is a huge downside for a tiny number of users. For the majority of users, re-read the "why" section. We'll try to figure out ways to continue embedding in other Java code, however, since we use this in our own work, and even within Processing itself (the Color Selector).
|
||||
2. We're still determining how much code we're willing to break due to API changes. Stay tuned.
|
||||
|
||||
#### Offscreen rendering
|
||||
* createGraphics() will create a buffer that's not resizable. `PGraphics.setSize()` is called in `PApplet.makeGraphics()`, and that's the end of the story. No `Surface.setSize()` calls are involved as in a normal rendering situation.
|
||||
|
||||
#### Retina/HiDPI/2x drawing and displays
|
||||
* Documentation changes [here](https://github.com/processing/processing-docs/issues/170)
|
||||
## The Mess
|
||||
|
||||
@@ -5442,6 +5442,9 @@ public class PApplet implements PConstants {
|
||||
* @see PApplet#createFont(String, float, boolean, char[])
|
||||
*/
|
||||
public PFont loadFont(String filename) {
|
||||
if (!filename.toLowerCase().endsWith(".vlw")) {
|
||||
throw new IllegalArgumentException("loadFont() only works with .vlw font files");
|
||||
}
|
||||
try {
|
||||
InputStream input = createInput(filename);
|
||||
return new PFont(input);
|
||||
@@ -9479,7 +9482,7 @@ public class PApplet implements PConstants {
|
||||
//System.out.println("interrupt");
|
||||
}
|
||||
}
|
||||
System.out.println("out of default size loop, " + width + " " + height);
|
||||
// System.out.println("out of default size loop, " + width + " " + height);
|
||||
// convenience to avoid another 'get' from the static main() method
|
||||
return surface;
|
||||
}
|
||||
|
||||
@@ -269,8 +269,17 @@ public class PGraphicsJava2D extends PGraphics {
|
||||
|
||||
@Override
|
||||
public void beginDraw() {
|
||||
// TODO this will happen when it's offscreen.. need a better option here
|
||||
if (image == null ||
|
||||
((BufferedImage) image).getWidth() != width ||
|
||||
((BufferedImage) image).getHeight() != height) {
|
||||
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
|
||||
}
|
||||
g2 = (Graphics2D) image.getGraphics();
|
||||
|
||||
// Calling getGraphics() seems to nuke the smoothing settings
|
||||
smooth(quality);
|
||||
|
||||
/*
|
||||
// NOTE: Calling image.getGraphics() will create a new Graphics context,
|
||||
// even if it's for the same image that's already had a context created.
|
||||
|
||||
@@ -87,7 +87,7 @@ public class PSurfaceAWT implements PSurface {
|
||||
|
||||
void createCanvas() {
|
||||
canvas = new SmoothCanvas();
|
||||
//canvas.setIgnoreRepaint(true); // ??
|
||||
canvas.setIgnoreRepaint(true); // ??
|
||||
|
||||
// send tab keys through to the PApplet
|
||||
canvas.setFocusTraversalKeysEnabled(false);
|
||||
@@ -278,12 +278,18 @@ public class PSurfaceAWT implements PSurface {
|
||||
// not sure why this was here, can't be good
|
||||
//canvas.setBounds(0, 0, sketch.width, sketch.height);
|
||||
|
||||
if (!canvas.isDisplayable()) {
|
||||
// System.out.println("no peer.. holding");
|
||||
return;
|
||||
}
|
||||
|
||||
// System.out.println("render(), canvas bounds are " + canvas.getBounds());
|
||||
if (canvas.getBufferStrategy() == null) { // whole block [121222]
|
||||
// System.out.println("creating a strategy");
|
||||
canvas.createBufferStrategy(2);
|
||||
}
|
||||
BufferStrategy strategy = canvas.getBufferStrategy();
|
||||
// System.out.println(strategy);
|
||||
if (strategy == null) {
|
||||
return;
|
||||
}
|
||||
@@ -367,7 +373,9 @@ public class PSurfaceAWT implements PSurface {
|
||||
|
||||
|
||||
public void blit() {
|
||||
canvas.repaint();
|
||||
// System.out.println("blit");
|
||||
((SmoothCanvas) canvas).render(); // ??
|
||||
// canvas.repaint();
|
||||
/*
|
||||
if (canvas.getGraphicsConfiguration() != null) {
|
||||
GraphicsDevice device = canvas.getGraphicsConfiguration().getDevice();
|
||||
@@ -671,8 +679,8 @@ public class PSurfaceAWT implements PSurface {
|
||||
|
||||
/** Resize frame for these sketch (canvas) dimensions. */
|
||||
private Dimension setFrameSize() { //int sketchWidth, int sketchHeight) {
|
||||
System.out.format("setting frame size %d %d %n", sketchWidth, sketchHeight);
|
||||
new Exception().printStackTrace(System.out);
|
||||
// System.out.format("setting frame size %d %d %n", sketchWidth, sketchHeight);
|
||||
// new Exception().printStackTrace(System.out);
|
||||
Insets insets = frame.getInsets();
|
||||
int windowW = Math.max(sketchWidth, MIN_WINDOW_WIDTH) +
|
||||
insets.left + insets.right;
|
||||
@@ -795,13 +803,13 @@ public class PSurfaceAWT implements PSurface {
|
||||
synchronized (pauseObject) {
|
||||
try {
|
||||
pauseObject.wait();
|
||||
PApplet.debug("out of wait");
|
||||
// PApplet.debug("out of wait");
|
||||
} catch (InterruptedException e) {
|
||||
// waiting for this interrupt on a start() (resume) call
|
||||
}
|
||||
}
|
||||
}
|
||||
PApplet.debug("done with pause");
|
||||
// PApplet.debug("done with pause");
|
||||
}
|
||||
|
||||
|
||||
@@ -815,17 +823,21 @@ public class PSurfaceAWT implements PSurface {
|
||||
|
||||
// needs to resize the frame, which will resize the canvas, and so on...
|
||||
public void setSize(int wide, int high) {
|
||||
System.out.format("frame visible %b, setSize(%d, %d) %n", frame.isVisible(), wide, high);
|
||||
new Exception().printStackTrace(System.out);
|
||||
// System.out.format("frame visible %b, setSize(%d, %d) %n", frame.isVisible(), wide, high);
|
||||
// new Exception().printStackTrace(System.out);
|
||||
|
||||
sketchWidth = wide;
|
||||
sketchHeight = high;
|
||||
|
||||
// canvas.setSize(wide, high);
|
||||
// frame.setSize(wide, high);
|
||||
setFrameSize(); //wide, high);
|
||||
if (frame != null) { // canvas only
|
||||
setFrameSize(); //wide, high);
|
||||
}
|
||||
setCanvasSize();
|
||||
frame.setLocationRelativeTo(null);
|
||||
if (frame != null) {
|
||||
frame.setLocationRelativeTo(null);
|
||||
}
|
||||
|
||||
GraphicsConfiguration gc = canvas.getGraphicsConfiguration();
|
||||
// If not realized (off-screen, i.e the Color Selector Tool), gc will be null.
|
||||
|
||||
+83
-40
@@ -1,14 +1,59 @@
|
||||
0233 (3.0a6)
|
||||
X remove Applet as base class
|
||||
X how to name the retina pixel stuff
|
||||
X hint(ENABLE_RETINA_PIXELS) or hint(ENABLE_HIDPI_PIXELS)
|
||||
X hint(ENABLE_2X_PIXELS)?
|
||||
X hidpi is Apple's name as well
|
||||
X mostly getting away from this
|
||||
|
||||
earlier
|
||||
X size(640,360 , P3D) doesn't work properly
|
||||
X https://github.com/processing/processing/issues/2924
|
||||
X https://github.com/processing/processing/issues/2925
|
||||
|
||||
|
||||
graphics
|
||||
X roll back full screen changes
|
||||
X https://github.com/processing/processing/issues/2641
|
||||
applet/sketch
|
||||
X remove isGL(), is2D(), is3D(), displayable() from PApplet
|
||||
X these were auto-imported from PGraphics
|
||||
X remove pause variable from PApplet (was not documented)
|
||||
X added copy() to PImage (to work like get(), ala PVector)
|
||||
X added getFontRenderContext() to PGraphics
|
||||
X why doesn't p5 punt when loadFont() is used on an otf?
|
||||
X is this a GL problem? (example in bug report wasn't GL)
|
||||
X https://github.com/processing/processing/issues/2876
|
||||
X since we don't have any magic number in there, just randomly breaks
|
||||
X add check to require .vlw extension with loadFont()
|
||||
_ performance issues on OS X (might be threading due to Applet)
|
||||
_ https://github.com/processing/processing/issues/2423
|
||||
_ clean up requestFocus() stuff
|
||||
_ make sure it works with retina/canvas/strategy as well
|
||||
_ requestFocus() method probably needs to be added to PApplet
|
||||
_ remove sketch path hack from PApplet
|
||||
_ args[] should be null if none passed (otherwise args == null checks are weird)
|
||||
|
||||
|
||||
full screen
|
||||
X roll back full screen changes
|
||||
X https://github.com/processing/processing/issues/2641
|
||||
o new full screen sometimes causes sketch to temporarily be in the wrong spot
|
||||
X removed the new stuff since it stank, rolled back to menu bar hiding
|
||||
X add option to have full screen span across screens
|
||||
o display=all in cmd line
|
||||
o sketchDisplay() -> 0 for all, or 1, 2, 3...
|
||||
X added --span option
|
||||
X play with improvements to full screen here
|
||||
_ show warning when display spanning is turned off
|
||||
_ defaults read com.apple.spaces spans-displays
|
||||
_ crash on startup when "Mirror Displays" selected (cantfix?)
|
||||
_ suspect that this is a specific chipset since Oracle didn't reproduce
|
||||
_ 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
|
||||
|
||||
|
||||
graphics
|
||||
_ how to allocation image object w/ createGraphics() (since no surface)
|
||||
_ add attrib() method
|
||||
_ https://github.com/processing/processing/issues/2963
|
||||
_ assign this to DXF as well?
|
||||
@@ -16,31 +61,33 @@ _ createGraphics() currently broken in Java2D
|
||||
_ size() command not working to do a resize
|
||||
_ deal with applySettings() change (maybe not a problem?)
|
||||
|
||||
_ remove sketch path hack from PApplet
|
||||
|
||||
python has to use launch() instead of open()
|
||||
map() is bad for Python (and JavaScript?)
|
||||
|
||||
_ args[] should be null if none passed (otherwise args == null checks are weird)
|
||||
_ size(640,360 , P3D) doesn't work properly
|
||||
_ https://github.com/processing/processing/issues/2924
|
||||
_ why doesn't p5 punt when loadFont() is used on an otf?
|
||||
_ is this a GL problem?
|
||||
|
||||
_ show warning when display spanning is turned off
|
||||
_ defaults read com.apple.spaces spans-displays
|
||||
|
||||
applet/component
|
||||
_ remove Applet as base class
|
||||
_ performance issues on OS X (might be threading due to Applet)
|
||||
_ https://github.com/processing/processing/issues/2423
|
||||
_ play with improvements to full screen here
|
||||
_ new full screen sometimes causes sketch to temporarily be in the wrong spot
|
||||
_ add option to have full screen span across screens
|
||||
_ display=all in cmd line
|
||||
_ sketchDisplay() -> 0 for all, or 1, 2, 3...
|
||||
_ clean up requestFocus() stuff
|
||||
_ make sure it works with retina/canvas/strategy as well
|
||||
under consideration
|
||||
_ break PUtil out from PApplet
|
||||
_ break more api with Processing 3?
|
||||
_ use enums for everything (fixes auto-completion)
|
||||
_ add chaining operations
|
||||
_ move to enums instead of PConstants?
|
||||
_ helps textMode() only accept valid entries
|
||||
_ really nice for auto-complete
|
||||
_ prevents hundreds of entries from coming up w/ auto-complete
|
||||
_ downside: breaks compatibility big time
|
||||
_ fix the registered methods doc, stop/dispose working
|
||||
_ Casey needs to nudge people about libraries, so we need to fix this
|
||||
_ pause(), resume(), start(), stop() clarifications
|
||||
_ dispose/stop not great w/ libraries yet
|
||||
_ PShape complete refactoring
|
||||
_ proper touch events
|
||||
_ touch event doesn't make sense for mouseMove on desktop, hover on Android
|
||||
_ probably go with pointer: more universal for touch/mouse
|
||||
_ high-level touch events (swipe, et al)
|
||||
_ if Andres is done, they go in, if not then 3.0
|
||||
_ move away from loadPixels
|
||||
_ implement requestXxxx() API
|
||||
|
||||
|
||||
processing.data
|
||||
@@ -96,18 +143,20 @@ _ needs to have a way to set width/height properly
|
||||
_ draw(s) doesn't work on the returned PShape
|
||||
|
||||
|
||||
hidpi
|
||||
retina/hidpi
|
||||
_ the 2X thing on the renderer name is unnecessary
|
||||
_ just do pixelFactor() (and pull it during compilation)?
|
||||
_ add sketchPixelFactor() to handle the scenario?
|
||||
_ or is it just a boolean, because pixelFactor(2) is the only option?
|
||||
_ remove retina hint
|
||||
_ Text looks blurry in GL Retina (andres)
|
||||
_ https://github.com/processing/processing/issues/2739
|
||||
_ check retina with PGraphicsRetina2D
|
||||
_ Text is half size in PGraphicsRetina2D
|
||||
_ https://github.com/processing/processing/issues/2738
|
||||
_ text not getting the correct font in Retina2D
|
||||
_ https://github.com/processing/processing/issues/2617
|
||||
_ saveFrame() with retina render is making black images
|
||||
_ zero alpha values still a problem with retina renderer
|
||||
_ https://github.com/processing/processing/issues/2030
|
||||
_ how to name the retina pixel stuff
|
||||
_ hint(ENABLE_RETINA_PIXELS) or hint(ENABLE_HIDPI_PIXELS)
|
||||
_ hint(ENABLE_2X_PIXELS)?
|
||||
_ hidpi is Apple's name as well
|
||||
_ no high-res display support for OpenGL
|
||||
_ https://github.com/processing/processing/issues/2573
|
||||
_ https://jogamp.org/bugzilla/show_bug.cgi?id=741
|
||||
@@ -115,16 +164,10 @@ _ no high-dpi support for core on Windows
|
||||
_ https://github.com/processing/processing/issues/2411
|
||||
_ retina sketches slow to start
|
||||
_ https://github.com/processing/processing/issues/2357
|
||||
_ Text looks blurry in GL Retina
|
||||
_ https://github.com/processing/processing/issues/2739
|
||||
|
||||
|
||||
cantfix
|
||||
_ crash on startup when "Mirror Displays" selected
|
||||
_ suspect that this is a specific chipset since Oracle didn't reproduce
|
||||
_ https://github.com/processing/processing/issues/2186
|
||||
_ test with JG's 13" retina laptop
|
||||
|
||||
_ zero alpha values still a problem with retina renderer
|
||||
_ https://github.com/processing/processing/issues/2030
|
||||
_ NPE when using image() created with createGraphics(PGraphicsRetina2D)
|
||||
_ https://github.com/processing/processing/issues/2510
|
||||
|
||||
decisions/misc
|
||||
_ use enums for constants
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#Sat Nov 12 10:56:00 CST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
#Sat Nov 12 10:56:00 CST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#Sat Nov 12 10:56:44 CST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
#Sat Nov 12 10:56:44 CST 2011
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.6
|
||||
|
||||
@@ -13,6 +13,9 @@ X https://github.com/processing/processing/issues/2947
|
||||
X server.stop produces an error: java.net.SocketException: socket closed
|
||||
X https://github.com/processing/processing/issues/74
|
||||
X https://github.com/processing/processing/pull/2474
|
||||
X NPE when calling Client.ip() after the connection has been closed
|
||||
X https://github.com/processing/processing/issues/2576
|
||||
X https://github.com/processing/processing/pull/2922
|
||||
|
||||
joel
|
||||
X Add reference for installed tools and libraries to the Help menu
|
||||
@@ -35,6 +38,10 @@ X http://code.google.com/p/processing/issues/detail?id=75
|
||||
X these bits need to be checked to ensure that they work on other distros
|
||||
X https://github.com/processing/processing/issues/114
|
||||
X https://github.com/processing/processing/pull/2972
|
||||
X https://github.com/processing/processing/issues/2973
|
||||
X https://github.com/processing/processing/pull/2974
|
||||
X Replace ColorChooser PApplets with custom Swing components
|
||||
X https://github.com/processing/processing/pull/2975
|
||||
|
||||
|
||||
_ make examples pull/build automatic during dist
|
||||
@@ -52,6 +59,13 @@ _ https://github.com/processing/processing/issues/2960
|
||||
_ Add support for localizing contributions
|
||||
_ https://github.com/processing/processing/pull/2833
|
||||
|
||||
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)
|
||||
|
||||
|
||||
high
|
||||
_ dist needs to do a git pull on processing-docs
|
||||
@@ -395,6 +409,8 @@ _ http://code.google.com/p/processing/issues/detail?id=494
|
||||
|
||||
PDE / Editor
|
||||
|
||||
_ Undo does not move to the correct location in the editor window
|
||||
_ https://github.com/processing/processing/issues/707
|
||||
_ clean up /tmp folders used during build
|
||||
_ https://github.com/processing/processing/issues/1896
|
||||
_ 'recent' menu doesn't respect examples folder of other p5 versions
|
||||
|
||||
Reference in New Issue
Block a user