インフォ | FAQ |
言語 | 環境 | 比較 |
Index |
Java | ActionScript
| Lingo |
Python | Design
By Numbers ProcessingとJavaには大きな違いがある。Processingグラフィックライブラリーと、ユーザーがクラスやオブジェクト、アニメーション、ダブルバッファリング(高度なユーザーにはまだ利用可能だが)のような高度な概念を必用としない単純化したプログラミング形式である。このような技術的な詳細については、Javaによって特別にプログラムされなければならないが、Processingと結びつけることにより、プログラムをもっと短く簡単に読むことができる。
|
Processing | Java | |
background(0); background(255); |
g.setColor(Color.black) fillRect(0, 0, size.width, size.height); g.setColor(Color.white) fillRect(0, 0, size.width, size.height); |
|
background(255, 204, 0); | g.setColor(new Color(255, 204, 0)); fillRect(0, 0, size.width, size.height); |
|
stroke(255); stroke(0); |
g.setColor(Color.white) g.setColor(Color.black) |
|
stroke(255, 204, 0); | g.setColor(new Color(255, 204, 0)); | |
fill(0, 102, 153); | g.setColor(new Color(0, 102, 153)); | |
Processing | Java | |
point(30, 20); | g.drawLine(30, 20, 30, 20); | |
line(0, 20, 80, 20); | g.drawLine(30, 20, 80, 20); | |
rect(10, 20, 30, 30); | g.fillRect(10, 20, 30, 30); g.drawRect(10, 20, 30, 30); |
|
Processing | Java | |
setPixel(30, 20, 255); | ??? | |
a = getPixel(60, 10); | ??? | |
pixels[y*width+x] | ??? | |
Processing | Java | |
int x = 70; //
Initialize x = 30; // Change value |
int x = 70; //
Initialize x = 30; // Change value |
|
float x = 70.0; x = 30.0; |
float x = 70.0f; x = 30.0f; |
|
int[] a = {5, 10, 11}; a[0] = 12; // Reassign |
int[] a = {5, 10, 11}; a[0] = 12; // Reassign |
|
Processing | Java | |
void loop() { // Statements } |
while(true) { // Statements } |
|
for(int a=45; a<=55; a++) { // Statements } |
for(int a=45; a<=55; a++) { // Statements } |
|
if(c==1) { // Statements } |
if(c==1) { // Statements } |
|
if(c!=1) { // Statements } |
if(c!=1) { // Statements } |
|
if(c < 1) { // Statements } |
if(c < 1) { // Statements } |
|
if(c >= 1) { // Statements } |
if(c >= 1) { // Statements } |
|
if((c >= 1) && (c < 20)) { // Statements } |
if((c >= 1) && (c < 20)) { // Statements } |
|
if(c >= 20) { |
if(c >= 20) { // Statements 1 } else if (c == 0) { // Statements 2 } else { // Statements 3 } |
|
Processing | Java | |
// Comment | // Comment | |
void doIt(int x) { // Statements } doIt(x); |
public void doIt(int x) { // Statements } doIt(x); |
|
int square(int x) { return x*x; } square(X); |
public int square(int x) { return x*x; } square(X); |
|
Processing | Java | |
mouseX mouseY |
/* Assuming there are two variables in the program
named MouseX and MouseY, these values must be changed by the programmer
in the mouseMoved() and mouseDragged methods. */ |
|
void mousePressed() { // Statements } |
public void mousePressed(MouseEvent e)
{ // Statements } |
|
if (key=='a') { // Statements } |
public void keyPressed(KeyEvent e) { |
|
void keyPressed() { // Statements } |
public void keyPressed(KeyEvent e) { // Statements } |
|
hour() minute() second() |
??? | |
Processing >> Java 1.1 by REAS, fry |
© 2002, 2001 Massachusetts Institute of Technology and Interaction Design Institute Ivrea | ||
Processing is an open project initiated by Ben Fry and Casey Reas |