Code

BFont f;

Vector showTextObjects;
int whichClick;
int initX;
int initY;
int finalX;
int finalY;
String tempString=null;
String[] objects={"The","A","An"};
String[] adjectives={"quick","fast","pretty","hungry","angry","Strong","slow","weary","beautiful","smelly"};
String[] noun={"boy","elephant","couch","person","train","nazi","village person","student","professor"};
String[] verb={"gives","takes","sits","goes","is","has","shouts","likes","hopes","shows",""};
String [] pronoun={"His","Her","My","Your","Their","Our","Its","Their"};
String [] things={"Table","Computer","DVD","Hamburger","Cheese Pizza","Phone","Pen","Broccoli"};

//String[] alphabet={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"};

Vector objVect;
Vector adjVect;
Vector nounVect;
Vector verbVect;
Vector proVect;
Vector thingVect;
void setup(){
  whichClick=0;
  background(255);
  size(400,400);
  f = loadFont("Univers66.vlw.gz");
  textFont(f, 30);
  fill(0);
  objVect=new Vector();
  for(int i=0;i<objects.length;i++){
    objVect.add(objects[i]);
  }
  adjVect=new Vector();
  for(int i=0;i<adjectives.length;i++){
    adjVect.add(adjectives[i]);
  }
  nounVect=new Vector();
  for(int i=0;i<noun.length;i++){
    nounVect.add(noun[i]);
  }
  verbVect=new Vector();
  for(int i=0;i<verb.length;i++){
    verbVect.add(verb[i]);
  }
  proVect=new Vector();
  for(int i=0;i<pronoun.length;i++){
    proVect.add(pronoun[i]);
  }

  thingVect=new Vector();
  for(int i=0;i<things.length;i++){
    thingVect.add(things[i]);
  }
  showTextObjects=new Vector();
  //fill(0);

}

void loop(){
  //The loop will simply loop through all the text objects.
  background(255);

  for(int i=0;i<showTextObjects.size();i++){
    Word wrd=(Word)showTextObjects.get(i);
    if(!wrd.wordDone){
      wrd.draw();
    }
    else{
      showTextObjects.remove(i);
    }
  }
  //fill(0);
  text("A",pmouseX-55,pmouseY-55);
  text("B",pmouseX-45,pmouseY-45);  
  text("C",pmouseX-35,pmouseY-35);
  text("D",pmouseX-25,pmouseY-25);  
  text("E",pmouseX-15,pmouseY-15);
  text("F",pmouseX-10,pmouseY-10);  
  text("H",mouseX,mouseY);

}

void mousePressed(){
  //Record the mouseX and mouseY and increment the click count.
  whichClick+=1;
  initX=mouseX;
  initY=mouseY;
  fill(255,0,0);
}

void mouseDragged(){
  fill(255,0,0);
  text("A",pmouseX-55,pmouseY-55);
  text("B",pmouseX-45,pmouseY-45);  
  text("C",pmouseX-35,pmouseY-35);
  text("D",pmouseX-25,pmouseY-25);  
  text("E",pmouseX-15,pmouseY-15);
  text("F",pmouseX-10,pmouseY-10);  
  text("H",mouseX,mouseY);
  fill(255);
}

void mouseReleased(){
  //Get mouseX and mouseY and create a word object out of either an adjective, noun, verb, object etc ( Based on how many clicks have occurred)
  //Add that object to the showTextObject vector.
  finalX=mouseX;
  finalY=mouseY;
  float distance=dist(initX,initY,finalX,finalY);
  if(whichClick==1){
    //get an object.
    int num=(int)random(1,objVect.size());
    String obj=(String)objVect.get(num);
    println("Object :"+obj);
    Word wrd=new Word(obj,initX,initY);
    this.showTextObjects.add(wrd);
  }
  else if(whichClick==2){
    //get an adjective.
    int num=(int)random(1,adjVect.size());
    String obj=(String)adjVect.get(num);
    println("Adjective :"+obj);
    Word wrd=new Word(obj,initX,initY);
    this.showTextObjects.add(wrd);
  }
  else if(whichClick==3){
    //get a noun.
    int num=(int)random(1,nounVect.size());
    String obj=(String)nounVect.get(num);
    println("Noun :"+obj);
    Word wrd=new Word(obj,initX,initY);
    this.showTextObjects.add(wrd);

  }
  else if(whichClick==4){
    //get an adjective.
    int num=(int)random(1,verbVect.size());
    String obj=(String)verbVect.get(num);
    println("Adjective :"+obj);
    Word wrd=new Word(obj,initX,initY);
    this.showTextObjects.add(wrd);
  }
  else if(whichClick==5){
    //get an adjective.
    int num=(int)random(1,proVect.size());
    String obj=(String)proVect.get(num);
    println("Adjective :"+obj);
    Word wrd=new Word(obj,initX,initY);
    this.showTextObjects.add(wrd);

  }
  else if(whichClick==6){
    //get an adjective.
    int num=(int)random(1,thingVect.size());
    String obj=(String)thingVect.get(num);
    println("Adjective :"+obj);
    Word wrd=new Word(obj,initX,initY);
    this.showTextObjects.add(wrd);
    whichClick=0;
  }
}

class Word{
  int fontColor;
  double velocity;
  //This will become true when the ypos becomes greater than 400.
  boolean wordDone=false;
  String word;
  int xpos;
  int ypos;
  Word(String word,int xpos, int ypos){
    fontColor=(int)random(0,200);
    velocity=0.9;
    this.xpos=xpos-10;
    this.ypos=ypos-10;
    this.word=word;
  }

  //The draw method will use the xpos and ypos of the current mouse click and will draw the font at that location till it falls out of screen with a certain velocity.

  void  draw(){
    if(this.ypos<=400){
      //fontColor=(int)random(0,200);
      fill(fontColor);
      this.ypos=(int)(this.ypos+velocity*2);
      //push();
      //scale(75.0, 75.0, 75.0);
      text(word, this.xpos, this.ypos);
      //pop();
    }
    else{
      wordDone=true;
    }
  }

}

Project 2: Create your own drawing tool, emphasizing algorithmic generation/modification/manipulation.

Statement:The contemporary computer scene is dominated by the graphical user interface (GUI). For almost every task, from manipulating text, imagery, sound, video, to configuring a computer's operating system (e.g. control panels), from searching for and organizing information (e.g. the web), to the process of programming (e.g. integrated development environments), there are special purpose GUI tools supporting the task through analogies to embodied interaction with physical objects. But no tool is neutral; every tool bears the marks of the historical process of its creation, literally encoding the biases, dreams, and political realities of its creators, offering affordances for some interactions while making other interactions difficult or impossible to perform or even conceive. While the ability to program does not bring absolute freedom (you can never step outside of culture, and of course programming languages are themselves tools embedded in culture), it does open up a region of free play, allowing the artist to climb up and down the dizzying tower of abstraction and encode her own biases, dreams and political realities. What graphical tools would you create? Create your own drawing tool, emphasizing algorithmic generation/modification/manipulation. Explore the balance of control between the tool and the person using the tool. The tool should do something different when moving vs. dragging (moving with the mouse button down). The code for your tool should use at least one class.
I tried to make a tool that mimicked fridge magnets that allow you to make sentences out of a bunch of words. I decided to stick with a text collage with moving text that is randomly generated when the mouse is dragged.The sentences dont really make sense, but the point was to generate sentences...(while attempting to follow the rules of English Grammar :)). If you drag the mouse, the text of the ABCDEFG text building factory changes to red. If you release the mouse button, a piece of text will fall and translate all the way to the bottom of the screen. I like to call this a Dynamic Text Collage.

hide brief