M21Code / ProcessingVideo / eventDroplists.pde
eventDroplists.pde
Raw
public void makepNumSelecter() {
  Font font = new Font("Karla", Font.PLAIN, 20);
  int x = 9*width/10; 
  int y = height/40;
  lblpNumSelecter = new GLabel(this, x, y, 100, 60, "Participant Number");
  //lblpNumSelecter.setTextItalic();
  lblpNumSelecter.setFont(font);
  lblpNumSelecter.setLocalColorScheme(8);

  String[] pNumOptions; 
  pNumOptions = new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"};
  pNumDropdownList = new GDropList(this, x, y + 60, 100, 300, 12, 14);
  pNumDropdownList.setItems(pNumOptions, 1); //Sets the item that is initially shown
  pNumDropdownList.setFont(font);
  pNumDropdownList.setLocalColorScheme(5);
}

void showQuestions() {
  Font font = new Font("Karla", Font.PLAIN, 20);
  int x = width/14; 
  int y = height/30;
  lblArousalSelecter = new GLabel(this, x, y, 230, 60, "How emotionally intense was the video overall?");
  lblArousalSelecter.setFont(font);
  lblArousalSelecter.setLocalColorScheme(8);
  //lblArousalSelecter.resizeToFit(true,true);

  String[] arousalOptions; 
  arousalOptions = new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  arousalDropdownList = new GDropList(this, x, y+60, 230, 300, 10, 14);
  arousalDropdownList.setItems(arousalOptions, 0); //Sets the item that is initially shown
  arousalDropdownList.setFont(font);
  arousalDropdownList.setLocalColorScheme(5);

  lblValenceSelecter = new GLabel(this, x+250, y, 230, 60, "How pleasant was the video overall?");
  lblValenceSelecter.setFont(font);
  lblValenceSelecter.setLocalColorScheme(8);

  String[] valenceOptions; 
  valenceOptions = new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  valenceDropdownList = new GDropList(this, x+250, y+60, 230, 300, 10, 14);
  valenceDropdownList.setItems(valenceOptions, 0); //Sets the item that is initially shown
  valenceDropdownList.setFont(font);
  valenceDropdownList.setLocalColorScheme(5);

  lblFamiliaritySelecter = new GLabel(this, x+500, y, 330, 60, "Have you seen or heard of the story before?");
  lblFamiliaritySelecter.setFont(font);
  lblFamiliaritySelecter.setLocalColorScheme(8);

  String[] familiarityOptions; 
  familiarityOptions = new String[] { "0: No answer chosen", "1: Seen exact footage before", "2: Familiar story, unfamiliar footage", "3: Never seen or heard of story"};
  familiarityDropdownList = new GDropList(this, x+500, y+60, 330, 140, 4, 14);
  familiarityDropdownList.setItems(familiarityOptions, 0); //Sets the item that is initially shown
  familiarityDropdownList.setFont(font);
  familiarityDropdownList.setLocalColorScheme(5);

  lblComfortSelecter = new GLabel(this, x+850, y, 230, 60, "How comfortable was the experience overall?");
  lblComfortSelecter.setFont(font);
  lblComfortSelecter.setLocalColorScheme(8);

  String[] comfortOptions; 
  comfortOptions = new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
  comfortDropdownList = new GDropList(this, x+850, y+60, 230, 300, 10, 14);
  comfortDropdownList.setItems(comfortOptions, 0); //Sets the item that is initially shown
  comfortDropdownList.setFont(font);
  comfortDropdownList.setLocalColorScheme(5);
}

public void handleDropListEvents(GDropList list, GEvent event) {
  if (list == pNumDropdownList && event == GEvent.SELECTED) {
    pNum = int(pNumDropdownList.getSelectedText());
    lblpNumSelecter.setVisible(false);
    pNumDropdownList.setVisible(false);
    background(0);
    println("Selected Participant: " + pNum);
  }
  if (list == arousalDropdownList && event == GEvent.SELECTED) {
    arousalVal = int(arousalDropdownList.getSelectedText());
    background(0);
    println("Selected Arousal: " + arousalVal);
  }
  if (list == valenceDropdownList && event == GEvent.SELECTED) {
    valenceVal = int(valenceDropdownList.getSelectedText());
    background(0);
    println("Selected Valence: " + valenceVal);
  }  
  if (list == familiarityDropdownList && event == GEvent.SELECTED) {
    familiarityVal = familiarityDropdownList.getSelectedText();
    background(0);
    println("Selected Familiarity: " + familiarityVal);
  }  
  if (list == comfortDropdownList && event == GEvent.SELECTED) {
    comfortVal = int(comfortDropdownList.getSelectedText());
    background(0);
    println("Selected Comfortability: " + comfortVal);
  }
}

void hideQuestions () {
  lblArousalSelecter.setVisible(false);
  arousalDropdownList.setVisible(false);
  lblValenceSelecter.setVisible(false);
  valenceDropdownList.setVisible(false);
  lblFamiliaritySelecter.setVisible(false);
  familiarityDropdownList.setVisible(false);
  lblComfortSelecter.setVisible(false);
  comfortDropdownList.setVisible(false);
}