01.02.2013 Views

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Stickies<br />

Task Magnets<br />

// ... more BeatBox.java code above this<br />

Let’s get right to the new features. Here’s a snippet from the<br />

BeatBox client code. Your job is to map the task stickies to the<br />

code that implements each part <strong>of</strong> the “Send a Poke...” story. We’ll<br />

get to the GUI work in a minute.<br />

public class RemoteReader implements Runnable {<br />

boolean[] checkboxState = null;<br />

String nameToShow = null;<br />

Object obj = null;<br />

public void run() {<br />

try {<br />

while((obj=in.readObject()) != null) {<br />

System.out.println("got an object from server");<br />

System.out.println(obj.getClass());<br />

String nameToShow = (String) obj;<br />

checkboxState = (boolean[]) in.readObject();<br />

if (nameToShow.equals(POKE_START_SEQUENCE)) {<br />

playPoke();<br />

nameToShow = "Hey! Pay attention.";<br />

}<br />

otherSeqsMap.put(nameToShow, checkboxState);<br />

listVector.add(nameToShow);<br />

incomingList.setListData(listVector);<br />

} // close while<br />

} catch (Exception ex) { ex.printStackTrace(); }<br />

} // close run<br />

private void playPoke() {<br />

Toolkit.getDefaultToolkit().beep();<br />

}<br />

} // close inner class<br />

Download at WoweBook.Com<br />

Task 1 MDE<br />

Sound an audible alert<br />

when receiving a poke<br />

message (can’t be<br />

annoying!)<br />

.5<br />

Task 4 BJD<br />

Merge Poke visual<br />

alert into message<br />

display system.<br />

version control<br />

Task 2 LUG<br />

Add support for<br />

checking for the Poke<br />

command and creating<br />

a message.<br />

.5<br />

Task 3 MDE<br />

Implement receiver<br />

code to read the<br />

data <strong>of</strong>f <strong>of</strong> the<br />

network.<br />

.5<br />

you are here 4 179<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!