Función UPDATEDISPLAYVARIABLES() - versiones variables con ajustes admin...
void updateDisplayVariables() {
// Reading the mind queryString
String currentHashtag = adminSettings [0];
String displayHashtag = "hashtag = "+adminSettings [0]+" ";
if (adminSettings[0]=="")
{
displayHashtag="";
}
String currentUserName = adminSettings [1];
String displayUserName = " = "+adminSettings [1]+" ";
if (adminSettings[1]=="")
{
displayUserName="";
}
String currentSearchTerms = adminSettings [2];
String displaySearchTerms = "search = "+adminSettings [2];
if (adminSettings[2]=="")
{
displayUserName="";
}
readingSettingText = "Reading the hive mind for "+queryType+"= "+ queryString;
color cl = color(70, 30, 180);// not in use
color cl2 = color(70, 230, 180);//not in use
fill (clPanel);
//rect(30, boxY+15, width, 105);
fill(0, 0, 0, 255);
textSize(40);
//text(readingSettingText, 10, boxY+40);
//rect(0, boxY+13, width, 1);
textSize(40);
text(" 2, boxY+33);
fill (clPanel);
rect(columnPos2_X, boxY-10, width, 50);
fill(0, 0, 0, 255);
textSize(35);
//text(adminSettings[7], columnPos2_X+30, boxY-25);
text("
//displayHashtag+displayUserName+displaySearchTerms;
}
Función BUILDADMINPANEL() - crear la interfaz de forma
void buildAdminPanel() {
int panelTop = height-panelHeight;
fill (clPanel);
rect(0, panelTop, width, panelHeight);
// >>>>>>> set up fonts
//PFont font = createFont("arial",20);
font = new ControlFont(createFont("arial", 100), 40);
// <<<<<<<
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> set up GUI elements >>>>>>>>>>>>>>>>>>>>
noStroke();
cp5 = new ControlP5(this); // adds in a control instance to add buttons and text field to
noStroke();
tf = cp5.addTextfield("");
tf.setPosition(border, boxY);
tf.setSize(boxWidth, boxHeight);
tf.setColorBackground(focusBackgroundColor);
tf.setColor(focusColor);
tf.setFont(font);
tf.setFocus(true);
//tf.setAutoClear(true);
tf.captionLabel().setControlFont(font);
//
// create a new button with name 'Tell my Fortune'
b = cp5.addButton("but", 20, 100, 50, 80, 20);
b.setId(2); // id to target this element
b.setWidth(250); // width
b.setHeight(25);
b.setPosition(border, boxY+100);
b.captionLabel().setControlFont(font);
b.captionLabel().style().marginLeft = 1;
b.captionLabel().style().marginTop = 1;
b.setVisible(true);
b.isOn();
b.setColorBackground(focusOffBackgroundColor);
//
// <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end of GUI <<<<<<<<<<
// >>>>>>>>
}
Función READFORTUNE() - biggie - esto inventa las fortunas...
void readFortune (String tweetText)
{
int picW1 = int(random (words.size()));
String fortuneWord1= words.get(picW1);
int picW2 = int(random (words.size()));
String fortuneWord2= words.get(picW2);
int hash = int(random (hashtags.size()));
String fortuneHash= hashtags.get(hash);
int urler = int(random (urls.size()));
String fortuneUrl= urls.get(urler);
int userer = int(random (usernames.size()));
String fortuneUser = usernames.get(userer);
int frag1Int =int (random (fortFrags1.size()));
String fraglet1 = fortFrags1.get(frag1Int);
int frag2Int =int (random (fortFrags2.size()));
String fraglet2 = fortFrags2.get(frag2Int);
int frag3Int =int (random (fortFrags3.size()));
String fraglet3 = fortFrags3.get(frag3Int);
int frag4Int =int (random (fortFrags4.size()));
String fraglet4 = fortFrags4.get(frag4Int);
fortune = "Psychic summary for + ". for: #"+queryString+". "+ fortuneWord1+", "+ fortuneWord2+", #"+fortuneHash+ ", "+fortuneUrl+". Enjoy/RT";
println ("just before fortune spoken");
fortuneSpoken = "Hello. "+tfUserCurrent+". "+adminSettings[7]+ ". "+fortuneGreeting +". Here. you are. Your Psychic Hive Mind. Fortune. based on reading .the collective mind of. "+queryString+". is. "+fraglet1+". "+ fortuneWord1+". "+ fraglet2+". "+fortuneWord2+". "+fraglet3+". hashtag."+fortuneHash+ ". "+fraglet4+". Twitter user."+fortuneUser+". Thank you. I have tweeted a psychic summary of this reading to your twitter account. Moove along now. " ;
println ("fortuneSpoken= "+fortuneSpoken);
}