Dance Studio
From IPRE Wiki
Hi<APPLET name="sketch_feb11a" WIDTH="500" HEIGHT="500" archive="http://wiki.roboteducation.org/Dance_Studio" standby="Loading Processing software…" codebase="http://wiki.roboteducation.org/Dance_Studio" code="sketch_081001a" mayscript="true" scriptable="true" image="" boxmessage="Loading Processing software…" boxcolor="#FFFFFF"><IMG SRC="" WIDTH="1" HEIGHT="1" /></APPLET>
import interfascia.*; // importing the interfascia library for user interaction
GUIController c; IFLabel filename; IFButton go; IFButton load_file; //loads a saved file IFButton save_file; //saves a file being worked on. IFButton start_over; boolean file_name = false;
void setup() {
size (500, 500); background (245); c = new GUIController(this); go = new IFButton ("Go!", 70, 70, 40); load_file = new IFButton ("Load", 10, 100, 100); save_file = new IFButton ("Save", 10, 130, 70); start_over = new IFButton ("Start Over", 90, 130, 100); filename = new IFLabel ("Filename", 130, 100, 100); go.addActionListener(this); load_file.addActionListener(this); save_file.addActionListener(this); start_over.addActionListener(this); c.add(go); c.add(load_file); c.add(save_file); frameRate(5);
}
void draw(){
background (245);
}
void actionPerformed (GUIEvent e) {
if (e.getSource() == go) { c.add(start_over); //c.remove(save_file); } else if (e.getSource() == load_file) { c.add(filename); c.add(start_over); file_name = true; } else if (e.getSource() == start_over) { if (filename != null) { if (file_name == true) { c.remove(filename); } c.remove(start_over); } }
}