mirror of
https://github.com/processing/processing4.git
synced 2026-04-21 19:54:23 +02:00
Add failing test to address #619
This commit is contained in:
65
java/test/resources/staticannotations.expected
Normal file
65
java/test/resources/staticannotations.expected
Normal file
@@ -0,0 +1,65 @@
|
||||
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 staticannotations extends PApplet {
|
||||
|
||||
public void setup() {
|
||||
|
||||
class Button {
|
||||
|
||||
int x, y, radius;
|
||||
|
||||
public Button (int x, int y, int radius) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.radius = radius;
|
||||
}
|
||||
|
||||
boolean over() {
|
||||
return dist(mouseX, mouseY, this.x, this.y) < this.radius;
|
||||
}
|
||||
|
||||
void draw() {
|
||||
ellipse(this.x, this.y, this.radius * 2, this.radius * 2);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
void old() {
|
||||
ellipse(this.x, this.y, this.radius, this.radius);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
class ButtonOther extends Button {
|
||||
|
||||
@Override
|
||||
boolean over() {
|
||||
return dist(mouseX, mouseY, this.x, this.y) < this.radius / 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
noLoop();
|
||||
}
|
||||
|
||||
static public void main(String[] passedArgs) {
|
||||
String[] appletArgs = new String[] { "staticannotations" };
|
||||
if (passedArgs != null) {
|
||||
PApplet.main(concat(appletArgs, passedArgs));
|
||||
} else {
|
||||
PApplet.main(appletArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user